change region selection after a combine op

git-svn-id: svn://localhost/ardour2/branches/3.0@9580 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-05-25 00:40:32 +00:00
parent bf57411634
commit e5dc4e4ea2
5 changed files with 24 additions and 7 deletions

View file

@ -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 ();

View file

@ -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

View file

@ -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);

View file

@ -139,7 +139,7 @@ public:
void partition (framepos_t start, framepos_t end, bool cut = false);
void duplicate (boost::shared_ptr<Region>, framepos_t position, float times);
void nudge_after (framepos_t start, framecnt_t distance, bool forwards);
void combine (const RegionList&, const std::string&);
boost::shared_ptr<Region> combine (const RegionList&, const std::string&);
void uncombine (boost::shared_ptr<Region>);
void shuffle (boost::shared_ptr<Region>, int dir);

View file

@ -3152,7 +3152,7 @@ Playlist::find_next_top_layer_position (framepos_t t) const
return max_framepos;
}
void
boost::shared_ptr<Region>
Playlist::combine (const RegionList& r, const std::string& name)
{
PropertyList plist;
@ -3237,6 +3237,8 @@ Playlist::combine (const RegionList& r, const std::string& name)
_combine_ops++;
thaw ();
return compound_region;
}
void