Program

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";
}

Program

Programs define how your interface reacts to events. Programs can change the state of parts or trigger other events.

  • name [program name]
    Symbolic name of program as a unique identifier.
  • signal [signal name]
    Specifies signals that cause the program to run. The signal received must match the specified source to run. There may be several signals, but only one signal keyword per program can be used. Also, there are some predefined signals for touch event handling. The predefined signals are:
  • ā€œhold,onā€: Holding on the mouse event matching the source that starts the program.
  • ā€œhold,offā€: Holding off the mouse event matching the source that starts the program.
  • ā€œfocus,part,inā€: Focusing in the matching source that starts the program.
  • ā€œfocus,part,outā€: Focusing out of the matching source that starts the program.
  • ā€œmouse,inā€: Moving the mouse into the matching source that starts the program.
  • ā€œmouse,outā€: Moving the mouse out of the matching source that starts the program.
  • ā€œmouse,moveā€: Moving the mouse in the matching source that starts the program.
  • ā€œmouse,down,*ā€: Pressing the mouse button in the matching source that starts the program.
  • ā€œmouse,up,*ā€: Releasing the mouse button in the matching source that starts the program.
  • ā€œmouse,clicked,*ā€: Clicking any mouse button in the matching source that starts the program.
  • ā€œmouse,wheel,0,*ā€: Moving the mouse wheel in the matching source that starts the program. A positive number moves up and a negative number moves down.
  • ā€œdrag,startā€: Starting a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
  • ā€œdrag,stopā€: Stopping a drag of the mouse in the matching source that starts the program. This signal works only in the draggable part.
  • ā€œdragā€: Dragging the mouse in the matching source that starts the program. This signal works only in the draggable part.
  • source [source name]
    Source of accepted signal. There may be several signals, but only one source keyword per program can be used. For example, source: ā€œbutton-*ā€; (signals from any part or program named ā€œbutton-*ā€ are accepted).
  • filter [part] [state]
    Filter signals to be only accepted if the part is in state named [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]
    Wait [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)
    Action to be performed by the program. Valid actions (only one can be specified) are:
    • 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)
    Defines how transitions occur using 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]
    Program or part on which the specified action acts.
  • after [after]
    Specifies a program that is run after the current program completes. The source and signal parameters of a program run as an after are ignored. Multiple after statements can be specified per program.