JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::SliderParameterAttachment Class Reference

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

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

Called after a drag operation has finished.

See also
sliderDragStarted, Slider::stoppedDragging

Reimplemented from juce::Slider::Listener.

References attachment, and juce::ParameterAttachment::endGesture().

◆ sliderDragStarted()

void juce::SliderParameterAttachment::sliderDragStarted ( Slider )
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.

See also
sliderDragEnded, Slider::startedDragging

Reimplemented from juce::Slider::Listener.

References attachment, and juce::ParameterAttachment::beginGesture().

◆ sliderValueChanged()

void juce::SliderParameterAttachment::sliderValueChanged ( Slider slider)
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().

See also
Slider::valueChanged

Implements juce::Slider::Listener.

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: