diff options
author | Carl Hetherington <carl@carlh.net> | 2009-02-02 22:17:06 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-02-02 22:17:06 +0000 |
commit | 54afc94e62b6397286d545744cea796f93f4b5f9 (patch) | |
tree | 589c5eedfb63e96da410801e1f8cc3d3d4c06cd1 /gtk2_ardour | |
parent | 633629b2b1590b687a79990fe1fb0df35301e709 (diff) |
Re-enable creation of stereo bundles for system IO, so that the mixer strip
connection menus for stereo tracks are populated again.
Also enable disconnection via these menus.
git-svn-id: svn://localhost/ardour2/branches/3.0@4481 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 40 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/port_group.cc | 5 |
3 files changed, 25 insertions, 24 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 1bee8268ae..fd1650738c 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -720,34 +720,34 @@ MixerStrip::input_press (GdkEventButton *ev) } void -MixerStrip::bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle> c) +MixerStrip::bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle> c) { - if (!ignore_toggle) { + if (ignore_toggle) { + return; + } - try { - _route->connect_input_ports_to_bundle (c, this); - } + ARDOUR::BundleList current = _route->bundles_connected_to_inputs (); - catch (AudioEngine::PortRegistrationFailure& err) { - error << _("could not register new ports required for that bundle") - << endmsg; - } + if (std::find (current.begin(), current.end(), c) == current.end()) { + _route->connect_input_ports_to_bundle (c, this); + } else { + _route->disconnect_input_ports_from_bundle (c, this); } } void -MixerStrip::bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle> c) +MixerStrip::bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle> c) { - if (!ignore_toggle) { + if (ignore_toggle) { + return; + } - try { - _route->connect_output_ports_to_bundle (c, this); - } + ARDOUR::BundleList current = _route->bundles_connected_to_outputs (); - catch (AudioEngine::PortRegistrationFailure& err) { - error << _("could not register new ports required for that bundle") - << endmsg; - } + if (std::find (current.begin(), current.end(), c) == current.end()) { + _route->connect_output_ports_to_bundle (c, this); + } else { + _route->disconnect_output_ports_from_bundle (c, this); } } @@ -766,7 +766,7 @@ MixerStrip::add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR::Bundl if (b->nchannels() == _route->n_inputs().get (b->type ())) { - citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_chosen), b))); + citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_toggled), b))); if (std::find (current.begin(), current.end(), b) != current.end()) { ignore_toggle = true; @@ -790,7 +790,7 @@ MixerStrip::add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR::Bund if (b->nchannels() == _route->n_outputs().get (b->type ())) { MenuList& citems = output_menu.items(); - citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_chosen), b))); + citems.push_back (CheckMenuElem (b->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_toggled), b))); if (std::find (current.begin(), current.end(), b) != current.end()) { ignore_toggle = true; diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index e859e52026..1b65834270 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -183,8 +183,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox Gtk::Menu output_menu; void add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &); - void bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle>); - void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>); + void bundle_input_toggled (boost::shared_ptr<ARDOUR::Bundle>); + void bundle_output_toggled (boost::shared_ptr<ARDOUR::Bundle>); void edit_input_configuration (); void edit_output_configuration (); diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index 405d503016..d0c56d02a4 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -192,11 +192,12 @@ PortGroupList::gather (ARDOUR::Session& session, bool inputs) } } - /* Bundles created by the session */ + /* Bundles created by the session. We only add the mono ones, + otherwise there is duplication of the same ports within the matrix */ boost::shared_ptr<ARDOUR::BundleList> b = session.bundles (); for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { - if ((*i)->ports_are_inputs() == inputs && (*i)->type() == _type) { + if ((*i)->nchannels() == 1 && (*i)->ports_are_inputs() == inputs && (*i)->type() == _type) { system->add_bundle (*i); } } |