linuxsampler 2.3.1
LinuxSampler::DeviceRuntimeParameter Class Referenceabstract

Abstracet base class for all driver parameters of the sampler. More...

#include <DeviceParameter.h>

Inheritance diagram for LinuxSampler::DeviceRuntimeParameter:
LinuxSampler::DeviceCreationParameter LinuxSampler::DeviceRuntimeParameterBool LinuxSampler::DeviceRuntimeParameterFloat LinuxSampler::DeviceRuntimeParameterInt LinuxSampler::DeviceRuntimeParameterString LinuxSampler::DeviceRuntimeParameterStrings LinuxSampler::DeviceCreationParameterBool LinuxSampler::DeviceCreationParameterFloat LinuxSampler::DeviceCreationParameterInt LinuxSampler::DeviceCreationParameterString LinuxSampler::DeviceCreationParameterStrings LinuxSampler::AudioChannel::ParameterIsMixChannel LinuxSampler::AudioChannel::ParameterMixChannelDestination LinuxSampler::AudioChannel::ParameterName LinuxSampler::MidiInputPort::ParameterName

Public Member Functions

virtual String Type ()=0
 Some name reflecting the parameter's value type, like "BOOL, "INT", "FLOAT", "STRING", "STRINGS".
 
virtual String Description ()=0
 A human readable description, explaining the exact purpose of the driver parameter.
 
virtual bool Fix ()=0
 Whether the parameter is read only.
 
virtual bool Multiplicity ()=0
 Whether the parameter only allows to set one scalar value, or if true is returned here, the parameter allows to manage a list of values instead.
 
virtual optional< StringRangeMin ()=0
 The driver parameter might (optionally) return a minimum value for the parameter.
 
virtual optional< StringRangeMax ()=0
 The driver parameter might (optionally) return a maximum value for the parameter.
 
virtual optional< StringPossibilities ()=0
 The driver parameter might (optionally) return a list of possible values for this parameter, encoded as comma separated list.
 
virtual String Value ()=0
 The current value of this parameter (encoded as String).
 
virtual void SetValue (String val) throw (Exception) =0
 Alter the parameter with the value given by val.
 
virtual ~DeviceRuntimeParameter ()
 Destructor.
 

Detailed Description

Abstracet base class for all driver parameters of the sampler.

All audio / MIDI drivers for the sampler are using dynamic driver parameters based on this base class. The main purpose behind this concept is to be able to write GUI frontends for the sampler, which don't need to know about specific drivers the sampler provides, nor the exact list of parameters those drivers offer. Instead a frontend can use this API to retrieve what kind of parameters the respective available drivers offer at runtime. This way new drivers can be added or existing ones being changed arbitrarily to the sampler at any time, without a GUI frontend to be changed or recompiled.

There are various parameter classes deriving from this base class, which implement convenient handling for the various common value types like bool, int, float, String. A driver would rather use one of those type specialized classes, instead of this abstract base class. Because the methods of this very base parameter class here are generalized being encoded in String type for all parameter types.

