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

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

#include <juce_ParameterAttachments.h>

Inheritance diagram for juce::ButtonParameterAttachment:
Collaboration diagram for juce::ButtonParameterAttachment:

Public Member Functions

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

Private Member Functions

void buttonClicked (Button *) override
 Called when the button is clicked. More...
 
virtual void buttonStateChanged (Button *)
 Called when the button's state changes. More...
 
void setValue (float newValue)
 

Private Attributes

ParameterAttachment attachment
 
Buttonbutton
 
bool ignoreCallbacks = false
 

Detailed Description

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

During the lifetime of this object it keeps the two things in sync, making it easy to connect a button to a parameter. When this object is deleted, the connection is broken. Make sure that your parameter and Button are not deleted before this object!

@tags{Audio}

Constructor & Destructor Documentation

◆ ButtonParameterAttachment()

juce::ButtonParameterAttachment::ButtonParameterAttachment ( RangedAudioParameter parameter,
Button button,
UndoManager undoManager = nullptr 
)

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

Parameters
parameterThe parameter to use
buttonThe Button to use
undoManagerAn optional UndoManager

◆ ~ButtonParameterAttachment()

juce::ButtonParameterAttachment::~ButtonParameterAttachment ( )
override

Destructor.

Member Function Documentation

◆ buttonClicked()

void juce::ButtonParameterAttachment::buttonClicked ( Button )
overrideprivatevirtual

Called when the button is clicked.

Implements juce::Button::Listener.

◆ buttonStateChanged()

virtual void juce::Button::Listener::buttonStateChanged ( Button )
inlinevirtualinherited

Called when the button's state changes.

◆ sendInitialUpdate()

void juce::ButtonParameterAttachment::sendInitialUpdate ( )

Call this after setting up your button in the case where you need to do extra setup after constructing this attachment.

◆ setValue()

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

Member Data Documentation

◆ attachment

ParameterAttachment juce::ButtonParameterAttachment::attachment
private

◆ button

Button& juce::ButtonParameterAttachment::button
private

◆ ignoreCallbacks

bool juce::ButtonParameterAttachment::ignoreCallbacks = false
private

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