X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_drag.h;h=3c1eef70f6152fb3424ccfcd074eb917fab9fa38;hb=45fd3593eba84e2d89290f5112f4541bb9399209;hp=de10ed078715e6553d85be023daae18386f55c95;hpb=c30bda5173f5cb918326a158c938c89da3efdd70;p=ardour.git diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index de10ed0787..3c1eef70f6 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -247,7 +247,7 @@ class RegionDrag; class DraggingView { public: - DraggingView (RegionView *, RegionDrag *); + DraggingView (RegionView *, RegionDrag *, TimeAxisView* original_tav); RegionView* view; ///< the view /** index into RegionDrag::_time_axis_views of the view that this region is currently being displayed on, @@ -264,6 +264,7 @@ public: framepos_t initial_end; ///< initial end position of the region framepos_t anchored_fade_length; ///< fade_length when anchored during drag boost::shared_ptr initial_playlist; + TimeAxisView* initial_time_axis_view; }; /** Abstract base class for drags that involve region(s) */ @@ -315,7 +316,7 @@ public: protected: double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *); - bool y_movement_allowed (int, double) const; + virtual bool y_movement_allowed (int, double) const; bool _brushing; ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged @@ -348,9 +349,11 @@ public: void setup_pointer_frame_offset (); -private: +protected: typedef std::set > PlaylistSet; + void add_stateful_diff_commands_for_playlists (PlaylistSet const &); +private: void finished_no_copy ( bool const, bool const, @@ -377,10 +380,9 @@ private: PlaylistSet& modified_playlists ); - void add_stateful_diff_commands_for_playlists (PlaylistSet const &); void collect_new_region_view (RegionView *); - RouteTimeAxisView* create_destination_time_axis (boost::shared_ptr); + RouteTimeAxisView* create_destination_time_axis (boost::shared_ptr, TimeAxisView* original); bool _copy; RegionView* _new_region_view; @@ -411,6 +413,48 @@ public: void aborted (bool); }; +/** Region drag in ripple mode */ + +class RegionRippleDrag : public RegionMoveDrag +{ +public: + RegionRippleDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list const &); + ~RegionRippleDrag () { delete exclude; } + + void motion (GdkEvent *, bool); + void finished (GdkEvent *, bool); + void aborted (bool); +protected: + bool y_movement_allowed (int delta_track, double delta_layer) const; + +private: + TimeAxisView *prev_tav; // where regions were most recently dragged from + TimeAxisView *orig_tav; // where drag started + framecnt_t prev_amount; + framepos_t prev_position; + framecnt_t selection_length; + bool allow_moves_across_tracks; // only if all selected regions are on one track + ARDOUR::RegionList *exclude; + void add_all_after_to_views (TimeAxisView *tav, framepos_t where, const RegionSelection &exclude, bool drag_in_progress); + void remove_unselected_from_views (framecnt_t amount, bool move_regions); + +}; + +/** "Drag" to cut a region (action only on button release) */ +class RegionCutDrag : public Drag +{ + public: + RegionCutDrag (Editor*, ArdourCanvas::Item*, framepos_t); + ~RegionCutDrag (); + + void motion (GdkEvent*, bool); + void finished (GdkEvent*, bool); + void aborted (bool); + + private: + EditorCursor* line; +}; + /** Drags to create regions */ class RegionCreateDrag : public Drag { @@ -947,6 +991,7 @@ class RangeMarkerBarDrag : public Drag { public: enum Operation { + CreateSkipMarker, CreateRangeMarker, CreateTransportMarker, CreateCDMarker