A specialized OpenGlToggleButton with additional functionality for the Vital synth.
More...
#include <synth_button.h>
A specialized OpenGlToggleButton with additional functionality for the Vital synth.
This button supports MIDI learn operations and can display different text or behavior depending on whether it is toggled. It also notifies registered ButtonListeners of changes.
◆ MenuId
Possible menu IDs for popup operations.
Enumerator |
---|
kCancel | |
kArmMidiLearn | |
kClearMidiLearn | |
◆ SynthButton()
SynthButton::SynthButton |
( |
String | name | ) |
|
Constructor.
- Parameters
-
name | The name of the button, often tied to a parameter. |
SynthButton constructor.
- Parameters
-
name | The name associated with the button, often a parameter name. |
◆ addButtonListener()
Adds a button listener to be notified of changes.
- Parameters
-
Adds a listener to be notified of state changes.
- Parameters
-
◆ clicked()
virtual void SynthButton::clicked |
( |
| ) |
|
|
inlineoverridevirtual |
Called when the button is clicked.
◆ getStringLookup()
const std::string * SynthButton::getStringLookup |
( |
| ) |
const |
|
inline |
Gets the string lookup array.
- Returns
- The string lookup array set by setStringLookup().
◆ getTextFromValue()
String SynthButton::getTextFromValue |
( |
bool | on | ) |
|
Retrieves the text corresponding to the on/off state.
- Parameters
-
value | True for on, false for off. |
- Returns
- The corresponding text string.
Retrieves the text corresponding to the on/off state from the optional string lookup.
- Parameters
-
on | True for on, false for off. |
- Returns
- The corresponding text.
◆ handlePopupResult()
void SynthButton::handlePopupResult |
( |
int | result | ) |
|
Handles the result of the popup menu selection.
- Parameters
-
result | The selected menu ID. |
Handles the popup menu result.
- Parameters
-
result | The selected menu ID. |
◆ mouseDown()
void SynthButton::mouseDown |
( |
const MouseEvent & | e | ) |
|
|
overridevirtual |
Called when the mouse is pressed down on the button.
- Parameters
-
Called when the mouse is pressed down. Shows a popup menu if right-clicked, otherwise begins a parameter change gesture.
- Parameters
-
◆ mouseUp()
void SynthButton::mouseUp |
( |
const MouseEvent & | e | ) |
|
|
overridevirtual |
Called when the mouse is released from the button.
- Parameters
-
Called when the mouse is released. Ends a parameter change gesture if not a popup menu click.
- Parameters
-
◆ setStringLookup()
void SynthButton::setStringLookup |
( |
const std::string * | lookup | ) |
|
|
inline |
Sets a string lookup array for on/off text.
- Parameters
-
lookup | A pointer to an array of two std::string items: [offText, onText]. |
The documentation for this class was generated from the following files:
- /Users/davidvogel/repos/VitalHelp/src/interface/editor_components/synth_button.h
- /Users/davidvogel/repos/VitalHelp/src/interface/editor_components/synth_button.cpp