diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-12 18:16:16 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-12 18:16:16 +0000 |
commit | 5ee1aaf8d0ad2b08398ed51aa21466877dbbb32d (patch) | |
tree | eb9665248b11b4c24b965c9829d397884caccf48 /libs | |
parent | 436196f58fcb82d1e26d3ef5054f0be9a3c184a8 (diff) |
MCP: rename ports again, remove ports from MCP bundles, wakeup devices
git-svn-id: svn://localhost/ardour2/branches/3.0@11947 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 19 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.cc | 11 |
2 files changed, 28 insertions, 2 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 490e7eef20..70c13df9d8 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -517,8 +517,15 @@ MackieControlProtocol::set_device (const string& device_name) void MackieControlProtocol::create_surfaces () { - string device_name = X_("MC Main"); + string device_name; surface_type_t stype = mcu; + char buf[128]; + + if (_device_info.extenders() == 0) { + device_name = X_("mackie control"); + } else { + device_name = X_("mackie control #1"); + } DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Create %1 surfaces\n", 1 + _device_info.extenders())); @@ -529,7 +536,12 @@ MackieControlProtocol::create_surfaces () /* next device will be an extender */ - device_name = X_("MC Extender"); + if (_device_info.extenders() < 2) { + device_name = X_("mackie control #2"); + } else { + snprintf (buf, sizeof (buf), X_("mackie control #%d"), n+2); + device_name = buf; + } stype = ext; _input_bundle->add_channel ( @@ -1087,6 +1099,9 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port) void MackieControlProtocol::clear_ports () { + _input_bundle->remove_channels (); + _output_bundle->remove_channels (); + for (PortSources::iterator i = port_sources.begin(); i != port_sources.end(); ++i) { g_source_destroy (*i); g_source_unref (*i); diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 91162c7962..9fecc2556e 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -154,6 +154,17 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui connect_to_signals (); + /* wakey wakey */ + + MidiByteArray wakeup (7, MIDI::sysex, 0x00, 0x00, 0x66, 0x14, 0x00, MIDI::eox); + _port->write (wakeup); + wakeup[4] = 0x15; /* wakup Mackie XT */ + _port->write (wakeup); + wakeup[4] = 0x10; /* wakupe Logic Control */ + _port->write (wakeup); + wakeup[4] = 0x11; /* wakeup Logic Control XT */ + _port->write (wakeup); + DEBUG_TRACE (DEBUG::MackieControl, "Surface::init finish\n"); } |