program { // name of the program name: "programname"; // signals which trigger the program signal: "signalname"; // filter incoming signals depending on the sender name source: "partname"; // filter incoming signals depending on the part's state filter: "partname" "statename"; // delay the program by X seconds plus a random time between 0 and Y in: 0.3 0.0; // action to perform action: STATE_SET "statename" state_value; // if action is STATE_SET, define a transition from the current to the target state transition: LINEAR 0.5; // if action is SIGNAL_EMIT, the name of the part which will receive the signal target: "partname"; // run another program after the current one is done after: "programname"; after: "anotherprogram"; }
Programs define how your interface reacts to events. Programs can change the state of parts or trigger other events.
name [program name]
signal [signal name]
source [source name]
filter [part] [state]
[state]
. Only one filter per program can be used. If [state]
is not given, the source of the event is used instead.in [from] [range]
[from]
seconds before executing the program and add a random number of seconds (from 0 to [range]
) to the total waiting time.action [type] (param1) (param2) (param3) (param4)
STATE_SET
: Set ātarget partā state as ātarget stateāACTION_STOP
: Stop the ongoing transition.SIGNAL_EMIT
: Emit a signal to the application level. The application can register a callback for handling actions based on the EDC state.DRAG_VAL_SET
: Set a value for the dragable part (x, y values).DRAG_VAL_STEP
: Set a step for the dragable part (x, y values).DRAG_VAL_PAGE
: Set a page for the dragable part (x, y values).FOCUS_SET
: Set the focus to the target group.FOCUS_SET
: Set the focus to the target group.PLAY_SAMPLE āsample nameā speed (channel)
: Play a music sample clip. PLAY_SAMPLE
's (optional) channel can be one of:EFFECT/FX
BACKGROUND/BG
MUSIC/MUS
FOREGROUND/FG
INTERFACE/UI
INPUT
ALERT
PLAY_TONE ātone nameā duration_in_seconds (Range 0.1 to 10.0)
: Play a predefined tone of a specific duration.PLAY_VIBRATION āsample nameā repeat (repeat count)
transition [type] [length] (interp val 1) (interp val 2) (option)
STATE_SET
action. [type]
is the style of the transition and [length]
is a double specifying the number of seconds in which to preform the transition. Valid types are:LIN
or LINEAR
SIN
or SINUSOIDAL
ACCEL
or ACCELERATE
DECEL
or DECELERATE
ACCEL_FAC
or ACCELERATE_FACTOR
DECEL_FAC
or DECELERATE_FACTOR
SIN_FAC
or SINUSOIDAL_FACTOR
DIVIS
or DIVISOR_INTERP
BOUNCE
SPRING
ACCEL_FAC
, DECEL_FAC
and SIN_FAC
need the extra optional āinterp
val 1ā to determine the āfactorā of curviness. 1.0 is the same as their
non-factor counterparts and 0.0 is equal to linear. Numbers higher than 1.0
make the curve angles steeper with a more pronounced curve point.
DIVIS
, BOUNCE
and SPRING
also require āinterp val 2ā in addition
to āinterp val 1ā.
DIVIS
uses [val 1]
as the initial gradient start (0.0 is horizontal,
1.0 is diagonal (linear), 2.0 is twice the gradient of linear, etc.). [val
2]
is interpreted as an integer factor defining how much the value swings
outside the gradient before going back to the final resting spot at the end.
0.0 for [val 2]
is equivalent to linear interpolation. Note that DIVIS
can exceed 1.0.
BOUNCE
uses [val 2]
as the number of bounces (so it is rounded down to
the nearest integer value), with [val 1]
determining how much the bounce
decays; 0.0 gives linear decay per bounce and higher values give much more
decay.
SPRING
is similar to bounce; [val 2]
specifies the number of spring
swings and [val 1]
specifies the decay, but it can exceed 1.0 on the outer
swings.
Valid options are:
CURRENT
causes the object to move from its current position. Can be used as the last parameter of any transition type.target [target]
after [after]
after
are ignored. Multiple after
statements can be specified per program.