Skip to content

simple event addition : end of score EVENT #51

@patikapusula

Description

@patikapusula

An "end of score" callback, useful for adapting the UI elements.

PlaybackEngine.ts

export enum PlaybackEvent {
  STATE_CHANGE = "state-change",
  ITERATION = "iteration",
  END_OF_SCORE = "end-of-score", // new event
}

// callback
  private endOfScoreCallback(message: string) {
    this.events.emit(PlaybackEvent.END_OF_SCORE, message);
  }

 // check for "end of score" and firing cb
private iterationCallback() {
    if (this.state !== PlaybackState.PLAYING) return;
    if (this.currentIterationStep > 0) this.cursor.next();
    ++this.currentIterationStep;	
// Checking here
if (this.currentIterationStep > this.iterationSteps) {
      this.endOfScoreCallback("End of score");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions