export type ObjectType = { [key in string]: any }

//指法映射
export const formatdata: ObjectType = {
  Flute: 2,
  Clarinet: 4,
  Trombone: 14,
  Tuba: 17,
  Trumpet: 12,
  Horn: 13,
  AltoSaxophone: 6,
  TenorSaxophone: 6,
  Saxophone: 6,
  UpBassHorn: 15,
  Euphonium: 15,
  Melodica: 137,
  HulusiFlute: 136,
  PanFlute: 135,
  Ocarina: 134,
  Recorder: 120,
  Ukulele: 130,
  Mouthorgan: 140,
  Piano: 150,
}

/**
 * 管乐团声部映射指法声部code
 */
export const subjectTypes: ObjectType = {
  '1': 'SmallDrum',
  '2': 'Flute',
  '3': 'Saxophone',
  '4': 'Clarinet',
  '5': 'Trumpet',
  '6': 'Trombone',
  '7': 'Horn',
  '8': 'UpBassHorn',
  '9': 'Tuba',
}
export const getSubjectIdCode = (subjectId: string) => {
  return subjectTypes[subjectId] || ''
}

/**
 * 转化为管乐迷声部ID
 */
export default (code: string): number | string => {
  const data = formatdata
  return data[code] || -1
}
