Class CueController

Nested Relationships

Class Documentation

class CueController

Public Types

enum Byte

Common bit indices for each Cue.

Values:

IDByte1
IDByte2
IDByte3
ChecksumByte
SizeByte1
SizeByte2
SizeByte3
SizeByte4
PayloadByte
enum Handler

The different handlers available for running Cues.

Values:

AnimationCueHandler
CanvasCueHandler
MaestroCueHandler
SectionCueHandler
ShowCueHandler

Public Functions

CueController(Maestro &maestro, uint32_t buffer_size = UINT8_MAX)

Constructor.

Parameters
  • maestro: Maestro that processed Cues will run on.

  • buffer_size: The size of the Cue buffer (defaults to 256).

~CueController()
uint8_t *assemble(uint32_t payload_size)

Prepares the Cue for transport by adding header info.

Return

Assembled Cue.

Parameters
  • payload_size: The size of the payload.

uint8_t checksum(const uint8_t *cue, uint32_t cue_size)

Generates a checksum for verifying the integrity of a Cue. Calculated by summing each byte in the Cue, diving by 256, and taking the remainder.

Return

New checksum.

Parameters
  • cue: The contents of the Cue.

  • cue_size: The size of the Cue.

CueHandler &enable_animation_cue_handler()

Enables the Animation CueHandler.

Return

New handler.

CueHandler &enable_canvas_cue_handler()

Enables the Canvas CueHandler.

Return

New handler.

CueHandler &enable_maestro_cue_handler()

Enables the Maestro CueHandler.

Return

New handler.

CueHandler &enable_section_cue_handler()

Enables the Section CueHandler.

Return

New handler.

CueHandler &enable_show_cue_handler()

Enables the Show CueHandler.

Return

New handler.

uint8_t *get_buffer() const

Returns the currently cached Cue.

Return

Cue buffer.

uint32_t get_cue_size() const

Returns the size of the currently cached Cue.

Return

Cue size.

uint32_t get_cue_size(uint8_t *cue) const

Returns the size of the specified Cue.

Return

Cue size.

Parameters
  • cue: Cue to measure.

CueHandler *get_handler(Handler handler) const

Returns the instance of the specified Handler.

Return

Handler instance.

Parameters
  • handler: Handler to get.

Maestro &get_maestro() const

Returns the controller’s Maestro.

Return

Maestro controlling this CueController.

bool is_blocked(const uint8_t *cue) const

Checks whether the Cue is blocked according to the block list.

Return

True if blocked.

Parameters
  • cue: Cue to check.

bool read(uint8_t byte)

Reads a Cue byte-by-byte into the buffer. Once the end of the Cue has been reached, the Cue runs and the reader resets for the next Cue.

Return

True if the Cue was successfully executed.

Parameters
  • byte: Byte to read into the buffer.

void run()

Runs the currently loaded Cue.

void run(uint8_t *cue)

Validates and runs the specified Cue.

Parameters
  • cue: Cue to load.

void set_blocked_cues(BlockedCue *blocks, uint8_t num_blocks)

Sets the Cue block list.

Parameters
  • blocks: Block list as an array of BlockedCues.

  • num_blocks: Number of items in the array.

bool validate_header(uint8_t *cue)

Validates the header and checksum of the provided Cue.

Return

True if valid, false if not.

Parameters
  • cue: Cue to validate.

struct BlockedCue

Defines a Cue that should be blocked from serialization.

Public Functions

BlockedCue(Handler handler, uint8_t action)

Public Members

Handler handler

The Handler that this Cue belongs to.

uint8_t action

The action being performed.