ControlBinding

class ControlBinding(**properties: Any)

Superclasses: Object, InitiallyUnowned, Object

A base class for value mapping objects that attaches control sources to Object properties. Such an object is taking one or more ControlSource instances, combines them and maps the resulting value to the type and value range of the bound property.

Methods

class ControlBinding
get_g_value_array(timestamp: int, interval: int, values: Sequence[Any]) bool

Gets a number of Value for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of Value.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

Parameters:
  • timestamp – the time that should be processed

  • interval – the time spacing between subsequent values

  • values – array to put control-values in

get_value(timestamp: int) Any | None

Gets the value for the given controlled property at the requested time.

Parameters:

timestamp – the time the control-change should be read from

is_disabled() bool

Checks if the control binding is disabled.

set_disabled(disabled: bool) None

This function is used to disable a control binding for some time, i.e. sync_values() will do nothing.

Parameters:

disabled – boolean that specifies whether to disable the controller or not.

sync_values(object: Object, timestamp: int, last_sync: int) bool

Sets the property of the object, according to the ControlSource that handles it and for the given timestamp.

If this function fails, it is most likely the application developers fault. Most probably the control sources are not setup correctly.

Parameters:
  • object – the object that has controlled properties

  • timestamp – the time that should be processed

  • last_sync – the last time this was called

Properties

class ControlBinding
props.name: str
props.object: Object

Virtual Methods

class ControlBinding
do_get_g_value_array(timestamp: int, interval: int, values: Sequence[Any]) bool

Gets a number of Value for the given controlled property starting at the requested time. The array values need to hold enough space for n_values of Value.

This function is useful if one wants to e.g. draw a graph of the control curve or apply a control curve sample by sample.

Parameters:
  • timestamp – the time that should be processed

  • interval – the time spacing between subsequent values

  • values – array to put control-values in

do_get_value(timestamp: int) Any | None

Gets the value for the given controlled property at the requested time.

Parameters:

timestamp – the time the control-change should be read from

do_sync_values(object: Object, timestamp: int, last_sync: int) bool

Sets the property of the object, according to the ControlSource that handles it and for the given timestamp.

If this function fails, it is most likely the application developers fault. Most probably the control sources are not setup correctly.

Parameters:
  • object – the object that has controlled properties

  • timestamp – the time that should be processed

  • last_sync – the last time this was called

Fields

class ControlBinding
disabled
name

Name of the property of this binding

object
parent

The parent structure

pspec

ParamSpec for this property