Browse Source

Get BBT info right.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
9bb119e0b5
1 changed files with 15 additions and 9 deletions
  1. +15
    -9
      Timeline/Timeline.C

+ 15
- 9
Timeline/Timeline.C View File

@@ -393,14 +393,6 @@ Timeline::solve_tempomap ( nframes_t when )
for ( list <Sequence_Widget *>::iterator i = tempo_map.begin(); for ( list <Sequence_Widget *>::iterator i = tempo_map.begin();
i != tempo_map.end(); ++i ) i != tempo_map.end(); ++i )
{ {
nframes_t next;

{
list <Sequence_Widget *>::iterator n = i;
++n;

next = n != tempo_map.end() ? (*n)->start() : when;
}


if ( ! strcmp( (*i)->class_name(), "Tempo_Point" ) ) if ( ! strcmp( (*i)->class_name(), "Tempo_Point" ) )
{ {
@@ -416,6 +408,17 @@ Timeline::solve_tempomap ( nframes_t when )
sig = p->time(); sig = p->time();
} }


nframes_t next;

{
list <Sequence_Widget *>::iterator n = i;
++n;
if ( n == tempo_map.end() )
next = when;
else
next = min( (*n)->start(), when );
}

for ( ; f < next; f += beat_inc ) for ( ; f < next; f += beat_inc )
{ {
if ( ++bbt.beat == sig.beats_per_bar ) if ( ++bbt.beat == sig.beats_per_bar )
@@ -427,8 +430,11 @@ Timeline::solve_tempomap ( nframes_t when )


// const int x = ts_to_x( f - xoffset ) + Track::width(); // const int x = ts_to_x( f - xoffset ) + Track::width();
if ( f >= when ) if ( f >= when )
return bbt;
break;

} }

return bbt;
} }






Loading…
Cancel
Save