3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2012 Christian Schoenebeck * |
* Copyright (C) 2005 - 2013 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
338 |
* Helper function for MIDI input devices that have the |
* Helper function for MIDI input devices that have the |
339 |
* MIDI data as raw bytes. |
* MIDI data as raw bytes. |
340 |
* |
* |
341 |
* @param pData - pointer to the raw MIDI data |
* @param pData - pointer to the raw MIDI data |
342 |
*/ |
*/ |
343 |
void DispatchRaw(uint8_t* pData); |
void DispatchRaw(uint8_t* pData); |
344 |
|
|
367 |
SynchronizedConfig<std::vector<uint8_t> > noteOnVelocityFilter; |
SynchronizedConfig<std::vector<uint8_t> > noteOnVelocityFilter; |
368 |
SynchronizedConfig<std::vector<uint8_t> >::Reader noteOnVelocityFilterReader; |
SynchronizedConfig<std::vector<uint8_t> >::Reader noteOnVelocityFilterReader; |
369 |
Mutex noteOnVelocityFilterMutex; |
Mutex noteOnVelocityFilterMutex; |
370 |
|
uint8_t runningStatusBuf[3]; |
371 |
|
|
372 |
/** |
/** |
373 |
* Constructor |
* Constructor |
378 |
* Destructor |
* Destructor |
379 |
*/ |
*/ |
380 |
virtual ~MidiInputPort(); |
virtual ~MidiInputPort(); |
381 |
|
|
382 |
|
/** |
383 |
|
* Takes a MIDI status byte (the first byte of each MIDI event) as |
384 |
|
* argument and returns the expected size of the associated MIDI |
385 |
|
* event according to the MIDI protocol. Returns -1 on invalid |
386 |
|
* status bytes AND on variable size events (SysEx events). |
387 |
|
* |
388 |
|
* This method can be used for drivers which have to deal with raw |
389 |
|
* MIDI data, like the CoreMIDI driver, which can receive MIDI |
390 |
|
* packets with more than one event per packet. |
391 |
|
* |
392 |
|
* This method handles "MIDI running status" as well. That is, in |
393 |
|
* case the supplied byte is not a status byte but a data byte, |
394 |
|
* it expects the event to be in "running status" and accordingly |
395 |
|
* uses the status byte of the previous event (processed by the |
396 |
|
* Dispatch*() methods). |
397 |
|
*/ |
398 |
|
int expectedEventSize(unsigned char byte); |
399 |
|
|
400 |
friend class MidiInputDevice; |
friend class MidiInputDevice; |
401 |
|
|
402 |
private: |
private: |
403 |
static SynchronizedConfig<std::set<Engine*> > SysexListeners; ///< All engines that are listening to sysex messages. |
static SynchronizedConfig<std::set<Engine*> > SysexListeners; ///< All engines that are listening to sysex messages. |
404 |
|
|
405 |
|
uint8_t* handleRunningStatus(uint8_t* pData); |
406 |
}; |
}; |
407 |
|
|
408 |
} // namsepace LinuxSampler |
} // namsepace LinuxSampler |