Class CueHandler

Inheritance Relationships

Derived Types

Class Documentation

class CueHandler

Subclassed by PixelMaestro::AnimationCueHandler, PixelMaestro::CanvasCueHandler, PixelMaestro::MaestroCueHandler, PixelMaestro::SectionCueHandler, PixelMaestro::ShowCueHandler

Public Functions

CueHandler(CueController &controller)

Constructor.

Parameters

virtual ~CueHandler()
virtual void run(uint8_t *cue) = 0

Protected Functions

void add_float_to_cue(uint32_t &index, float value)

Inserts a float into a Cue.

Parameters
  • index: Last position in the Cue.

  • value: Float to insert.

void add_uint16_to_cue(uint32_t &index, uint16_t value)

Inserts a 16-bit integer into a Cue.

Parameters
  • index: Last position in the Cue.

  • value: 16-bit integer to insert.

void add_uint32_to_cue(uint32_t &index, uint32_t value)

Inserts a 32-bit integer into a Cue.

Parameters
  • index: Last position in the Cue.

  • value: 32-bit integer to insert.

Section *get_section(uint8_t section_id, uint8_t layer_id) const

Returns the Section/Layer corresponding to the given Section ID and Layer level.

Return

Matching Section/Layer or nullptr if not found.

Parameters
  • section: Index of the Section in the Maestro.

  • layer: Layer depth level.

Palette *deserialize_palette(const uint8_t *cue, uint8_t num_colors)

Extracts a Palette from a Cue.

Return

The New Palette.

Parameters
  • cue: The Cue starting at the Palette’s address.

  • num_colors: The number of colors in the Palette.

uint16_t serialize_palette(uint8_t cue[], const Palette &palette)

Serializes a Palette into a Cue.

Return

Index in the Cue immediately after the Palette.

Parameters
  • cue: The address in the Cue where the Palette will be written.

  • palette: The Palette to store.

uint32_t start_cue(uint8_t handler_byte, uint8_t action_byte)

Assembles the first part of a Cue.

Return

The current index in the Cue.

Parameters
  • handler_byte: The CueHandler that the Cue belongs to.

  • action_byte: The action being performed.

uint32_t start_cue(uint8_t handler_byte, uint8_t action_byte, uint8_t section_num, uint8_t layer_num)

Assembles the first part of a Cue.

Return

The current index in the Cue.

Parameters
  • handler_byte: The CueHandler that the Cue belongs to.

  • action_byte: The action being performed.

  • section_num: The ID of the affected Section.

  • layer_num: The ID of the affected Layer.

Protected Attributes

CueController &controller_

The controller managing this Handler.