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

Method rebuild

packages/playground/src/components/TrackList.ts:29–55  ·  view source on GitHub ↗
(score: alphaTab.model.Score)

Source from the content-addressed store, hash-verified

27 }
28
29 private rebuild(score: alphaTab.model.Score): void {
30 for (const item of this.items) {
31 item.dispose();
32 }
33 this.items = [];
34 this.root.replaceChildren();
35 this.selection.clear();
36
37 for (const track of score.tracks) {
38 const item = new TrackItem(this.api, track);
39 item.onSelect = e => {
40 e.stopPropagation();
41 if (!e.ctrlKey) {
42 this.selection.clear();
43 this.selection.set(track.index, track);
44 } else if (this.selection.has(track.index)) {
45 this.selection.delete(track.index);
46 } else {
47 this.selection.set(track.index, track);
48 }
49 this.api.renderTracks(Array.from(this.selection.values()).sort((a, b) => a.index - b.index));
50 };
51 this.items.push(item);
52 this.root.appendChild(item.root);
53 }
54 this.refreshActive();
55 }
56
57 private refreshActive(): void {
58 const active = new Set<number>();

Callers 1

constructorMethod · 0.95

Calls 12

disposeMethod · 0.95
refreshActiveMethod · 0.95
fromMethod · 0.80
clearMethod · 0.65
appendChildMethod · 0.65
setMethod · 0.45
hasMethod · 0.45
deleteMethod · 0.45
renderTracksMethod · 0.45
sortMethod · 0.45
valuesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected