MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / pickTrackIcon

Function pickTrackIcon

packages/playground/src/components/TrackItem.ts:7–25  ·  view source on GitHub ↗
(track: alphaTab.model.Track)

Source from the content-addressed store, hash-verified

5import { ToggleButton } from './primitives/ToggleButton';
6
7function pickTrackIcon(track: alphaTab.model.Track): IconNode {
8 if (track.playbackInfo.primaryChannel === 9 || track.staves[0]?.isPercussion) {
9 return Icons.TrackDrum;
10 }
11 const program = track.playbackInfo.program;
12 if (program >= 0 && program <= 7) {
13 // Acoustic Grand .. Clavi
14 return Icons.TrackPiano;
15 }
16 if ((program >= 52 && program <= 54) || program === 85) {
17 // Choir Aahs / Voice Oohs / Synth Voice / Lead 6 (voice)
18 return Icons.TrackVoice;
19 }
20 if (program >= 112 && program <= 119) {
21 // Percussive program range (Tinkle Bell .. Reverse Cymbal)
22 return Icons.TrackDrum;
23 }
24 return Icons.Track;
25}
26
27injectStyles(
28 'TrackItem',

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected