mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
make region-selection on click apply across tracks if RippleAll is in use
This commit is contained in:
parent
eac366ec8e
commit
e5175f51d6
2 changed files with 61 additions and 5 deletions
|
|
@ -773,11 +773,13 @@ private:
|
||||||
void sort_track_selection (TrackViewList&);
|
void sort_track_selection (TrackViewList&);
|
||||||
|
|
||||||
void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
|
void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
|
||||||
|
void get_all_equivalent_regions (RegionView* rv, std::vector<RegionView*> &) const;
|
||||||
RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
|
RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
|
||||||
RegionView* regionview_from_region (boost::shared_ptr<ARDOUR::Region>) const;
|
RegionView* regionview_from_region (boost::shared_ptr<ARDOUR::Region>) const;
|
||||||
RouteTimeAxisView* rtav_from_route (boost::shared_ptr<ARDOUR::Route>) const;
|
RouteTimeAxisView* rtav_from_route (boost::shared_ptr<ARDOUR::Route>) const;
|
||||||
|
|
||||||
void mapover_tracks_with_unique_playlists (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
|
void mapover_tracks_with_unique_playlists (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
|
||||||
|
void mapover_all_tracks_with_unique_playlists (sigc::slot<void,RouteTimeAxisView&,uint32_t>) const;
|
||||||
void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, std::vector<RegionView*>*) const;
|
void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, std::vector<RegionView*>*) const;
|
||||||
|
|
||||||
void mapover_grouped_routes (sigc::slot<void, RouteUI&> sl, RouteUI*, PBD::PropertyID) const;
|
void mapover_grouped_routes (sigc::slot<void, RouteUI&> sl, RouteUI*, PBD::PropertyID) const;
|
||||||
|
|
|
||||||
|
|
@ -537,6 +537,38 @@ Editor::mapover_tracks_with_unique_playlists (sigc::slot<void, RouteTimeAxisView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::mapover_all_tracks_with_unique_playlists (sigc::slot<void, RouteTimeAxisView&, uint32_t> sl) const
|
||||||
|
{
|
||||||
|
set<boost::shared_ptr<Playlist> > playlists;
|
||||||
|
|
||||||
|
set<RouteTimeAxisView*> tracks;
|
||||||
|
|
||||||
|
for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
|
RouteTimeAxisView* v = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||||
|
|
||||||
|
boost::shared_ptr<Track> t = v->track();
|
||||||
|
if (t) {
|
||||||
|
if (playlists.insert (t->playlist()).second) {
|
||||||
|
/* haven't seen this playlist yet */
|
||||||
|
tracks.insert (v);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* not actually a "Track", but a timeaxis view that
|
||||||
|
we should mapover anyway.
|
||||||
|
*/
|
||||||
|
tracks.insert (v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* call the slots */
|
||||||
|
uint32_t const sz = tracks.size ();
|
||||||
|
|
||||||
|
for (set<RouteTimeAxisView*>::iterator i = tracks.begin(); i != tracks.end(); ++i) {
|
||||||
|
sl (**i, sz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionView * basis, vector<RegionView*>* all_equivs) const
|
Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionView * basis, vector<RegionView*>* all_equivs) const
|
||||||
{
|
{
|
||||||
|
|
@ -576,6 +608,16 @@ Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivale
|
||||||
equivalent_regions.push_back (basis);
|
equivalent_regions.push_back (basis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::get_all_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions) const
|
||||||
|
{
|
||||||
|
mapover_all_tracks_with_unique_playlists (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions));
|
||||||
|
|
||||||
|
/* add clicked regionview since we skipped all other regions in the same track as the one it was in */
|
||||||
|
|
||||||
|
equivalent_regions.push_back (basis);
|
||||||
|
}
|
||||||
|
|
||||||
RegionSelection
|
RegionSelection
|
||||||
Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) const
|
Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) const
|
||||||
{
|
{
|
||||||
|
|
@ -646,10 +688,14 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
||||||
|
|
||||||
if (press) {
|
if (press) {
|
||||||
|
|
||||||
if (selection->selected (clicked_routeview)) {
|
if (Config->get_edit_mode() == RippleAll) {
|
||||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
get_all_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||||
} else {
|
} else {
|
||||||
all_equivalent_regions.push_back (clicked_regionview);
|
if (selection->selected (clicked_routeview)) {
|
||||||
|
get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
||||||
|
} else {
|
||||||
|
all_equivalent_regions.push_back (clicked_regionview);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add all the equivalent regions, but only on button press */
|
/* add all the equivalent regions, but only on button press */
|
||||||
|
|
@ -665,7 +711,11 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
||||||
|
|
||||||
case Selection::Set:
|
case Selection::Set:
|
||||||
if (!selection->selected (clicked_regionview)) {
|
if (!selection->selected (clicked_regionview)) {
|
||||||
get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
if (Config->get_edit_mode() == RippleAll) {
|
||||||
|
get_all_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||||
|
} else {
|
||||||
|
get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
||||||
|
}
|
||||||
selection->set (all_equivalent_regions);
|
selection->set (all_equivalent_regions);
|
||||||
commit = true;
|
commit = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -675,7 +725,11 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
|
||||||
else {
|
else {
|
||||||
if (selection->regions.size() > 1) {
|
if (selection->regions.size() > 1) {
|
||||||
/* collapse region selection down to just this one region (and its equivalents) */
|
/* collapse region selection down to just this one region (and its equivalents) */
|
||||||
get_equivalent_regions(clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
if (Config->get_edit_mode() == RippleAll) {
|
||||||
|
get_all_equivalent_regions (clicked_regionview, all_equivalent_regions);
|
||||||
|
} else {
|
||||||
|
get_equivalent_regions(clicked_regionview, all_equivalent_regions, ARDOUR::Properties::group_select.property_id);
|
||||||
|
}
|
||||||
selection->set(all_equivalent_regions);
|
selection->set(all_equivalent_regions);
|
||||||
commit = true;
|
commit = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue