// Shape of public/punkachien.json (produced by build_player_data.py).

export interface RoleGroup {
  key: string
  label: string
  color: string
  glyph: string
}

export interface Orbit {
  orbit: string
  label: string
  group: string
  /** RMS dB per `binS` bin, aligned to track t0 */
  activity: number[]
}

export interface MasterInfo {
  file: string
  I: number | null // integrated LUFS
  LRA: number | null
  TP: number | null // true peak dBFS
}

export interface LoudTrace {
  /** momentary LUFS per `stepS` */
  trace: number[]
  stepS: number
}

export type Variant = 'stream' | 'club'

export interface Take {
  id: string
  label: string
  gig: string
  date: string
  dur: number
  binS: number
  masters: Record<Variant, MasterInfo>
  loud: Record<Variant, LoudTrace>
  orbits: Orbit[]
}

export interface PlayerData {
  track: string
  calibration: string
  activeDb: number
  roleGroups: RoleGroup[]
  takes: Take[]
}

export interface Note {
  id: string
  takeId: string
  t: number // seconds
  text: string
}
