Timeline: Ignore zoom level when moving to next/prev beat/bar
Also prevent moving left beyond the start. Fixes #42.pull/43/head
parent
ceb04569e9
commit
fff974ac96
|
@ -476,7 +476,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
|
||||||
{
|
{
|
||||||
nframes_t f = transport->frame;
|
nframes_t f = transport->frame;
|
||||||
|
|
||||||
if ( prev_line( &f ) )
|
if ( f > 0 && prev_line( &f ) )
|
||||||
transport->locate( f );
|
transport->locate( f );
|
||||||
}
|
}
|
||||||
else if ( ! strcmp( picked, "Playhead right beat" ) )
|
else if ( ! strcmp( picked, "Playhead right beat" ) )
|
||||||
|
@ -490,7 +490,7 @@ Timeline::menu_cb ( Fl_Menu_ *m )
|
||||||
{
|
{
|
||||||
nframes_t f = transport->frame;
|
nframes_t f = transport->frame;
|
||||||
|
|
||||||
if ( prev_line( &f, true ) )
|
if ( f > 0 && prev_line( &f, true ) )
|
||||||
transport->locate( f );
|
transport->locate( f );
|
||||||
}
|
}
|
||||||
else if ( ! strcmp( picked, "Playhead right bar" ) )
|
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 };
|
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 )
|
if ( n.closest == (nframes_t)-1 )
|
||||||
return false;
|
return false;
|
||||||
|
@ -911,7 +916,14 @@ Timeline::prev_line ( nframes_t *frame, bool bar ) const
|
||||||
|
|
||||||
nearest_line_arg n = { when, 0, bar };
|
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 )
|
if ( n.closest == JACK_MAX_FRAMES )
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue