Variables has a name, value and type.

Name of a variable should not contain a space and should be shorter than 256 characters. Even if most applications will handle both spaces and longer names.

Value is always a string. And the type is default text/plain if no other is selected.
The value is in Unicode and not limited to a specific length.


TABLE OF CONTENTS


Movie Variables

In the composer it is possible to add variables of different types to the Movie. These variables will be available for the playback when playing this movie. The scope of these variables is Local (Dise Movie Context).

Any file (image, video, binary) that is connected to the variable will be uploaded as a dependency and accessible as a data connection or through a script.

Template fields

Variables in the Movie can be promoted into template fields, which allows the Composer to upload them to the portal and add the variable as a template field.
Not all types can be used as template fields and the portal will handle types that are connected to a file differently from those that are not.

The Template and Template Fields will be converted into Messages and Message Fields in the Portal and those will then be published in a playlist to the player.

Required

A template field can be required, meaning that the function filling in the field has to enter something. There is no logic on the Composer or Player to enforce this instead it is up to the UI to use this rule.

Template vs Message

A template is created by the Composer when uploading a Dise Movie to the portal that has one or more variables marked as a template field. 

Each template field will have the following properties

  • Name

  • Type (see below)

  • Value (can be empty but usually something, read only)

  • Required

A message is created by the Portal and is connected to a template. It has fields corresponding to the template fields.
But if the template has been changed after the message was created there can be difference between the two (like fields changed, removed or added).
The message can be added into a playlist.

The message has these properties

  • Name

  • Type

  • Value

Publishing & Playback

A message is published in the playlist that they are attached in (they can be attached to more than one). The player will get the name, type, value of the message field. The template field value will not be sent to the player.

When the message field is received by the Player it will put that into the variables for the Movie, replacing (on name) any variables that was created for the movie (see above).

Types


Object position (Relative)

Mediatype

application/x-ds-object-position-relative

Data

Semicolon separated pixel position x;y

Relative to the position where the object was created.

Example

"0;0" (no change)

"1000:0" (+1000 pixels on the x-axis)

"0:1000" (+1000 pixels on the y-axis)

"0:-1000" (-1000 pixels on the y-axis)


Object color

The color of the object, only for objects with color (like text, shape, ticker, …)

Mediatype

application/x-ds-object-color

Data

Color value in hex "#RRGGBB"

Example

"FF0000" (red)


Object visible

Mediatype

application/x-ds-object-visible

Data

"true" om the object should show, false if it should not show.

Example

"true" (shows)

"false" (does not show)


Image file

Mediatype

