audio-mixer-engine 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-mixer-engine.cjs.js +1 -1
- package/dist/audio-mixer-engine.es.js +336 -326
- package/package.json +1 -1
- package/src/lib/playback-manager.js +17 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audio-mixer-engine",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Audio engine library for audio mixer applications with MIDI parsing, playback, and synthesis",
|
|
5
5
|
"main": "dist/audio-mixer-engine.cjs.js",
|
|
6
6
|
"module": "dist/audio-mixer-engine.es.js",
|
|
@@ -446,26 +446,29 @@ export default class PlaybackManager {
|
|
|
446
446
|
stop() {
|
|
447
447
|
if (this.state === 'stopped') return;
|
|
448
448
|
|
|
449
|
-
const
|
|
450
|
-
this.state = 'stopped';
|
|
451
|
-
this.frozenTime = 0;
|
|
452
|
-
this.leadInData = null;
|
|
453
|
-
this.leadInProgress = null;
|
|
454
|
-
this.leadInStartTime = null;
|
|
449
|
+
const previousState = this.state;
|
|
455
450
|
|
|
456
|
-
//
|
|
451
|
+
// Apply the same per-state cleanup as pause()
|
|
452
|
+
if (previousState === 'lead-in') {
|
|
453
|
+
this._pauseLeadIn();
|
|
454
|
+
} else if (previousState === 'playing') {
|
|
455
|
+
this.midiPlayer.pause();
|
|
456
|
+
this._stopMetronome();
|
|
457
|
+
}
|
|
457
458
|
this._stopLeadIn();
|
|
458
|
-
this._stopMetronome();
|
|
459
459
|
this._stopTimeUpdateLoop();
|
|
460
460
|
|
|
461
|
-
// Reset
|
|
462
|
-
this.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
461
|
+
// Reset to beginning
|
|
462
|
+
this.frozenTime = 0;
|
|
463
|
+
this.leadInData = null;
|
|
464
|
+
this.leadInProgress = null;
|
|
465
|
+
this.leadInStartTime = null;
|
|
466
|
+
if (this.midiPlayer) {
|
|
467
|
+
this.midiPlayer.skipToTime(0);
|
|
467
468
|
}
|
|
469
|
+
this._resetMetronomeBeatTracking();
|
|
468
470
|
|
|
471
|
+
this.state = 'stopped';
|
|
469
472
|
this._emitEvent('playbackStopped', {});
|
|
470
473
|
}
|
|
471
474
|
|