diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-25 00:40:32 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-25 00:40:32 +0000 |
commit | e5dc4e4ea2cd4f2a91f77464980db52fd4df6b86 (patch) | |
tree | 829ac5a39327ca1f167c6bcb1b90dd9238e82f65 /gtk2_ardour | |
parent | bf574116346fdc3804d37c0e7ee424608d7ee38e (diff) |
change region selection after a combine op
git-svn-id: svn://localhost/ardour2/branches/3.0@9580 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 2 |
3 files changed, 20 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 02bf220b4d..9e46c04eed 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6426,9 +6426,20 @@ Editor::combine_regions () } begin_reversible_command (_("combine regions")); + + vector<RegionView*> new_selection; for (RTVS::iterator i = tracks.begin(); i != tracks.end(); ++i) { - (*i)->combine_regions (); + RegionView* rv; + + if ((rv = (*i)->combine_regions ()) != 0) { + new_selection.push_back (rv); + } + } + + selection->clear_regions (); + for (vector<RegionView*>::iterator i = new_selection.begin(); i != new_selection.end(); ++i) { + selection->add (*i); } commit_reversible_command (); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 296251a859..bbdc369ede 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -2486,13 +2486,13 @@ void add_region_to_list (RegionView* rv, Playlist::RegionList* l, uint32_t* max_ *max_level = max (*max_level, rv->region()->max_source_level()); } -void +RegionView* RouteTimeAxisView::combine_regions () { assert (is_track()); if (!_view) { - return; + return 0; } Playlist::RegionList selected_regions; @@ -2504,8 +2504,12 @@ RouteTimeAxisView::combine_regions () string name = RegionFactory::compound_region_name (playlist->name(), playlist->combine_ops(), max_level); playlist->clear_changes (); - playlist->combine (selected_regions, name); + boost::shared_ptr<Region> compound_region = playlist->combine (selected_regions, name); + _session->add_command (new StatefulDiffCommand (playlist)); + /* make the new region be selected */ + + return _view->find_view (compound_region); } void diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 27e816738f..2e79294568 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -94,7 +94,7 @@ public: /* Editing operations */ void cut_copy_clear (Selection&, Editing::CutCopyOp); bool paste (ARDOUR::framepos_t, float times, Selection&, size_t nth); - void combine_regions (); + RegionView* combine_regions (); void uncombine_regions (); void uncombine_region (RegionView*); void toggle_automation_track (const Evoral::Parameter& param); |