Skip to content

Cue properties

Everything a script reaches through this, by cue type. Each property is this.<name>.get(), and this.<name>.set(value) when it is writable — a read-only property has no set at all.

Writes are live: they change the cue that is playing, never the saved show. Editing the same field in the inspector while the cue is on air overwrites what the script set, because the engine then pushes the stored value back onto it.

Every cue type

PropertyAccessTypeMeaning
durationgetnumber | nullLength in seconds. null when the cue never ends on its own.
levelget / setnumberPlayback level, 0 to 1 — volume for a sound, opacity for a picture. Setting it is a fade of no length, the same path the inspector’s slider takes. Only on the types marked below.

level is there for: audio, image, video, text, html, youtube, webcam, visio, screen. The control and group cues have no level of their own.

audio

PropertyAccessTypeMeaning
pangetnumberStereo position, -1 left to 1 right. Read-only: the pan node is built into the audio graph when the cue starts.

Plus duration and level.

function onTick() {
    // Duck to a quarter after ten seconds.
    if (time > 10) this.level.set(0.25);
}

image

PropertyAccessTypeMeaning
tintget / setstring | nullColour laid over the picture; null for none
brightnessget / setnumber1 = untouched
contrastget / setnumber1 = untouched
saturationget / setnumber1 = untouched, 0 = greyscale
mirrorXget / setbooleanFlip horizontally
mirrorYget / setbooleanFlip vertically

Plus duration and level.

video

The same six as image, plus:

PropertyAccessTypeMeaning
audioLevelget / setnumberVolume of the video’s own sound, 0 to 1

Plus duration and level.

text

PropertyAccessTypeMeaning
textget / setstringThe words on screen
fontFamilyget / setstring | nullFont family name; null for the default
fontSizeget / setnumberSize in pixels at the output’s own resolution
textColorget / setstringAny CSS colour
alignget / setstringleft, center or right
valignget / setstringtop, middle or bottom
offsetXget / setnumberHorizontal offset, as a fraction of the output width
offsetYget / setnumberVertical offset, as a fraction of the output height
tintget / setstring | nullColour laid over the text
brightnessget / setnumber1 = untouched
contrastget / setnumber1 = untouched
saturationget / setnumber1 = untouched

Plus duration and level.

const names = ['ANNA', 'BERT', 'CLARE'];

function onStart() {
    every({ interval: 2, delay: 0 }, function (index) {
        this.text.set(names[index % names.length]);
    });
}

html

PropertyAccessTypeMeaning
tintget / setstring | nullColour laid over the page
brightnessget / setnumber1 = untouched
contrastget / setnumber1 = untouched
saturationget / setnumber1 = untouched
audioLevelget / setnumberVolume of the page’s sound, 0 to 1

Plus duration and level.

visio and screen

PropertyAccessTypeMeaning
tintget / setstring | nullColour laid over the picture
brightnessget / setnumber1 = untouched
contrastget / setnumber1 = untouched
saturationget / setnumber1 = untouched
audioLevelget / setnumberVolume of the guest’s microphone, 0 to 1

Plus duration and level.

webcam

PropertyAccessTypeMeaning
audioLevelget / setnumberVolume of the camera’s microphone, 0 to 1

Plus duration and level. A camera feed is not colour-corrected, so it has no tint / brightness / contrast / saturation.

youtube

PropertyAccessTypeMeaning
audioLevelget / setnumberVolume of the video, 0 to 1

Plus duration and level. The picture lives in a cross-origin iframe that cannot be filtered, so there are no colour properties.

playlist

PropertyAccessTypeMeaning
indexgetnumberItem playing, counting from 1; 0 between items
countgetnumberHow many items the playlist plays in a pass
passgetnumberPass in flight, counting from 1

Plus duration. Read-only: which item plays is the playlist’s own business.

function onTick() {
    if (this.index.get() === this.count.get()) {
        log.info('last item of pass', this.pass.get());
    }
}

Everything else

multilaunch, fade, fadeall, start, stop, stopall, loadshow, osc, midi, mqtt and http expose duration and nothing more. The message cues are fire-and-forget: by the time a script could touch a field, the message has been sent.

Not exposed, on purpose

  • inputRect (the source sub-rect of a visual cue) is an object rather than a single value, and handing scripts a shape means committing to it.
  • Anything the inspector stores but playback cannot change mid-run — a cue’s file, its output routing, its loop settings. Changing those means restarting the cue, which a script can already ask for by other means.

Adding one

Properties come from two passes, in src/lib/engine-v2/scriptable-properties.ts:

  1. baseScriptableProperties — what any cue has (duration, and level when the runner reports one).
  2. the cue’s runner, through getScriptableProperties(cue, ctx), for what only that type knows about. A runner that returns a name the base pass already used replaces it.

A property declares a name, a one-line description (which is what the editor shows beside it), a read(running, ctx), and optionally a write(running, ctx, value). Leave write out and the property is read-only everywhere, including in the editor’s proposals.