A visual component that displays the current modulation amount applied to a slider parameter.
More...
#include <modulation_meter.h>
A visual component that displays the current modulation amount applied to a slider parameter.
The ModulationMeter shows how a parameter (represented by a SynthSlider) is modulated by one or more sources. It can display modulation in either a linear or rotary style, depending on the slider it is associated with. The meter updates dynamically based on the current modulation values (mono and poly outputs) and shows the modulated range of the parameter.
◆ ModulationMeter()
Constructs a ModulationMeter.
- Parameters
-
mono_total | A pointer to the mono modulation output associated with this parameter. |
poly_total | A pointer to the poly modulation output associated with this parameter. |
slider | The SynthSlider representing the parameter being modulated. |
quads | A pointer to an OpenGlMultiQuad used for rendering. |
index | The index of the quad within the OpenGlMultiQuad to update. |
◆ ~ModulationMeter()
ModulationMeter::~ModulationMeter |
( |
| ) |
|
|
virtual |
◆ destination()
Gets the destination slider that the meter is visualizing.
- Returns
- A pointer to the SynthSlider representing the parameter.
◆ getModPercent()
Gets the current modulation percentage.
- Returns
- A poly_float containing the modulation percentage values.
◆ isModulated()
bool ModulationMeter::isModulated |
( |
| ) |
const |
|
inline |
Checks whether there are any modulations on the associated parameter.
- Returns
- True if the parameter is modulated, false otherwise.
◆ isRotary()
bool ModulationMeter::isRotary |
( |
| ) |
const |
|
inline |
Checks if the associated parameter control is a rotary knob.
- Returns
- True if rotary; false if linear or other type.
◆ resized()
void ModulationMeter::resized |
( |
| ) |
|
|
override |
Called when the component is resized.
Adjusts the vertices of the modulation meter to fit the new size and updates its state.
◆ setActive()
void ModulationMeter::setActive |
( |
bool | active | ) |
|
Sets whether the modulation meter is active (visible and updating).
- Parameters
-
active | True to activate, false to deactivate. |
◆ setAmountQuadVertices()
void ModulationMeter::setAmountQuadVertices |
( |
OpenGlQuad & | quad | ) |
|
Sets up the quad coordinates for the modulation amount indicator.
- Parameters
-
quad | The OpenGlQuad representing the modulation amount indicator. |
◆ setModulated()
void ModulationMeter::setModulated |
( |
bool | modulated | ) |
|
|
inline |
Sets the modulated state of the meter.
- Parameters
-
modulated | True if the parameter is modulated. |
◆ setModulationAmountQuad()
void ModulationMeter::setModulationAmountQuad |
( |
OpenGlQuad & | quad, |
|
|
float | amount, |
|
|
bool | bipolar ) |
Sets the given quad to represent a modulation amount line or arc.
- Parameters
-
quad | The OpenGlQuad to configure. |
amount | The amount of modulation to display (e.g., a fraction of a parameter's range). |
bipolar | If true, treat the amount as bipolar (centered), otherwise unipolar. |
◆ updateDrawing()
void ModulationMeter::updateDrawing |
( |
bool | use_poly | ) |
|
Updates the drawing of the modulation meter, recalculating mod percent and visuals.
- Parameters
-
use_poly | If true, includes poly outputs in the calculation; otherwise mono only. |
The documentation for this class was generated from the following files: