X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fglobal_port_matrix.cc;h=fcd9960e43fe75010db5a1d582c5d41653e52f12;hb=4c42a77441e74356cd909d994e270d1e1314aad4;hp=f229a1a4ac8d16aeeb2d493db44afee1d60eeaf9;hpb=78237f3ac3a7918417cd11b30d25c4afdf9b2108;p=ardour.git diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc index f229a1a4ac..fcd9960e43 100644 --- a/gtk2_ardour/global_port_matrix.cc +++ b/gtk2_ardour/global_port_matrix.cc @@ -42,6 +42,10 @@ GlobalPortMatrix::GlobalPortMatrix (Gtk::Window* p, Session* s, DataType t) void GlobalPortMatrix::setup_ports (int dim) { + if (!_session) { + return; + } + _ports[dim].suspend_signals (); _ports[dim].gather (_session, type(), dim == IN, false, show_only_bundles ()); _ports[dim].resume_signals (); @@ -50,6 +54,10 @@ GlobalPortMatrix::setup_ports (int dim) void GlobalPortMatrix::set_state (BundleChannel c[2], bool s) { + if (!_session) { + return; + } + Bundle::PortList const & in_ports = c[IN].bundle->channel_ports (c[IN].channel); Bundle::PortList const & out_ports = c[OUT].bundle->channel_ports (c[OUT].channel); @@ -160,6 +168,8 @@ GlobalPortMatrixWindow::GlobalPortMatrixWindow (Session* s, DataType t) break; } + signal_key_press_event().connect (sigc::mem_fun (_port_matrix, &PortMatrix::key_press)); + add (_port_matrix); _port_matrix.show (); } @@ -176,6 +186,10 @@ void GlobalPortMatrixWindow::set_session (Session* s) { _port_matrix.set_session (s); + + if (!s) { + hide (); + } } string