LMMS
Loading...
Searching...
No Matches
juce::ParameterListener Class Referenceabstract
Inheritance diagram for juce::ParameterListener:
juce::AudioProcessorParameter::Listener juce::AudioProcessorListener juce::Timer juce::ParameterComponent juce::BooleanParameterComponent juce::ChoiceParameterComponent juce::SliderParameterComponent juce::SwitchParameterComponent

Public Member Functions

 ParameterListener (AudioProcessor &proc, AudioProcessorParameter &param)
 ~ParameterListener () override
AudioProcessorParametergetParameter () const noexcept
virtual void handleNewParameterValue ()=0

Private Member Functions

void parameterValueChanged (int, float) override
void parameterGestureChanged (int, bool) override
void audioProcessorParameterChanged (AudioProcessor *, int index, float) override
void audioProcessorChanged (AudioProcessor *, const ChangeDetails &) override
void timerCallback () override
Private Member Functions inherited from juce::AudioProcessorParameter::Listener
virtual ~Listener ()=default
Private Member Functions inherited from juce::AudioProcessorListener
virtual ~AudioProcessorListener ()=default
virtual void audioProcessorParameterChangeGestureBegin (AudioProcessor *processor, int parameterIndex)
virtual void audioProcessorParameterChangeGestureEnd (AudioProcessor *processor, int parameterIndex)
Private Member Functions inherited from juce::Timer
virtual ~Timer ()
void startTimer (int intervalInMilliseconds) noexcept
void startTimerHz (int timerFrequencyHz) noexcept
void stopTimer () noexcept
bool isTimerRunning () const noexcept
int getTimerInterval () const noexcept
 Timer () noexcept
 Timer (const Timer &) noexcept

Private Attributes

AudioProcessorprocessor
AudioProcessorParameterparameter
Atomic< intparameterValueHasChanged { 0 }
const bool isLegacyParam

Additional Inherited Members

Static Private Member Functions inherited from juce::Timer
static void JUCE_CALLTYPE callAfterDelay (int milliseconds, std::function< void()> functionToCall)
static void JUCE_CALLTYPE callPendingTimersSynchronously ()

Constructor & Destructor Documentation

◆ ParameterListener()

juce::ParameterListener::ParameterListener ( AudioProcessor & proc,
AudioProcessorParameter & param )
inline

◆ ~ParameterListener()

juce::ParameterListener::~ParameterListener ( )
inlineoverride

Member Function Documentation

◆ audioProcessorChanged()

void juce::ParameterListener::audioProcessorChanged ( AudioProcessor * processor,
const ChangeDetails & details )
inlineoverrideprivatevirtual

Called to indicate that something else in the plugin has changed, like its program, number of parameters, etc.

IMPORTANT NOTE: This will be called synchronously, and many audio processors will call it during their audio callback. This means that not only has your handler code got to be completely thread-safe, but it's also got to be VERY fast, and avoid blocking. If you need to handle this event on your message thread, use this callback to trigger an AsyncUpdater or ChangeBroadcaster which you can respond to later on the message thread.

Implements juce::AudioProcessorListener.

◆ audioProcessorParameterChanged()

void juce::ParameterListener::audioProcessorParameterChanged ( AudioProcessor * processor,
int parameterIndex,
float newValue )
inlineoverrideprivatevirtual

Receives a callback when a parameter is changed.

IMPORTANT NOTE: This will be called synchronously when a parameter changes, and many audio processors will change their parameter during their audio callback. This means that not only has your handler code got to be completely thread-safe, but it's also got to be VERY fast, and avoid blocking. If you need to handle this event on your message thread, use this callback to trigger an AsyncUpdater or ChangeBroadcaster which you can respond to on the message thread.

Implements juce::AudioProcessorListener.

◆ getParameter()

AudioProcessorParameter & juce::ParameterListener::getParameter ( ) const
inlinenoexcept

◆ handleNewParameterValue()

virtual void juce::ParameterListener::handleNewParameterValue ( )
pure virtual

◆ parameterGestureChanged()

void juce::ParameterListener::parameterGestureChanged ( int parameterIndex,
bool gestureIsStarting )
inlineoverrideprivatevirtual

Indicates that a parameter change gesture has started.

E.g. if the user is dragging a slider, this would be called with gestureIsStarting being true when they first press the mouse button, and it will be called again with gestureIsStarting being false when they release it.

IMPORTANT NOTE: This will be called synchronously, and many audio processors will call it during their audio callback. This means that not only has your handler code got to be completely thread-safe, but it's also got to be VERY fast, and avoid blocking. If you need to handle this event on your message thread, use this callback to trigger an AsyncUpdater or ChangeBroadcaster which you can respond to later on the message thread.

Implements juce::AudioProcessorParameter::Listener.

◆ parameterValueChanged()

void juce::ParameterListener::parameterValueChanged ( int parameterIndex,
float newValue )
inlineoverrideprivatevirtual

Receives a callback when a parameter has been changed.

IMPORTANT NOTE: This will be called synchronously when a parameter changes, and many audio processors will change their parameter during their audio callback. This means that not only has your handler code got to be completely thread-safe, but it's also got to be VERY fast, and avoid blocking. If you need to handle this event on your message thread, use this callback to trigger an AsyncUpdater or ChangeBroadcaster which you can respond to on the message thread.

Implements juce::AudioProcessorParameter::Listener.

◆ timerCallback()

void juce::ParameterListener::timerCallback ( )
inlineoverrideprivatevirtual

The user-defined callback routine that actually gets called periodically.

It's perfectly ok to call startTimer() or stopTimer() from within this callback to change the subsequent intervals.

Implements juce::Timer.

Member Data Documentation

◆ isLegacyParam

const bool juce::ParameterListener::isLegacyParam
private

◆ parameter

AudioProcessorParameter& juce::ParameterListener::parameter
private

◆ parameterValueHasChanged

Atomic<int> juce::ParameterListener::parameterValueHasChanged { 0 }
private

◆ processor

AudioProcessor& juce::ParameterListener::processor
private

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