VizDirector

class VizDirector(catalogue: List<Visualization>, seed: Long = Random.nextLong(), minimumHoldSeconds: Float = 8.0f)

Changes scenes only at a supported musical boundary. Tempo, elapsed time and energy-only flags cannot authorize a change. A seeded choice matches the scene to current energy.

The first drawing and the order of the changes come from seed, which is random unless one is given, so two runs open on different drawings and walk different sequences. Pass a seed to play a run back exactly.

Set maximumHoldSeconds to let a long wait change the drawing anyway, which a viewer-facing application usually wants; see that property for why.

Constructors

Link copied to clipboard
constructor(catalogue: List<Visualization>, seed: Long = Random.nextLong(), minimumHoldSeconds: Float = 8.0f)

Properties

Link copied to clipboard

True keeps every change to a plain fade, whatever a drawing offers.

Link copied to clipboard

True while incoming is on its way in.

Link copied to clipboard

What is on screen. Snapshot state, so a control that names the drawing follows the director.

Link copied to clipboard

What is arriving, while a change is under way.

Link copied to clipboard

Longest one drawing is held with no boundary at all, after which the next beat changes it.

Link copied to clipboard

Seconds until the next change, or -1 when it is not known.

Link copied to clipboard

A way of changing to use every time, or null to let the music decide.

Link copied to clipboard

How far through the change we are, 0 to 1.

Link copied to clipboard

How the change is being made.

Functions

Link copied to clipboard
fun advance(frame: SpectrumFrame, deltaSeconds: Float)

Moves it on by one frame. Call this once per drawn frame, before drawing.

Link copied to clipboard
fun show(visualization: Visualization)

Puts a chosen drawing on screen at once, as when someone picks one by hand.

Link copied to clipboard
fun startWith(name: String)

Starts on a named drawing, or the first one if the name is not in the list.