LMMS
Loading...
Searching...
No Matches
juce::ButtonParameterAttachment Class Reference

#include <juce_ParameterAttachments.h>

Inheritance diagram for juce::ButtonParameterAttachment:
juce::Button::Listener

Public Member Functions

 ButtonParameterAttachment (RangedAudioParameter &parameter, Button &button, UndoManager *undoManager=nullptr)
 ~ButtonParameterAttachment () override
void sendInitialUpdate ()

Private Member Functions

void setValue (float newValue)
void buttonClicked (Button *) override
Private Member Functions inherited from juce::Button::Listener
virtual ~Listener ()=default
virtual void buttonStateChanged (Button *)

Private Attributes

Buttonbutton
ParameterAttachment attachment
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.

◆ 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 files: