Runtime

The runtime of a plugin is comprised of three parts. Initialize -> Render Loop -> Shutdown

The only exception to this pattern is the use of on*Change Callbacks which are processed at the start of a frame prior to the render function being called.

"Initialize"

Initialize runs once when a device is [re]connected to, and anytime the streaming toggle is enabled in the device's config page. You'll want to handle any initial start up tasks here.

  • Note: if the device has any conflicting processes running initialization will wait until they are closed, or the user bypasses the check.
Javascript
Copy

Render Loop

The Render Loop is the core of the plugin and is where color changes and other runtime functions are handled.

The process of each frame is as follows:

  1. User Settings are updated for the frame
  2. Colors are grabbed for the device and sub devices pixel buffers
  3. on*Change Callbacks are called in order
  4. Render is called
  • Note: The default time between frames is 30ms
Javascript
Copy

"Shutdown"

Shutdown is called when SignalRGB exits gracefully, and whenever the streaming toggle is disabled in the device config page. You'll want to return the device to its hardware mode here if needed.

Javascript
Copy

on*Changed Callbacks

These functions get called whenever a User Control is changed. These trigger just before the Render() function is called in the order they occurred in.

  • Note: Their naming must be as follows: "on[User Control property name]Changed()". This is case sensitive.
Javascript
Copy

Built in Callbacks are as Follows:

Function NameDescription
onBrightnessChanged()Triggers when the device's main brightness slider is moved.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard