ParameterBindings
The parameters of objects, bound by labels: their values are read, set, randomized, saved and loaded by the label of an object and the name of a parameter. This is what a GUI shows, without a GUI: programs that run without one, and other front ends, like remote controls or MIDI controllers, use it in the same way.
Objects are added with add, under a label that is unique. The objects held by properties with a NestedParameter annotation are bound too, labeled <label of the parent>/<label of the nested parameter>; when such a property holds another object, rebindNested binds that object.
val bindings = ParameterBindings()
val settings = bindings.add(Settings(), "settings")
bindings.load(File("parameters.json"))
bindings["settings", "radius"] = 20.0Types
The binding of obj, an object with parameters, under label
The binding of the object held by the property of a ParameterType.Nested parameter of parent
Properties
an object was added
the bindings of the objects that are added, in the order they are added
Values were changed through the bindings: by set, invoke, randomize, fromObject or load; for nested parameters by rebindNested. Front ends trigger it for the changes they make, like the GUI of orx-gui for its controls. Changes made to the objects directly are not noticed.
the values were loaded, by fromObject or load
the property of a nested parameter holds another object, which is bound, see rebindNested
an object was removed
Functions
Adds obj under label, or the title of its Description annotation; the label is made unique. Objects without parameters are not bound.
the bindings of the objects and of the objects nested in them, parents before the objects nested in them
sets the values of the parameters to the values in json, see fromObject
Sets the values of the parameters of the objects to labeledValues, by the label of the object and the name of the parameter; values of objects or parameters that are not bound are ignored. Complements toObject.
Moves the values of the numeric, vector and color parameters towards random values in their ranges by strength, 0 keeps the values, 1 sets random values
Binds the objects that the properties of nested parameters hold when they hold other objects than the ones that are bound, with the objects nested in them
The values of the parameters of all objects, by the label of the object and the name of the parameter, to be saved; complements fromObject. This allows the values to be saved together with other data.