double CTimeBar::pixel_to_position(int pixel)
{
- double start = 0, length = 0;
+ double start = 0, end = get_edl_length();
EDL *edl = get_edl();
if( edl ) {
- start = edl->local_session->preview_start;
- if( start >= 0 )
- length = edl->local_session->preview_end - start;
+ double preview_start = edl->local_session->preview_start;
+ double preview_end = edl->local_session->preview_end;
+ if( preview_end >= 0 || preview_start > 0 )
+ start = preview_start;
+ if( preview_end >= 0 && preview_end < end )
+ end = preview_end;
}
- if( length <= 0 )
- length = get_edl_length();
- return start + (double)pixel * length / get_w();
+ if( start > end ) start = end;
+ return start + (double)pixel * (end - start) / get_w();
}
void CTimeBar::select_label(double position)
{
- EDL *edl = mwindow->edl;
-
- gui->unlock_window();
- mwindow->gui->mbuttons->transport->handle_transport(STOP, 1, 0, 0);
- gui->lock_window();
+ gui->stop_transport("CTimeBar::select_label");
- position = mwindow->edl->align_to_frame(position, 1);
+ EDL *edl = mwindow->edl;
+ position = edl->align_to_frame(position, 1);
if( shift_down() ) {
if( position > edl->local_session->get_selectionend(1) / 2 +