#include <MidiInputPort.h>
Classes | |
class | ParameterName |
MIDI Port Parameter 'NAME'. More... | |
Public Member Functions | |
void | Connect (EngineChannel *pEngineChannel, midi_chan_t MidiChannel) |
Connect given sampler engine channel with this MIDI input device. | |
void | Disconnect (EngineChannel *pEngineChannel) |
Disconnect given sampler engine channel from this MIDI input device. | |
MidiInputDevice * | GetDevice () |
Return MIDI device where this MIDI port belongs to. | |
uint | GetPortNumber () |
Return port number with which this MIDI port is registered to the MIDI device. | |
std::map< String, DeviceRuntimeParameter * > | PortParameters () |
Return all parameter settings of this MIDI port. | |
void | Connect (VirtualMidiDevice *pDevice) |
Connects the given virtual MIDI device to this MIDI input device. | |
void | Disconnect (VirtualMidiDevice *pDevice) |
Disconnect the previously connected virtual MIDI device. | |
void | DispatchNoteOn (uint8_t Key, uint8_t Velocity, uint MidiChannel) |
Should be called by the implementing MIDI input device whenever a note on event arrived, this will cause the note on event to be forwarded to all connected engines on the corresponding MIDI channel. | |
void | DispatchNoteOn (uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) |
Should be called by the implementing MIDI input device whenever a note on event arrived, this will cause the note on event to be forwarded to all connected engines on the corresponding MIDI channel. | |
void | DispatchNoteOff (uint8_t Key, uint8_t Velocity, uint MidiChannel) |
Should be called by the implementing MIDI input device whenever a note off event arrived, this will cause the note off event to be forwarded to all connected engines on the corresponding MIDI channel. | |
void | DispatchNoteOff (uint8_t Key, uint8_t Velocity, uint MidiChannel, int32_t FragmentPos) |
Should be called by the implementing MIDI input device whenever a note off event arrived, this will cause the note off event to be forwarded to all connected engines on the corresponding MIDI channel. | |
void | DispatchPitchbend (int Pitch, uint MidiChannel) |
Should be called by the implementing MIDI input device whenever a pitchbend event arrived, this will cause the pitchbend event to be forwarded to all connected engines. | |
void | DispatchPitchbend (int Pitch, uint MidiChannel, int32_t FragmentPos) |
Should be called by the implementing MIDI input device whenever a pitchbend event arrived, this will cause the pitchbend event to be forwarded to all connected engines. | |
void | DispatchControlChange (uint8_t Controller, uint8_t Value, uint MidiChannel) |
Should be called by the implementing MIDI input device whenever a control change event arrived, this will cause the control change event to be forwarded to all engines on the corresponding MIDI channel. | |
void | DispatchControlChange (uint8_t Controller, uint8_t Value, uint MidiChannel, int32_t FragmentPos) |
Should be called by the implementing MIDI input device whenever a control change event arrived, this will cause the control change event to be forwarded to all engines on the corresponding MIDI channel. | |
void | DispatchProgramChange (uint8_t Program, uint MidiChannel) |
Should be called by the implementing MIDI input device whenever a program change event arrived. | |
void | DispatchBankSelectMsb (uint8_t BankMsb, uint MidiChannel) |
void | DispatchBankSelectLsb (uint8_t BankLsb, uint MidiChannel) |
void | DispatchSysex (void *pData, uint Size) |
Should be called by the implementing MIDI input device whenever a system exclusive message arrived, this will cause the message to be forwarded to all connected engines. | |
void | DispatchRaw (uint8_t *pData) |
Helper function for MIDI input devices that have the MIDI data as raw bytes. | |
void | DispatchRaw (uint8_t *pData, int32_t FragmentPos) |
Helper function for MIDI input devices that have the MIDI data as raw bytes. | |
Static Public Member Functions | |
static void | AddSysexListener (Engine *engine) |
Registers that an engine wants to have sysex messages. | |
static bool | RemoveSysexListener (Engine *engine) |
Removes engine from list of engines getting sysex messages. | |
Protected Types | |
typedef std::set< EngineChannel * > | MidiChannelMap_t [17] |
Protected Member Functions | |
MidiInputPort (MidiInputDevice *pDevice, int portNumber) | |
Constructor. | |
virtual | ~MidiInputPort () |
Destructor. | |
Protected Attributes | |
MidiInputDevice * | pDevice |
int | portNumber |
std::map< String, DeviceRuntimeParameter * > | Parameters |
All port parameters. | |
SynchronizedConfig < MidiChannelMap_t > | MidiChannelMap |
Contains the list of connected engines for each MIDI channel, where index 0 points to the list of engines which are connected to all MIDI channels. Usually it's not necessary for the descendant to use this map, instead it should just use the Dispatch* methods. | |
SynchronizedConfig < MidiChannelMap_t >::Reader | MidiChannelMapReader |
MIDI thread access to MidiChannelMap. | |
Mutex | MidiChannelMapMutex |
Used to protect the MidiChannelMap from being used at the same time by different threads. | |
SynchronizedConfig< std::set < Engine * > >::Reader | SysexListenersReader |
MIDI thread access to SysexListeners. | |
SynchronizedConfig < std::vector < VirtualMidiDevice * > > | virtualMidiDevices |
SynchronizedConfig < std::vector < VirtualMidiDevice * > >::Reader | virtualMidiDevicesReader |
Mutex | virtualMidiDevicesMutex |
Friends | |
class | MidiInputDevice |
Definition at line 39 of file MidiInputPort.h.
typedef std::set<EngineChannel*> LinuxSampler::MidiInputPort::MidiChannelMap_t[17] [protected] |
Definition at line 332 of file MidiInputPort.h.
LinuxSampler::MidiInputPort::MidiInputPort | ( | MidiInputDevice * | pDevice, | |
int | portNumber | |||
) | [protected] |
Constructor.
virtual LinuxSampler::MidiInputPort::~MidiInputPort | ( | ) | [protected, virtual] |
Destructor.
static void LinuxSampler::MidiInputPort::AddSysexListener | ( | Engine * | engine | ) | [static] |
Registers that an engine wants to have sysex messages.
void LinuxSampler::MidiInputPort::Connect | ( | VirtualMidiDevice * | pDevice | ) |
Connects the given virtual MIDI device to this MIDI input device.
This can be used to listen to MIDI data arriving on the MIDI input device's MIDI ports, e.g. to show an MIDI activity indicator somewhere.
void LinuxSampler::MidiInputPort::Connect | ( | EngineChannel * | pEngineChannel, | |
midi_chan_t | MidiChannel | |||
) |
Connect given sampler engine channel with this MIDI input device.
The engine channel can either be connected to one specific MIDI channel or all MIDI channels. If an engine channel gets connected twice to this MIDI input device, then the engine's old connection will be detached (no matter on which MIDI channel).
pEngineChannel | - sampler engine
|
void LinuxSampler::MidiInputPort::Disconnect | ( | VirtualMidiDevice * | pDevice | ) |
Disconnect the previously connected virtual MIDI device.
void LinuxSampler::MidiInputPort::Disconnect | ( | EngineChannel * | pEngineChannel | ) |
Disconnect given sampler engine channel from this MIDI input device.
If the given engine channel was not connected with this device, nothing happens.
pEngineChannel | - sampler engine |
void LinuxSampler::MidiInputPort::DispatchBankSelectLsb | ( | uint8_t | BankLsb, | |
uint | MidiChannel | |||
) |
void LinuxSampler::MidiInputPort::DispatchBankSelectMsb | ( | uint8_t | BankMsb, | |
uint | MidiChannel | |||
) |
void LinuxSampler::MidiInputPort::DispatchControlChange | ( | uint8_t | Controller, | |
uint8_t | Value, | |||
uint | MidiChannel, | |||
int32_t | FragmentPos | |||
) |
Should be called by the implementing MIDI input device whenever a control change event arrived, this will cause the control change event to be forwarded to all engines on the corresponding MIDI channel.
This method is meant for offline rendering and / or in case the exact fragment position of the event is already known.
Controller | - MIDI controller number
|
void LinuxSampler::MidiInputPort::DispatchControlChange | ( | uint8_t | Controller, | |
uint8_t | Value, | |||
uint | MidiChannel | |||
) |
Should be called by the implementing MIDI input device whenever a control change event arrived, this will cause the control change event to be forwarded to all engines on the corresponding MIDI channel.
This method is meant for realtime rendering, this way an event is immediately created with the current system time as time stamp.
Controller | - MIDI controller number
|
void LinuxSampler::MidiInputPort::DispatchNoteOff | ( | uint8_t | Key, | |
uint8_t | Velocity, | |||
uint | MidiChannel, | |||
int32_t | FragmentPos | |||
) |
Should be called by the implementing MIDI input device whenever a note off event arrived, this will cause the note off event to be forwarded to all connected engines on the corresponding MIDI channel.
This method is meant for offline rendering and / or in case the exact fragment position of the event is already known.
Key | - MIDI key number of the released key
|
void LinuxSampler::MidiInputPort::DispatchNoteOff | ( | uint8_t | Key, | |
uint8_t | Velocity, | |||
uint | MidiChannel | |||
) |
Should be called by the implementing MIDI input device whenever a note off event arrived, this will cause the note off event to be forwarded to all connected engines on the corresponding MIDI channel.
This method is meant for realtime rendering, this way an event is immediately created with the current system time as time stamp.
Key | - MIDI key number of the released key
|
void LinuxSampler::MidiInputPort::DispatchNoteOn | ( | uint8_t | Key, | |
uint8_t | Velocity, | |||
uint | MidiChannel, | |||
int32_t | FragmentPos | |||
) |
Should be called by the implementing MIDI input device whenever a note on event arrived, this will cause the note on event to be forwarded to all connected engines on the corresponding MIDI channel.
This method is meant for offline rendering and / or in case the exact fragment position of the event is already known.
Key | - MIDI key number of the triggered key
|
void LinuxSampler::MidiInputPort::DispatchNoteOn | ( | uint8_t | Key, | |
uint8_t | Velocity, | |||
uint | MidiChannel | |||
) |
Should be called by the implementing MIDI input device whenever a note on event arrived, this will cause the note on event to be forwarded to all connected engines on the corresponding MIDI channel.
This method is meant for realtime rendering, this way an event is immediately created with the current system time as time stamp.
Key | - MIDI key number of the triggered key
|
void LinuxSampler::MidiInputPort::DispatchPitchbend | ( | int | Pitch, | |
uint | MidiChannel, | |||
int32_t | FragmentPos | |||
) |
Should be called by the implementing MIDI input device whenever a pitchbend event arrived, this will cause the pitchbend event to be forwarded to all connected engines.
This method is meant for offline rendering and / or in case the exact fragment position of the event is already known.
Pitch | - MIDI pitch value
|
void LinuxSampler::MidiInputPort::DispatchPitchbend | ( | int | Pitch, | |
uint | MidiChannel | |||
) |
Should be called by the implementing MIDI input device whenever a pitchbend event arrived, this will cause the pitchbend event to be forwarded to all connected engines.
This method is meant for realtime rendering, this way an event is immediately created with the current system time as time stamp.
Pitch | - MIDI pitch value
|
void LinuxSampler::MidiInputPort::DispatchProgramChange | ( | uint8_t | Program, | |
uint | MidiChannel | |||
) |
Should be called by the implementing MIDI input device whenever a program change event arrived.
In case the respective sampler channel(s) are enabled for MIDI instrument mapping, the respective sampler engine and instrument will be loaded on the connected sampler channel(s) as defined by the respective entry in the MIDI instrument map.
Note: the MIDI instrument map is empty by default on sampler startup. It has to be explicitly filled with entries and the sampler channel(s) have to be enabled for a certain MIDI instrument table, otherwise program change messages are ignored!
Program | - MIDI program change number
|
void LinuxSampler::MidiInputPort::DispatchRaw | ( | uint8_t * | pData, | |
int32_t | FragmentPos | |||
) |
Helper function for MIDI input devices that have the MIDI data as raw bytes.
pData | - pointer to the raw MIDI data
|
void LinuxSampler::MidiInputPort::DispatchRaw | ( | uint8_t * | pData | ) |
Helper function for MIDI input devices that have the MIDI data as raw bytes.
pData | - pointer to the raw MIDI data |
void LinuxSampler::MidiInputPort::DispatchSysex | ( | void * | pData, | |
uint | Size | |||
) |
Should be called by the implementing MIDI input device whenever a system exclusive message arrived, this will cause the message to be forwarded to all connected engines.
pData | - pointer to the sysex data
|
MidiInputDevice* LinuxSampler::MidiInputPort::GetDevice | ( | ) |
Return MIDI device where this MIDI port belongs to.
uint LinuxSampler::MidiInputPort::GetPortNumber | ( | ) |
Return port number with which this MIDI port is registered to the MIDI device.
std::map<String,DeviceRuntimeParameter*> LinuxSampler::MidiInputPort::PortParameters | ( | ) |
Return all parameter settings of this MIDI port.
static bool LinuxSampler::MidiInputPort::RemoveSysexListener | ( | Engine * | engine | ) | [static] |
Removes engine from list of engines getting sysex messages.
friend class MidiInputDevice [friend] |
Definition at line 351 of file MidiInputPort.h.
SynchronizedConfig<MidiChannelMap_t> LinuxSampler::MidiInputPort::MidiChannelMap [protected] |
Contains the list of connected engines for each MIDI channel, where index 0 points to the list of engines which are connected to all MIDI channels. Usually it's not necessary for the descendant to use this map, instead it should just use the Dispatch* methods.
Definition at line 333 of file MidiInputPort.h.
Mutex LinuxSampler::MidiInputPort::MidiChannelMapMutex [protected] |
Used to protect the MidiChannelMap from being used at the same time by different threads.
Definition at line 335 of file MidiInputPort.h.
SynchronizedConfig<MidiChannelMap_t>::Reader LinuxSampler::MidiInputPort::MidiChannelMapReader [protected] |
MIDI thread access to MidiChannelMap.
Definition at line 334 of file MidiInputPort.h.
std::map<String,DeviceRuntimeParameter*> LinuxSampler::MidiInputPort::Parameters [protected] |
All port parameters.
Definition at line 331 of file MidiInputPort.h.
MidiInputDevice* LinuxSampler::MidiInputPort::pDevice [protected] |
Definition at line 329 of file MidiInputPort.h.
int LinuxSampler::MidiInputPort::portNumber [protected] |
Definition at line 330 of file MidiInputPort.h.
SynchronizedConfig<std::set<Engine*> >::Reader LinuxSampler::MidiInputPort::SysexListenersReader [protected] |
MIDI thread access to SysexListeners.
Definition at line 336 of file MidiInputPort.h.
SynchronizedConfig<std::vector<VirtualMidiDevice*> > LinuxSampler::MidiInputPort::virtualMidiDevices [protected] |
Definition at line 337 of file MidiInputPort.h.
Mutex LinuxSampler::MidiInputPort::virtualMidiDevicesMutex [protected] |
Definition at line 339 of file MidiInputPort.h.
SynchronizedConfig<std::vector<VirtualMidiDevice*> >::Reader LinuxSampler::MidiInputPort::virtualMidiDevicesReader [protected] |
Definition at line 338 of file MidiInputPort.h.