Can someone tell me what's wrong? I'm getting syntax errors but can't find them.
The errors seem to be around where I set the message ports, I set both the audioPlay and Canvas to the same port should that affect anything?
Function showAudioCanvas(showList As Object, showIndex As Object, isPlayAll As Boolean) As Integer
dinfo = CreateObject("roDeviceInfo")
dsize = dinfo.GetDisplaySize()
dtype = dinfo.GetDisplayType()
width = dsize.w
height = dsize.h
if dtype = "HDTV" then
iurl = "http://www.map2life.com/roku/images/Splash/HD/SplashHDResized.jpg"
if not(width = 1280) or not(height = 720) then
print "WARNING: unusual screen dimensions detected. the splash screen may not display properly."
endif
else
iurl = "http://www.map2life.com/roku/images/Splash/SD/SplashSDResized.jpg"
if not(width = 720) or not(height = 480) then
print "WARNING: unusual screen dimensions detected. the splash screen may not display properly."
endif
endif
image = {
Color:"#000000",
CompositionMode:"Source",
Url:iurl,
TargetRect:{x:0,y:0}
}
'set pre audioplayer data
audioPlayer = CreateObject("roAudioPlayer")
port = CreateObject("roMessagePort")
'audioport = CreateObject("roMessagePort")
'set audioplayer message port to the same port as springboardscreen
audioPlayer.SetMessagePort(port)
if isPlayAll then
audioPlayer.SetContentList(showList)
else
audioplayer.addcontent(showList[showIndex])
endif
audioplayer.setloop(false)
canvas = CreateObject("roImageCanvas")
'port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
'Set opaque background
'canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
canvas.SetRequireAllImagesToDraw(true)
canvas.SetLayer(1, image)
audioPlayer.Play()
canvas.Show()
while(true)
msg = wait(0,port)
if type(msg) = "roImageCanvasEvent" then
if (msg.isRemoteKeyPressed()) then
index = msg.GetIndex()
print "Key Pressed - " ; msg.GetIndex()
if (i = 2) then
audioPlayer.Stop()
' Up - Close the screen.
canvas.close()
else if ( index = 0) then
audioPlayer.Stop()
'back to close
canvas.close()
endif
else if (msg.isScreenClosed()) then
audioPlayer.Stop()
print "Closed"
return
end if
else if type(msg) = "roAudioPlayerEvent"
if msg.isRequestFailed() then
Error = msg.GetMessage()
ShowDialog1Button("Connection Failed", Error, "Ok")
else if msg.isFullResult() then
return -1
end if
else if type(msg) = "roUniversalControlEvent" then
if msg.GetInt() = 13 then
if audioPlayer.isPaused() then
audioPlayer.Play()
else
audioPlayer.Pause()
endif
endif
end if
end while
End Function