pull/43/merge
Roy Vegard Ovesen 2013-03-28 17:20:11 -07:00
commit 342ac0078f
1 changed files with 16 additions and 4 deletions

View File

@ -476,7 +476,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
{
nframes_t f = transport->frame;
if ( prev_line( &f ) )
if ( f > 0 && prev_line( &f ) )
transport->locate( f );
}
else if ( ! strcmp( picked, "Playhead right beat" ) )
@ -490,7 +490,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
{
nframes_t f = transport->frame;
if ( prev_line( &f, true ) )
if ( f > 0 && prev_line( &f, true ) )
transport->locate( f );
}
else if ( ! strcmp( picked, "Playhead right bar" ) )
@ -890,7 +890,12 @@ Timeline::next_line ( nframes_t *frame, bool bar ) const
nearest_line_arg n = { when, JACK_MAX_FRAMES, bar };
render_tempomap( when, x_to_ts( w() ), prev_next_line_cb, &n );
nframes_t length = sample_rate() * 60;
if (length > (JACK_MAX_FRAMES - when))
length = JACK_MAX_FRAMES - when;
render_tempomap( when, length, prev_next_line_cb, &n );
if ( n.closest == (nframes_t)-1 )
return false;
@ -911,7 +916,14 @@ Timeline::prev_line ( nframes_t *frame, bool bar ) const
nearest_line_arg n = { when, 0, bar };
render_tempomap( xoffset, when - xoffset, prev_next_line_cb, &n );
nframes_t start = 0;
/** Assume that the tempo will not be less than 1.0 bpm */
start = when - sample_rate() * 60;
if ((int)start < 0)
start = 0;
render_tempomap( start, when - start, prev_next_line_cb, &n );
if ( n.closest == JACK_MAX_FRAMES )
return false;