-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major changes including menu and today info
- Loading branch information
Showing
19 changed files
with
422 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
out | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
sub show(args as Object) | ||
m.top.backgroundColor = "0x0960CCFF" | ||
m.top.backgroundUri = "" | ||
|
||
m.grid = CreateObject("roSGNode", "GridView") | ||
m.grid.setFields({ | ||
style: "hero" | ||
posterShape: "16x9" | ||
}) | ||
|
||
content = CreateObject("roSGNode", "ContentNode") | ||
content.addfields({ | ||
HandlerConfigGrid: { | ||
name: "GridHandler" | ||
} | ||
}) | ||
|
||
m.grid.content = content | ||
|
||
m.top.ComponentController.callFunc("show", { | ||
view: m.grid | ||
}) | ||
|
||
m.grid.ObserveField("rowItemSelected", "OnGridItemSelected") | ||
end sub | ||
|
||
sub OnGridItemSelected(event as Object) | ||
grid = event.GetRoSGNode() | ||
selectedIndex = event.getdata() | ||
view = ShowView(selectedIndex[1]) | ||
end sub | ||
|
||
function ShowView(selectedIndex as integer) | ||
viewToShow = "NTunesScene" | ||
|
||
if selectedIndex = 1 then viewToShow = "TodayScene" | ||
|
||
view = CreateObject("roSGNode", viewToShow) | ||
|
||
m.top.ComponentController.callFunc("show", { | ||
view: view | ||
}) | ||
|
||
return view | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<component name="HomeScene" extends="BaseScene" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd"> | ||
<script type="text/brightscript" uri="pkg:/components/HomeScene.brs" /> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<component name="NTunesScene" extends="BaseScene" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd" initialFocus="audio_control_button"> | ||
<component name="NTunesScene" extends="SGDEXComponent" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd" initialFocus="audio_control_button"> | ||
<script type="text/brightscript" uri="pkg:/components/NTunesScene.brs" /> | ||
<children> | ||
<Group id="artwork"> | ||
<Poster | ||
id="current_show_image_path" | ||
width="500" | ||
height="500" | ||
translation="[100, 100]" /> | ||
<Group id="ntunesGroup"> | ||
<Group id="artwork"> | ||
<Poster | ||
id="current_show_image_path" | ||
width="500" | ||
height="500" | ||
translation="[100, 100]" /> | ||
</Group> | ||
<Group id="song_info" translation="[700, 100]"> | ||
<Label id="title" text="Now Playing" font="font:LargeBoldSystemFont" translation="[0, 0]" /> | ||
<Label id="current_track_title" font="font:MediumBoldSystemFont" text="Loading..." translation="[0, 60]" /> | ||
<Label id="current_track_artist_name" translation="[0, 120]" /> | ||
<Label id="current_show_name" translation="[0, 180]" /> | ||
</Group> | ||
<Group> | ||
<Button | ||
id="audio_control_button" | ||
translation="[100, 700]" | ||
text="Play" /> | ||
</Group> | ||
<Audio id="audio_player" /> | ||
<Timer id="refresh_timer" repeat="true" duration="10" /> | ||
</Group> | ||
<Group id="song_info" translation="[700, 100]"> | ||
<Label id="title" text="Now Playing" font="font:LargeBoldSystemFont" translation="[0, 0]" /> | ||
<Label id="current_track_title" font="font:MediumBoldSystemFont" text="Loading..." translation="[0, 60]" /> | ||
<Label id="current_track_artist_name" translation="[0, 120]" /> | ||
<Label id="current_show_name" translation="[0, 180]" /> | ||
</Group> | ||
<Group> | ||
<Button | ||
id="audio_control_button" | ||
translation="[100, 700]" | ||
text="Play" /> | ||
</Group> | ||
<Audio id="audio_player" /> | ||
<Timer id="refresh_timer" repeat="true" duration="10" /> | ||
</children> | ||
</component> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
sub Init() | ||
m.top.ObserveField("wasShown", "OnWasShown") | ||
end sub | ||
|
||
sub OnWasShown() | ||
m.top.setFocus(true) | ||
|
||
m.audio_track_index = 1 | ||
|
||
m.parks = [] | ||
m.park_id_index = 0 | ||
m.park_ids = [ "mk", "ep", "hs", "ak", "ds", "tl", "bb" ] | ||
|
||
setUpTodaySceneLabels() | ||
|
||
buildTodaySceneTasks() | ||
|
||
setUpTodaySceneRefreshTimer() | ||
|
||
setUpTodaySceneAudio() | ||
|
||
refreshTodaySceneData() | ||
end sub | ||
|
||
sub setUpTodaySceneLabels() | ||
m.park_image = m.top.findNode("park_image") | ||
m.name = m.top.findNode("name") | ||
m.todaysHours = m.top.findNode("todaysHours") | ||
m.tomorrowsHours = m.top.findNode("tomorrowsHours") | ||
end sub | ||
|
||
sub buildTodaySceneTasks() | ||
m.TodayParkHoursTask = CreateObject("roSGNode", "TodayParkHoursTask") | ||
m.TodayParkHoursTask.ObserveField("parks", "onTodaySceneParksChanged") | ||
end sub | ||
|
||
sub setUpTodaySceneRefreshTimer() | ||
m.refresh_timer = m.top.findNode("refresh_timer") | ||
m.refresh_timer.control = "start" | ||
m.refresh_timer.ObserveField("fire", "changeTodayScenePark") | ||
end sub | ||
|
||
sub setUpTodaySceneAudio() | ||
m.audio = m.top.findNode("audio_player") | ||
m.audio.observeField("state", "todaySceneAudioPlayerStateChanged") | ||
|
||
changeTodaySceneAudioTrack() | ||
end sub | ||
|
||
sub refreshTodaySceneData() | ||
m.TodayParkHoursTask.control = "RUN" | ||
end sub | ||
|
||
sub changeTodayScenePark() | ||
m.park_id_index++ | ||
|
||
if (m.park_id_index > 6) then m.park_id_index = 0 | ||
|
||
updateTodayScenePark() | ||
end sub | ||
|
||
sub updateTodayScenePark() | ||
current_park_id = m.park_ids[m.park_id_index] | ||
m.current_park = m.parks[current_park_id] | ||
m.park_image.uri = m.current_park.imageUrl | ||
m.name.text = m.current_park.name | ||
m.todaysHours.text = m.current_park.todaysHours | ||
m.tomorrowsHours.text = m.current_park.tomorrowsHours | ||
end sub | ||
|
||
sub onTodaySceneParksChanged() | ||
m.parks = m.TodayParkHoursTask.parks | ||
updateTodayScenePark() | ||
end sub | ||
|
||
sub todaySceneAudioPlayerStateChanged() | ||
if (m.audio.state = "finished") then | ||
m.audio_track_index++ | ||
|
||
if (m.audio_track_index > 16) then m.audio_track_index = 1 | ||
|
||
changeTodaySceneAudioTrack() | ||
end if | ||
end sub | ||
|
||
sub changeTodaySceneAudioTrack() | ||
audiocontent = createObject("RoSGNode", "ContentNode") | ||
audiocontent.url = "https://wdwntnow.oseast-us-1.phoenixnap.com/music/today_at_wdw/" + m.audio_track_index.ToStr() + ".mp3" | ||
|
||
m.audio.content = audiocontent | ||
m.audio.control = "play" | ||
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<component name="TodayScene" extends="SGDEXComponent" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd"> | ||
<script type="text/brightscript" uri="pkg:/components/TodayScene.brs" /> | ||
<children> | ||
<Group id="todayGroup"> | ||
<Group id="artwork"> | ||
<Poster | ||
id="park_image" | ||
height="1080" | ||
width="1920" | ||
translation="[0, 0]" /> | ||
</Group> | ||
<Group id="park_info" translation="[100, 100]"> | ||
<Label id="name" font="font:LargeBoldSystemFont" translation="[0, 0]" /> | ||
<Label id="todaysHoursLabel" font="font:MediumBoldSystemFont" translation="[0, 60]" text="Today's hours:" /> | ||
<Label id="todaysHours" font="font:MediumBoldSystemFont" translation="[270, 60]" /> | ||
<Label id="tomorrowsHoursLabel" font="font:MediumBoldSystemFont" translation="[0, 120]" text="Tomorrow's hours:" /> | ||
<Label id="tomorrowsHours" font="font:MediumBoldSystemFont" translation="[345, 120]" /> | ||
</Group> | ||
<Audio id="audio_player" /> | ||
<Timer id="refresh_timer" repeat="true" duration="10" /> | ||
</Group> | ||
</children> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
sub GetContent() | ||
' feed = ReadAsciiFile("pkg:/config/menu.json") | ||
' json = ParseJson(feed) | ||
json = ParseJson("{""WDWNT"":[{""id"":0,""title"":""WDWNTunes"",""shortDescription"":""Broadcasting Magic, Music, and Mayhem"",""thumbnail"":""https://wdwnt.com/wp-content/uploads/2017/11/WDWNTunes_v3_600.png""}, {""id"":1,""title"":""Today at WDW"",""shortDescription"":""View today's and tomorrow's park hours as you would on resort TV!"",""thumbnail"":""https://wdwntnow.oseast-us-1.phoenixnap.com/images/theme-park/80007944/01.jpg""}]}") | ||
rootNodeArray = ParseJsonToNodeArray(json) | ||
m.top.content.AppendChildren(rootNodeArray) | ||
end sub | ||
|
||
function ParseJsonToNodeArray(jsonAA as Object) as Object | ||
if jsonAA = invalid then return [] | ||
resultNodeArray = [] | ||
|
||
for each fieldInJsonAA in jsonAA | ||
mediaItemsArray = jsonAA[fieldInJsonAA] | ||
itemsNodeArray = [] | ||
for each mediaItem in mediaItemsArray | ||
itemNode = ParseMediaItemToNode(mediaItem, fieldInJsonAA) | ||
itemsNodeArray.Push(itemNode) | ||
end for | ||
rowNode = Utils_AAToContentNode({ | ||
title: fieldInJsonAA | ||
}) | ||
rowNode.AppendChildren(itemsNodeArray) | ||
|
||
resultNodeArray.Push(rowNode) | ||
end for | ||
|
||
return resultNodeArray | ||
end function | ||
|
||
function ParseMediaItemToNode(mediaItem as Object, mediaType as String) as Object | ||
itemNode = Utils_AAToContentNode({ | ||
"id" : mediaItem.id | ||
"title" : mediaItem.title | ||
"hdPosterUrl" : mediaItem.thumbnail | ||
"Description" : mediaItem.shortDescription | ||
}) | ||
|
||
if mediaItem = invalid then | ||
return itemNode | ||
end if | ||
|
||
return itemNode | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<component name="GridHandler" extends="ContentHandler" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd"> | ||
<script type="text/brightscript" uri="pkg:/components/content/GridHandler.brs" /> | ||
<script type="text/brightscript" uri="pkg:/source/rsg_utils.brs" /> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
|
||
<component name="NTunesNode" extends="ContentNode"> | ||
<interface> | ||
<field id="current_track_title" type="string" /> | ||
<field id="current_track_artist_name" type="string" /> | ||
<field id="current_show_name" type="string" /> | ||
<field id="current_show_image_path" type="string" /> | ||
<field id="next_track_title" type="string" /> | ||
<field id="next_track_artist_name" type="string" /> | ||
</interface> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
|
||
<component name="ParkNode" extends="ContentNode"> | ||
<interface> | ||
<field id="name" type="string" /> | ||
<field id="imageUrl" type="string" /> | ||
<field id="todaysHours" type="string" /> | ||
<field id="tomorrowsHours" type="string" /> | ||
</interface> | ||
</component> |
Oops, something went wrong.