image/*

Data

Filename (full or relative path) or hash of file.

Example

"C:\DiseContent\image.jpg"

"0206205f41452687c772749b28f0bbabbaf9893c"


Video file

Mediatype

video/*

Data

Filename (full or relative path) or hash of file.

Example

"C:\DiseContent\video.mp4"

"03ea55d42903c041b1ff64c2bd593fb7b9d3a843"


Binary file

Note: Will not be promoted as a template field

Mediatype

application/octet-stream

Data

Filename (full or relative path) or hash of file.

Example

"C:\DiseContent\info.json"

"f39d30498126f724d70107c737f023c5de071e8e"


Using variables

Variables can be read or created using these methods.

Message Field [Composer, Premium Player, Lite Player, CX Portal]

If a Message is connected to the template playing on the player, then all message fields will be added as Variables to the Movie and are then accessible to all other methods listed here.

Script [Composer, Premium Player]

variabel = DISEScript.GetVariable("namn")
variabel = DISEScript.GetVariable("local", "namn")
variabel = DISEScript.GetVariable("global", "namn")
DISEScript.SetVariable("name", "value")
DISEScript.SetVariable("local", "name", "value")
DISEScript.SetVariable("global" "name", "value")

Without scope the variable will first be found in local scope and then in the global

Connect Property [Composer]

In the Composer we can connect a variable to a Property of a Object (image, video, text, …). This works for all types above (position, color, visible).

Scope: First local scope and then global.

Data connection [Composer]

Used by “Connect Property” but can also be used for most objects to change the text or filename.

Scope: First local scope and then global.

Player Custom Setting VAR-x [Premium Player, Lite Player, Portal]

Added on player or player group in Portal.

Custom settings

Scheduling [Composer]

Scope: First local scope and then global.

HTTP API [Premium Player]

Scope: Global

http://kb8.dise.com/index.php/HTTP_API.html

Variable editor [Premium Player]

Scope: Global

Playback monitor [Premium Player]

Only view

Scope: Movie context

Web pages / Widget [Lite player]

When adding a web page to a playlist and playing on Lite player any variables on the player will automatically be added to the end of the URL as query parameters.

Scope

Variables can be global or connected to a Dise Movie Context (Local)

Global variables are only available through the application, so they are not shared by default between the Control center and Replay or between the Portal and he Control center.

There is a setting called "VariableDefaultScope" that you can set to "local" to force the player to check local variables when nothing is speciefied, you can also set it to "global" if you want to ignore local variables when nothing is specified (Backward compability). 

Set variables

  • From the Portal
    How: Create a setting (string) on a player/group that for example is called Var-X. This will set a variable on the Player that is called 'X'.
    Scope: Global

  • From script
    How:
    • In a script, run:

      DISEScript.SetVariable("namn", u"BOB")
      DISEScript.SetVariable("global", "namn", u"BOB")
      DISEScript.SetVariable("local", "namn", u"BOB")


      Scope:
      - Dise Movies where the variable and script is defined if nothing else has been specified.
      - Global for background scripts

  • From the players HTTP api
    How: 
    • Make sure the webserver is active on the player

    • Find the players API-GUID

    • Send

      curl -H "Content-Type:text/xml" -X PUT --data "<Request><Variablename> Persistent='false'>Value</Variablename ></Request>" http://localhost:8080/api/Replay/API-GUID/Variables/Variablename

      to set a variable to a certain value

      Scope:
      - Global

  • From Remote Control (Multicast UDP message)
    How: 
    • Send

      00000000000000|BOB|Variable|Set|name|BOB

      To set the variable 'name' to 'BOB

    • Alternatively send legacy

      00000000000000|BOB|AddVariable|name

      to only set the variable 'name'

      Scope:
      - Global

  • From event
    How: 
    • Right click the object or scene and pick Events

    • Choose for example When scene starts and click Add. 

    • Choose "Set variable" in the list and write name and value below.

      Scope:
      - Dise movie context (default in new versions) or Global (Automaticly created before v27)
      - There is a choice to either use Global or Local variables

  • During scene or object runtime
    How:
    • Right click on the object or scene and pick Events

    • Click Add under Variables set during playback

      Scope:
      - Dise movie context (default in new versions) or Global (Automaticly created before v27)
      - There is a choice to either use Global or Local variables

  • From Global variable editor
    How: 
    • In Premium press F5 and choose Debug > Variable editor (Need to turn on debugging, see custom settings 'debug' setting)

    • In Composer choose File > Debug > Global variables
      Then choose Add to add or dubbelclick on already created variables to edit them.

      Scope:
      - Global

  • From variable editor & "preview" context editor
    How:
    • In Composer choose Movie > Edit variables

    • Click Add to add a variable.

    • Note! This variable editor does not allow you to set the value, but only to define them for later use.
      This variable will then be visible both in the data connection dialog (see below) and in the context editor.

    • Choose Movie > Edit contexts

    • Click Add to add a context

    • Choose a variable by either hitting F2 or by clicking in the Value-column to change a predefined variable.

      Scope:
      - The current Dise movie context, only works in Composer.

Reserved variable names

  • ApplicationVersion
    Version of software, only for Replay and Premium player..

  • FramesPerSecond
    Current FPS of the playback (calculated each second)

  • MachineName
    Machine name from DISEGlobal.settings.

  • ReplayName
    Name of the player, only works in Replay

  • PlaylistName

    A list of playlist / channel names in playback. The order is how they are in the layout.

    If there is for example three playlists, Background, Navigation and Advertising, PlaylistName = [Background, Navigation, Advertising]

  • PlaylistItemCount

    A list of the number of scenes in playlists/channels currently in playback.

    If there for example are two playlists, A and B with 4 and 9 scenes respectively, PlaylistItemCount = [4,9]

  • PlaylistItemCurrentIndex
    A list of indexes for the scene that is currenly in playback. The value is 1-based.

    If for example there are two playlists, A and B where A is on the second stage and B on the fourth stage PlaylistItemCurrentIndex = [2,4]

Automatically created variable names

On premium player

Player

  • PlayerId
    The id of the player

  • PlayerName
    Name of the player

Location

Only exists in the new Portal

  • BrandId
    the display's brand id

  • BrandName
    the display's brand name

  • CountryId
    the display's country id

  • CountryCode
    the display's country code

  • RegionId
    the display's region id

  • RegionName
    the display's region name

  • SiteId
    the display's site id

  • SiteName
    the display's site name

  • SiteLatitude
    the geographical latitude value for this display's site

  • SiteLongitude
    the geographical longitude value for this display's site

  • SiteAddress
    the display's site address

  • AreaId
    the display's area id

  • AreaName
    the display's area name

Tag

  • <TagName>
    for each tag on the display, a corresponding variable is created


Persitent

A persistent variable will be saved to disk when it is created / changed and loaded when starting the software.