An object of this class maintains a connection between a Slider and a plug-in parameter. More...
#include <juce_ParameterAttachments.h>
Public Member Functions | |
SliderParameterAttachment (RangedAudioParameter ¶meter, Slider &slider, UndoManager *undoManager=nullptr) | |
Creates a connection between a plug-in parameter and a Slider. More... | |
~SliderParameterAttachment () override | |
Destructor. More... | |
void | sendInitialUpdate () |
Call this after setting up your slider in the case where you need to do extra setup after constructing this attachment. More... | |
Private Member Functions | |
void | setValue (float newValue) |
void | sliderDragEnded (Slider *) override |
Called after a drag operation has finished. More... | |
void | sliderDragStarted (Slider *) override |
Called when the slider is about to be dragged. More... | |
void | sliderValueChanged (Slider *) override |
Called when the slider's value is changed. More... | |
Private Attributes | |
ParameterAttachment | attachment |
bool | ignoreCallbacks = false |
Slider & | slider |
An object of this class maintains a connection between a Slider and a plug-in parameter.
During the lifetime of this object it keeps the two things in sync, making it easy to connect a slider to a parameter. When this object is deleted, the connection is broken. Make sure that your parameter and Slider are not deleted before this object!
@tags{Audio}
juce::SliderParameterAttachment::SliderParameterAttachment | ( | RangedAudioParameter & | parameter, |
Slider & | slider, | ||
UndoManager * | undoManager = nullptr |
||
) |
Creates a connection between a plug-in parameter and a Slider.
parameter | The parameter to use |
slider | The Slider to use |
undoManager | An optional UndoManager |
|
override |
Destructor.
void juce::SliderParameterAttachment::sendInitialUpdate | ( | ) |
Call this after setting up your slider in the case where you need to do extra setup after constructing this attachment.
|
private |
|
inlineoverrideprivatevirtual |
Called after a drag operation has finished.
Reimplemented from juce::Slider::Listener.
References attachment, and juce::ParameterAttachment::endGesture().
|
inlineoverrideprivatevirtual |
Called when the slider is about to be dragged.
This is called when a drag begins, then it's followed by multiple calls to sliderValueChanged(), and then sliderDragEnded() is called after the user lets go.
Reimplemented from juce::Slider::Listener.
References attachment, and juce::ParameterAttachment::beginGesture().
|
overrideprivatevirtual |
Called when the slider's value is changed.
This may be caused by dragging it, or by typing in its text entry box, or by a call to Slider::setValue().
You can find out the new value using Slider::getValue().
Implements juce::Slider::Listener.
|
private |
Referenced by sliderDragEnded(), and sliderDragStarted().
|
private |
|
private |