()
| 878 | private _generatedAudioEndTime: number = 0; |
| 879 | |
| 880 | public setup() { |
| 881 | this._synth.setupMetronomeChannel(this._sequencer.metronomeChannel, this._synth.metronomeVolume); |
| 882 | |
| 883 | const syncPoints = this._sequencer.currentSyncPoints; |
| 884 | const alphaTabEndTime = this._sequencer.currentEndTime; |
| 885 | |
| 886 | if (syncPoints.length === 0) { |
| 887 | this._generatedAudioEndTime = alphaTabEndTime; |
| 888 | } else { |
| 889 | const lastSyncPoint = syncPoints[syncPoints.length - 1]; |
| 890 | let endTime = lastSyncPoint.syncTime; |
| 891 | const remainingTicks = this._sequencer.currentEndTick - lastSyncPoint.synthTick; |
| 892 | if (remainingTicks > 0) { |
| 893 | endTime += MidiUtils.ticksToMillis(remainingTicks, lastSyncPoint.syncBpm); |
| 894 | } |
| 895 | this._generatedAudioEndTime = endTime; |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | public render(milliseconds: number): AudioExportChunk | undefined { |
| 900 | if (this._sequencer.isFinished) { |
no test coverage detected