RokuJoel wrote:Yes, you can do that however, you lose the advantage of multi-threading, so you can expect, if your code is at all complex, for it to exhibit substandard performance as various things will block for screen refresh, which may slow down your code execution significantly.
EnTerr wrote:RokuJoel wrote:Yes, you can do that however, you lose the advantage of multi-threading, so you can expect, if your code is at all complex, for it to exhibit substandard performance as various things will block for screen refresh, which may slow down your code execution significantly.
Hmm, why wouldn't multi-threading work, if he would be using the same scenic-components?
It's the same executor with the same capabilities... it was mentioned console is on another port, global vars separate - sounds like in the same threading container?
TheEndless wrote:You can't create Task nodes outside of the SceneGraph thread.
EnTerr wrote:TheEndless wrote:You can't create Task nodes outside of the SceneGraph thread.
Okay... i don't follow, i am afraid. How does that necessitate (static) XML, vs being spun dynamically from the scynical-graph thread?
TheEndless wrote:There's no reason you couldn't dynamically create all of the components for the scene via code, though.
bR2nd = m.top.findNode("bannerGroup").createChild("Rectangle"): bR2nd.id = "bR2"
ccA2nd = bR2nd.createChild("Animation"): ccA2nd.id = "ccA2"
ccR2nd = ccA2nd.createChild("ColorFieldInterpolator"): ccR2nd.id = "ccR2"
ccR2nd.setFields({key:[0.0,0.5,1.0], keyValue:[&h00FF00FF, &h00000FFF, &h00FF00FF], fieldToInterp:"bR2.color" })
ccA2nd.setFields({duration:10, repeat:true, control:"start", easeFunction:"linear"})
bR2nd.setFields({width:1280, height:30, color:&h00FF00FF, translation:[0,0]})
m.top.findNode("bannerGroup").createChild("Rectangle").id = "bottomRectangle2"
PrintChildren(m.top,"")
print m.top.findNode("textTimer").id ' Prints textTimer as it should
print m.top.findNode("colorchangeRectangle").id ' Prints colorchangeRectangle as it should
print m.top.findNode("bannerGroup").GetChild(3).id ' Prints bottomRectangle2 as it should
print m.top.findNode("bannerGroup").findNode("bottomRectangle2") ' Print invalid, even tho we can see the node as GetChild(3)
print m.top.findNode("bottomRectangle2") ' Again prints invalid
function PrintChildren(node, prefix)
print Prefix+"["+Node.id+"]"+", "+Node.GetChildCount().ToStr()+", "+Node.subType()
for count = 0 to Node.GetChildCount()-1
if Node.ID<>"musicvideos" printChildren(Node.GetChild(Count),prefix+" ")
' Video doesnt traverse well with this routine, unrelated issue so ignoring it
end for
end function
[], 2, videobannerScene
[], 0, Poster
[LayerRoot], 3, RenderableNode
[Layer], 0, RenderableNode
[Layer], 4, RenderableNode
[musicvideos], 2, Video
[bannerGroup], 4, RenderableNode
[bottomRectangle], 1, Rectangle
[colorchangeAnimation], 1, Animation
[colorchangeRectangle], 0, ColorFieldInterpolator
[bottomLabel], 1, Label
[scrollbackAnimation], 1, Animation
[scrollbackLabel], 0, Vector2DFieldInterpolator
[channelPoster], 1, Poster
[fadeinoutAnimation], 1, Animation
[fadeinoutPoster], 0, FloatFieldInterpolator
[bottomRectangle2], 0, Rectangle
[warningRectangle], 1, Rectangle
[warningLabel], 0, Label
[textTimer], 0, Timer
[Layer], 0, RenderableNode
textTimer
colorchangeRectangle
bottomRectangle2
invalid
invalid
<?xml version="1.0" encoding="utf-8" ?>
<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->
<component name="epgGridScene" extends="Scene">
<script type="text/brightscript" >
</script>
<children>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>
<?xml version="1.0" encoding="utf-8" ?>
<component name="customEPGGrid" extends="EPGGrid" >
<script type="text/brightscript" >
<![CDATA[
function init()
print "inside epg"
m.content = createObject("RoSGNode","ContentNode")
m.top.setFocus(true)
dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000
addChannel("ABC")
addItem("ABC Show ", dateNow)
addChannel("CBS")
addItem("CBS Show ", dateNow)
addChannel("NBC")
addItem("NBC Show ", dateNow)
addChannel("NICK")
addItem("NICK Show ", dateNow)
addChannel("OUTSIDE")
addItem("Outside Show ", dateNow)
addChannel("TEST")
addItem("Test Show ", dateNow)
m.top.content = m.content
m.top.translation = [50, 300]
m.top.numRows = 5
m.top.duration = 10800
m.top.nowNextMode = false
m.top.infoGridGap = 0
m.top.channelInfoColumnLabel = "Hello"
end function
sub addChannel(channelText as string)
m.channel = m.content.createChild("ContentNode")
m.channel.TITLE = channelText
m.channel.HDSMALLICONURL = "http://css.boshanka.co.uk/wp-content/uploads/2015/04/icon-logo-design-small.png"
end sub
sub addItem(progText as string, timeStart)
For i=0 To 5 Step 1
program = m.channel.createChild("ContentNode")
program.TITLE = progText + str(i)
program.PLAYSTART = timeStart + (i * 2000)
program.PLAYDURATION = "2000"
End For
end sub
]]>
</script>
</component>
'********** Copyright 2015 Roku Corp. All Rights Reserved. **********
sub Main()
showChannelSGScreen()
end sub
sub showChannelSGScreen()
print "in showChannelSGScreen"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("epgGridScene")
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
print "screen closed"
return
end if
end if
end while
end sub
edskitter wrote:I can get the EPG to render but I can not get the grid to have focus to move up / down / left / right. What am I missing?
function onKeyEvent(key as string, press as boolean) as boolean
handled = false
if (press)
if(key = "options")
m.dialog = CreateObject("roSGNode", "Dialog")
m.dialog.title = "HELLO WORLD"
m.dialog.message = "SIMPLE DIALOG"
handled = true
end if
end if
return handled
end function
m.top.jumpToItem = 0
m.top.animateToItem = 1