Introduction, Roku object interfaces and methods – BrightSign HD2000 Object Reference Manual User Manual

Page 4

Advertising
background image

Introduction

Roku Objects (RO) are the standardized way Roku software exposes functionality for our products’ public
SDKs. In other words, to publish a new API, Roku will create a new Roku Object. The first product to
use this method is the BrightSign.

Roku Objects have these key objectives:

 To be largely language independent.

 To be robust to software upgrades. A RO interface, once established, never changes its methods

or its binary linkage.

 To be compatible with compiled or interpreted languages. ROs are completely discoverable and

callable at run time or compile time.

 To support multiple abstract interfaces. This allows objects to be used in powerful ways as we’ll

see below.


As well as the core Roku Object architecture, this reference also defines event architecture and the required
interfaces to participate in this scheme. The event scheme is a fundamental piece of any multi-threaded
application. Its standardization is the first part in a sequence of RO based standards Roku will adopt across
our products, to maximize compatibility of third party plug-ins.

This document describes the Roku Object architecture as two main sections:

 how to use them (as a script writer)

 the initial objects defined for BrightSign

Roku Object Interfaces and Methods

Every Roku Object consists of one or more “Interfaces”. An RO Interface consists of one or more
Methods. For example, the roVideoPlayer has two interfaces: ifMediaTransport and ifSetMessagePort.
The Interface ifSetMessagePort has one Member: SetPort.

For example:
p = CreateObject("roMessagePort")
video= CreateObject("roVideoPlayer")

gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
video.SetPort(p)

This syntax makes use of a short cut provided by the language: The interface name is optional, unless it is
needed to resolve name conflicts.

For example:
gpio.SetPort(p)

is the same as:
gpio.ifSetMessagePort.SetPort(p)

Note that the abstract Interface ifSetMessagePort is exposed and implemented by both the
roGpioControlPort and the roVideoPlayer objects. Once the method SetPort is called, these objects will
send their events to the supplied message port. This is discussed more in the Event section below.

Once an interface is defined and published, it is never changed. For example, imagine if Roku decided in a
future release that the ifSetMessagePort really needed another method, say “ClearMessagePort”. Instead of
changing the ifSetMessagePort interface, we would create a new interface ifSetMessagePort2. This

4

Advertising
This manual is related to the following products: