Class Maestro

Class Documentation

class Maestro

Public Functions

Maestro(uint16_t rows, uint16_t columns, uint8_t num_sections = 1)

Constructor. Creates a Maestro with the designated dimensions and Section count.

Parameters
  • rows: Number of rows in the new Sections.

  • columns: Number of columns in the new Sections.

  • num_sections: Number of Sections to create.

Maestro(Section *sections, uint8_t num_sections)

Constructor. Creates the Maestro with the specified Sections.

Parameters
  • sections: Array of Sections to manage.

  • num_sections: Number of Sections in the array.

~Maestro()
CueController &get_cue_controller() const

Returns the active Cue controller.

Return

Cue controller.

Colors::RGB get_pixel_color(uint8_t section, uint16_t x, uint16_t y) const

Returns the color of the specified Pixel in the specified Section after applying post-processing.

Return

Pixel color after adjusting for Layers and brightness.

Parameters

uint8_t get_num_sections() const

Returns the number of Sections.

Return

Number of Sections.

Section *get_section(uint8_t section) const

Returns the Section at the specified index.

Return

Section at the specified index.

Parameters
  • section: Index of the Section to return.

Show *get_show() const

Returns the current Show.

Return

Active Show.

Timer &get_timer() const

Gets the Maestro’s update timer.

Return

Maestro timer.

void remove_sections()

Deletes the Sections array, if they were dynamically allocated.

void remove_show()

Deletes the active Show.

void set_brightness(uint8_t brightness)

Sets the global brightness level for all Sections simultaneously.

Parameters
  • brightness: Brightness level from 0 (off) to 255 (full).

CueController &set_cue_controller(uint16_t buffer_size = UINT8_MAX)

Sets a new Cue controller, or returns the current Controller if one is already set.

Return

New Cue controller.

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

void set_sections(Section *sections, uint8_t num_sections)

Sets the Sections used in the Maestro. If there are dynamically allocated Sections, they will be deleted.

Parameters
  • sections: Array of Sections.

  • num_sections: Number of Sections in the array.

Timer &set_timer(uint16_t interval)

Sets the interval between Maestro updates.

Return

Maestro timer.

Parameters
  • interval: Update interval.

Show &set_show(Event *events, uint16_t num_events)

Creates a new Show with the specified Event list. If a Show already exists, this updates the existing Show with the new Event list.

Return

New Show.

Parameters
  • events: Events used in the Show.

  • num_events: The number of Events.

void sync(const uint32_t &new_time = 0)

Sets each component’s last refresh time (including the Maestro itself).

Parameters
  • new_time: The new refresh time. Leave blank to set to 0.

bool update(const uint32_t &current_time, bool force = false)

Main update routine.

Return

True if the Maestro has changed.

Parameters
  • current_time: Current program runtime.

  • force: If true, bypass the refresh interval check and force the Maestro to update.