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. | |
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 |
class | AudioOutputDeviceFactory |
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 63 of file MidiInputDevice.h.
LinuxSampler::MidiInputDevice::MidiInputDevice | ( | std::map< String, DeviceCreationParameter * > | DriverParameters, | |
void * | pSampler | |||
) | [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++.
virtual LinuxSampler::MidiInputDevice::~MidiInputDevice | ( | ) | [protected, virtual] |
Destructor.
void LinuxSampler::MidiInputDevice::AcquirePorts | ( | uint | Ports | ) | [protected] |
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.
virtual MidiInputPort* LinuxSampler::MidiInputDevice::CreateMidiPort | ( | ) | [pure virtual] |
Create new Midi port This will be called by AcquirePorts Each individual device must implement this.
int LinuxSampler::Device::deviceId | ( | ) | const [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.
virtual String LinuxSampler::MidiInputDevice::Driver | ( | ) | [pure virtual] |
Return device driver name.
void LinuxSampler::MidiInputDevice::fireMidiPortAdded | ( | MidiInputPort * | pPort | ) | [protected] |
Notifies listeners that the supplied MIDI input port has just been added.
pPort | The MIDI input port that has been added. |
void LinuxSampler::MidiInputDevice::fireMidiPortCountChanged | ( | int | NewCount | ) | [protected] |
Notifies listeners that the amount of MIDI inpurt ports have been changed.
NewCount | The new number of MIDI input ports. |
void LinuxSampler::MidiInputDevice::fireMidiPortToBeRemoved | ( | MidiInputPort * | pPort | ) | [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 |
virtual bool LinuxSampler::Device::isAutonomousDevice | ( | ) | [virtual, inherited] |
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.
static bool LinuxSampler::Device::isAutonomousDriver | ( | ) | [static, inherited] |
Whether this is an autonomous device driver.
virtual void LinuxSampler::MidiInputDevice::Listen | ( | ) | [pure virtual] |
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.
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.
void LinuxSampler::Device::setDeviceId | ( | int | id | ) | [protected, inherited] |
virtual void LinuxSampler::MidiInputDevice::StopListen | ( | ) | [pure virtual] |
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.
friend class AudioOutputDeviceFactory [friend, inherited] |
Reimplemented in LinuxSampler::AudioOutputDevice.
friend class MidiInputDeviceFactory [friend] |
Reimplemented from LinuxSampler::Device.
Definition at line 231 of file MidiInputDevice.h.
friend class MidiInputPort [friend] |
Definition at line 232 of file MidiInputDevice.h.
friend class ParameterActive [friend] |
Definition at line 229 of file MidiInputDevice.h.
friend class ParameterPorts [friend] |
Definition at line 230 of file MidiInputDevice.h.
std::map<String,DeviceCreationParameter*> LinuxSampler::MidiInputDevice::Parameters [protected] |
All device parameters.
Definition at line 177 of file MidiInputDevice.h.
Definition at line 180 of file MidiInputDevice.h.
std::map<int,MidiInputPort*> LinuxSampler::MidiInputDevice::Ports [protected] |
All MIDI ports.
Definition at line 178 of file MidiInputDevice.h.
void* LinuxSampler::MidiInputDevice::pSampler [protected] |
Sampler instance. FIXME: should actually be of type Sampler*.
Definition at line 179 of file MidiInputDevice.h.