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 |
|
Return value |
mixed
Returns the value that was passed to |
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 |
|
Return value |
mixed
Returns the value of the device var saved as Returns |
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
|
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.
Along will all base Object functions, specific functions are available for devices outputting to DMX / ArtNet:
setChannel
( channel, channelValue )
Arguments |
|
Return value |
number
Returns the value that was passed to |
An object that references a media file that you created in the Media Browser.
@TODO implements Medias in Kodtrol, lol