commit 612ddacc901f682fc6736d3a1670d0e0dc9734a8
parent 97272f3b92699d70437596665cf92829b8be51a0
Author: Brian C. Lane <bcl@brianlane.com>
Date: Sun, 13 Nov 2022 08:30:37 -0800
Add loader task startup
Diffstat:
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/HMS/components/MainLoaderTask.brs b/HMS/components/MainLoaderTask.brs
@@ -0,0 +1,15 @@
+'********************************************************************
+'** Home Media Server Application - MainLoaderTask
+'** Copyright (c) 2022 Brian C. Lane All Rights Reserved.
+'********************************************************************
+sub Init()
+ print "MainLoaderTask->Init()"
+
+ m.top.functionName = "GetContent"
+end sub
+
+' GetContent is executed when m.contentTask.control = "run" from MainScene
+sub GetContent()
+ print "MainLoaderTask->GetContent()"
+
+end sub
diff --git a/HMS/components/MainLoaderTask.xml b/HMS/components/MainLoaderTask.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<component name="MainLoaderTask" extends="Task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">
+ <script type="text/brightscript" uri="MainLoaderTask.brs" />
+
+ <interface>
+ <field id="content" type="node" />
+ </interface>
+</component>
diff --git a/HMS/components/MainScene.brs b/HMS/components/MainScene.brs
@@ -1,6 +1,27 @@
-' MainScene entry point
+'********************************************************************
+'** Home Media Server Application - MainScene
+'** Copyright (c) 2022 Brian C. Lane All Rights Reserved.
+'********************************************************************
sub Init()
- print "MainScene.Init() has been executed"
+ print "MainScene->Init()"
+ RunContentTask()
end sub
+
+
+sub RunContentTask()
+ print "MainScene->RunContentTask()"
+
+ m.contentTask = CreateObject("roSGNode", "MainLoaderTask")
+ m.contentTask.ObserveField("content", "OnMainContentLoaded")
+ m.contentTask.control = "run"
+end sub
+
+sub OnMainContentLoaded()
+ print "MainScene->OnMainContentLoaded()"
+
+' m.GridScreen.SetFocus(true)
+' m.loadingIndicator.visible = false
+' m.GridScreen.content = m.contentTask.content
+end sub