Prevent direct and indirect selection of VCAs

the ::selection_filter() does not cover select-all and various other
indirect selection operations.
This commit is contained in:
Robin Gareus 2017-02-18 00:45:37 +01:00
parent 4258bad19d
commit 85e3d2158e
2 changed files with 27 additions and 0 deletions

View file

@ -40,6 +40,7 @@
#include "automation_time_axis.h"
#include "public_editor.h"
#include "control_point.h"
#include "vca_time_axis.h"
#include "pbd/i18n.h"
@ -274,6 +275,9 @@ Selection::toggle (const TrackViewList& track_list)
PresentationInfo::ChangeSuspender cs;
for (TrackViewList::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
if (dynamic_cast<VCATimeAxisView*> (*i)) {
continue;
}
toggle ((*i));
}
}
@ -281,6 +285,10 @@ Selection::toggle (const TrackViewList& track_list)
void
Selection::toggle (TimeAxisView* track)
{
if (dynamic_cast<VCATimeAxisView*> (track)) {
return;
}
TrackSelection::iterator i;
if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
@ -437,6 +445,9 @@ Selection::add (TrackViewList const & track_list)
if (!added.empty()) {
for (TrackViewList::iterator x = added.begin(); x != added.end(); ++x) {
if (dynamic_cast<VCATimeAxisView*> (*x)) {
continue;
}
(*x)->set_selected (true);
}
}
@ -445,6 +456,9 @@ Selection::add (TrackViewList const & track_list)
void
Selection::add (TimeAxisView* track)
{
if (dynamic_cast<VCATimeAxisView*> (track)) {
return;
}
clear_objects(); //enforce object/range exclusivity
TrackViewList tr;
@ -783,6 +797,9 @@ Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac)
void
Selection::set (TimeAxisView* track)
{
if (dynamic_cast<VCATimeAxisView*> (track)) {
return;
}
clear_objects (); //enforce object/range exclusivity
PresentationInfo::ChangeSuspender cs;
@ -822,6 +839,9 @@ Selection::set (const TrackViewList& track_list)
bool missing = false;
for (TrackViewList::const_iterator x = track_list.begin(); x != track_list.end(); ++x) {
if (dynamic_cast<VCATimeAxisView*> (*x)) {
continue;
}
if (find (tracks.begin(), tracks.end(), *x) == tracks.end()) {
missing = true;
}
@ -836,6 +856,9 @@ Selection::set (const TrackViewList& track_list)
/* argument is different from existing selection */
for (TrackViewList::iterator x = tracks.begin(); x != tracks.end(); ++x) {
if (dynamic_cast<VCATimeAxisView*> (*x)) {
continue;
}
(*x)->set_selected (false);
}

View file

@ -25,6 +25,7 @@
#include "track_selection.h"
#include "time_axis_view.h"
#include "public_editor.h"
#include "vca_time_axis.h"
using namespace std;
@ -44,6 +45,9 @@ TrackSelection::add (TrackViewList const & t)
TrackViewList added;
for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
if (dynamic_cast<VCATimeAxisView*> (*i)) {
continue;
}
/* select anything in the same select-enabled route group */
ARDOUR::RouteGroup* rg = (*i)->route_group ();