summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-22 16:11:00 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-22 16:11:00 +0000
commit9c733915a0bc4b5274fac749b1adc874da79a6ee (patch)
tree1db070ef198c7b7890cb98c84a37a1321c810183 /gtk2_ardour/route_time_axis.cc
parentd40ee9548661f88db1bc1dcda0b463220d59a8d8 (diff)
basic uncombining (no post-facto region trimming)
git-svn-id: svn://localhost/ardour2/branches/3.0@9566 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 2dbc8635f7..16e1d72d53 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -2503,6 +2503,35 @@ RouteTimeAxisView::combine_regions ()
string name = string_compose (_("%1 compound-%2 (%3)"), playlist->name(), playlist->combine_ops()+1, max_level+1);
playlist->clear_changes ();
- playlist->join (selected_regions, name);
+ playlist->combine (selected_regions, name);
_session->add_command (new StatefulDiffCommand (playlist));
}
+
+void
+RouteTimeAxisView::uncombine_regions ()
+{
+ assert (is_track());
+
+ if (!_view) {
+ return;
+ }
+
+ Playlist::RegionList selected_regions;
+ boost::shared_ptr<Playlist> playlist = track()->playlist();
+ uint32_t max_level = 0;
+
+ /* have to grab selected regions first because the uncombine is going
+ * to change that in the middle of the list traverse
+ */
+
+ _view->foreach_selected_regionview (sigc::bind (sigc::ptr_fun (add_region_to_list), &selected_regions, &max_level));
+
+ playlist->clear_changes ();
+
+ for (Playlist::RegionList::iterator i = selected_regions.begin(); i != selected_regions.end(); ++i) {
+ playlist->uncombine (*i);
+ }
+
+ _session->add_command (new StatefulDiffCommand (playlist));
+}
+