Besides that, there are 2 distinct sets of parameter types:

  • "Runtime" parameters which can be set and changed by the user (i.e. with a GUI frontend) at any time.
  • "Creation" parameters which can only be set by the user before a driver is instantiated (a driver instance is called a "device" in the sampler's terms). After the driver is instantiated, "creation" parameters are read only for the life time of a driver (device) instance. Typical example for a "creation" parameter would be an audio driver that allows to select a specific sound card.
See also
DeviceCreationParameter

Definition at line 73 of file DeviceParameter.h.

Constructor & Destructor Documentation

◆ ~DeviceRuntimeParameter()

virtual LinuxSampler::DeviceRuntimeParameter::~DeviceRuntimeParameter ( )
inlinevirtual

Destructor.

Virtual base destructor which enforces that all destructors of all deriving classes are called automatically upon object destruction.

Definition at line 189 of file DeviceParameter.h.

Member Function Documentation

◆ Description()

virtual String LinuxSampler::DeviceRuntimeParameter::Description ( )
pure virtual

◆ Fix()

virtual bool LinuxSampler::DeviceRuntimeParameter::Fix ( )
pure virtual

Whether the parameter is read only.

Not to be confused with "creation" parameters! A driver parameter which returns true here can never be set or altered at any time. Not even at instanciation time of the driver! A typical example would be a parameter "SAMPLERATE" for a specific sound card, where the specific sound card does not allow to switch the sound card's sample rate in any way. Yet the value returned by the parameter (read only) might be different, depending on the actual sound card the user selected with the audio driver.

Implemented in LinuxSampler::AudioChannel::ParameterName, LinuxSampler::AudioChannel::ParameterIsMixChannel, LinuxSampler::AudioChannel::ParameterMixChannelDestination, LinuxSampler::AudioOutputDevice::ParameterActive, LinuxSampler::AudioOutputDevice::ParameterSampleRate, LinuxSampler::AudioOutputDevice::ParameterChannels, LinuxSampler::MidiInputDevice::ParameterActive, LinuxSampler::MidiInputDevice::ParameterPorts, and LinuxSampler::MidiInputPort::ParameterName.

◆ Multiplicity()

virtual bool LinuxSampler::DeviceRuntimeParameter::Multiplicity ( )
pure virtual

Whether the parameter only allows to set one scalar value, or if true is returned here, the parameter allows to manage a list of values instead.

A typical example of multiplicity parameter is i.e. a "ROUTING" parameter, that would allow a user to interconnect the sampler with other apps and devices with drivers that support such concepts (like JACK and ALSA MIDI do).

Implemented in LinuxSampler::DeviceRuntimeParameterBool, LinuxSampler::DeviceRuntimeParameterInt, LinuxSampler::DeviceRuntimeParameterFloat, LinuxSampler::DeviceRuntimeParameterString, LinuxSampler::DeviceRuntimeParameterStrings, LinuxSampler::DeviceCreationParameterBool, LinuxSampler::DeviceCreationParameterInt, LinuxSampler::DeviceCreationParameterFloat, LinuxSampler::DeviceCreationParameterString, and LinuxSampler::DeviceCreationParameterStrings.

◆ Possibilities()

virtual optional< String > LinuxSampler::DeviceRuntimeParameter::Possibilities ( )
pure virtual

The driver parameter might (optionally) return a list of possible values for this parameter, encoded as comma separated list.

For example an audio driver might return "44100,96000" for a "SAMPLERATE" parameter for a specific sound card.

You probably don't want to call this method directly, but instead cast this object to the respective deriving parameter class like DeviceRuntimeParameterInt, and use its PossibilitiesAsInt() method instead, which conveniently returns a vector in its value type. So you don't need to parse this return value here.

Implemented in LinuxSampler::DeviceCreationParameter, LinuxSampler::DeviceRuntimeParameterBool, LinuxSampler::DeviceRuntimeParameterInt, LinuxSampler::DeviceRuntimeParameterFloat, LinuxSampler::DeviceRuntimeParameterString, and LinuxSampler::DeviceRuntimeParameterStrings.

◆ RangeMax()

virtual optional< String > LinuxSampler::DeviceRuntimeParameter::RangeMax ( )
pure virtual

The driver parameter might (optionally) return a maximum value for the parameter.

If some actual value is returned here, the sampler automatically performs bounds checking of parameter values to be set for such a parameter and a GUI frontend might display a spin box in such a case to the user, honoring the returned maximum value.

You probably don't want to call this method directly, but instead cast this object to the respective deriving parameter class like DeviceRuntimeParameterInt, and use its RangeMaxAsInt() method instead, which conveniently returns a value in its value type. So you don't need to parse this return value here.

Implemented in LinuxSampler::DeviceCreationParameter, LinuxSampler::DeviceRuntimeParameterBool, LinuxSampler::DeviceRuntimeParameterInt, LinuxSampler::DeviceRuntimeParameterFloat, LinuxSampler::DeviceRuntimeParameterString, and LinuxSampler::DeviceRuntimeParameterStrings.

◆ RangeMin()

virtual optional< String > LinuxSampler::DeviceRuntimeParameter::RangeMin ( )
pure virtual

The driver parameter might (optionally) return a minimum value for the parameter.

If some actual value is returned here, the sampler automatically performs bounds checking of parameter values to be set for such a parameter and a GUI frontend might display a spin box in such a case to the user, honoring the returned minimum value.

You probably don't want to call this method directly, but instead cast this object to the respective deriving parameter class like DeviceRuntimeParameterInt, and use its RangeMinAsInt() method instead, which conveniently returns a value in its value type. So you don't need to parse this return value here.

Implemented in LinuxSampler::DeviceCreationParameter, LinuxSampler::DeviceRuntimeParameterBool, LinuxSampler::DeviceRuntimeParameterInt, LinuxSampler::DeviceRuntimeParameterFloat, LinuxSampler::DeviceRuntimeParameterString, and LinuxSampler::DeviceRuntimeParameterStrings.

◆ SetValue()

virtual void LinuxSampler::DeviceRuntimeParameter::SetValue ( String  val)
throw (Exception
)
pure virtual

Alter the parameter with the value given by val.

The respective deriving parameter class automatically parses the String value supplied here, and converts it into its native value type like int, float or String vector ("Strings").

Parameters
-new parameter value encoded as string
Exceptions
Exception- if val is out of bounds, not encoded correctly in its string representation or any other reason the driver might not want to accept the given value.

Implemented in LinuxSampler::DeviceRuntimeParameterBool, LinuxSampler::DeviceRuntimeParameterInt, LinuxSampler::DeviceRuntimeParameterFloat, LinuxSampler::DeviceRuntimeParameterString, LinuxSampler::DeviceRuntimeParameterStrings, LinuxSampler::DeviceCreationParameterBool, LinuxSampler::DeviceCreationParameterInt, LinuxSampler::DeviceCreationParameterFloat, LinuxSampler::DeviceCreationParameterString, and LinuxSampler::DeviceCreationParameterStrings.

◆ Type()

virtual String LinuxSampler::DeviceRuntimeParameter::Type ( )
pure virtual

◆ Value()

virtual String LinuxSampler::DeviceRuntimeParameter::Value ( )
pure virtual

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