From a8f9ba4a5edc7137dc02ae6d8b0245c3b1d5bc87 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 9 Nov 2019 05:03:38 +0100 Subject: Preview video frame when dragging --- gtk2_ardour/editor_drag.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gtk2_ardour/editor_drag.h') diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 6994b8131f..f4a76cb599 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -120,6 +120,9 @@ public: return _current_pointer_sample; } + /** return drag-motion displays video-frame of drag-location */ + bool preview_video () const; + private: Editor* _editor; std::list _drags; @@ -189,6 +192,10 @@ public: return true; } + bool preview_video () const { + return _preview_video; + } + /** @return minimum number of samples (in x) and pixels (in y) that should be considered a movement */ virtual std::pair move_threshold () const { return std::make_pair (1, 1); @@ -217,6 +224,12 @@ public: _pointer_sample_offset = 0; } + /** Set up the _video_sample_offset - relative to _current_pointer_sample */ + virtual void setup_video_sample_offset () { + _video_sample_offset = 0; + _preview_video = false; + } + protected: double grab_x () const { @@ -261,12 +274,15 @@ protected: void show_verbose_cursor_time (samplepos_t); void show_verbose_cursor_duration (samplepos_t, samplepos_t, double xoffset = 0); void show_verbose_cursor_text (std::string const &); + void show_view_preview (samplepos_t); Editor* _editor; ///< our editor DragManager* _drags; ArdourCanvas::Item* _item; ///< our item /** Offset from the mouse's position for the drag to the start of the thing that is being dragged */ ARDOUR::samplecnt_t _pointer_sample_offset; + ARDOUR::samplecnt_t _video_sample_offset; + bool _preview_video; bool _x_constrained; ///< true if x motion is constrained, otherwise false bool _y_constrained; ///< true if y motion is constrained, otherwise false bool _was_rolling; ///< true if the session was rolling before the drag started, otherwise false @@ -341,6 +357,8 @@ protected: int _visible_y_high; uint32_t _ntracks; + void setup_video_sample_offset (); + friend class DraggingView; private: @@ -979,6 +997,7 @@ public: } void setup_pointer_sample_offset (); + void setup_video_sample_offset (); private: void update_item (ARDOUR::Location *); -- cgit v1.2.3