Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
BrightSign players use a standardized library of BrightScript objects to expose functionality for public software development. To publish a new API for interacting with BrightSign hardware, we create a new BrightScript object. Insert excerpt BrightScript Version Navigation Menu BrightScript Version Navigation Menu nopanel true
The pages in this section provide definitions for objects that can be used in BrightScript. A brief description, a list of interfaces, and the member functions of the interfaces are provided for each object class. While most BrightScript objects have self-contained pages, some objects are grouped on the same page if they are closely related or depend on one another for functionality.
Here is a sample of objects that are used frequently when creating applications in BrightScript:
- roVideoMode: Configures video output and interacts with displays using CEC/EDID.
- roRectangle: Used to define zones/widgets on the screen. This object is passed to many other objects to define their screen area, including roVideoPlayer, roImagePlayer, roImageWidget, roHtmlWidget, roClockWidget, and roCanvasWidget.
- roVideoPlayer: Plays videos.
- roImagePlayer: Displays images.
- roHtmlWidget: Displays local or remote HTML content using the Chromium rendering engine.
- roNetworkConfiguration: Used to configure Ethernet, WiFi, and local network parameters.
- roDeviceInformation: Used to retrieve a wide array of system information, including model type, device serial number, and firmware version.
Interfaces and Methods
Every BrightScript object consists of one or more "interfaces." An interface consists of one or more "methods." For example, the roVideoPlayer object has several interfaces, including ifMessagePort. The interface ifMessagePort has one method: SetPort()
.
...
BrightScript Objects consist only of interfaces, and interfaces define only methods. There is no concept of a "property" or variable at the object or interface level. These must be implemented as "set" or "get" methods in an interface.
Classes
A "class name" is used to create a BrightScript object. For example, the class name for a video playback instance is roVideoPlayer, so, to initialize a video playback instance, you would use code similar to the following:
Code Block | ||
---|---|---|
| ||
video = CreateObject("roVideoPlayer") |
...
Zone support can be disabled by calling EnableZoneSupport(false)
. When zones are not enabled, the image layer is hidden whenever video is played, and the video layer is hidden whenever images are played.
...
An event can be any number occurrences: a button has been pressed; a timer has been triggered; a UDP message has been received; a video has finished playing back; etc.
By By convention, event scripting for BrightScript objects follows this work flow:
...
An event can be generated by any BrightScript Object. For example, the class roControlPort sends events of type roControlDown and roControlUp. The roControlDown implements the ifInt interface, which allows access to an integer. An event loop needs to be aware of the possible events it can receive and be able to process them.
...
The following sections provide definitions for objects that can be used in BrightScript. A brief description, a list of interfaces, and the member functions of the interfaces are provided for each object class. While most BrightScript objects have self-contained pages, some objects are grouped on the same page if they are closely related or depend on one another for functionality.