From 696f3bdda592717bff23b72a35dee3ae55669354 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 8 Apr 2012 20:52:45 +0000 Subject: [PATCH] MCP: connect to correct signal for buttons; more code tidy; extra debugging if we can't find a control git-svn-id: svn://localhost/ardour2/branches/3.0@11836 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/mackie_port.cc | 8 +++++++- libs/surfaces/mackie/timer.h | 30 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/libs/surfaces/mackie/mackie_port.cc b/libs/surfaces/mackie/mackie_port.cc index ff2f4aa54f..69a67279f9 100644 --- a/libs/surfaces/mackie/mackie_port.cc +++ b/libs/surfaces/mackie/mackie_port.cc @@ -275,7 +275,7 @@ void MackiePort::connect_to_signals () /* V-Pot messages are Controller */ p->controller.connect_same_thread (*this, boost::bind (&MackiePort::handle_midi_controller_message, this, _1, _2)); /* Button messages are NoteOn */ - p->controller.connect_same_thread (*this, boost::bind (&MackiePort::handle_midi_note_on_message, this, _1, _2)); + p->note_on.connect_same_thread (*this, boost::bind (&MackiePort::handle_midi_note_on_message, this, _1, _2)); /* Fader messages are Pitchbend */ p->channel_pitchbend[0].connect_same_thread (*this, boost::bind (&MackiePort::handle_midi_pitchbend_message, this, _1, _2, 0U)); p->channel_pitchbend[1].connect_same_thread (*this, boost::bind (&MackiePort::handle_midi_pitchbend_message, this, _1, _2, 1U)); @@ -340,6 +340,8 @@ MackiePort::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, if (control) { float midi_pos = pb >> 4; // only the top 10 bytes are used _mcp.handle_control_event (*this, *control, midi_pos / 1023.0); + } else { + DEBUG_TRACE (DEBUG::MackieControl, "fader not found\n"); } } @@ -354,6 +356,8 @@ MackiePort::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev ControlState control_state (ev->velocity == 0x7f ? press : release); control->set_in_use (control_state.button_state == press); control_event (*this, *control, control_state); + } else { + DEBUG_TRACE (DEBUG::MackieControl, "button not found\n"); } } @@ -387,6 +391,8 @@ MackiePort::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* _mcp.add_in_use_timeout (*this, *control, control); control_event (*this, *control, state); + } else { + DEBUG_TRACE (DEBUG::MackieControl, "pot not found\n"); } } diff --git a/libs/surfaces/mackie/timer.h b/libs/surfaces/mackie/timer.h index 88875539fe..96d7210ff6 100644 --- a/libs/surfaces/mackie/timer.h +++ b/libs/surfaces/mackie/timer.h @@ -1,19 +1,19 @@ /* -Copyright (C) 1998, 1999, 2000, 2007 John Anderson - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Copyright (C) 1998, 1999, 2000, 2007 John Anderson + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef timer_h