repeat play, in/out <> shortcuts, append to proj wording, cleanup
[goodguy/history.git] / cinelerra-5.1 / cinelerra / vwindowgui.C
index a94e176750392f3efdf8b29849b546095eaa4536..4458eb764c80ba1bf608fd1e25f80f5284a1c9c4 100644 (file)
@@ -352,8 +352,27 @@ int VWindowGUI::keypress_event()
        return result;
 }
 
+void VWindowGUI::stop_transport(const char *lock_msg)
+{
+       if( !transport->is_stopped() ) {
+               if( lock_msg ) unlock_window();
+               transport->handle_transport(STOP, 1, 0, 0);
+               if( lock_msg ) lock_window(lock_msg);
+       }
+}
+
 int VWindowGUI::button_press_event()
 {
+       if( get_buttonpress() == LEFT_BUTTON && canvas->get_canvas() &&
+           canvas->get_canvas()->get_cursor_over_window() ) {
+               PlaybackEngine *playback_engine = vwindow->playback_engine;
+               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();
+               }
+               return transport->forward_play->handle_event();
+       }
        if(canvas->get_canvas())
                return canvas->button_press_event_base(canvas->get_canvas());
        return 0;
@@ -411,6 +430,7 @@ int VWindowGUI::drag_stop()
        {
                highlighted = 0;
                canvas->draw_refresh();
+               unlock_window();
 
                Indexable *indexable = mwindow->session->drag_assets->size() ?
                        mwindow->session->drag_assets->get(0) :
@@ -418,12 +438,12 @@ int VWindowGUI::drag_stop()
                EDL *edl = mwindow->session->drag_clips->size() ?
                        mwindow->session->drag_clips->get(0) :
                        0;
-
                if(indexable)
                        vwindow->change_source(indexable);
                else
                if(edl)
                        vwindow->change_source(edl);
+               lock_window("VWindowGUI::drag_stop");
                return 1;
        }