Gin
|
A parameter with user values, real time safe callbacks, modulation, and all sorts of other fancy stuff. More...
Inherits juce::AudioPluginInstance::HostedParameter, juce::AsyncUpdater, and juce::Timer.
Classes | |
class | ParameterListener |
struct | ParamState |
Public Types | |
using | Ptr = Parameter * |
Public Member Functions | |
Parameter (Processor &, juce::String uid, juce::String name, juce::String shortName, juce::String label, float minValue, float maxValue, float intervalValue, float defaultValue, float skewFactor=1.0f, std::function< juce::String(const Parameter &, float)> textFunction=nullptr) | |
Parameter (Processor &, juce::String uid, juce::String name, juce::String shortName, juce::String label, juce::NormalisableRange< float > range, float defaultValue, std::function< juce::String(const Parameter &, float)> textFunction=nullptr) | |
juce::String | getUid () const |
void | setInternal (bool i) |
bool | isInternal () const |
void | setModIndex (int i) |
int | getModIndex () const |
void | setModMatrix (ModMatrix *m) |
ModMatrix * | getModMatrix () const |
virtual void | prepareToPlay (double, int) |
virtual void | reset () |
float | getProcValue () |
virtual float | getProcValue (int) |
float | getUserValue () const |
int | getUserValueInt () const |
bool | getUserValueBool () const |
float | getUserDefaultValue () const |
virtual void | setUserValue (float v) |
virtual void | setUserValueNotifingHost (float f) |
void | setUserValueAsUserAction (float f) |
juce::String | getUserValueText () const |
juce::String | userValueToText (float val) |
bool | isOnOff () |
bool | isOn () |
virtual bool | isSmoothingActive () |
void | beginUserAction () |
void | beginUserTimedAction () |
void | endUserAction () |
juce::NormalisableRange< float > | getUserRange () const |
float | getUserRangeStart () const |
float | getUserRangeEnd () const |
void | addListener (ParameterListener *listener) |
void | removeListener (ParameterListener *listener) |
ParamState | getState () |
void | setState (const ParamState &state) |
juce::String | getParameterID () const override |
float | getValue () const override |
bool | getBoolValue () const |
void | setValue (float newValue) override |
float | getDefaultValue () const override |
juce::String | getName (int maximumStringLength) const override |
juce::String | getShortName () const |
juce::String | getLabel () const override |
int | getNumSteps () const override |
juce::String | getText (float value, int) const override |
float | getValueForText (const juce::String &text) const override |
bool | isOrientationInverted () const override |
bool | isAutomatable () const override |
bool | isMetaParameter () const override |
float | getSkew () |
bool | isSkewSymmetric () |
Public Attributes | |
std::function< float(float)> | conversionFunction |
Protected Member Functions | |
void | handleAsyncUpdate () override |
void | timerCallback () override |
virtual void | changed () |
Protected Attributes | |
Processor & | processor |
juce::NormalisableRange< float > | range |
bool | internal = false |
ModMatrix * | modMatrix = nullptr |
int | modIndex = -1 |
float | value = 0.0f |
float | defaultValue = 0.0f |
juce::String | uid |
juce::String | name |
juce::String | shortName |
juce::String | label |
std::function< juce::String(const Parameter &, float)> | textFunction |
int | userActionCount = 0 |
juce::ListenerList< ParameterListener > | listeners |
A parameter with user values, real time safe callbacks, modulation, and all sorts of other fancy stuff.
A paramter return it's value in 3 formats: value: always 0..1 user value: range as displayed to user proc value: range used for processing
For example, a gain parameter may have a user range of -100 to +10 dB. The coresponding proc range would be 0 to 3.1623. By default user value and proc value are the same. To provide an alternate proc value, set conversionFunction
Parameters can be either internal or external. External parameters are exposed to the host and can be modulated. Internal parameters are for things that should not be modulated.
Parameters can optionally be added to a modmatrix
using Parameter::Ptr = Parameter* |
Parameter::Parameter | ( | Processor & | , |
juce::String | uid, | ||
juce::String | name, | ||
juce::String | shortName, | ||
juce::String | label, | ||
float | minValue, | ||
float | maxValue, | ||
float | intervalValue, | ||
float | defaultValue, | ||
float | skewFactor = 1.0f , |
||
std::function< juce::String(const Parameter &, float)> | textFunction = nullptr |
||
) |
Parameter::Parameter | ( | Processor & | , |
juce::String | uid, | ||
juce::String | name, | ||
juce::String | shortName, | ||
juce::String | label, | ||
juce::NormalisableRange< float > | range, | ||
float | defaultValue, | ||
std::function< juce::String(const Parameter &, float)> | textFunction = nullptr |
||
) |
juce::String Parameter::getUid | ( | ) | const |
References uid.
Referenced by ParamComponent::getUid().
void Parameter::setInternal | ( | bool | i | ) |
bool Parameter::isInternal | ( | ) | const |
void Parameter::setModIndex | ( | int | i | ) |
References modIndex.
int Parameter::getModIndex | ( | ) | const |
References modIndex.
|
virtual |
|
virtual |
float Parameter::getProcValue | ( | ) |
References conversionFunction, and getUserValue().
|
virtual |
References conversionFunction, and getUserValue().
float Parameter::getUserValue | ( | ) | const |
Referenced by PluginButton::clicked(), SVGPluginButton::clicked(), getProcValue(), isOn(), PluginButton::PluginButton(), PluginComboBox::PluginComboBox(), PluginSlider::PluginSlider(), PluginSlider::sliderValueChanged(), SVGPluginButton::SVGPluginButton(), PluginButton::valueUpdated(), SVGPluginButton::valueUpdated(), PluginComboBox::valueUpdated(), and PluginSlider::valueUpdated().
float Parameter::getUserDefaultValue | ( | ) | const |
References defaultValue.
Referenced by PluginSlider::mouseDown().
|
virtual |
|
virtual |
void Parameter::setUserValueAsUserAction | ( | float | f | ) |
juce::String Parameter::getUserValueText | ( | ) | const |
References getText(), getValue(), and label.
Referenced by PluginButton::clicked(), SVGPluginButton::clicked(), PluginButton::PluginButton(), SVGPluginButton::SVGPluginButton(), PluginButton::valueUpdated(), and SVGPluginButton::valueUpdated().
juce::String Parameter::userValueToText | ( | float | val | ) |
References getText(), label, and range.
Referenced by PluginComboBox::PluginComboBox().
bool Parameter::isOnOff | ( | ) |
References range.
bool Parameter::isOn | ( | ) |
References getUserValue(), and range.
|
virtual |
void Parameter::beginUserAction | ( | ) |
void Parameter::beginUserTimedAction | ( | ) |
void Parameter::endUserAction | ( | ) |
juce::NormalisableRange<float> Parameter::getUserRange | ( | ) | const |
References range.
float Parameter::getUserRangeStart | ( | ) | const |
References range.
Referenced by PluginComboBox::comboBoxChanged(), PluginComboBox::PluginComboBox(), PluginSlider::PluginSlider(), and PluginComboBox::valueUpdated().
float Parameter::getUserRangeEnd | ( | ) | const |
References range.
Referenced by PluginComboBox::PluginComboBox(), and PluginSlider::PluginSlider().
void Parameter::addListener | ( | ParameterListener * | listener | ) |
void Parameter::removeListener | ( | ParameterListener * | listener | ) |
ParamState Parameter::getState | ( | ) |
void Parameter::setState | ( | const ParamState & | state | ) |
|
override |
References uid.
|
override |
Referenced by getBoolValue(), and getUserValueText().
bool Parameter::getBoolValue | ( | ) | const |
References getValue().
|
override |
|
override |
References defaultValue, and range.
|
override |
juce::String Parameter::getShortName | ( | ) | const |
References shortName.
Referenced by PluginButton::PluginButton(), and PluginSlider::PluginSlider().
|
override |
References label.
|
override |
|
override |
Referenced by getUserValueText(), and userValueToText().
|
override |
|
override |
|
override |
|
override |
float Parameter::getSkew | ( | ) |
References range.
bool Parameter::isSkewSymmetric | ( | ) |
References range.
|
overrideprotected |
|
overrideprotected |
|
protectedvirtual |
std::function<float (float)> Parameter::conversionFunction |
Referenced by getProcValue().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getModMatrix(), and setModMatrix().
|
protected |
Referenced by getModIndex(), and setModIndex().
|
protected |
Referenced by getUserValue(), getUserValueBool(), getUserValueInt(), and getValue().
|
protected |
Referenced by getDefaultValue(), and getUserDefaultValue().
|
protected |
Referenced by getParameterID(), and getUid().
|
protected |
|
protected |
Referenced by getShortName().
|
protected |
Referenced by getLabel(), getUserValueText(), and userValueToText().
|
protected |
|
protected |
|
protected |