From aea350c958e2ec8ff545123cee5ae9157ef66fe3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 20 Oct 2017 02:54:06 +0200 Subject: Don't offer possible recursive VCA assignments in the GUI --- gtk2_ardour/control_slave_ui.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'gtk2_ardour/control_slave_ui.cc') diff --git a/gtk2_ardour/control_slave_ui.cc b/gtk2_ardour/control_slave_ui.cc index 14467a0118..0c8ad87d28 100644 --- a/gtk2_ardour/control_slave_ui.cc +++ b/gtk2_ardour/control_slave_ui.cc @@ -191,22 +191,17 @@ ControlSlaveUI::vca_button_release (GdkEventButton* ev, uint32_t n) for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) { - boost::shared_ptr gcs = stripable->gain_control(); - boost::shared_ptr gcm = (*v)->gain_control(); - - if (gcs == gcm) { - /* asked to slave to self. not ok */ - continue; - } - - if (gcm->slaved_to (gcs)) { - /* master is already slaved to slave */ + if (stripable->assigned_to (_session->vca_manager_ptr (), *v)) { + /* master(stripable) is directly or indirectly controlled by slave (v) */ continue; } items.push_back (CheckMenuElem ((*v)->name())); Gtk::CheckMenuItem* item = dynamic_cast (&items.back()); + boost::shared_ptr gcs = stripable->gain_control(); + boost::shared_ptr gcm = (*v)->gain_control(); + if (gcs->slaved_to (gcm)) { item->set_active (true); slaved = true; -- cgit v1.2.3