if msg.GetIndex() = 1
PlayStart = RegRead(showList[showIndex].ContentId)
if PlayStart <> invalid then
showList[showIndex].PlayStart = PlayStart.ToInt()
endif
showVideoScreen(showList[showIndex])
refreshShowDetail(screen,showList,showIndex)
endif
if msg.GetIndex() = 2
showList[showIndex].PlayStart = 0
showVideoScreen(showList[showIndex])
refreshShowDetail(screen,showList,showIndex)
if msg.GetIndex() = 2
showList[showIndex].PlayStart = 0
if Showlist[ShowIndex].streamformat=".gif" or Showlist[Showindex].StreamFormat="image" then
showImage(showlist[showindex])
else
showVideoScreen(showList[showIndex])
end if
refreshShowDetail(screen,showList,showIndex)
'***************************************************************
'** The show detail screen (springboard) is where the user sees
'** the details for a show and is allowed to select a show to
'** begin playback. This is the main event loop for that screen
'** and where we spend our time waiting until the user presses a
'** button and then we decide how best to handle the event.
'***************************************************************
Function showDetailScreen(screen As Object, showList As Object, showIndex as Integer) As Integer
if validateParam(screen, "roSpringboardScreen", "showDetailScreen") = false return -1
if validateParam(showList, "roArray", "showDetailScreen") = false return -1
refreshShowDetail(screen, showList, showIndex)
'remote key id's for left/right navigation
remoteKeyLeft = 4
remoteKeyRight = 5
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent" then
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isRemoteKeyPressed()
print "Remote key pressed"
if msg.GetIndex() = remoteKeyLeft then
showIndex = getPrevShow(showList, showIndex)
if showIndex <> -1
refreshShowDetail(screen, showList, showIndex)
end if
else if msg.GetIndex() = remoteKeyRight
showIndex = getNextShow(showList, showIndex)
if showIndex <> -1
refreshShowDetail(screen, showList, showIndex)
end if
endif
else if msg.isButtonPressed()
print "ButtonPressed"
print "ButtonPressed"
if msg.GetIndex() = 1
PlayStart = RegRead(showList[showIndex].ContentId)
if PlayStart <> invalid then
showList[showIndex].PlayStart = PlayStart.ToInt()
endif
showVideoScreen(showList[showIndex])
refreshShowDetail(screen,showList,showIndex)
endif
if msg.GetIndex() = 2
showList[showIndex].PlayStart = 0
if Showlist[ShowIndex].streamformat=".gif" or Showlist[Showindex].StreamFormat="image" then
showImage(showlist[showindex])
else
showVideoScreen(showList[showIndex])
end if
refreshShowDetail(screen,showList,showIndex)
endif
if msg.GetIndex() = 3
endif
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
return showIndex
End Function
<feed>
<!-- resultLength indicates the total number of results for this feed --><resultLength>1</resultLength><!-- endIndix indicates the number of results for this *paged* section of the feed --><endIndex>1</endIndex>
<item sdImg="http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif" hdImg="http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif">
<title>24 Hour Tornado Outlook</title>
<contentType>image</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamFormat>.gif</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif</streamUrl>
</media>
<synopsis>The 24 Hour Tornado Outlook from the National Weather Service.</synopsis>
<genres>Weather</genres><runtime>100</runtime></item>
</feed>
if Showlist[ShowIndex].streamformat=".gif" or Showlist[Showindex].StreamFormat="image" then
if Showlist[ShowIndex].streamformat=".gif" or Showlist[Showindex].contentType="image" then
if Showlist[Showindex].contentType="image" then
'***************************************************************
'** The show detail screen (springboard) is where the user sees
'** the details for a show and is allowed to select a show to
'** begin playback. This is the main event loop for that screen
'** and where we spend our time waiting until the user presses a
'** button and then we decide how best to handle the event.
'***************************************************************
Function showDetailScreen(screen As Object, showList As Object, showIndex as Integer) As Integer
if validateParam(screen, "roSpringboardScreen", "showDetailScreen") = false return -1
if validateParam(showList, "roArray", "showDetailScreen") = false return -1
refreshShowDetail(screen, showList, showIndex)
'remote key id's for left/right navigation
remoteKeyLeft = 4
remoteKeyRight = 5
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent" then
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isRemoteKeyPressed()
print "Remote key pressed"
if msg.GetIndex() = remoteKeyLeft then
showIndex = getPrevShow(showList, showIndex)
if showIndex <> -1
refreshShowDetail(screen, showList, showIndex)
end if
else if msg.GetIndex() = remoteKeyRight
showIndex = getNextShow(showList, showIndex)
if showIndex <> -1
refreshShowDetail(screen, showList, showIndex)
end if
endif
else if msg.isButtonPressed()
print "ButtonPressed"
print "ButtonPressed"
if msg.GetIndex() = 1
PlayStart = RegRead(showList[showIndex].ContentId)
if PlayStart <> invalid then
showList[showIndex].PlayStart = PlayStart.ToInt()
endif
if Showlist[showIndex].contentType="image" then
showImage(showList[showIndex])
else
showVideoScreen(showList[showIndex])
end if
refreshShowDetail(screen,showList,showIndex)
endif
if msg.GetIndex() = 2
showList[showIndex].PlayStart = 0
if showList[showIndex].contentType="image" then
showImage(showList[showIndex])
else
showVideoScreen(showList[showIndex])
end if
refreshShowDetail(screen,showList,showIndex)
endif
if msg.GetIndex() = 3
endif
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
return showIndex
End Function
<feed>
<!-- resultLength indicates the total number of results for this feed --><resultLength>1</resultLength><!-- endIndix indicates the number of results for this *paged* section of the feed --><endIndex>1</endIndex>
<item sdImg="http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif" hdImg="http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif">
<title>24 Hour Tornado Outlook</title>
<contentType>image</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://www.spc.noaa.gov/products/outlook/day1probotlk_1200_torn.gif</streamUrl>
</media>
<synopsis>The 24 Hour Tornado Outlook from the National Weather Service.</synopsis>
<genres>Weather</genres><runtime>100</runtime></item>
</feed>
if Showlist[ShowIndex].streamformat=".gif" or Showlist[Showindex].contentType="image" then
if Showlist[Showindex].contentType="image" then
if Showlist[showIndex].contentType="image" then
'Set Default screen values for items not in feed
item.HDBranded = false
item.IsHD = false
item.StarRating = "90"
item.ContentType = "episode"
Function showImage (image As Object)
ss = CreateObject ("roSlideShow")
port = CreateObject ("roMessagePort")
ss.SetMessagePort (port)
ss.AddContent ({Url: image.SDPosterUrl})
ss.SetUnderscan (3)
ss.Show ()
While True
msg = Wait (0, port)
If Type (msg) = "roSlideShowEvent"
If msg.IsScreenClosed ()
ss.Close ()
Exit While
EndIf
EndIf
End While
End Function
Function showImage (image As Object)
' Get the TV's display size
di = CreateObject ("roDeviceInfo")
displaySize = di.GetDisplaySize ()
displayMode = di.GetDisplayMode ()
' Make use of the 'Action Safe Zone'
' HD->1150x646 starting at (64, 35)
' SD->648x432, starting at (36, 24)
If displayMode = "720p" ' 720p (HD)
displayH% = 646
displayW% = 1150
displayX% = 64
displayY% = 35
Else If displayMode = "480i" ' 480p (SD)
displayH% = 432
displayW% = 648
displayX% = 36
displayY% = 24
Else ' Unknown display type
displayH% = displaySize.H * 0.9
displayW% = displaySize.W * 0.9
displayX% = (displaySize.W - displayW%) / 2
displayY% = (displaySize.H - displayH%) / 2
EndIf
port = CreateObject ("roMessagePort")
ic = CreateObject ("roImageCanvas")
ic.SetMessagePort (port)
' Black opaque background
ic.SetLayer (0, {Color: "#FF000000", CompositionMode: "Source"})
' Fill the display area with the image
' Display the title just below the top center of the image
ic.SetLayer (1, [{url: image.SDPosterUrl,
TargetRect: {x: displayX%, y: displayY%, w: displayW%, h: displayH%}},
{Text: image.Title,
TextAttrs: {Color: "#AA777777", Font: "Medium", HAlign: "Center", VAlign: "Top"},
TargetRect: {x: displayX%, y: displayY% + 10, w: displayW%, h: displayH% - 10}
}])
ic.Show ()
While True
msg = Wait (0, port)
If Type (msg) = "roImageCanvasEvent"
If msg.IsScreenClosed ()
ic.Close ()
Exit While
Else If msg.IsRemoteKeyPressed ()
key = msg.GetIndex ()
' Exit regardless of which key is pressed
ic.Close ()
Exit While
EndIf
EndIf
End While
End Function