Fix a problem with the time display
Some changes made in commit e05c82758e
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.
This commit is contained in:
@@ -99,6 +99,7 @@ public:
|
||||
static void setTicksPerTact( tick_t tpt );
|
||||
static MidiTime stepPosition( int step );
|
||||
static double ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute);
|
||||
static double ticksToMilliseconds(double ticks, bpm_t beatsPerMinute);
|
||||
|
||||
private:
|
||||
tick_t m_ticks;
|
||||
|
||||
@@ -197,6 +197,11 @@ MidiTime MidiTime::stepPosition( int step )
|
||||
}
|
||||
|
||||
double MidiTime::ticksToMilliseconds(tick_t ticks, bpm_t beatsPerMinute)
|
||||
{
|
||||
return MidiTime::ticksToMilliseconds(static_cast<double>(ticks), beatsPerMinute);
|
||||
}
|
||||
|
||||
double MidiTime::ticksToMilliseconds(double ticks, bpm_t beatsPerMinute)
|
||||
{
|
||||
// 60 * 1000 / 48 = 1250
|
||||
return ( ticks * 1250 ) / beatsPerMinute;
|
||||
|
||||
Reference in New Issue
Block a user