|
@@ -329,7 +329,7 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
|
this.reset();
|
|
|
}
|
|
|
|
|
|
- public play(): void {
|
|
|
+ public async play(): Promise<void> {
|
|
|
if (this.cursorIterator !== undefined && this.cursorIterator.EndReached) {
|
|
|
console.log("End reached, resetting");
|
|
|
this.reset();
|
|
@@ -337,11 +337,11 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
|
|
|
|
this.isPlaying = true;
|
|
|
this.RunningState = PlaybackState.Running;
|
|
|
- this.timingSource.start();
|
|
|
+ await this.timingSource.start();
|
|
|
this.loop();
|
|
|
}
|
|
|
|
|
|
- public pause(): void {
|
|
|
+ public async pause(): Promise<void> {
|
|
|
// lock(this.playbackThreadSyncObject) {
|
|
|
this.isPlaying = false;
|
|
|
// stop all active midi notes:
|
|
@@ -354,7 +354,7 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
|
|
|
|
// notify delegates (coreContainer) that the playing has finished:
|
|
|
this.RunningState = PlaybackState.Stopped;
|
|
|
- this.timingSource.pause();
|
|
|
+ await this.timingSource.pause();
|
|
|
try {
|
|
|
//bool endReached = this.iterator !== undefined && this.iterator.EndReached;
|
|
|
for (const listener of this.listeners) {
|