The BLOCKS SDK
ControlButton Class Referenceabstract

Description

Represents a button on a block device.

Public Member Functions

 ControlButton (Block &)
 
virtual ~ControlButton ()
 Destructor. More...
 
virtual ButtonFunction getType () const =0
 Returns the button's type. 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 bool hasLight () const =0
 Returns true if this button has a controllable light. More...
 
virtual bool setLightColour (LEDColour newColour)=0
 If the button can light-up, this sets its colour. More...
 
void addListener (Listener *)
 
void removeListener (Listener *)
 

Public Attributes

Blockblock
 

Protected Attributes

juce::ListenerList< Listenerlisteners
 

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

Constructor & Destructor Documentation

§ ControlButton()

ControlButton::ControlButton ( Block )

§ ~ControlButton()

virtual ControlButton::~ControlButton ( )
virtual

Destructor.

Member Function Documentation

§ getType()

virtual ButtonFunction ControlButton::getType ( ) const
pure virtual

Returns the button's type.

§ getName()

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

Returns the button's description.

§ getPositionX()

virtual float 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 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.

§ hasLight()

virtual bool ControlButton::hasLight ( ) const
pure virtual

Returns true if this button has a controllable light.

§ setLightColour()

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

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

§ addListener()

void ControlButton::addListener ( Listener )

§ removeListener()

void ControlButton::removeListener ( Listener )

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 
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 

Member Data Documentation

§ block

Block& ControlButton::block

§ listeners

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

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