X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvwindowgui.C;h=931b0d3e1a18c101b576b360ab4fd89ba594f790;hp=5ff595eeaec5801f23c60b0bb5006cbb486f3489;hb=8ab335aafbd648cad728f18e01153715a4e59eef;hpb=ecf90ad2d14e5f72505b824b7b50edd717d2d404 diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 5ff595ee..931b0d3e 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -356,15 +356,17 @@ int VWindowGUI::button_press_event() { if( get_buttonpress() == LEFT_BUTTON && canvas->get_canvas() && canvas->get_canvas()->get_cursor_over_window() ) { + int command = STOP; PlaybackEngine *playback_engine = vwindow->playback_engine; - unlock_window(); - if( playback_engine->is_playing_back ) { - transport->handle_transport(STOP, 1); - } - else { - transport->handle_transport(NORMAL_FWD, 1); + if( !playback_engine->is_playing_back && vwindow->get_edl() != 0 ) { + double length = vwindow->get_edl()->tracks->total_playable_length(); + double position = playback_engine->get_tracking_position(); + if( position >= length ) transport->goto_start(); + command = NORMAL_FWD; } - vwindow->gui->lock_window("VWindowEditing::prev_label"); + unlock_window(); + transport->handle_transport(command, 1); + lock_window("VWindowGUI::button_press_event"); return 1; } if(canvas->get_canvas())