()
| 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) { |
no test coverage detected