Allow snapping to the start of the video timeline. (should work, but needs testing...
authorBen Loftis <ben@harrisonconsoles.com>
Fri, 8 Jun 2018 21:12:35 +0000 (16:12 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Fri, 8 Jun 2018 21:12:35 +0000 (16:12 -0500)
gtk2_ardour/editor_ops.cc
gtk2_ardour/video_timeline.h

index d730bb772aeebe5e34df786e49046435e548811a..f4647553f99a20635730fa7c0f655ee425b53891 100644 (file)
@@ -68,6 +68,7 @@
 #include "canvas/canvas.h"
 
 #include "actions.h"
+#include "ardour_ui.h"
 #include "audio_region_view.h"
 #include "audio_streamview.h"
 #include "audio_time_axis.h"
@@ -748,6 +749,11 @@ Editor::build_region_boundary_cache ()
                }
        }
 
+       //allow regions to snap to the video start (if any) as if it were a "region"
+       if (ARDOUR_UI::instance()->video_timeline) {
+               region_boundary_cache.push_back (ARDOUR_UI::instance()->video_timeline->get_video_start_offset());
+       }
+       
        std::pair<samplepos_t, samplepos_t> ext = session_gui_extents (false);
        samplepos_t session_end = ext.second;
 
index fd882adb3eec1223541bf6f2f5ca05a7a9b0f5ec..2e5aeb7ef7ec88da087b646cb075a89d2d9778a2 100644 (file)
@@ -74,6 +74,8 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
        void toggle_offset_locked ();
        bool is_offset_locked () { return video_offset_lock; }
 
+       ARDOUR::sampleoffset_t get_video_start_offset() { return video_start_offset; }
+
        void open_video_monitor ();
        void close_video_monitor ();
        void control_video_monitor (int, int);