summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index fccc707694..c080b3365d 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -23,6 +23,8 @@
#include <gtkmm/label.h>
#include "ardour/bundle.h"
#include "ardour/types.h"
+#include "ardour/session.h"
+#include "ardour/route.h"
#include "port_matrix.h"
#include "i18n.h"
@@ -65,6 +67,9 @@ PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type, bool of
_vscroll.signal_value_changed().connect (sigc::mem_fun (*this, &PortMatrix::vscroll_changed));
setup_scrollbars ();
+ _session.RouteAdded.connect (sigc::hide (sigc::mem_fun (*this, &PortMatrix::routes_changed)));
+ routes_changed ();
+
/* XXX hard-coded initial size suggestion */
set_size_request (400, 200);
show_all ();
@@ -78,6 +83,23 @@ PortMatrix::~PortMatrix ()
}
void
+PortMatrix::routes_changed ()
+{
+ for (std::vector<sigc::connection>::iterator i = _route_connections.begin(); i != _route_connections.end(); ++i) {
+ i->disconnect ();
+ }
+
+ boost::shared_ptr<ARDOUR::Session::RouteList> routes = _session.get_routes ();
+ for (ARDOUR::Session::RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
+ _route_connections.push_back (
+ (*i)->processors_changed.connect (sigc::mem_fun (*this, &PortMatrix::setup))
+ );
+ }
+
+ setup ();
+}
+
+void
PortMatrix::setup ()
{
_column_ports.gather (_session);