13
0

MCP: more clarification of control ID scheme

git-svn-id: svn://localhost/ardour2/branches/3.0@11899 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-04-11 15:37:06 +00:00
parent 7a221363bb
commit 9b6c41c134
4 changed files with 12 additions and 5 deletions

View File

@ -41,7 +41,6 @@ class Control
{
public:
enum base_id_t {
fader_base_id = 0xe0,
pot_base_id = 0x30,
jog_base_id = 0x3c,
fader_touch_button_base_id = 0xe0,

View File

@ -45,5 +45,5 @@ MidiByteArray
Fader::update_message ()
{
int posi = int (0x3fff * position);
return MidiByteArray (3, fader_base_id | raw_id(), posi & 0x7f, posi >> 7);
return MidiByteArray (3, 0xe0 | 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, pot_base_id | raw_id(), msg);
return MidiByteArray (3, 0xb0, raw_id(), msg);
}

View File

@ -230,7 +230,7 @@ Surface::init_controls()
}
static StripControlDefinition mackie_strip_controls[] = {
{ "gain", Control::fader_base_id, Fader::factory, },
{ "gain", 0, Fader::factory, },
{ "vpot", Control::pot_base_id, Pot::factory, },
{ "recenable", Control::recenable_button_base_id, Button::factory, },
{ "solo", Control::solo_button_base_id, Button::factory, },
@ -332,10 +332,18 @@ Surface::connect_to_signals ()
void
Surface::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, uint32_t fader_id)
{
/* Pitchbend messages are fader messages. Nothing in the data we get
* from the MIDI::Parser conveys the fader ID, which was given by the
* channel ID in the status byte.
*
* Instead, we have used bind() to supply the fader-within-strip ID
* when we connected to the per-channel pitchbend events.
*/
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi pitchbend on port %3, fader = %1 value = %2\n",
fader_id, pb, _number));
Fader* fader = faders[Control::fader_base_id | fader_id];
Fader* fader = faders[fader_id];
if (fader) {
Strip* strip = dynamic_cast<Strip*> (&fader->group());