X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fio_selector.cc;h=b9e19de7adb867df65427576e7b99bfc6c4ef9f0;hb=6ab6ad5bb732512d04593b1a5d566d5e787d45ed;hp=d440e1397bcfa551280cbb170dbfebe32e5c7655;hpb=28791ac5e6c96f6bace1587557409b3b12cf5b23;p=ardour.git diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index d440e1397b..b9e19de7ad 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -47,7 +47,7 @@ IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_ , _io (io) { setup_type (); - + /* signal flow from 0 to 1 */ _find_inputs_for_io_outputs = (_io->direction() == IO::Output); @@ -97,7 +97,7 @@ IOSelector::io_changed_proxy () so we can't call setup_all_ports (which results in a call to Route::foreach_processor) without a deadlock unless we break things up with this idle handler. */ - + Glib::signal_idle().connect_once (sigc::mem_fun (*this, &IOSelector::io_changed)); } @@ -136,16 +136,14 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s) ARDOUR::Bundle::PortList const & our_ports = c[_ours].bundle->channel_ports (c[_ours].channel); ARDOUR::Bundle::PortList const & other_ports = c[_other].bundle->channel_ports (c[_other].channel); - Glib::Mutex::Lock lm (AudioEngine::instance()->process_lock()); - for (ARDOUR::Bundle::PortList::const_iterator i = our_ports.begin(); i != our_ports.end(); ++i) { for (ARDOUR::Bundle::PortList::const_iterator j = other_ports.begin(); j != other_ports.end(); ++j) { - Port* f = _session->engine().get_port_by_name_locked (*i); + Port* f = _session->engine().get_port_by_name (*i); if (!f) { return; } - + if (s) { _io->connect (f, *j, 0); } else { @@ -158,6 +156,10 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s) PortMatrixNode::State IOSelector::get_state (ARDOUR::BundleChannel c[2]) const { + if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) { + return PortMatrixNode::NOT_ASSOCIATED; + } + ARDOUR::Bundle::PortList const & our_ports = c[_ours].bundle->channel_ports (c[_ours].channel); ARDOUR::Bundle::PortList const & other_ports = c[_other].bundle->channel_ports (c[_other].channel); @@ -215,12 +217,12 @@ IOSelector::channel_noun () const } IOSelectorWindow::IOSelectorWindow (ARDOUR::Session* session, boost::shared_ptr io, bool /*can_cancel*/) - : _selector (this, session, io) + : ArdourDialog (_("I/O selector")) + , _selector (this, session, io) { set_name ("IOSelectorWindow2"); - set_title (_("I/O selector")); - add (_selector); + get_vbox()->pack_start (_selector); set_position (Gtk::WIN_POS_MOUSE);