Skip to content

Instantly share code, notes, and snippets.

@0xTenable
Created August 5, 2016 17:10
Show Gist options
  • Save 0xTenable/bc426ecf899165f5616f75c7bb51ea96 to your computer and use it in GitHub Desktop.
Save 0xTenable/bc426ecf899165f5616f75c7bb51ea96 to your computer and use it in GitHub Desktop.
Main function fix for matrixebiz
'********************************************************************
'
' NewVideoPlayer -- Example Multi-Level Roku Channel
'
' Copyright (c) 2015, belltown. All rights reserved. See LICENSE.txt
'
'*********************************************************************
'
' Source files:
' Main.brs - This file
' UI.brs - User-interface code including message dialogs
' UITheme.brs - The channel's UI theme
' Parse.brs - Top-level parsing of Xml documents
' RokuFeed.brs - Handles parsing of Roku SDK example videoplayer-compatible feeds
' RssFeed.brs - Handles standard RSS elements and calls other functions to handle MRSS/iTunes extensions
' AtomFeed.brs - Add code here to support Atom Feeds (not currently supported)
' Mrss.brs - Handles MRSS RSS extensions. Go here to find what MRSS elements/attributes are supported
' Itunes.brs - Handles iTunes RSS extensions. Go here to find what iTunes elements/attributes are supported
' Url.brs - Utility functions to read data from a local path or external url
' Utils.brs - General-purpose utility functions
' FormatJson.brs - Only needed for version 3.1 firmware, which does not have native BrightScript FormatJSON support
'
' The _DEBUG_ON function MUST be defined once. Return True to enable debug-logging.
Function _DEBUG_ON () As Boolean : Return True : End Function
' The maximum number of feed items returned (0 = no limit)
Function MAX_ITEMS () As Integer : Return 20 : End Function
Sub Main ()
' Initialize the application-wide theme. Go to UITheme.brs to make changes to your application theme.
uiThemeInit ()
ShowMessageDialog()
End Sub
Function ShowMessageDialog() As Void
port = CreateObject("roMessagePort")
dialog = CreateObject("roMessageDialog")
dialog.SetMessagePort(port)
dialog.SetTitle("Channel Notice!")
dialog.SetText("Message")
dialog.AddButton(1, "OK")
dialog.EnableBackButton(true)
dialog.Show()
While True
dlgMsg = wait(0, dialog.GetMessagePort())
If type(dlgMsg) = "roMessageDialogEvent"
if dlgMsg.isButtonPressed()
if dlgMsg.GetIndex() = 1
' Parse the top-level Xml file, passing the resultant hierarchical content list to the UI display function
uiDisplay (parseXmlDocument ("pkg:/xml/categories.xml"))
exit while
end if
else if dlgMsg.isScreenClosed()
exit while
end if
end if
end while
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment