Brightsign HD2000 BrightScript Reference Guide User Manual Page 4

  • Download
  • Add to my manuals
  • Print
  • Page
    / 30
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 3
4
Introduction
Roku BrightScript is a scripting language based on Basic. It is easy to learn, and when combined with Roku
Objects, it allows developers to create the logic needed for interactive signs or kiosks. This document
specifies the syntax and built-in functions of the scripting language. To write useful applications, you should
also refer to the Roku Object reference.
This manual is designed for people that have some experience programming software. It is a reference guide,
not a tutorial.
BrightScript is an interpreted language, and runs on the BrightSign. To write BrightScript you just need a
text editor on your PC or Mac. You can create it using any text editor. I use the editor that comes with
Microsoft Visual Studio, which conveniently does color coding for Basic. Once a script is created, you save
it, copy it to a Compact Flash card, put it in BrightSign, turn on the power, and use a terminal program to
enter the “script <filename>” command. See the BrightSign User Guide for more information on this.
Quick Example
This example will give you a quick flavor of the Roku BrightScript scripting language with a script that plays
a video file.
REM Defaults to 640x480x60p VGA Out
video=CreateObject("roVideoPlayer")
p=CreateObject("roMessagePort")
ok=video.SetLoopMode(1)
ok=video.PlayFile("/autoplay.vob")
msg=wait(0, p)
Let’s go through each line:
REM Defaults to 640x480x60p VGA Out
This line does nothing, it is a “remark”. You use REM or ‘ (apostrophe) to indicate a remark or comment.
video=CreateObject("roVideoPlayer")
The CreateObject function creates a “Roku Object”. See the BrightScript Object Reference for more
information on this. The variable “video” now holds the reference to this object, and has the type
“roVideoPlayer”
p=CreateObject("roMessagePort")
This creates an object of type roMessagePort that is used to receive events.
ok=video.SetLoopMode(1)
This calls the method SetLoopMode of the object roVideoPlayer. This causes the roVideoPlayer to always
loop any video it plays back (forever). The “ok” variable now holds the result of this method call, which
indicates if there was an error or not. There is almost never an error in this case and this script doesn’t
actually check the return code.
ok=video.PlayFile("/autoplay.vob")
Tell the video object to play the file “/autoplay.vob” (autoplay.vob in the root of the Compact Flash card).
msg=wait(0, p)
Wait for an event on the message port p. There will never be one, since the “SetPort” member was never
called. See the discussion on the event architecture in the BrightScript Roku Objects reference manual for
more info. The “0” in “wait” is that timeout value. 0 means never time out. So the net result of this “wait”
is to wait forever, since it will never time out, and p never receives events.
Page view 3
1 2 3 4 5 6 7 8 9 ... 29 30

Comments to this Manuals

No comments

Transcend TS64MQR72V4J manuály

Uživatelské manuály a uživatelské příručky pro Paměťové moduly Transcend TS64MQR72V4J.
Poskytujeme 1 manuály pdf Transcend TS64MQR72V4J ke stažení zdarma podle typů dokumentů: Datový list






Další produkty a příručky pro Paměťové moduly Transcend

Modely Typ Dokumentu
TS32MLQ64V5F Datový list   Transcend 256MB DDR2 DDR2-533 Unbuffer Non-ECC Memory, 11 stránky
JM533QSJ-512M Datový list Transcend JetRam 512MB DDR2-553 CL4, 3 stránky
TS128MDR72V6K Datový list   Transcend 1024MB DDR 184Pin DIMM DDR266 ECC Registered, 3 stránky
JetRam 4GB Manuál Transcend JetRam 4GB, 3 stránky
TS32MLQ64V6M Datový list Transcend 256MB DDR2 667 un-buffer DIMM 5-5-5, 3 stránky
TS64MSD64V3J Datový list   Transcend 512 MB DDR DDR333 Non-ECC Memory, 12 stránky
TS64MDR72V6F5 Datový list   Transcend Memory 512MB DDR 266 DIMM CL2, 11 stránky