diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-09 14:01:22 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-09 14:01:22 -0400 |
commit | 9b5a071c3317697bec9fd4269d86b2f254816f38 (patch) | |
tree | 37e1364f02d10d9da07513c8690c10d3515b8790 /libs/surfaces/mackie/surface.cc | |
parent | 7e771c9fdc025791e8b1e23520532566eed19cd8 (diff) |
varied and wide changes to get input and output combos closer to working
Diffstat (limited to 'libs/surfaces/mackie/surface.cc')
-rw-r--r-- | libs/surfaces/mackie/surface.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 7beaef59fa..7709ebb264 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -125,9 +125,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui DEBUG_TRACE (DEBUG::MackieControl, "init_strips done\n"); } - if (!_mcp.device_info().uses_ipmidi()) { - ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&Surface::connection_handler, this, _1, _2, _3, _4, _5), &_mcp); - } else { + if (_mcp.device_info().uses_ipmidi()) { /* ipMIDI port already exists, we can just assume that we're * connected. * @@ -149,8 +147,6 @@ Surface::~Surface () { DEBUG_TRACE (DEBUG::MackieControl, "Surface::~Surface init\n"); - port_connection.disconnect (); - if (input_source) { g_source_destroy (input_source); input_source = 0; @@ -172,11 +168,11 @@ Surface::~Surface () DEBUG_TRACE (DEBUG::MackieControl, "Surface::~Surface done\n"); } -void +bool Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn) { if (!_port) { - return; + return false; } string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->input_name()); @@ -194,6 +190,9 @@ Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, b } else { connection_state &= ~OutputConnected; } + } else { + /* not our ports */ + return false; } if ((connection_state & (InputConnected|OutputConnected)) == (InputConnected|OutputConnected)) { @@ -228,6 +227,8 @@ Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, b DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface %1 disconnected (input or output or both)\n", _name)); _active = false; } + + return true; /* connection status changed */ } XMLNode& |