Kodtrolshow control app [alpha]

View on GitHub

Scripting

Objects

Accessible in your scripts are Objects that reference items that you created in Kodtrol, such as Devices and Medias.


All objects have the following base functions:

setVar ( varName, varValue )

Save a device-specific variable.

Arguments
  • varName ( string )

    the device var name

  • varValue ( mixed )

    the device var value

Return value mixed

Returns the value that was passed to varValue.

Example // Set a device var device.setVar('foo', 42); // Set the device var and assign its value to a code variable var myVar = device.setVar('foo', 'off'); // myVar is 'off'
getVar ( varName )

Get a device-specific variable.

Arguments
  • varName ( string )

    the device var name

Return value mixed

Returns the value of the device var saved as varName.

Returns null if the var doesn't exist.

Example // Set a device var device.setVar('foo', 42); // Get the device var and assign its value to a code variable var myVar = device.getVar('foo'); // myVar is 42 // Getting a non-existant var var myAbsentVar = device.getVar('bar'); // myAbsentVar is null

Device objects

An object that references a device that you created in the Device Browser. It can be a physical device, or a virtual device.

Depending on the device's associated output type, different functions will be available on the Device object.

DMX / ArtNet

Along will all base Object functions, specific functions are available for devices outputting to DMX / ArtNet:

setChannel ( channel, channelValue )
Arguments
  • channel ( number | string )

    the channel number or alias

  • channelValue ( number )

    the channel value

Return value number

Returns the value that was passed to channelValue.


Media objects

An object that references a media file that you created in the Media Browser.

@TODO implements Medias in Kodtrol, lol