0

my scrpt works, but i have to put a print command. why ?



my application ist two buttons for to coice the clip german or spanish, an another button to stop. the script works but i have to put a print command. why ?


ini=CreateObject("roVideoMode")
rem ini.SetMode("pal")
ini.SetMode("1024x768x60p")

v= CreateObject("roVideoPlayer")
p = CreateObject("roMessagePort")
gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
v.SetPort(p)
v.SetVolume(100)
Playstatus = 0

event_loop:

msg=p.GetMessage() 'This line needs to be changed



print "without this print-command the script does not work. why?"
if type(msg)="roGpioButton" then Button
if type(msg)="roVideoEvent" then Videoevent
goto event_loop

Button:
butn = msg.GetInt()
if butn = 0 and Playstatus = 0 then
gpio.SetOutputState(0,1)
gpio.SetOutputState(1,0)
Playstatus = 1
ok=v.PlayFile("deutsch.vob")
goto event_loop
endif
if butn = 2 and Playstatus = 0 then
gpio.SetOutputState(0,0)
gpio.SetOutputState(1,1)
Playstatus = 1
ok=v.PlayFile("spanisch.vob")
goto event_loop
endif
if butn = 4 then
gpio.SetOutputState(0,0)
gpio.SetOutputState(1,0)
ok=v.StopClear()
Playstatus = 0
goto event_loop
endif
goto event_loop

Videoevent:
Event = msg.GetInt()
print Event
if Event = 8 then
Playstatus = 0
gpio.SetOutputState(0,0)
gpio.SetOutputState(1,0)
endif
goto event_loop

3 comments

  • 0
    Avatar
    RokuLyndon


    Change this line:



    msg=p.GetMessage()





    to:



    msg=wait(0,p)







    With that change, your script works for me.
  • 0
    Avatar
    Levi Uzodike

    Where does the text in print commands show up?

    Also, is there an online or downloadable interpreter to run BrightScript code through to test certain parts of a program before uploading to BrightAuthor? I see there's some kind of BrightScript Micro Debugger mentioned in the reference manual, but I'm not sure how to access it?

  • 0
    Avatar
    Bright Scripters
Please sign in to leave a comment.