Skip to content

Commit bcdb5ec

Browse files
Fix a problem with the time display
Some changes made in commit e05c827 have broken the update of the time display. This commit fixes the problem by introducing a second version of MidiTime::ticksToMilliseconds which takes a double as an argument for the ticks. This new method is then used by the call to ticksToMilliseconds in Song::processNextBuffer which fixes the problem.
1 parent 6f1b11f commit bcdb5ec

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/MidiTime.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class EXPORT MidiTime
9999
static void setTicksPerTact( tick_t tpt );
100100
static MidiTime stepPosition( int step );
101101
static double ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute);
102+
static double ticksToMilliseconds(double ticks, bpm_t beatsPerMinute);
102103

103104
private:
104105
tick_t m_ticks;

src/core/midi/MidiTime.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ MidiTime MidiTime::stepPosition( int step )
197197
}
198198

199199
double MidiTime::ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute)
200+
{
201+
return MidiTime::ticksToMilliseconds(static_cast<double>(ticks), beatsPerMinute);
202+
}
203+
204+
double MidiTime::ticksToMilliseconds(double ticks, bpm_t beatsPerMinute)
200205
{
201206
// 60 * 1000 / 48 = 1250
202207
return ( ticks * 1250 ) / beatsPerMinute;

0 commit comments

Comments
 (0)