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