91 |
} |
} |
92 |
|
|
93 |
void MidiInputPort::DispatchNoteOn(uint8_t Key, uint8_t Velocity, uint MidiChannel) { |
void MidiInputPort::DispatchNoteOn(uint8_t Key, uint8_t Velocity, uint MidiChannel) { |
94 |
|
if (Key > 127 || Velocity > 127 || MidiChannel > 16) return; |
95 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
96 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
97 |
{ |
{ |
109 |
} |
} |
110 |
|
|
111 |
void MidiInputPort::DispatchNoteOn(uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) { |
void MidiInputPort::DispatchNoteOn(uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) { |
112 |
|
if (Key > 127 || Velocity > 127 || MidiChannel > 16) return; |
113 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
114 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
115 |
{ |
{ |
127 |
} |
} |
128 |
|
|
129 |
void MidiInputPort::DispatchNoteOff(uint8_t Key, uint8_t Velocity, uint MidiChannel) { |
void MidiInputPort::DispatchNoteOff(uint8_t Key, uint8_t Velocity, uint MidiChannel) { |
130 |
|
if (Key > 127 || Velocity > 127 || MidiChannel > 16) return; |
131 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
132 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
133 |
{ |
{ |
145 |
} |
} |
146 |
|
|
147 |
void MidiInputPort::DispatchNoteOff(uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) { |
void MidiInputPort::DispatchNoteOff(uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) { |
148 |
|
if (Key > 127 || Velocity > 127 || MidiChannel > 16) return; |
149 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
150 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
151 |
{ |
{ |
163 |
} |
} |
164 |
|
|
165 |
void MidiInputPort::DispatchPitchbend(int Pitch, uint MidiChannel) { |
void MidiInputPort::DispatchPitchbend(int Pitch, uint MidiChannel) { |
166 |
|
if (Pitch < -8192 || Pitch > 8191 || MidiChannel > 16) return; |
167 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
168 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
169 |
{ |
{ |
181 |
} |
} |
182 |
|
|
183 |
void MidiInputPort::DispatchPitchbend(int Pitch, uint MidiChannel, int32_t FragmentPos) { |
void MidiInputPort::DispatchPitchbend(int Pitch, uint MidiChannel, int32_t FragmentPos) { |
184 |
|
if (Pitch < -8192 || Pitch > 8191 || MidiChannel > 16) return; |
185 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
186 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
187 |
{ |
{ |
199 |
} |
} |
200 |
|
|
201 |
void MidiInputPort::DispatchControlChange(uint8_t Controller, uint8_t Value, uint MidiChannel) { |
void MidiInputPort::DispatchControlChange(uint8_t Controller, uint8_t Value, uint MidiChannel) { |
202 |
|
if (Controller > 128 || Value > 127 || MidiChannel > 16) return; |
203 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
204 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
205 |
{ |
{ |
217 |
} |
} |
218 |
|
|
219 |
void MidiInputPort::DispatchControlChange(uint8_t Controller, uint8_t Value, uint MidiChannel, int32_t FragmentPos) { |
void MidiInputPort::DispatchControlChange(uint8_t Controller, uint8_t Value, uint MidiChannel, int32_t FragmentPos) { |
220 |
|
if (Controller > 128 || Value > 127 || MidiChannel > 16) return; |
221 |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
const MidiChannelMap_t& midiChannelMap = MidiChannelMapReader.Lock(); |
222 |
// dispatch event for engines listening to the same MIDI channel |
// dispatch event for engines listening to the same MIDI channel |
223 |
{ |
{ |
244 |
} |
} |
245 |
|
|
246 |
void MidiInputPort::DispatchProgramChange(uint8_t Program, uint MidiChannel) { |
void MidiInputPort::DispatchProgramChange(uint8_t Program, uint MidiChannel) { |
247 |
|
if (Program > 127 || MidiChannel > 16) return; |
248 |
if (!pDevice || !pDevice->pSampler) { |
if (!pDevice || !pDevice->pSampler) { |
249 |
std::cerr << "MidiInputPort: ERROR, no sampler instance to handle program change." |
std::cerr << "MidiInputPort: ERROR, no sampler instance to handle program change." |
250 |
<< "This is a bug, please report it!\n" << std::flush; |
<< "This is a bug, please report it!\n" << std::flush; |