diff options
author | Carl Hetherington <carl@carlh.net> | 2010-04-05 15:23:54 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-04-05 15:23:54 +0000 |
commit | 6e49c73bb0ba1037346d8a7b589185d281c97211 (patch) | |
tree | f48e20f8985ae720f04d1df31af2770ea269dbaf /gtk2_ardour | |
parent | 7c9c3b8f6ccc4c0ebf963b05c2df400864ba46f0 (diff) |
Make port matrix notice when connections are changed outside of ardour.
git-svn-id: svn://localhost/ardour2/branches/3.0@6858 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/port_matrix.cc | 23 | ||||
-rw-r--r-- | gtk2_ardour/port_matrix.h | 1 |
2 files changed, 18 insertions, 6 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index f26a78a722..88987f03ef 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -121,7 +121,7 @@ PortMatrix::init () { select_arrangement (); - /* Signal handling is kind of split into two parts: + /* Signal handling is kind of split into three parts: * * 1. When _ports[] changes, we call setup(). This essentially sorts out our visual * representation of the information in _ports[]. @@ -129,6 +129,8 @@ PortMatrix::init () * 2. When certain other things change, we need to get our subclass to clear and * re-fill _ports[], which in turn causes appropriate signals to be raised to * hook into part (1). + * + * 3. Assorted other signals. */ @@ -142,11 +144,6 @@ PortMatrix::init () _ports[i].BundleChanged.connect (_bundle_changed_connections, invalidator (*this), boost::bind (&PortMatrix::setup, this), gui_context()); } - /* scrolling stuff */ - _hscroll.signal_value_changed().connect (sigc::mem_fun (*this, &PortMatrix::hscroll_changed)); - _vscroll.signal_value_changed().connect (sigc::mem_fun (*this, &PortMatrix::vscroll_changed)); - - /* Part 2: notice when things have changed that require our subclass to clear and refill _ports[] */ /* watch for routes being added or removed */ @@ -158,6 +155,14 @@ PortMatrix::init () /* and also ports */ _session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context()); + + /* Part 3: other stuff */ + + _session->engine().PortConnectedOrDisconnected.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::port_connected_or_disconnected, this), gui_context ()); + + _hscroll.signal_value_changed().connect (sigc::mem_fun (*this, &PortMatrix::hscroll_changed)); + _vscroll.signal_value_changed().connect (sigc::mem_fun (*this, &PortMatrix::vscroll_changed)); + reconnect_to_routes (); setup (); @@ -829,3 +834,9 @@ PortMatrix::add_disassociate_option (Menu_Helpers::MenuList& m, boost::weak_ptr< snprintf (buf, sizeof (buf), _("%s all from '%s'"), disassociation_verb().c_str(), escape_underscores (b->channel_name (c)).c_str()); m.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::disassociate_all_on_channel), w, c, d))); } + +void +PortMatrix::port_connected_or_disconnected () +{ + _body->rebuild_and_draw_grid (); +} diff --git a/gtk2_ardour/port_matrix.h b/gtk2_ardour/port_matrix.h index a33d8c2910..0c0a52a1a1 100644 --- a/gtk2_ardour/port_matrix.h +++ b/gtk2_ardour/port_matrix.h @@ -189,6 +189,7 @@ private: void session_going_away (); void add_remove_option (Gtk::Menu_Helpers::MenuList &, boost::weak_ptr<ARDOUR::Bundle>, int); void add_disassociate_option (Gtk::Menu_Helpers::MenuList &, boost::weak_ptr<ARDOUR::Bundle>, int, int); + void port_connected_or_disconnected (); Gtk::Window* _parent; |