Internal Kwidget parameter that can receive changes from a GenericParameter.
More...
#include <KParameter.h>
Internal Kwidget parameter that can receive changes from a GenericParameter.
KParameter is designed to be an audio parameter that is owned internally by a Kwidget, and can be assigned to an external or DAW-facing parameter to control the audio produced by that Kwidget.
KParameter works in tandem with GenericParameter to allow the ability to route external parameters to different internal parameters at runtime.
- See also
- GenericParameter
◆ KParameter()
| krotos::KParameter::KParameter |
( |
const String & | parameterID, |
|
|
const String & | parameterName, |
|
|
const NormalisableRange< float > & | normalisableRange, |
|
|
float | defaultValue, |
|
|
const String & | parameterLabel = String(), |
|
|
std::function< String(float value, int maximumStringLength)> | stringFromValue = nullptr, |
|
|
std::function< float(const String &text)> | valueFromString = nullptr ) |
◆ attach()
◆ detach()
| void krotos::KParameter::detach |
( |
| ) |
|
◆ get()
| float krotos::KParameter::get |
( |
| ) |
const |
Returns the current denormalised parameter value.
◆ getAttachedParameter()
◆ getDefaultValue()
| float krotos::KParameter::getDefaultValue |
( |
| ) |
const |
|
overrideprivate |
◆ getNormalisableRange()
| const NormalisableRange< float > & krotos::KParameter::getNormalisableRange |
( |
| ) |
const |
|
override |
Get this parameter's range.
◆ getText()
| String krotos::KParameter::getText |
( |
float | value, |
|
|
int | length ) const |
|
overrideprivate |
◆ getValue()
| float krotos::KParameter::getValue |
( |
| ) |
const |
|
override |
Returns the current normalised parameter value.
◆ getValueForText()
| float krotos::KParameter::getValueForText |
( |
const String & | text | ) |
const |
|
overrideprivate |
◆ isOn()
| bool krotos::KParameter::isOn |
( |
| ) |
const |
Helper function for "boolean" parameters. Returns true if the normalised value is > 0.5
◆ notifyListeners()
| void krotos::KParameter::notifyListeners |
( |
| ) |
|
Calls the parameter's ValueChanged listeners with the current value.
◆ parameterGestureChanged()
| void krotos::KParameter::parameterGestureChanged |
( |
int | , |
|
|
bool | ) |
|
inlineoverride |
◆ parameterValueChanged()
| void krotos::KParameter::parameterValueChanged |
( |
int | , |
|
|
float | newValue ) |
|
override |
◆ set()
| void krotos::KParameter::set |
( |
float | newValue | ) |
|
Sets the current denormalised parameter value, and sends a notification.
◆ setValue()
| void krotos::KParameter::setValue |
( |
float | newValue | ) |
|
|
overrideprivate |
◆ GenericParameter
◆ m_attachedParameter
◆ m_defaultValue
| const float krotos::KParameter::m_defaultValue |
|
private |
◆ m_normalisedValue
| std::atomic<float> krotos::KParameter::m_normalisedValue |
|
private |
◆ m_range
| NormalisableRange<float> krotos::KParameter::m_range |
|
private |
◆ m_stringFromValueFunction
| std::function<String(float, int)> krotos::KParameter::m_stringFromValueFunction |
|
private |
◆ m_value
| std::atomic<float> krotos::KParameter::m_value |
|
private |
◆ m_valueFromStringFunction
| std::function<float(const String&)> krotos::KParameter::m_valueFromStringFunction |
|
private |
The documentation for this class was generated from the following files: