Fix formatting samplecnt_t (aka int64_t aka long long int)
[ardour.git] / gtk2_ardour / editor_drag.h
index f48d3c4953fbd32a19f1f85f2ee9716e04962580..f4a76cb599a16426fea4eafb183de4e2ec6ad448 100644 (file)
@@ -1,21 +1,27 @@
 /*
-    Copyright (C) 2009 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2015 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2015-2018 Ben Loftis <ben@harrisonconsoles.com>
+ * Copyright (C) 2016 Tim Mayberry <mojofunk@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #ifndef __gtk2_ardour_editor_drag_h_
 #define __gtk2_ardour_editor_drag_h_
@@ -114,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<Drag*> _drags;
@@ -183,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<ARDOUR::samplecnt_t, int> move_threshold () const {
                return std::make_pair (1, 1);
@@ -211,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 {
@@ -255,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
@@ -335,6 +357,8 @@ protected:
        int _visible_y_high;
        uint32_t _ntracks;
 
+       void setup_video_sample_offset ();
+
        friend class DraggingView;
 
 private:
@@ -486,8 +510,8 @@ protected:
        bool y_movement_allowed (int delta_track, double delta_layer, int skip_invisible = 0) const;
 
 private:
-       TimeAxisView *prev_tav;         // where regions were most recently dragged from
-       TimeAxisView *orig_tav;         // where drag started
+       TimeAxisView *prev_tav; // where regions were most recently dragged from
+       TimeAxisView *orig_tav; // where drag started
        ARDOUR::samplecnt_t prev_amount;
        ARDOUR::samplepos_t prev_position;
        ARDOUR::samplecnt_t selection_length;
@@ -973,6 +997,7 @@ public:
        }
 
        void setup_pointer_sample_offset ();
+       void setup_video_sample_offset ();
 
 private:
        void update_item (ARDOUR::Location *);