linuxsampler 2.3.1
|
Abstract base class for MIDI input drivers in LinuxSampler. More...
#include <MidiInputDevice.h>
Classes | |
class | ParameterActive |
Device Parameter 'ACTIVE'. More... | |
class | ParameterPorts |
Device Parameter 'PORTS'. More... | |
Public Member Functions | |
virtual void | Listen ()=0 |
Start listen to MIDI input events on the MIDI input port. | |
virtual void | StopListen ()=0 |
Stop to listen to MIDI input events on the MIDI input port. | |
virtual String | Driver ()=0 |
Return device driver name. | |
virtual MidiInputPort * | CreateMidiPort ()=0 |
Create new Midi port This will be called by AcquirePorts Each individual device must implement this. | |
MidiInputPort * | GetPort (uint iPort) throw (MidiInputException) |
Return midi port iPort. | |
uint | PortCount () |
Returns amount of MIDI ports this MIDI input device currently provides. | |
std::map< String, DeviceCreationParameter * > | DeviceParameters () |
Return all device parameter settings. | |
int | MidiInputDeviceID () |
Returns the unique ID number associated with this MIDIInputDevice instance. | |
void | AddMidiPortCountListener (MidiPortCountListener *l) |
Registers the specified listener to be notified when the number of MIDI input ports is changed. | |
void | RemoveMidiPortCountListener (MidiPortCountListener *l) |
Removes the specified listener, to stop being notified of further MIDI input port count chances. | |
virtual bool | isAutonomousDevice () |
Determines whether the device is an autonomous instance of some driver or not autonomous (that is bound to some other entity). | |
int | deviceId () const |
Returns the numerical ID of this device instance. | |
Static Public Member Functions | |
static bool | isAutonomousDriver () |
Whether this is an autonomous device driver. | |
Protected Member Functions | |
MidiInputDevice (std::map< String, DeviceCreationParameter * > DriverParameters, void *pSampler) | |
Constructor. | |
virtual | ~MidiInputDevice () |
Destructor. | |
void | fireMidiPortCountChanged (int NewCount) |
Notifies listeners that the amount of MIDI inpurt ports have been changed. | |
void | fireMidiPortToBeRemoved (MidiInputPort *pPort) |
Notifies listeners that the supplied MIDI input port is going to be removed soon. | |
void | fireMidiPortAdded (MidiInputPort *pPort) |
Notifies listeners that the supplied MIDI input port has just been added. | |
void | AcquirePorts (uint Ports) |
Set number of MIDI ports required by the engine This can either do nothing, create more ports or destroy ports depenging on the parameter and how many ports already exist on this driver. | |
void | setDeviceId (int id) |
Protected Attributes | |
std::map< String, DeviceCreationParameter * > | Parameters |
All device parameters. | |
std::map< int, MidiInputPort * > | Ports |
All MIDI ports. | |
void * | pSampler |
Sampler instance. FIXME: should actually be of type Sampler*. | |
ListenerList< MidiPortCountListener * > | portCountListeners |
Friends | |
class | ParameterActive |
class | ParameterPorts |
class | MidiInputDeviceFactory |
class | MidiInputPort |
Abstract base class for MIDI input drivers in LinuxSampler.
This class will be derived by specialized classes which implement the connection to a specific MIDI input system (e.g. Alsa Sequencer, CoreMIDI). The MidiInputDevice desendant should just call the appropriate (protected) Dispatch* method here when an MIDI event occured. The dispatch* methods here will automatically forward the MIDI event to the appropriate, connected sampler engines.
Definition at line 66 of file MidiInputDevice.h.
|
protected |
Constructor.
FIXME: the pointer argument pSapmler should actually be of type Sampler*. Unfortunately the bidirectional relationship between this header and Sampler.h would clash on header file inclusion, so that's why I had to make it of type void* here. This is an annoying constraint of C++.
|
protectedvirtual |
Destructor.
Set number of MIDI ports required by the engine This can either do nothing, create more ports or destroy ports depenging on the parameter and how many ports already exist on this driver.
Ports | - number of ports to be left on this driver after this call. |
void LinuxSampler::MidiInputDevice::AddMidiPortCountListener | ( | MidiPortCountListener * | l | ) |
Registers the specified listener to be notified when the number of MIDI input ports is changed.
|
pure virtual |
Create new Midi port This will be called by AcquirePorts Each individual device must implement this.
|
inherited |
Returns the numerical ID of this device instance.
Every device instance has a unique ID among all devices of its category, that is e.g. every MIDI input device has a unique ID among all MIDI input devices and every audio output device has a unique ID among all audio output devices. The IDs are usually generated by the respective factory class.
std::map< String, DeviceCreationParameter * > LinuxSampler::MidiInputDevice::DeviceParameters | ( | ) |
Return all device parameter settings.
|
protected |
Notifies listeners that the supplied MIDI input port has just been added.
pPort | The MIDI input port that has been added. |
Notifies listeners that the amount of MIDI inpurt ports have been changed.
NewCount | The new number of MIDI input ports. |
|
protected |
Notifies listeners that the supplied MIDI input port is going to be removed soon.
pPort | The MIDI input port that is going to be removed. |
MidiInputPort * LinuxSampler::MidiInputDevice::GetPort | ( | uint | iPort | ) | |
throw | ( | MidiInputException | |||
) |
Return midi port iPort.
MidiInputException | if index out of bounds |
Determines whether the device is an autonomous instance of some driver or not autonomous (that is bound to some other entity).
An autonomous device can be created and deleted separately. A non autonomous device only exists in the context of some entity, e.g. in the context of a host plugin (VST, AU, LV2, DSSI, ...) instance, and thus such a device cannot be created or deleted on its own.
By default, this method returns true
unless overridden by the descendent.
Whether this is an autonomous device driver.
Start listen to MIDI input events on the MIDI input port.
The MIDIInputPort descendant should forward all MIDI input events by calling the appropriate (protected) Dispatch* method of class MidiInputPort.
int LinuxSampler::MidiInputDevice::MidiInputDeviceID | ( | ) |
Returns the unique ID number associated with this MIDIInputDevice instance.
This ID number is unique among all MIDIInputDevice instances of the same Sampler instance and during the whole lifetime of the Sampler instance.
uint LinuxSampler::MidiInputDevice::PortCount | ( | ) |
Returns amount of MIDI ports this MIDI input device currently provides.
void LinuxSampler::MidiInputDevice::RemoveMidiPortCountListener | ( | MidiPortCountListener * | l | ) |
Removes the specified listener, to stop being notified of further MIDI input port count chances.
Stop to listen to MIDI input events on the MIDI input port.
After this method was called, the MidiInputPort descendant should ignore all MIDI input events.
Definition at line 245 of file MidiInputDevice.h.
|
friend |
Definition at line 246 of file MidiInputDevice.h.
|
friend |
Definition at line 243 of file MidiInputDevice.h.
|
friend |
Definition at line 244 of file MidiInputDevice.h.
|
protected |
All device parameters.
Definition at line 191 of file MidiInputDevice.h.
|
protected |
Definition at line 194 of file MidiInputDevice.h.
|
protected |
All MIDI ports.
Definition at line 192 of file MidiInputDevice.h.
|
protected |
Sampler instance. FIXME: should actually be of type Sampler*.
Definition at line 193 of file MidiInputDevice.h.