From d75c7151d4cf306f1961e7a967ea129c6fd8d153 Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Wed, 23 Oct 2013 21:50:01 +0100 Subject: Ripple mode: basic implementation Add a value for Ripple to EditMode enum. Add Ripple edit mode to edit mode dropdown, by adding it to the Editor::build_edit_mode_menu() helper function, and remove the old code that added items to the (now unused) Editor::edit_mode_strings. Add the regions that should be affected by the drag to RegionDrag::_views so that the drag carries them along automatically. Use a copy of the RegionList in Playlist::core_ripple(), since bad things happen when iterating over regions and they get moved around in the list. Handle rippling in removal of regions from playlist. When dragging in ripple mode, exclude all regions that lie before the original start position of the selected regions being dragged from rippling: this is what Mixbus does. Make editor dragging respect snap-to settings, by using the existing compute_x_delta() function, which did almost the right thing. Move setting of _last_frame_position out of that function so all ripple-dragged regions can move. Ripple when dragging from region list: even though Mixbus doesn't do this, it seems like a good idea. Prevent multi-track selection being dragged across tracks, by making RegionMotionDrag::y_movement_allowed() virtual, and overriding it in RegionRippleDrag to forbid dragging of selections containing regions on more than one track to dofferent tracks in ripple mode. Remember which TimeAxisView a ripple-mode drag that's allowed cross-track drags started from, so that the effect of rippling regions after any region that's dragged off that track can be undone. --- libs/ardour/ardour/playlist.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libs/ardour/ardour/playlist.h') diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 5629a04629..ababa60063 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -144,6 +144,14 @@ public: void uncombine (boost::shared_ptr); void shuffle (boost::shared_ptr, int dir); + void ripple (framepos_t at, framecnt_t distance, RegionList *exclude); + void ripple (framepos_t at, framecnt_t distance, boost::shared_ptr exclude) { + RegionList el; + if (exclude) + el.push_back (exclude); + ripple (at, distance, &el); + } + void update_after_tempo_map_change (); boost::shared_ptr cut (std::list&, bool result_is_hidden = true); @@ -283,6 +291,7 @@ public: bool first_set_state; bool _hidden; bool _splicing; + bool _rippling; bool _shuffling; bool _nudging; uint32_t _refcnt; @@ -337,6 +346,11 @@ public: void splice_locked (framepos_t at, framecnt_t distance, boost::shared_ptr exclude); void splice_unlocked (framepos_t at, framecnt_t distance, boost::shared_ptr exclude); + void core_ripple (framepos_t at, framecnt_t distance, RegionList *exclude); + void ripple_locked (framepos_t at, framecnt_t distance, RegionList *exclude); + void ripple_unlocked (framepos_t at, framecnt_t distance, RegionList *exclude); + + virtual void remove_dependents (boost::shared_ptr /*region*/) {} virtual XMLNode& state (bool); -- cgit v1.2.3