ParameterHistory

class ParameterHistory(val bindings: ParameterBindings, val maxSteps: Int = 100, clock: () -> Double = { System.nanoTime() / 1E9 })(source)

The history of the changes to the values of bindings, for undo and redo. Changes that come in quick succession are one step: the changes of a drag of a control to the same parameter, and the changes that are made at once, like by ParameterBindings.randomize or ParameterBindings.load.

Parameters

maxSteps

the most steps that are kept

clock

the time in seconds, real time by default

Constructors

Link copied to clipboard
constructor(bindings: ParameterBindings, maxSteps: Int = 100, clock: () -> Double = { System.nanoTime() / 1E9 })

Properties

Link copied to clipboard

changes within this time from the start of a step are part of it, in seconds

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

changes to the same parameter within this time from the last change are part of its step, in seconds

Link copied to clipboard

Functions

Link copied to clipboard
fun clear()

forgets all steps

Link copied to clipboard
fun redo(): Boolean

redoes the last step that was undone, true when there was one

Link copied to clipboard
fun undo(): Boolean

undoes the last step, true when there was one