Vital
Loading...
Searching...
No Matches
ModulationMeter Class Reference

A visual component that displays the current modulation amount applied to a slider parameter. More...

#include <modulation_meter.h>

Inheritance diagram for ModulationMeter:

Public Member Functions

 ModulationMeter (const vital::Output *mono_total, const vital::Output *poly_total, const SynthSlider *slider, OpenGlMultiQuad *quads, int index)
 Constructs a ModulationMeter.
 
virtual ~ModulationMeter ()
 Destructor.
 
void resized () override
 Called when the component is resized.
 
void setActive (bool active)
 Sets whether the modulation meter is active (visible and updating).
 
void updateDrawing (bool use_poly)
 Updates the drawing of the modulation meter, recalculating mod percent and visuals.
 
void setModulationAmountQuad (OpenGlQuad &quad, float amount, bool bipolar)
 Sets the given quad to represent a modulation amount line or arc.
 
void setAmountQuadVertices (OpenGlQuad &quad)
 Sets up the quad coordinates for the modulation amount indicator.
 
bool isModulated () const
 Checks whether there are any modulations on the associated parameter.
 
bool isRotary () const
 Checks if the associated parameter control is a rotary knob.
 
void setModulated (bool modulated)
 Sets the modulated state of the meter.
 
vital::poly_float getModPercent ()
 Gets the current modulation percentage.
 
const SynthSliderdestination ()
 Gets the destination slider that the meter is visualizing.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ModulationMeter()

ModulationMeter::ModulationMeter ( const vital::Output * mono_total,
const vital::Output * poly_total,
const SynthSlider * slider,
OpenGlMultiQuad * quads,
int index )

Constructs a ModulationMeter.

Parameters
mono_totalA pointer to the mono modulation output associated with this parameter.
poly_totalA pointer to the poly modulation output associated with this parameter.
sliderThe SynthSlider representing the parameter being modulated.
quadsA pointer to an OpenGlMultiQuad used for rendering.
indexThe index of the quad within the OpenGlMultiQuad to update.

◆ ~ModulationMeter()

ModulationMeter::~ModulationMeter ( )
virtual

Destructor.

Member Function Documentation

◆ destination()

const SynthSlider * ModulationMeter::destination ( )
inline

Gets the destination slider that the meter is visualizing.

Returns
A pointer to the SynthSlider representing the parameter.

◆ getModPercent()

vital::poly_float ModulationMeter::getModPercent ( )
inline

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
activeTrue to activate, false to deactivate.

◆ setAmountQuadVertices()

void ModulationMeter::setAmountQuadVertices ( OpenGlQuad & quad)

Sets up the quad coordinates for the modulation amount indicator.

Parameters
quadThe OpenGlQuad representing the modulation amount indicator.

◆ setModulated()

void ModulationMeter::setModulated ( bool modulated)
inline

Sets the modulated state of the meter.

Parameters
modulatedTrue 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
quadThe OpenGlQuad to configure.
amountThe amount of modulation to display (e.g., a fraction of a parameter's range).
bipolarIf 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_polyIf true, includes poly outputs in the calculation; otherwise mono only.

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