Add "Follow Playhead" option.

pull/3/head
Jonathan Moore Liles 2008-04-29 20:08:49 -05:00
parent b307642224
commit 98afd445ed
3 changed files with 11 additions and 1 deletions

View File

@ -176,7 +176,7 @@ exit( 0 );}
}
MenuItem {} {
label {Delete Selected}
callback {timeline->delete_selected();} selected
callback {timeline->delete_selected();}
xywh {20 20 40 25} shortcut 0xffff
}
}
@ -248,6 +248,11 @@ exit( 0 );}
label {&Timeline} open
xywh {0 0 74 25}
} {
MenuItem {} {
label {&Follow Playhead}
callback {Timeline::follow_playhead = menu_picked_value( o );} selected
xywh {20 20 40 25} type Toggle value 1
}
Submenu {} {
label {&Snap to} open
xywh {0 0 74 25}

View File

@ -34,6 +34,7 @@
bool Timeline::draw_with_measure_lines = true;
Timeline::snap_e Timeline::snap_to = Bars;
bool Timeline::snap_magnetic = true;
bool Timeline::follow_playhead = true;
const float UPDATE_FREQ = 0.02f;
@ -664,6 +665,9 @@ Timeline::redraw_playhead ( void )
{
redraw_overlay();
last_playhead = transport->frame;
if ( follow_playhead )
xposition( max( 0, ts_to_x( transport->frame ) - ( ( tracks->w() - Track::width() ) >> 1 ) ) );
}
}

View File

@ -117,6 +117,7 @@ public:
static bool draw_with_measure_lines;
static snap_e snap_to;
static bool snap_magnetic;
static bool follow_playhead;
Tempo_Sequence *tempo_track;
Time_Sequence *time_track;