()
| 861 | } |
| 862 | |
| 863 | public updateDurations(): void { |
| 864 | const ticks: number = this._calculateDuration(); |
| 865 | this.playbackDuration = ticks; |
| 866 | |
| 867 | switch (this.graceType) { |
| 868 | case GraceType.BeforeBeat: |
| 869 | case GraceType.OnBeat: |
| 870 | switch (this.duration) { |
| 871 | case Duration.Sixteenth: |
| 872 | this.playbackDuration = MidiUtils.toTicks(Duration.SixtyFourth); |
| 873 | break; |
| 874 | case Duration.ThirtySecond: |
| 875 | this.playbackDuration = MidiUtils.toTicks(Duration.OneHundredTwentyEighth); |
| 876 | break; |
| 877 | default: |
| 878 | this.playbackDuration = MidiUtils.toTicks(Duration.ThirtySecond); |
| 879 | break; |
| 880 | } |
| 881 | this.displayDuration = 0; |
| 882 | break; |
| 883 | case GraceType.BendGrace: |
| 884 | this.playbackDuration /= 2; |
| 885 | this.displayDuration = 0; |
| 886 | break; |
| 887 | default: |
| 888 | this.displayDuration = ticks; |
| 889 | const previous: Beat | null = this.previousBeat; |
| 890 | if (previous && previous.graceType === GraceType.BendGrace) { |
| 891 | this.playbackDuration = previous.playbackDuration; |
| 892 | } |
| 893 | break; |
| 894 | } |
| 895 | } |
| 896 | |
| 897 | public finishTuplet(): void { |
| 898 | const previousBeat: Beat | null = this.previousBeat; |
no test coverage detected