Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

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. 

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()

...

  1. Wait for an event.
  2. Process the event.
  3. Return to step 1.

 

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 convention, event scripting for BrightScript objects follows this work flow:

  1. An object of the type roMessagePort is created by the user's script.
  2. Objects that can send events (i.e. those that support the ifMessagePort/ifSetMessagePort interface) are instructed to send their events to this message port using the SetPort() method. You can set up multiple message ports and have each event go to its own message port, but it is usually simpler to create one message port and have all the events sent to this one port.
  3. The script waits for an event. The actual function to do this is ifMessagePort.WaitMessage(), but the built-in Wait() statement in BrightScript allows you to do this more easily.
  4. If multiple event types are possible, your script should determine which event the wait function received, then process it. The script then jumps back to the wait.

 

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.

...