JUCE
Classes | Public Member Functions | Public Attributes | List of all members
LEDGrid Class Referenceabstract

Represents a 2D grid of LEDs on a block device. More...

Classes

struct  Program
 A program that can be loaded onto an LEDGrid. More...
 
struct  ProgramEventMessage
 A message that can be sent to the currently loaded program. More...
 
struct  Renderer
 

Public Member Functions

 LEDGrid (Block &)
 
virtual ~LEDGrid ()
 Destructor. More...
 
virtual int getNumColumns () const =0
 Returns the number of columns in the LED grid. More...
 
virtual int getNumRows () const =0
 Returns the number of rows in the LED grid. More...
 
virtual juce::Result setProgram (Program *)=0
 Sets the Program to run on this LEDGrid. More...
 
virtual ProgramgetProgram () const =0
 Returns a pointer to the currently loaded program. More...
 
virtual void sendProgramEvent (const ProgramEventMessage &)=0
 Sends a message to the currently loaded program. More...
 
virtual void setDataByte (size_t offset, uint8 value)=0
 Sets a single byte on the heap. More...
 
virtual void setDataBytes (size_t offset, const void *data, size_t num)=0
 Sets multiple bytes on the heap. More...
 
virtual void setDataBits (uint32 startBit, uint32 numBits, uint32 value)=0
 Sets multiple bits on the heap. More...
 
virtual uint8 getDataByte (size_t offset)=0
 Gets a byte from the heap. More...
 
void setRenderer (Renderer *newRenderer) noexcept
 Set the visualiser that will create visuals for this block (nullptr for none). More...
 
RenderergetRenderer () const noexcept
 Returns the visualiser currently attached to this block (nullptr for none). More...
 

Public Attributes

Blockblock
 The device that this LEDGrid belongs to. More...
 

Detailed Description

Represents a 2D grid of LEDs on a block device.

Constructor & Destructor Documentation

§ LEDGrid()

LEDGrid::LEDGrid ( Block )

§ ~LEDGrid()

virtual LEDGrid::~LEDGrid ( )
virtual

Destructor.

Member Function Documentation

§ getNumColumns()

virtual int LEDGrid::getNumColumns ( ) const
pure virtual

Returns the number of columns in the LED grid.

§ getNumRows()

virtual int LEDGrid::getNumRows ( ) const
pure virtual

Returns the number of rows in the LED grid.

§ setProgram()

virtual juce::Result LEDGrid::setProgram ( Program )
pure virtual

Sets the Program to run on this LEDGrid.

The supplied Program's lifetime will be managed by this class, so do not use the Program in other places in your code.

§ getProgram()

virtual Program* LEDGrid::getProgram ( ) const
pure virtual

Returns a pointer to the currently loaded program.

§ sendProgramEvent()

virtual void LEDGrid::sendProgramEvent ( const ProgramEventMessage )
pure virtual

Sends a message to the currently loaded program.

To receive the message the program must provide a function called handleMessage with the following form:

void handleMessage (int param1, int param2)
{
// Do something with the two integer parameters that the app has sent...
}

§ setDataByte()

virtual void LEDGrid::setDataByte ( size_t  offset,
uint8  value 
)
pure virtual

Sets a single byte on the heap.

§ setDataBytes()

virtual void LEDGrid::setDataBytes ( size_t  offset,
const void *  data,
size_t  num 
)
pure virtual

Sets multiple bytes on the heap.

§ setDataBits()

virtual void LEDGrid::setDataBits ( uint32  startBit,
uint32  numBits,
uint32  value 
)
pure virtual

Sets multiple bits on the heap.

§ getDataByte()

virtual uint8 LEDGrid::getDataByte ( size_t  offset)
pure virtual

Gets a byte from the heap.

§ setRenderer()

void LEDGrid::setRenderer ( Renderer newRenderer)
noexcept

Set the visualiser that will create visuals for this block (nullptr for none).

Note that the LEDGrid will NOT take ownership of this object, so the caller must ensure that it doesn't get deleted while in use here.

§ getRenderer()

Renderer* LEDGrid::getRenderer ( ) const
noexcept

Returns the visualiser currently attached to this block (nullptr for none).

Member Data Documentation

§ block

Block& LEDGrid::block

The device that this LEDGrid belongs to.


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