33 "key",
"MIDIInControl",
38 static FactoryRegistrator<ProcessingFactory, MIDIInControl>
reg =
metadata;
44 mMessageSize = mControllingBytes = 0;
45 mMsgByteIdToControlId = 0;
52 mMessageSize = mControllingBytes = 0;
53 mMsgByteIdToControlId = 0;
62 if (ret==
false)
return false;
70 mControllingBytes = mMessageSize;
72 if (mConfig.GetChannel()!=0) mControllingBytes--;
75 if (mConfig.GetFirstData()!=128) mControllingBytes--;
77 if (mMsgByteIdToControlId)
delete mMsgByteIdToControlId;
78 mMsgByteIdToControlId =
new unsigned char[mControllingBytes];
82 bool singlePitchBendValue =
false;
85 for (
int i=0;i<mMessageSize;i++)
87 const char* fieldname = 0;
95 if (mConfig.GetChannel()==0)
96 fprintf(stderr,
"ERROR: sysex in not yet implemented\n");
101 if (mConfig.GetChannel()==0)
107 if (mConfig.GetFirstData()==128)
123 singlePitchBendValue =
true;
129 if (!singlePitchBendValue)
140 mMsgByteIdToControlId[i] = ctrlid++;
143 mMsgByteIdToControlId[i] = 0xFF;
150 void MIDIInControl::Handle(
unsigned char* msg,
int size)
155 for (
int i=size-1;i>=0;i--)
157 if (i==0 && (msg[0]&0xF0) == 0xF0)
166 if (mMsgByteIdToControlId[i] == 0xFF)
continue;
168 if (i==1 && (msg[0]&0xF0)==0xE0)