linuxsampler 2.3.1
LinuxSampler::MidiInputDevice Class Referenceabstract

Abstract base class for MIDI input drivers in LinuxSampler. More...

#include <MidiInputDevice.h>

Inheritance diagram for LinuxSampler::MidiInputDevice:
LinuxSampler::Device

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 MidiInputPortCreateMidiPort ()=0
 Create new Midi port This will be called by AcquirePorts Each individual device must implement this.
 
MidiInputPortGetPort (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.
 
voidpSampler
 Sampler instance. FIXME: should actually be of type Sampler*.
 
ListenerList< MidiPortCountListener * > portCountListeners
 

Friends

class ParameterActive
 
class ParameterPorts
 
class MidiInputDeviceFactory
 
class MidiInputPort
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MidiInputDevice()

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++.

◆ ~MidiInputDevice()

virtual LinuxSampler::MidiInputDevice::~MidiInputDevice ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ AcquirePorts()

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.

Parameters
Ports- number of ports to be left on this driver after this call.

◆ AddMidiPortCountListener()

void LinuxSampler::MidiInputDevice::AddMidiPortCountListener ( MidiPortCountListener l)

Registers the specified listener to be notified when the number of MIDI input ports is changed.

◆ CreateMidiPort()

virtual MidiInputPort * LinuxSampler::MidiInputDevice::CreateMidiPort ( )
pure virtual

Create new Midi port This will be called by AcquirePorts Each individual device must implement this.

◆ deviceId()

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.

◆ DeviceParameters()

std::map< String, DeviceCreationParameter * > LinuxSampler::MidiInputDevice::DeviceParameters ( )

Return all device parameter settings.

◆ Driver()

virtual String LinuxSampler::MidiInputDevice::Driver ( )
pure virtual

Return device driver name.

◆ fireMidiPortAdded()

void LinuxSampler::MidiInputDevice::fireMidiPortAdded ( MidiInputPort pPort)
protected

Notifies listeners that the supplied MIDI input port has just been added.

Parameters
pPortThe MIDI input port that has been added.

◆ fireMidiPortCountChanged()

void LinuxSampler::MidiInputDevice::fireMidiPortCountChanged ( int  NewCount)
protected

Notifies listeners that the amount of MIDI inpurt ports have been changed.

Parameters
NewCountThe new number of MIDI input ports.

◆ fireMidiPortToBeRemoved()

void LinuxSampler::MidiInputDevice::fireMidiPortToBeRemoved ( MidiInputPort pPort)
protected

Notifies listeners that the supplied MIDI input port is going to be removed soon.

Parameters
pPortThe MIDI input port that is going to be removed.

◆ GetPort()

MidiInputPort * LinuxSampler::MidiInputDevice::GetPort ( uint  iPort)
throw (MidiInputException
)

Return midi port iPort.

Exceptions
MidiInputExceptionif index out of bounds

◆ isAutonomousDevice()

virtual bool LinuxSampler::Device::isAutonomousDevice ( )
virtualinherited

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.

◆ isAutonomousDriver()

static bool LinuxSampler::Device::isAutonomousDriver ( )
staticinherited

Whether this is an autonomous device driver.

See also
isAutonomousDevice()

◆ Listen()

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.

◆ MidiInputDeviceID()

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.

Returns
a value equal or larger than 0, a negative value only on severe internal problems

◆ PortCount()

uint LinuxSampler::MidiInputDevice::PortCount ( )

Returns amount of MIDI ports this MIDI input device currently provides.

◆ RemoveMidiPortCountListener()

void LinuxSampler::MidiInputDevice::RemoveMidiPortCountListener ( MidiPortCountListener l)

Removes the specified listener, to stop being notified of further MIDI input port count chances.

◆ setDeviceId()

void LinuxSampler::Device::setDeviceId ( int  id)
protectedinherited

◆ StopListen()

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.

Friends And Related Symbol Documentation

◆ MidiInputDeviceFactory

friend class MidiInputDeviceFactory
friend

Definition at line 245 of file MidiInputDevice.h.

◆ MidiInputPort

Definition at line 246 of file MidiInputDevice.h.

◆ ParameterActive

Definition at line 243 of file MidiInputDevice.h.

◆ ParameterPorts

Definition at line 244 of file MidiInputDevice.h.

Member Data Documentation

◆ Parameters

std::map<String,DeviceCreationParameter*> LinuxSampler::MidiInputDevice::Parameters
protected

All device parameters.

Definition at line 191 of file MidiInputDevice.h.

◆ portCountListeners

ListenerList<MidiPortCountListener*> LinuxSampler::MidiInputDevice::portCountListeners
protected

Definition at line 194 of file MidiInputDevice.h.

◆ Ports

std::map<int,MidiInputPort*> LinuxSampler::MidiInputDevice::Ports
protected

All MIDI ports.

Definition at line 192 of file MidiInputDevice.h.

◆ pSampler

void* LinuxSampler::MidiInputDevice::pSampler
protected

Sampler instance. FIXME: should actually be of type Sampler*.

Definition at line 193 of file MidiInputDevice.h.


The documentation for this class was generated from the following file: