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

Method refresh

packages/playground/src/components/Waveform.ts:61–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 }
60
61 private async refresh(): Promise<void> {
62 const score = this.api.score;
63 const player = this.api.player;
64 if (!score || !player || !score.backingTrack || this.api.actualPlayerMode !== alphaTab.PlayerMode.EnabledBackingTrack) {
65 this.hide();
66 return;
67 }
68
69 const output = player.output as alphaTab.synth.IAudioElementBackingTrackSynthOutput;
70 if (typeof output.audioElement === 'undefined') {
71 this.hide();
72 return;
73 }
74 this.bindAudio(output.audioElement);
75
76 if (score === this.currentScore) {
77 return;
78 }
79 this.currentScore = score;
80 this.root.classList.remove('hidden');
81 await this.draw(score.backingTrack);
82 }
83
84 private bindAudio(audio: HTMLAudioElement): void {
85 if (this.audioElement === audio) {

Callers 1

constructorMethod · 0.95

Calls 3

hideMethod · 0.95
bindAudioMethod · 0.95
drawMethod · 0.95

Tested by

no test coverage detected