From 4717080aeed8bce37e11218c2a54c5ac91f29f3c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 12 Jun 2016 08:18:01 -0400 Subject: [PATCH] reduce verbosity of -D mackie in the presence of continued handshaking/keepalive messages. --- libs/surfaces/mackie/mackie_control_protocol.cc | 4 ++-- libs/surfaces/mackie/surface.cc | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 40897761df..40fe07b8ff 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -1630,7 +1630,7 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port) if (ioc & IO_IN) { - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("something happend on %1\n", port->name())); + // DEBUG_TRACE (DEBUG::MackieControl, string_compose ("something happend on %1\n", port->name())); /* Devices using regular JACK MIDI ports will need to have the x-thread FIFO drained to avoid burning endless CPU. @@ -1647,7 +1647,7 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port) } } - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name())); + // DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name())); framepos_t now = session->engine().sample_time(); port->parse (now); } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 400dad85ab..494418a090 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -675,8 +675,6 @@ Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count { MidiByteArray bytes (count, raw_bytes); - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); - if (_mcp.device_info().no_handshake()) { turn_it_on (); } @@ -693,6 +691,9 @@ Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count switch (bytes[5]) { case 0x01: + if (!_active) { + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); + } /* MCP: Device Ready LCP: Connection Challenge */ @@ -700,12 +701,17 @@ Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count DEBUG_TRACE (DEBUG::MackieControl, "Logic Control Device connection challenge\n"); write_sysex (host_connection_query (bytes)); } else { - DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Mackie Control Device ready, current status = %1\n", _active)); + if (!_active) { + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Mackie Control Device ready, current status = %1\n", _active)); + } turn_it_on (); } break; case 0x06: + if (!_active) { + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); + } /* Behringer X-Touch Compact: Device Ready */ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Behringer X-Touch Compact ready, current status = %1\n", _active)); @@ -713,6 +719,7 @@ Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count break; case 0x03: /* LCP Connection Confirmation */ + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); DEBUG_TRACE (DEBUG::MackieControl, "Logic Control Device confirms connection, ardour replies\n"); if (bytes[4] == 0x10 || bytes[4] == 0x11) { write_sysex (host_connection_confirmation (bytes)); @@ -721,11 +728,13 @@ Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count break; case 0x04: /* LCP: Confirmation Denied */ + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); DEBUG_TRACE (DEBUG::MackieControl, "Logic Control Device denies connection\n"); _active = false; break; default: + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes)); DEBUG_TRACE (DEBUG::MackieControl, string_compose ("unknown device ID byte %1", (int) bytes[5])); error << "MCP: unknown sysex: " << bytes << endmsg; }