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

Method stop

packages/alphatab/src/synth/AlphaSynth.ts:371–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369 }
370
371 public stop(): void {
372 if (!this._isMidiLoaded) {
373 return;
374 }
375 Logger.debug('AlphaSynth', 'Stopping playback');
376 this.state = PlayerState.Paused;
377 this.output.pause();
378 this._notPlayedSamples = 0;
379 this.sequencer.stop();
380 this.synthesizer.noteOffAll(true);
381 this.tickPosition = this.sequencer.mainPlaybackRange ? this.sequencer.mainPlaybackRange.startTick : 0;
382 (this.stateChanged as EventEmitterOfT<PlayerStateChangedEventArgs>).trigger(
383 new PlayerStateChangedEventArgs(this.state, true)
384 );
385 }
386
387 public playOneTimeMidiFile(midi: MidiFile): void {
388 if (this.sequencer.isPlayingOneTimeMidi) {

Callers 4

destroyMethod · 0.95
resetSoundFontsMethod · 0.95
loadMidiFileMethod · 0.95
checkForFinishMethod · 0.95

Calls 5

debugMethod · 0.65
pauseMethod · 0.65
stopMethod · 0.65
noteOffAllMethod · 0.65
triggerMethod · 0.45

Tested by

no test coverage detected