MusicSheetErrors.ts 663 B

12345678910111213141516171819202122232425
  1. // skeleton by Andrea
  2. export class MusicSheetErrors {
  3. public measureErrors: { [n: number]: string[] } = {};
  4. private errors: string[] = [];
  5. private tempErrors: string[] = [];
  6. public finalizeMeasure(measureNumber: number): void {
  7. let list: string[] = this.measureErrors[measureNumber];
  8. if (!list) {
  9. list = [];
  10. }
  11. this.measureErrors[measureNumber] = list.concat(this.tempErrors);
  12. this.tempErrors = [];
  13. }
  14. public pushMeasureError(errorMsg: string): void {
  15. this.tempErrors.push(errorMsg);
  16. }
  17. public push(errorMsg: string): void {
  18. this.errors.push(errorMsg);
  19. }
  20. }