Global Sequence Variables

<< Click to Display Table of Contents >>

Navigation:  Part 2: DeltaGUI Software > Building a Show by Combining Resources > Using Sequences >

Global Sequence Variables

The sequence editor has a built-in language interpreter allowing you to write complex sequences using variables and conditions.

From this page, you can add, edit or delete global variables, which are created in the server and are persistent after the server quits.

You can choose any name for the global variable, and it can be one of the following styles:

Int
whole number, value in the range -2147483648 to +2147483647

Float
floating point 1.17 × 10-38 to 3.4 × 1038

String
character array, up to 128 characters in length.

Variables can be used in sequences to control playback or media, for example this sequence creates and initialises a global variable (similar to adding via the dialog above) to keep track of which timeline is active:

Sequence InitialiseVars:

globalvar $i_ WhichTimeline = 0

This sequence then uses these variables to control show playback when the sequence is triggered (from external control, from the timeline or from the buttons in the sequence editor).

Sequence ShowControl:

if ($i_ WhichTimeline =1)
 {
 play tl=2
 sequence TL1AudioDown
 sequence TL1VideoDown
 delay 1000
 stop tl=1
 $i_ WhichTimeline =2
 }
else
 {
 play tl=1
 sequence TL2AudioDown
 sequence TL2VideoDown
 delay 1000
 stop tl=2
 $i_ WhichTimeline =1
 }

This sequence interrogates the $i_ WhichTimeline variable and if it is 1, plays timeline 2, triggers off other sequences which fade down timeline 1, then stops timeline 1 after a delay. It then sets the $i_ WhichTimeline to 2 so that the next time the same sequence is called, the Else part is called to reverse the actions and start timeline 1 while stopping timeline 2.

A further example is a realtime clock, where a text resource is placed on the timeline and this sequence is triggered (once only, since it keeps running) to update the text resource contents with a string representing the current local time:

Sequence RTC:

#start
$mystringvar2=$currenttime
textparams MyRTC $mystringvar2 150 255 255 0 tl=1

Delay 500ms
gotolabel #start

In this sequence, the $mystringvar2 is a String type variable (previously created in a sequence or the editor), and it is set to the reserved variable ‘$currenttime’ which fills it with for example 10:20:41. The Textparams command then sets the resource named ‘MyRTC’ to this value and the text size is 150, the colour is 255,255,0 (yellow) and the timeline is 1.

Code Syntax