Gin
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ADSRComponent Class Reference

Interactive visual editor for ADSR envelope parameters. More...

#include <gin_adsrcomponent.h>

Inheritance diagram for ADSRComponent:

Public Member Functions

 ADSRComponent ()
 
 ~ADSRComponent () override=default
 
void setParams (Parameter::Ptr attack, Parameter::Ptr decay, Parameter::Ptr sustain, Parameter::Ptr release)
 
- Public Member Functions inherited from MultiParamComponent
 MultiParamComponent ()
 
 ~MultiParamComponent () override
 
juce::Colour dimIfNeeded (const juce::Colour &c)
 
- Public Member Functions inherited from Parameter::ParameterListener
virtual ~ParameterListener ()
 

Public Attributes

std::function< std::vector< std::pair< int, float > >()> phaseCallback
 

Additional Inherited Members

- Protected Member Functions inherited from MultiParamComponent
void showBubble (const juce::String &text, const juce::Rectangle< int > &rc)
 
void hideBubble ()
 
void watchParam (Parameter *p)
 
void unwatchParam (Parameter *p)
 
void unwatchParams ()
 
virtual void paramChanged ()
 
void enablementChanged () override
 
void valueUpdated (Parameter *) override
 
void handleAsyncUpdate () override
 
- Protected Attributes inherited from MultiParamComponent
juce::Array< Parameter * > params
 
std::unique_ptr< juce::BubbleMessageComponent > bubble
 

Detailed Description

Interactive visual editor for ADSR envelope parameters.

ADSRComponent provides an intuitive graphical interface for editing ADSR (Attack, Decay, Sustain, Release) envelope parameters. Users can drag handles to adjust the envelope shape, with real-time visual feedback and optional phase indication showing the current envelope position.

Key Features:

The component requires four parameters (attack, decay, sustain, release) and optionally accepts a callback to display current envelope phases for visual feedback during playback.

Usage:

adsrEditor.setBounds(0, 0, 300, 150);
// Optional: Show current envelope phases
adsrEditor.phaseCallback = [this]() {
std::vector<std::pair<int, float>> phases;
for (auto* voice : activeVoices)
return phases;
};
Interactive visual editor for ADSR envelope parameters.
Definition gin_adsrcomponent.h:47
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
See also
Parameter, MultiParamComponent, AnalogADSR

Constructor & Destructor Documentation

◆ ADSRComponent()

ADSRComponent::ADSRComponent ( )

◆ ~ADSRComponent()

ADSRComponent::~ADSRComponent ( )
overridedefault

Member Function Documentation

◆ setParams()

void ADSRComponent::setParams ( Parameter::Ptr  attack,
Parameter::Ptr  decay,
Parameter::Ptr  sustain,
Parameter::Ptr  release 
)

Member Data Documentation

◆ phaseCallback

std::function<std::vector<std::pair<int,float> >()> ADSRComponent::phaseCallback

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