diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-18 16:15:11 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-10-18 16:15:11 +0000 |
commit | 2d9ed69fe2f8f35d81bb9bc33c8f4fa8393dd00a (patch) | |
tree | 82fe9f5e381c45e95962ba024bd87228a6f62047 /gtk2_ardour/mixer_strip.cc | |
parent | 3e59452fa0182ace7785c62acef83cb0d213cc86 (diff) |
change input/output button context menus for mixer strip to be non-additive: when selecting a new IO bundle, disconnect from any existing connections before connecting to the new one (fixes #5087)
git-svn-id: svn://localhost/ardour2/branches/3.0@13308 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 848439ccd1..c4410438f9 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -874,7 +874,7 @@ MixerStrip::input_press (GdkEventButton *ev) } void -MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c) +MixerStrip::bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle> c) { if (ignore_toggle) { return; @@ -883,14 +883,14 @@ MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c) ARDOUR::BundleList current = _route->input()->bundles_connected (); if (std::find (current.begin(), current.end(), c) == current.end()) { - _route->input()->connect_ports_to_bundle (c, this); + _route->input()->connect_ports_to_bundle (c, true, this); } else { _route->input()->disconnect_ports_from_bundle (c, this); } } void -MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c) +MixerStrip::bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle> c) { if (ignore_toggle) { return; @@ -899,7 +899,7 @@ MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c) ARDOUR::BundleList current = _route->output()->bundles_connected (); if (std::find (current.begin(), current.end(), c) == current.end()) { - _route->output()->connect_ports_to_bundle (c, this); + _route->output()->connect_ports_to_bundle (c, true, this); } else { _route->output()->disconnect_ports_from_bundle (c, this); } @@ -930,13 +930,7 @@ MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR: std::string n = b->name (); replace_all (n, "_", " "); - citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_toggled), b))); - - if (std::find (current.begin(), current.end(), b) != current.end()) { - ignore_toggle = true; - dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true); - ignore_toggle = false; - } + citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_chosen), b))); } void @@ -964,13 +958,7 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR std::string n = b->name (); replace_all (n, "_", " "); - citems.push_back (CheckMenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_toggled), b))); - - if (std::find (current.begin(), current.end(), b) != current.end()) { - ignore_toggle = true; - dynamic_cast<CheckMenuItem *> (&citems.back())->set_active (true); - ignore_toggle = false; - } + citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_chosen), b))); } void |