linuxsampler 2.3.1
LinuxSampler::SamplerChannel Class Reference

LinuxSampler sampler channel (a.k.a. More...

#include <Sampler.h>

Public Member Functions

void SetEngineType (String EngineType) throw (Exception)
 Assign a sampler engine type to this sampler channel.
 
void SetAudioOutputDevice (AudioOutputDevice *pDevice) throw (Exception)
 Connect this sampler channel to an audio output device, that is an instance of an audio output driver.
 
void Connect (MidiInputPort *pPort) throw (Exception)
 Connect the given MIDIInputPort to this SamplerChannel.
 
void Disconnect (MidiInputPort *pPort) throw (Exception)
 Disconnects the given MidiInputPort from this SamplerChannel.
 
void DisconnectAllMidiInputPorts () throw (Exception)
 Disconnects all MIDI input ports currently connected with this SamplerChannel.
 
std::vector< MidiInputPort * > GetMidiInputPorts ()
 Returns all MIDI input ports currently connected to this sampler channel.
 
void SetMidiInputDevice (MidiInputDevice *pDevice) DEPRECATED_API throw (Exception)
 Connect this sampler channel to a MIDI input device.
 
void SetMidiInputPort (int MidiPort) DEPRECATED_API throw (Exception)
 Change the MIDI input port connected to this sampler channel.
 
void SetMidiInputChannel (midi_chan_t MidiChannel)
 Define on which MIDI channel(s) this sampler channel should listen to (on all MIDI ports and all virtual MIDI devices connected to this sampler channel).
 
void SetMidiInput (MidiInputDevice *pDevice, int iMidiPort, midi_chan_t MidiChannel=midi_chan_all) DEPRECATED_API throw (Exception)
 Connect this sampler channel to a MIDI input triplet.
 
EngineChannelGetEngineChannel ()
 Returns the EngineChannel object that was deployed on this sampler channel appropriate to the given sampler engine type.
 
midi_chan_t GetMidiInputChannel ()
 Returns the MIDI input channel to which this sampler channel is currently connected to.
 
int GetMidiInputPort () DEPRECATED_API
 Returns the MIDI input port number to which this sampler channel is currently connected to.
 
AudioOutputDeviceGetAudioOutputDevice ()
 Returns the audio output device to which this sampler channel is currently connected to.
 
MidiInputDeviceGetMidiInputDevice () DEPRECATED_API
 Returns the MIDI input device to which this sampler channel is currently connected to.
 
uint Index ()
 Returns the index number of this sampler channel within the Sampler instance.
 
SamplerGetSampler ()
 Returns the sampler to which this channel belongs.
 
void AddEngineChangeListener (EngineChangeListener *l)
 Registers the specified listener to be notified when the engine type of this sampler channel is changed.
 
void RemoveEngineChangeListener (EngineChangeListener *l)
 Removes the specified listener.
 
void RemoveAllEngineChangeListeners ()
 Removes the specified listener.
 
void fireEngineToBeChanged ()
 Notifies listeners that the engine type of this sampler channel is going to be changed soon.
 
void fireEngineChanged ()
 Notifies listeners that the engine type of this sampler channel is changed.
 

Protected Member Functions

 SamplerChannel (Sampler *pS)
 
virtual ~SamplerChannel ()
 

Protected Attributes

SamplerpSampler
 
EngineChannelpEngineChannel
 
AudioOutputDevicepAudioOutputDevice
 
int iIndex
 

Friends

class Sampler
 

Detailed Description

LinuxSampler sampler channel (a.k.a.

"sampler part")

Encapsulates a channel of a specific sampler engine type, one connection to a MIDI input device and one connection to an audio output device. You cannot create an instance of this class on your own, you have to use the AddSamplerChannel() method of the Sampler object to create a new sampler channel.

Definition at line 49 of file Sampler.h.

Constructor & Destructor Documentation

◆ SamplerChannel()

LinuxSampler::SamplerChannel::SamplerChannel ( Sampler pS)
protected

◆ ~SamplerChannel()

virtual LinuxSampler::SamplerChannel::~SamplerChannel ( )
protectedvirtual

Member Function Documentation

◆ AddEngineChangeListener()

void LinuxSampler::SamplerChannel::AddEngineChangeListener ( EngineChangeListener l)

Registers the specified listener to be notified when the engine type of this sampler channel is changed.

◆ Connect()

void LinuxSampler::SamplerChannel::Connect ( MidiInputPort pPort)
throw (Exception
)

Connect the given MIDIInputPort to this SamplerChannel.

The connection is added to the sampler channel. So other MIDI input connections remain unaffected by this call. If the given port is already connected to this sampler channel, then this call is ignored.

Parameters
pPort- MIDI input port to connect to
Exceptions
Exceptionin case the MIDI device is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port or even device

◆ Disconnect()

void LinuxSampler::SamplerChannel::Disconnect ( MidiInputPort pPort)
throw (Exception
)

Disconnects the given MidiInputPort from this SamplerChannel.

All other MIDI input ports connected to this sampler channel remain unaffected. If the given port is not currently connected to this sampler channel, then this call is ignored.

Parameters
pPort- MIDI input port to disconnect
Exceptions
Exceptionin case the MIDI device is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port or even device

◆ DisconnectAllMidiInputPorts()

void LinuxSampler::SamplerChannel::DisconnectAllMidiInputPorts ( )
throw (Exception
)

Disconnects all MIDI input ports currently connected with this SamplerChannel.

Exceptions
Exceptionin case the MIDI device is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port or even device

◆ fireEngineChanged()

void LinuxSampler::SamplerChannel::fireEngineChanged ( )

Notifies listeners that the engine type of this sampler channel is changed.

◆ fireEngineToBeChanged()

void LinuxSampler::SamplerChannel::fireEngineToBeChanged ( )

Notifies listeners that the engine type of this sampler channel is going to be changed soon.

◆ GetAudioOutputDevice()

AudioOutputDevice * LinuxSampler::SamplerChannel::GetAudioOutputDevice ( )

Returns the audio output device to which this sampler channel is currently connected to.

Returns
pointer to audio output device or NULL if not connected

◆ GetEngineChannel()

EngineChannel * LinuxSampler::SamplerChannel::GetEngineChannel ( )

Returns the EngineChannel object that was deployed on this sampler channel appropriate to the given sampler engine type.

Returns
pointer to engine or NULL if no engine deployed

◆ GetMidiInputChannel()

midi_chan_t LinuxSampler::SamplerChannel::GetMidiInputChannel ( )

Returns the MIDI input channel to which this sampler channel is currently connected to.

Returns
The MIDI input channel on which the sampler channel is listening to.

◆ GetMidiInputDevice()

MidiInputDevice * LinuxSampler::SamplerChannel::GetMidiInputDevice ( )

Returns the MIDI input device to which this sampler channel is currently connected to.

Returns
pointer to MIDI input device or NULL if not connected
Deprecated:
This method is only provided for backward compatibility. It is a relict from days where there was only 1 MIDI input allowed per sampler channel.

◆ GetMidiInputPort()

int LinuxSampler::SamplerChannel::GetMidiInputPort ( )

Returns the MIDI input port number to which this sampler channel is currently connected to.

This method should not be used in new applications anymore!

Returns
MIDI input port number or -1 if not connected
Deprecated:
This method is only provided for backward compatibility. It is a relict from days where there was only 1 MIDI input allowed per sampler channel.

◆ GetMidiInputPorts()

std::vector< MidiInputPort * > LinuxSampler::SamplerChannel::GetMidiInputPorts ( )

Returns all MIDI input ports currently connected to this sampler channel.

◆ GetSampler()

Sampler * LinuxSampler::SamplerChannel::GetSampler ( )

Returns the sampler to which this channel belongs.

◆ Index()

uint LinuxSampler::SamplerChannel::Index ( )

Returns the index number of this sampler channel within the Sampler instance.

◆ RemoveAllEngineChangeListeners()

void LinuxSampler::SamplerChannel::RemoveAllEngineChangeListeners ( )

Removes the specified listener.

◆ RemoveEngineChangeListener()

void LinuxSampler::SamplerChannel::RemoveEngineChangeListener ( EngineChangeListener l)

Removes the specified listener.

◆ SetAudioOutputDevice()

void LinuxSampler::SamplerChannel::SetAudioOutputDevice ( AudioOutputDevice pDevice)
throw (Exception
)

Connect this sampler channel to an audio output device, that is an instance of an audio output driver.

If this sampler channel was already connected to an audio output device, then the old connection will automatically be removed before.

Parameters
pDevice- audio output device to connect to
Exceptions
Exceptionin case the audio device is tried to be changed while the sampler channel is used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the audio output device

◆ SetEngineType()

void LinuxSampler::SamplerChannel::SetEngineType ( String  EngineType)
throw (Exception
)

Assign a sampler engine type to this sampler channel.

Parameters
EngineType- type of the engine to use
Exceptions
Exception- if EngineType is invalid
See also
Sampler::AvailableEngineTypes()

◆ SetMidiInput()

void LinuxSampler::SamplerChannel::SetMidiInput ( MidiInputDevice pDevice,
int  iMidiPort,
midi_chan_t  MidiChannel = midi_chan_all 
)
throw (Exception
)

Connect this sampler channel to a MIDI input triplet.

This call will also disconnect all existing MIDI input connections from this sampler channel before establishing the new connection! Disconnection of all previous connections is done to preserve full behavior backward compatibility to times when this API only allowed one MIDI input port per sampler channel.

Parameters
pDevice- MIDI input device to connect to
iMidiPort- MIDI port to connect to
MidiChannel- optional: MIDI channel on which the sampler channel should listen to (default: listen on all MIDI channels)
Exceptions
Exceptionin case the MIDI port is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port
Deprecated:
This method is only provided for backward compatibility. It is a relict from days where there was only 1 MIDI input allowed per sampler channel.

◆ SetMidiInputChannel()

void LinuxSampler::SamplerChannel::SetMidiInputChannel ( midi_chan_t  MidiChannel)

Define on which MIDI channel(s) this sampler channel should listen to (on all MIDI ports and all virtual MIDI devices connected to this sampler channel).

By default, that is after creation of a new sampler channel, the sampler channel will listen to all MIDI channels (a.k.a. "MIDI Omni mode").

Parameters
MidiChannel- MIDI channel to listen
Exceptions
Exceptionif provided MidiChannel is not a valid constant as defined by midi_chan_t

◆ SetMidiInputDevice()

void LinuxSampler::SamplerChannel::SetMidiInputDevice ( MidiInputDevice pDevice)
throw (Exception
)

Connect this sampler channel to a MIDI input device.

This call will also disconnect all existing MIDI input connections from this sampler channel before establishing the new connection! Disconnection of all previous connections is done to preserve full behavior backward compatibility to times when this API only allowed one MIDI input port per sampler channel.

Parameters
pDevice- MIDI input device to connect to
Exceptions
Exceptionin case the MIDI device is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port or even device
Deprecated:
This method is only provided for backward compatibility. It is a relict from days where there was only 1 MIDI input allowed per SamplerChannel.

◆ SetMidiInputPort()

void LinuxSampler::SamplerChannel::SetMidiInputPort ( int  MidiPort)
throw (Exception
)

Change the MIDI input port connected to this sampler channel.

Calling this method will switch the connection of the first (and only the first) MIDIInputPort currently being connected to this sampler channel, to another port of the same MidiInputDevice. Or in other words: the first MIDIInputPort currently connected to this sampler channel will be disconnected, and the requested other port of its MIDIInputDevice will be connected to this sampler channel instead.

This behavior is implemented to preserve full behavior backward compatibility to times when this API only allowed one MIDI input port per SamplerChannel.

Parameters
MidiPort- MIDI port to connect to
Exceptions
Exceptionin case the MIDI port is tried to be changed while the sampler channel is being used by a host plugin (e.g. VST, AU, DSSI, LV2) which don't allow to change the MIDI port
Deprecated:
This method is only provided for backward compatibility. It is a relict from days where there was only 1 MIDI input allowed per SamplerChannel.

Friends And Related Symbol Documentation

◆ Sampler

Definition at line 310 of file Sampler.h.

Member Data Documentation

◆ iIndex

int LinuxSampler::SamplerChannel::iIndex
protected

Definition at line 308 of file Sampler.h.

◆ pAudioOutputDevice

AudioOutputDevice* LinuxSampler::SamplerChannel::pAudioOutputDevice
protected

Definition at line 307 of file Sampler.h.

◆ pEngineChannel

EngineChannel* LinuxSampler::SamplerChannel::pEngineChannel
protected

Definition at line 306 of file Sampler.h.

◆ pSampler

Sampler* LinuxSampler::SamplerChannel::pSampler
protected

Definition at line 305 of file Sampler.h.


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