()
| 333 | } |
| 334 | |
| 335 | private _playInternal() { |
| 336 | if (this.sequencer.isPlayingOneTimeMidi) { |
| 337 | Logger.debug('AlphaSynth', 'Cancelling one time midi'); |
| 338 | this._stopOneTimeMidi(); |
| 339 | } |
| 340 | |
| 341 | Logger.debug('AlphaSynth', 'Starting playback'); |
| 342 | this.synthesizer.setupMetronomeChannel(this.sequencer.metronomeChannel, this.metronomeVolume); |
| 343 | this._synthStopping = false; |
| 344 | this.state = PlayerState.Playing; |
| 345 | (this.stateChanged as EventEmitterOfT<PlayerStateChangedEventArgs>).trigger( |
| 346 | new PlayerStateChangedEventArgs(this.state, false) |
| 347 | ); |
| 348 | } |
| 349 | |
| 350 | public pause(): void { |
| 351 | if (this.state === PlayerState.Paused || !this._isMidiLoaded) { |
no test coverage detected