13
0

MCP: handle control IDs a little better

git-svn-id: svn://localhost/ardour2/branches/3.0@11898 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-04-11 15:22:05 +00:00
parent 91b6f28a9b
commit 7a221363bb
3 changed files with 6 additions and 6 deletions

View File

@ -45,5 +45,5 @@ MidiByteArray
Fader::update_message ()
{
int posi = int (0x3fff * position);
return MidiByteArray (3, raw_id(), posi & 0x7f, posi >> 7);
return MidiByteArray (3, fader_base_id | raw_id(), posi & 0x7f, posi >> 7);
}

View File

@ -81,7 +81,7 @@ Pot::update_message ()
msg += (lrintf (value * 10.0) + 1) & 0x0f; // 0b00001111
}
return MidiByteArray (3, 0xb0, raw_id(), msg);
return MidiByteArray (3, 0xb0, pot_base_id | raw_id(), msg);
}

View File

@ -335,7 +335,7 @@ Surface::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, uin
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi pitchbend on port %3, fader = %1 value = %2\n",
fader_id, pb, _number));
Fader* fader = faders[fader_id];
Fader* fader = faders[Control::fader_base_id | fader_id];
if (fader) {
Strip* strip = dynamic_cast<Strip*> (&fader->group());
@ -354,7 +354,7 @@ void
Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("SurfacePort::handle_note_on %1 = %2\n", ev->note_number, ev->velocity));
Button* button = buttons[ev->note_number];
if (button) {
@ -367,7 +367,7 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("global button %1\n", button->raw_id()));
_mcp.handle_button_event (*this, *button, ev->velocity == 0x7f ? press : release);
}
}
}
}
void
@ -375,7 +375,7 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev
{
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("SurfacePort::handle_midi_controller %1 = %2\n", ev->controller_number, ev->value));
Pot* pot = pots[ev->controller_number];
Pot* pot = pots[Control::pot_base_id | ev->controller_number];
if (!pot && ev->controller_number == Control::jog_base_id) {
pot = dynamic_cast<Pot*> (controls_by_name["jog"]);