JUCE
Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
juce::ControlButton Class Referenceabstract

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

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
}
 These are all known types of control buttons. More...
 

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
 

Detailed Description

Represents a button on a block device.

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 

Constructor & Destructor Documentation

§ ControlButton()

juce::ControlButton::ControlButton ( Block )

§ ~ControlButton()

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

Destructor.

Member Function Documentation

§ getType()

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

Returns the button's type.

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

§ hasLight()

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

Returns true if this button has a controllable light.

§ setLightColour()

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

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

§ addListener()

void juce::ControlButton::addListener ( Listener )

§ removeListener()

void juce::ControlButton::removeListener ( Listener )

Member Data Documentation

§ block

Block& juce::ControlButton::block

§ listeners

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

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