blip  0.1
LEDArray Class Reference

A class representing an LED array. More...

#include <LEDArray.hpp>

Public Member Functions

 ~LEDArray ()
 Destructor. More...
 
uint_t getCount () const
 Get the number of LEDs in the LED array. More...
 
uint_t getPrimaryIndex () const
 Get the index of the primary LED. More...
 
uint32_t getColorSupportMask () const
 Get a bitmask that indicates which LEDs support changing of their colors. More...
 
bool supportsColor (uint_t index) const
 Test if the LED with the given index supports changing of its color. More...
 
void setActivated (uint_t index, bool activated)
 Activate or deactivate the LED with the given index. More...
 
bool isActivated (uint_t index)
 Test if the LED with the given index is activated. More...
 
void setActivatedMask (uint32_t mask)
 Specify which LEDs should be enabled and disabled via a bitmask. More...
 
uint32_t getActivatedMask ()
 Get a bitmask which indicates which LEDs are activated and which are deactivated. More...
 
void setColor (uint_t index, const Color &color)
 Set the color of the LED with the given index. More...
 
Color getColor (uint_t index)
 Get the color of the LED with the given index. More...
 

Detailed Description

A class representing an LED array.

Instances of this class may be obtained from an AudioEngine.

NOTE: As of Android platform version 9, the OpenSL implementation is missing LED array functionality.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ ~LEDArray()

~LEDArray ( )

Destructor.

Member Function Documentation

◆ getActivatedMask()

uint32_t getActivatedMask ( )

Get a bitmask which indicates which LEDs are activated and which are deactivated.

Returns
The bitmask, wherein 1 bits indicate which LEDs are activated and 0 bits indicate which are deactivated.
Exceptions
AudioExceptionIf an error occurs.

◆ getColor()

Color getColor ( uint_t  index)

Get the color of the LED with the given index.

Parameters
indexThe LED index.
Returns
The current color of the LED.
Exceptions
AudioExceptionIf an error occurs.

◆ getColorSupportMask()

uint32_t getColorSupportMask ( ) const
inline

Get a bitmask that indicates which LEDs support changing of their colors.

◆ getCount()

uint_t getCount ( ) const
inline

Get the number of LEDs in the LED array.

◆ getPrimaryIndex()

uint_t getPrimaryIndex ( ) const
inline

Get the index of the primary LED.

◆ isActivated()

bool isActivated ( uint_t  index)

Test if the LED with the given index is activated.

Parameters
indexThe LED index.
Returns
true if the LED is activated (turned on) or deactivated (turned off).
Exceptions
AudioExceptionIf an error occurs.

◆ setActivated()

void setActivated ( uint_t  index,
bool  activated 
)

Activate or deactivate the LED with the given index.

Parameters
indexThe LED index.
activatedA flag indicating whether the LED should be activated (turned on) or deactivated (turned off).
Exceptions
AudioExceptionIf an error occurs.

◆ setActivatedMask()

void setActivatedMask ( uint32_t  mask)

Specify which LEDs should be enabled and disabled via a bitmask.

Parameters
maskThe bitmask, wherein 1 bits indicate which LEDs should be activated and 0 bits indicate which should be deactivated.
Exceptions
AudioExceptionIf an error occurs.

◆ setColor()

void setColor ( uint_t  index,
const Color color 
)

Set the color of the LED with the given index.

Parameters
indexThe LED index.
colorThe new color. The hardware will select the closest possible color.
Exceptions
AudioExceptionIf an error occurs.

◆ supportsColor()

bool supportsColor ( uint_t  index) const

Test if the LED with the given index supports changing of its color.


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