()
| 348 | } |
| 349 | |
| 350 | public pause(): void { |
| 351 | if (this.state === PlayerState.Paused || !this._isMidiLoaded) { |
| 352 | return; |
| 353 | } |
| 354 | Logger.debug('AlphaSynth', 'Pausing playback'); |
| 355 | this.state = PlayerState.Paused; |
| 356 | (this.stateChanged as EventEmitterOfT<PlayerStateChangedEventArgs>).trigger( |
| 357 | new PlayerStateChangedEventArgs(this.state, false) |
| 358 | ); |
| 359 | this.output.pause(); |
| 360 | this.synthesizer.noteOffAll(false); |
| 361 | } |
| 362 | |
| 363 | public playPause(): void { |
| 364 | if (this.state !== PlayerState.Paused || !this._isMidiLoaded) { |
no test coverage detected