()
| 842 | } |
| 843 | |
| 844 | private _calculateDuration(): number { |
| 845 | if (this.overrideDisplayDuration !== undefined) { |
| 846 | return this.overrideDisplayDuration!; |
| 847 | } |
| 848 | if (this.isFullBarRest) { |
| 849 | return this.voice.bar.masterBar.calculateDuration(); |
| 850 | } |
| 851 | let ticks: number = MidiUtils.toTicks(this.duration); |
| 852 | if (this.dots === 2) { |
| 853 | ticks = MidiUtils.applyDot(ticks, true); |
| 854 | } else if (this.dots === 1) { |
| 855 | ticks = MidiUtils.applyDot(ticks, false); |
| 856 | } |
| 857 | if (this.tupletDenominator > 0 && this.tupletNumerator >= 0) { |
| 858 | ticks = MidiUtils.applyTuplet(ticks, this.tupletNumerator, this.tupletDenominator); |
| 859 | } |
| 860 | return ticks; |
| 861 | } |
| 862 | |
| 863 | public updateDurations(): void { |
| 864 | const ticks: number = this._calculateDuration(); |
no test coverage detected