region selection toggle in RippleAll mode applies across all tracks

This commit is contained in:
Paul Davis 2021-06-03 15:35:09 -06:00
parent 38cb16f521
commit ece174ca47
5 changed files with 41 additions and 2 deletions

View File

@ -671,9 +671,18 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
} else {
if (button_release_can_deselect) {
/* just remove this one region, but only on a permitted button release */
/* just remove this one region
* (or all equivalent regions
* for RippleAll, but only on a
* permitted button release
*/
selection->remove (clicked_regionview);
if (Config->get_edit_mode() == RippleAll) {
get_all_equivalent_regions (clicked_regionview, all_equivalent_regions);
selection->remove (all_equivalent_regions);
} else {
selection->remove (clicked_regionview);
}
commit = true;
/* no more deselect action on button release till a new press

View File

@ -162,6 +162,26 @@ RegionSelection::remove (RegionView* rv)
return false;
}
bool
RegionSelection::remove (vector<RegionView*> rv)
{
RegionSelection::iterator r;
bool removed_at_least_one = false;
for (vector<RegionView*>::iterator rx = rv.begin(); rx != rv.end(); ++rx) {
if ((r = find (begin(), end(), *rx)) != end()) {
// remove from layer sorted list
_bylayer.remove (*rx);
pending.remove ((*rx)->region()->id());
erase (r);
removed_at_least_one = true;
}
}
return removed_at_least_one;
}
/** Add a region to the list sorted by layer.
* @param rv Region to add.
*/

View File

@ -48,6 +48,7 @@ public:
bool add (RegionView*);
bool remove (RegionView*);
bool remove (std::vector<RegionView*>);
void sort_by_position_and_track ();
bool contains (RegionView*) const;

View File

@ -591,6 +591,14 @@ Selection::remove (RegionView* r)
}
}
void
Selection::remove (vector<RegionView*> rv)
{
if (regions.remove (rv)) {
RegionsChanged ();
}
}
void
Selection::remove (uint32_t selection_id)
{

View File

@ -179,6 +179,7 @@ public:
void remove (const TrackViewList&);
void remove (const MidiNoteSelection&);
void remove (RegionView*);
void remove (std::vector<RegionView*>);
void remove (MidiCutBuffer*);
void remove (uint32_t selection_id);
void remove (samplepos_t, samplepos_t);