VCV Rack API v2
Loading...
Searching...
No Matches
rack::engine::SwitchQuantity Struct Reference
module NULL

#include <ParamQuantity.hpp>

Inheritance diagram for rack::engine::SwitchQuantity:
[legend]
Collaboration diagram for rack::engine::SwitchQuantity:
[legend]

Public Member Functions

std::string getDisplayValueString () override
 Returns a string representation of the display value.
 
void setDisplayValueString (std::string s) override
 Always sets immediate value.
 
- Public Member Functions inherited from rack::engine::ParamQuantity
ParamgetParam ()
 
void setValue (float value) override
 Sets the target value of the Engine's smoothing algorithm, or immediate value if smoothing is disabled.
 
float getValue () override
 Gets the Param's smoothing target value, or immediate value if smoothing is disabled.
 
void setImmediateValue (float value)
 Sets the Param's value immediately without smoothing.
 
float getImmediateValue ()
 Gets the Param's value post-smoothing.
 
float getMinValue () override
 Returns the minimum recommended value.
 
float getMaxValue () override
 Returns the maximum recommended value.
 
float getDefaultValue () override
 Returns the default value, for resetting.
 
float getDisplayValue () override
 Returns the value, transformed for displaying.
 
void setDisplayValue (float displayValue) override
 Always sets immediate value.
 
int getDisplayPrecision () override
 The number of total decimal places for generating the display value string.
 
std::string getLabel () override
 The name of the quantity.
 
std::string getUnit () override
 The unit abbreviation of the quantity.
 
void reset () override
 Resets the value to the default value.
 
void randomize () override
 Sets the value to a uniform random value between the bounds.
 
virtual std::string getDescription ()
 
virtual json_t * toJson ()
 
virtual void fromJson (json_t *rootJ)
 
DEPRECATED void setSmoothValue (float value)
 Deprecated.
 
DEPRECATED float getSmoothValue ()
 Deprecated.
 
- Public Member Functions inherited from rack::Quantity
virtual ~Quantity ()
 
virtual std::string getString ()
 Returns a string representation of the quantity.
 
bool isMin ()
 Checks whether the value is at the min value.
 
bool isMax ()
 Checks whether the value is at the max value.
 
void setMin ()
 Sets the value to the min value.
 
void setMax ()
 Sets the value to the max value.
 
void toggle ()
 Sets the value to max if the current value is min, otherwise sets the value to min.
 
void moveValue (float deltaValue)
 Adds an amount to the value.
 
float getRange ()
 The difference between the max and min values.
 
bool isBounded ()
 Checks whether the bounds are finite.
 
float toScaled (float value)
 Transforms a value to the range 0 to 1.
 
float fromScaled (float scaledValue)
 Transforms a value from the range 0 to 1.
 
void setScaledValue (float scaledValue)
 Sets value from the range 0 to 1.
 
float getScaledValue ()
 Returns the value scaled to the range 0 to 1.
 
void moveScaledValue (float deltaScaledValue)
 Adds an amount to the value scaled to the range 0 to 1.
 

Public Attributes

std::vector< std::string > labels
 
- Public Attributes inherited from rack::engine::ParamQuantity
int paramId = -1
 
float minValue = 0.f
 The minimum allowed value.
 
float maxValue = 1.f
 The maximum allowed value.
 
float defaultValue = 0.f
 The initial value.
 
std::string name
 The name of the parameter, using sentence capitalization.
 
std::string unit
 The numerical unit of measurement appended to the value.
 
float displayBase = 0.f
 Set to 0 for linear, positive for exponential, negative for logarithmic.
 
float displayMultiplier = 1.f
 
float displayOffset = 0.f
 
int displayPrecision = 5
 Number of digits of precision to display.
 
std::string description
 An optional one-sentence description of the parameter.
 
bool resetEnabled = true
 Enables parameter resetting when the module or parameter itself is reset.
 
bool randomizeEnabled = true
 Enables parameter randomization when the module is randomized.
 
bool smoothEnabled = false
 Enables per-sample Engine parameter smoothing when setSmoothValue() is called.
 
bool snapEnabled = false
 Rounds values to the nearest integer.
 

Member Function Documentation

◆ getDisplayValueString()

std::string rack::engine::SwitchQuantity::getDisplayValueString ( )
overridevirtual

Returns a string representation of the display value.

Reimplemented from rack::engine::ParamQuantity.

◆ setDisplayValueString()

void rack::engine::SwitchQuantity::setDisplayValueString ( std::string s)
overridevirtual

Always sets immediate value.

Reimplemented from rack::engine::ParamQuantity.

Member Data Documentation

◆ labels

std::vector<std::string> rack::engine::SwitchQuantity::labels

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