36 throw Err(
"This MIDIDevice is not associated with any MIDIManager");
43 if (mMIDIManager==0) mMIDIManager = am;
44 else if (mMIDIManager!=am)
46 throw Err(
"An MIDIDevice can only be associated with one MIDIManager");
79 throw(
Err(
"MIDIDevice::Unregister(): I am not this MIDIIn object's device."));
81 std::vector<MIDIIn*>::iterator it = std::find(
mInputs.begin(),
mInputs.end(),&in);
84 throw(
Err(
"MIDIDevice::Unregister(): MIDIIn object not registered in this device."));
89 for (
int status = 0;status<8;status++)
91 for (
int channel = 0;channel<16;channel++)
93 for (
int i=0;i<128;i++)
95 if (
target[status][channel][i]==&in)
96 target[status][channel][i] = 0;
113 std::vector<MIDIOut*>::iterator it = std::find(
mOutputs.begin(),
mOutputs.end(),&out);
116 throw(
Err(
"MIDIDevice::Unregister(): MIDIOut object not registered in this device."));
128 void MIDIDevice::SetTarget(
130 unsigned char chn,
unsigned char firstData,
142 for (firstData=0;firstData<128;firstData++)
144 SetTarget(msg,chn,firstData,inp);
153 CLAM_WARNING(
true,
"CLAM::MIDIDevice: SysEx not yet implemented");
159 for (chn = 1;chn<=16;chn++)
161 SetTarget(msg,chn,firstData,inp);
167 target[msg][chn][firstData] = inp;
176 for (status = 0;status<8;status++)
178 for (
int channel = 0;channel<16;channel++)
180 for (
int byte=0;byte<128;byte++)
182 target[status][channel][byte] = 0;
187 for (
unsigned int i=0; i<
mInputs.size(); i++)
213 return MIDI::sNBytesPerSysMsg[
int(sm)];
224 if (byte==0xfe)
return;
249 int status = ((
mData[0]&0xF0)>>4)-8;
250 int channel =
mData[0]&0x0F;
254 mData[0] = 0x80|channel;