JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::SliderParameterAttachment Class Referenceabstract

An object of this class maintains a connection between a Slider and a plug-in parameter. More...

#include <juce_ParameterAttachments.h>

Inheritance diagram for juce::SliderParameterAttachment:
Collaboration diagram for juce::SliderParameterAttachment:

Public Member Functions

 SliderParameterAttachment (RangedAudioParameter &parameter, Slider &slider, UndoManager *undoManager=nullptr)
 Creates a connection between a plug-in parameter and a Slider.
 
 ~SliderParameterAttachment () override
 Destructor.
 
void sendInitialUpdate ()
 Call this after setting up your slider in the case where you need to do extra setup after constructing this attachment.
 

Private Member Functions

void setValue (float newValue)
 
virtual void sliderDragEnded (Emitter *)
 Called after a drag operation has finished.
 
void sliderDragEnded (Slider *) override
 
virtual void sliderDragStarted (Emitter *)
 Called when the slider is about to be dragged.
 
void sliderDragStarted (Slider *) override
 
virtual void sliderValueChanged (Emitter *)=0
 Called when the slider's value is changed.
 
void sliderValueChanged (Slider *) override
 

Private Attributes

ParameterAttachment attachment
 
bool ignoreCallbacks = false
 
Sliderslider
 

Detailed Description

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}

Constructor & Destructor Documentation

◆ SliderParameterAttachment()

juce::SliderParameterAttachment::SliderParameterAttachment ( RangedAudioParameter parameter,
Slider slider,
UndoManager undoManager = nullptr 
)

Creates a connection between a plug-in parameter and a Slider.

Parameters
parameterThe parameter to use
sliderThe Slider to use
undoManagerAn optional UndoManager

◆ ~SliderParameterAttachment()

juce::SliderParameterAttachment::~SliderParameterAttachment ( )
override

Destructor.

Member Function Documentation

◆ sendInitialUpdate()

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.

◆ setValue()

void juce::SliderParameterAttachment::setValue ( float  newValue)
private

◆ sliderDragEnded() [1/2]

template<typename Emitter >
virtual void juce::SliderListener< Emitter >::sliderDragEnded ( Emitter *  )
inlinevirtualinherited

Called after a drag operation has finished.

See also
sliderDragStarted, Slider::stoppedDragging

Reimplemented in juce::WebSliderParameterAttachment.

◆ sliderDragEnded() [2/2]

void juce::SliderParameterAttachment::sliderDragEnded ( Slider )
inlineoverrideprivate

◆ sliderDragStarted() [1/2]

template<typename Emitter >
virtual void juce::SliderListener< Emitter >::sliderDragStarted ( Emitter *  )
inlinevirtualinherited

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.

See also
sliderDragEnded, Slider::startedDragging

Reimplemented in juce::WebSliderParameterAttachment.

◆ sliderDragStarted() [2/2]

void juce::SliderParameterAttachment::sliderDragStarted ( Slider )
inlineoverrideprivate

◆ sliderValueChanged() [1/2]

template<typename Emitter >
virtual void juce::SliderListener< Emitter >::sliderValueChanged ( Emitter *  )
pure virtualinherited

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().

See also
Slider::valueChanged

Implemented in juce::WebSliderParameterAttachment.

◆ sliderValueChanged() [2/2]

void juce::SliderParameterAttachment::sliderValueChanged ( Slider )
overrideprivate

Member Data Documentation

◆ attachment

ParameterAttachment juce::SliderParameterAttachment::attachment
private

◆ ignoreCallbacks

bool juce::SliderParameterAttachment::ignoreCallbacks = false
private

◆ slider

Slider& juce::SliderParameterAttachment::slider
private

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