X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fcontrol_slave_ui.cc;h=0c8ad87d28da3b26eed082cc0d25bb40a5c86be3;hb=474d68c05132291fd8eb200006e7e63aebefdc8d;hp=0223b00003483541fe61d94b935470a8436055e7;hpb=c149d7d64c19f223565c9c0e941ff15a4ff030e7;p=ardour.git diff --git a/gtk2_ardour/control_slave_ui.cc b/gtk2_ardour/control_slave_ui.cc index 0223b00003..0c8ad87d28 100644 --- a/gtk2_ardour/control_slave_ui.cc +++ b/gtk2_ardour/control_slave_ui.cc @@ -31,13 +31,13 @@ #include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/utils.h" -#include "ardour_button.h" #include "control_slave_ui.h" #include "gui_thread.h" #include "pbd/i18n.h" using namespace ARDOUR; +using namespace ArdourWidgets; using namespace Gtk; using std::string; @@ -111,6 +111,7 @@ ControlSlaveUI::update_vca_display () if (!any) { pack_start (initial_button, true, true); + initial_button.show (); } show (); @@ -134,7 +135,7 @@ ControlSlaveUI::vca_menu_toggle (Gtk::CheckMenuItem* menuitem, uint32_t n) if (!menuitem->get_active()) { sl->unassign (vca); } else { - sl->assign (vca, false); + sl->assign (vca); } } @@ -190,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;