linuxsampler 2.3.1
LinuxSampler::DeviceRuntimeParameterInt Class Referenceabstract

Abstract base class for driver parameters of type int. More...

#include <DeviceParameter.h>

Inheritance diagram for LinuxSampler::DeviceRuntimeParameterInt:
LinuxSampler::DeviceRuntimeParameter LinuxSampler::AudioChannel::ParameterMixChannelDestination

Public Member Functions

 DeviceRuntimeParameterInt (int iVal)
 Constructor for value type int.
 
virtual String Type () OVERRIDE
 Some name reflecting the parameter's value type, like "BOOL, "INT", "FLOAT", "STRING", "STRINGS".
 
virtual bool Multiplicity () OVERRIDE
 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 () OVERRIDE
 The driver parameter might (optionally) return a minimum value for the parameter.
 
virtual optional< StringRangeMax () OVERRIDE
 The driver parameter might (optionally) return a maximum value for the parameter.
 
virtual optional< StringPossibilities () OVERRIDE
 The driver parameter might (optionally) return a list of possible values for this parameter, encoded as comma separated list.
 
virtual String Value () OVERRIDE
 The current value of this parameter (encoded as String).
 
virtual void SetValue (String val) OVERRIDE throw (Exception)
 Alter the parameter with the value given by val.
 
virtual int ValueAsInt ()
 
virtual void SetValue (int i) throw (Exception)
 
virtual optional< intRangeMinAsInt ()=0
 Must be implemented by descendant, returning a minimum int value for the parameter.
 
virtual optional< intRangeMaxAsInt ()=0
 Must be implemented by descendant, returning a maximum int value for the parameter.
 
virtual std::vector< intPossibilitiesAsInt ()=0
 Must be implemented by descendant, returning a list of possible int values for the parameter.
 
virtual void OnSetValue (int i) throw (Exception) =0
 Must be implemented be a driver's parameter class to react on the parameter value being set / altered.
 
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.
 

Protected Attributes

int iVal
 

Detailed Description

Abstract base class for driver parameters of type int.

Implements a "runtime" driver parameter for value type int. A driver offering a parameter of type int would derive its parameter class from this class and implement the abstract methods OnSetValue(), RangeMinAsInt(), RangeMaxAsInt(), PossibilitiesAsInt().

See DeviceCreationParameter and DeviceRuntimeParameter for a discussion about "runtime" parameters vs. "creation" parameters.

See also
DeviceCreationParameterInt

Definition at line 263 of file DeviceParameter.h.

Constructor & Destructor Documentation

◆ DeviceRuntimeParameterInt()

LinuxSampler::DeviceRuntimeParameterInt::DeviceRuntimeParameterInt ( int  iVal)

Constructor for value type int.

Sets an initial value for the parameter.

Parameters
iVal- initial integer value

Member Function Documentation

◆ Description()

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

◆ Fix()

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

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::DeviceRuntimeParameterInt::Multiplicity ( )
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).

Implements LinuxSampler::DeviceRuntimeParameter.

◆ OnSetValue()

virtual void LinuxSampler::DeviceRuntimeParameterInt::OnSetValue ( int  i)
throw (Exception
)
pure virtual

Must be implemented be a driver's parameter class to react on the parameter value being set / altered.

Parameters
i- new parameter value set by the user
Exceptions
Exception- might be thrown by the driver in case it cannot handle the supplied parameter value for whatever reason

Implemented in LinuxSampler::AudioChannel::ParameterMixChannelDestination.

◆ Possibilities()

virtual optional< String > LinuxSampler::DeviceRuntimeParameterInt::Possibilities ( )
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.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ PossibilitiesAsInt()

virtual std::vector< int > LinuxSampler::DeviceRuntimeParameterInt::PossibilitiesAsInt ( )
pure virtual

Must be implemented by descendant, returning a list of possible int values for the parameter.

If a list of possible values does not make sense, the implementation should return an empty vector.

Implemented in LinuxSampler::AudioChannel::ParameterMixChannelDestination.

◆ RangeMax()

virtual optional< String > LinuxSampler::DeviceRuntimeParameterInt::RangeMax ( )
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.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ RangeMaxAsInt()

virtual optional< int > LinuxSampler::DeviceRuntimeParameterInt::RangeMaxAsInt ( )
pure virtual

Must be implemented by descendant, returning a maximum int value for the parameter.

If a maximum value does not make sense for the specific driver parameter, then the implementation should return optional<int>::nothing.

Implemented in LinuxSampler::AudioChannel::ParameterMixChannelDestination.

◆ RangeMin()

virtual optional< String > LinuxSampler::DeviceRuntimeParameterInt::RangeMin ( )
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.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ RangeMinAsInt()

virtual optional< int > LinuxSampler::DeviceRuntimeParameterInt::RangeMinAsInt ( )
pure virtual

Must be implemented by descendant, returning a minimum int value for the parameter.

If a minimum value does not make sense for the specific driver parameter, then the implementation should return optional<int>::nothing.

Implemented in LinuxSampler::AudioChannel::ParameterMixChannelDestination.

◆ SetValue() [1/2]

virtual void LinuxSampler::DeviceRuntimeParameterInt::SetValue ( int  i)
throw (Exception
)
virtual

◆ SetValue() [2/2]

virtual void LinuxSampler::DeviceRuntimeParameterInt::SetValue ( String  val)
throw (Exception
)
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.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ Type()

virtual String LinuxSampler::DeviceRuntimeParameterInt::Type ( )
virtual

Some name reflecting the parameter's value type, like "BOOL, "INT", "FLOAT", "STRING", "STRINGS".

Upon the value returned here, the object can be casted to the respective implementing parameter class.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ Value()

virtual String LinuxSampler::DeviceRuntimeParameterInt::Value ( )
virtual

The current value of this parameter (encoded as String).

You might want to cast to the respective deriving parameter class like DeviceRuntimeParameterInt and use its method ValueAsInt() for not being forced to parse the String here.

Implements LinuxSampler::DeviceRuntimeParameter.

◆ ValueAsInt()

virtual int LinuxSampler::DeviceRuntimeParameterInt::ValueAsInt ( )
virtual

Member Data Documentation

◆ iVal

int LinuxSampler::DeviceRuntimeParameterInt::iVal
protected

Definition at line 331 of file DeviceParameter.h.


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