Improve tempomap rendering.
This commit is contained in:
parent
4f52567504
commit
1cd36adce8
|
@ -399,6 +399,7 @@ Timeline::render_tempomap( nframes_t start, nframes_t length, measure_line_callb
|
||||||
sig.beat_type = 4;
|
sig.beat_type = 4;
|
||||||
|
|
||||||
nframes_t f = 0;
|
nframes_t f = 0;
|
||||||
|
nframes_t next = 0;
|
||||||
|
|
||||||
nframes_t frames_per_beat = samples_per_minute / bpm;
|
nframes_t frames_per_beat = samples_per_minute / bpm;
|
||||||
|
|
||||||
|
@ -420,17 +421,18 @@ Timeline::render_tempomap( nframes_t start, nframes_t length, measure_line_callb
|
||||||
sig = p->time();
|
sig = p->time();
|
||||||
}
|
}
|
||||||
|
|
||||||
nframes_t next;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
list <Sequence_Widget *>::iterator n = i;
|
list <Sequence_Widget *>::iterator n = i;
|
||||||
++n;
|
++n;
|
||||||
if ( n == tempo_map.end() )
|
if ( n == tempo_map.end() )
|
||||||
next = end;
|
next = end;
|
||||||
else
|
else
|
||||||
next = min( (*n)->start(), end );
|
// next = min( (*n)->start(), end );
|
||||||
|
/* points may not always be aligned with beat boundaries, so we must align here */
|
||||||
|
next = (*n)->start() - ( ( (*n)->start() - (*i)->start() ) % frames_per_beat );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for ( ; f < next; f += frames_per_beat )
|
for ( ; f < next; f += frames_per_beat )
|
||||||
{
|
{
|
||||||
if ( ++bbt.beat == sig.beats_per_bar )
|
if ( ++bbt.beat == sig.beats_per_bar )
|
||||||
|
@ -471,7 +473,6 @@ done:
|
||||||
/* FIXME: this this right? */
|
/* FIXME: this this right? */
|
||||||
|
|
||||||
const nframes_t frames_per_tick = frames_per_beat / ticks_per_beat;
|
const nframes_t frames_per_tick = frames_per_beat / ticks_per_beat;
|
||||||
|
|
||||||
bbt.tick = ticks_per_beat - ( ( ( f - end ) / frames_per_tick ) % (nframes_t)ticks_per_beat );
|
bbt.tick = ticks_per_beat - ( ( ( f - end ) / frames_per_tick ) % (nframes_t)ticks_per_beat );
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
|
|
Loading…
Reference in New Issue