JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ControlButton Class Referenceabstract

Represents a button on a block device. More...

#include <juce_ControlButton.h>

Collaboration diagram for juce::ControlButton:

Classes

struct  Listener
 A listener that can be attached to a ControlButton object so that it gets called when the button is pushed or released. More...
 

Public Types

enum  ButtonFunction {
  mode,
  volume,
  up,
  down,
  scale,
  chord,
  arp,
  sustain,
  octave,
  love,
  click,
  snap,
  back,
  playOrPause,
  record,
  learn,
  button0,
  button1,
  button2,
  button3,
  button4,
  button5,
  button6,
  button7,
  velocitySensitivity,
  glideSensitivity,
  slideSensitivity,
  pressSensitivity,
  liftSensitivity,
  fixedVelocity,
  glideLock,
  pianoMode
}
 These are all known types of control buttons. More...
 

Public Member Functions

 ControlButton (Block &)
 
virtual ~ControlButton ()
 Destructor. More...
 
void addListener (Listener *)
 Adds a listener to the control button. More...
 
virtual juce::String getName () const =0
 Returns the button's description. More...
 
virtual float getPositionX () const =0
 Returns the position of this button on the device, in device units. More...
 
virtual float getPositionY () const =0
 Returns the position of this button on the device, in device units. More...
 
virtual ButtonFunction getType () const =0
 Returns the button's type. More...
 
virtual bool hasLight () const =0
 Returns true if this button has a controllable light. More...
 
void removeListener (Listener *)
 Removes a listener from the control button. More...
 
virtual bool setLightColour (LEDColour newColour)=0
 If the button can light-up, this sets its colour. More...
 

Public Attributes

Blockblock
 The control block that this button belongs to. More...
 

Protected Attributes

juce::ListenerList< Listenerlisteners
 

Detailed Description

Represents a button on a block device.

{Blocks}

Member Enumeration Documentation

◆ ButtonFunction

These are all known types of control buttons.

You can find out which buttons a device has by calling getButtons(), and can get the name of a button type with getButtonName().

Enumerator
mode 

The side button on a lightpad block and the first button on a live/loop block.

volume 

The volume button on a live/loop block.

up 

The up button on a control block.

down 

The down button on a control block.

scale 

The scale button on a live block.

chord 

The chord button on a live block.

arp 

The arp button on a live block.

sustain 

The sustain button on a live block.

octave 

The octave button on a live block.

love 

The love button on a live block.

click 

The click button on a loop block.

snap 

The snap button on a loop block.

back 

The back button on a loop block.

playOrPause 

The play or pause button on a loop block.

record 

The record button on a loop block.

learn 

The learn button on a loop block.

button0 

Button 0 on a developer block.

button1 

Button 1 on a developer block.

button2 

Button 2 on a developer block.

button3 

Button 3 on a developer block.

button4 

Button 4 on a developer block.

button5 

Button 5 on a developer block.

button6 

Button 6 on a developer block.

button7 

Button 7 on a developer block.

velocitySensitivity 

The velocity sensitivity button on a touch block.

glideSensitivity 

The glide sensitivity button on a touch block.

slideSensitivity 

The slide sensitivity button on a touch block.

pressSensitivity 

The press sensitivity button on a touch block.

liftSensitivity 

The lift sensitivity button on a touch block.

fixedVelocity 

The fixed velocity button on a touch block.

glideLock 

The glide lock button on a touch block.

pianoMode 

The piano mode button on a touch block.

Constructor & Destructor Documentation

◆ ControlButton()

juce::ControlButton::ControlButton ( Block )

◆ ~ControlButton()

virtual juce::ControlButton::~ControlButton ( )
virtual

Destructor.

Member Function Documentation

◆ addListener()

void juce::ControlButton::addListener ( Listener )

Adds a listener to the control button.

◆ getName()

virtual juce::String juce::ControlButton::getName ( ) const
pure virtual

Returns the button's description.

◆ getPositionX()

virtual float juce::ControlButton::getPositionX ( ) const
pure virtual

Returns the position of this button on the device, in device units.

For buttons that are on the side of the device, this may want to return a value that is beyond the phyiscal block size.

◆ getPositionY()

virtual float juce::ControlButton::getPositionY ( ) const
pure virtual

Returns the position of this button on the device, in device units.

For buttons that are on the side of the device, this may want to return a value that is beyond the phyiscal block size.

◆ getType()

virtual ButtonFunction juce::ControlButton::getType ( ) const
pure virtual

Returns the button's type.

◆ hasLight()

virtual bool juce::ControlButton::hasLight ( ) const
pure virtual

Returns true if this button has a controllable light.

◆ removeListener()

void juce::ControlButton::removeListener ( Listener )

Removes a listener from the control button.

◆ setLightColour()

virtual bool juce::ControlButton::setLightColour ( LEDColour  newColour)
pure virtual

If the button can light-up, this sets its colour.

Member Data Documentation

◆ block

Block& juce::ControlButton::block

The control block that this button belongs to.

◆ listeners

juce::ListenerList<Listener> juce::ControlButton::listeners
protected

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