move spinner to JFScene and migrate all other screnes to use it + use booleans on JFScene to control spinner + resize spinner to be similar size as video player spinner

This commit is contained in:
Charles Ewert 2023-11-21 21:14:40 -05:00
parent 26cf3517f8
commit d2fcc932b2
31 changed files with 84 additions and 139 deletions

View File

@ -64,9 +64,6 @@ sub init()
'set inital counts for overhang before content is loaded. 'set inital counts for overhang before content is loaded.
m.loadItemsTask.totalRecordCount = 0 m.loadItemsTask.totalRecordCount = 0
m.spinner = m.top.findNode("spinner")
m.spinner.visible = true
m.Alpha = m.top.findNode("AlphaMenu") m.Alpha = m.top.findNode("AlphaMenu")
m.AlphaSelected = m.top.findNode("AlphaSelected") m.AlphaSelected = m.top.findNode("AlphaSelected")
@ -92,7 +89,7 @@ end sub
'Load initial set of Data 'Load initial set of Data
sub loadInitialItems() sub loadInitialItems()
m.loadItemsTask.control = "stop" m.loadItemsTask.control = "stop"
m.spinner.visible = true startLoadingSpinner()
if m.top.parentItem.json.Type = "CollectionFolder" 'or m.top.parentItem.json.Type = "Folder" if m.top.parentItem.json.Type = "CollectionFolder" 'or m.top.parentItem.json.Type = "Folder"
m.top.HomeLibraryItem = m.top.parentItem.Id m.top.HomeLibraryItem = m.top.parentItem.Id
@ -238,7 +235,7 @@ sub loadInitialItems()
end if end if
m.loadItemsTask.observeField("content", "ItemDataLoaded") m.loadItemsTask.observeField("content", "ItemDataLoaded")
m.spinner.visible = true startLoadingSpinner(false)
m.loadItemsTask.control = "RUN" m.loadItemsTask.control = "RUN"
SetUpOptions() SetUpOptions()
end sub end sub
@ -450,6 +447,7 @@ end sub
' '
'Handle loaded data, and add to Grid 'Handle loaded data, and add to Grid
sub ItemDataLoaded(msg) sub ItemDataLoaded(msg)
stopLoadingSpinner()
m.top.alphaActive = false m.top.alphaActive = false
itemData = msg.GetData() itemData = msg.GetData()
m.loadItemsTask.unobserveField("content") m.loadItemsTask.unobserveField("content")
@ -475,7 +473,7 @@ sub ItemDataLoaded(msg)
m.genreList.setFocus(true) m.genreList.setFocus(true)
m.loading = false m.loading = false
m.spinner.visible = false stopLoadingSpinner()
return return
end if end if
@ -498,7 +496,7 @@ sub ItemDataLoaded(msg)
m.itemGrid.setFocus(true) m.itemGrid.setFocus(true)
m.genreList.setFocus(false) m.genreList.setFocus(false)
m.spinner.visible = false stopLoadingSpinner()
end sub end sub
' '
@ -571,7 +569,7 @@ end sub
' '
'Load next set of items 'Load next set of items
sub loadMoreData() sub loadMoreData()
m.spinner.visible = true startLoadingSpinner(false)
if m.Loading = true then return if m.Loading = true then return
m.Loading = true m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems m.loadItemsTask.startIndex = m.loadedItems
@ -594,7 +592,7 @@ sub onItemalphaSelected()
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = "" m.VoiceBox.text = ""
m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true startLoadingSpinner(false)
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -609,7 +607,7 @@ sub onvoiceFilter()
m.loadItemsTask.NameStartsWith = " " m.loadItemsTask.NameStartsWith = " "
m.loadItemsTask.searchTerm = m.voiceBox.text m.loadItemsTask.searchTerm = m.voiceBox.text
m.loadItemsTask.recursive = true m.loadItemsTask.recursive = true
m.spinner.visible = true startLoadingSpinner(false)
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -842,7 +840,6 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if end if
if key = "replay" if key = "replay"
m.spinner.visible = true
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.loadItemsTask.nameStartsWith = "" m.loadItemsTask.nameStartsWith = ""
m.voiceBox.text = "" m.voiceBox.text = ""

View File

@ -22,7 +22,6 @@
<Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" /> <Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" />
<Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" /> <Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" />
<ItemGridOptions id="options" visible="false" /> <ItemGridOptions id="options" visible="false" />
<Spinner id="spinner" translation="[900, 450]" />
<Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear"> <Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear">
<FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 0.25 ]" fieldToInterp="backdropTransition.opacity" /> <FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 0.25 ]" fieldToInterp="backdropTransition.opacity" />
<FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 0.25, 0.00 ]" fieldToInterp="backdrop.opacity" /> <FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 0.25, 0.00 ]" fieldToInterp="backdrop.opacity" />

View File

@ -17,7 +17,6 @@ sub setupNodes()
m.selectedMovieOfficialRating = m.top.findNode("selectedMovieOfficialRating") m.selectedMovieOfficialRating = m.top.findNode("selectedMovieOfficialRating")
m.movieLogo = m.top.findNode("movieLogo") m.movieLogo = m.top.findNode("movieLogo")
m.swapAnimation = m.top.findNode("backroundSwapAnimation") m.swapAnimation = m.top.findNode("backroundSwapAnimation")
m.spinner = m.top.findNode("spinner")
m.Alpha = m.top.findNode("AlphaMenu") m.Alpha = m.top.findNode("AlphaMenu")
m.AlphaSelected = m.top.findNode("AlphaSelected") m.AlphaSelected = m.top.findNode("AlphaSelected")
m.micButton = m.top.findNode("micButton") m.micButton = m.top.findNode("micButton")
@ -83,8 +82,6 @@ sub init()
'set inital counts for overhang before content is loaded. 'set inital counts for overhang before content is loaded.
m.loadItemsTask.totalRecordCount = 0 m.loadItemsTask.totalRecordCount = 0
m.spinner.visible = true
'Get reset folder setting 'Get reset folder setting
m.resetGrid = m.global.session.user.settings["itemgrid.reset"] m.resetGrid = m.global.session.user.settings["itemgrid.reset"]
@ -117,7 +114,7 @@ end sub
'Load initial set of Data 'Load initial set of Data
sub loadInitialItems() sub loadInitialItems()
m.loadItemsTask.control = "stop" m.loadItemsTask.control = "stop"
m.spinner.visible = true startLoadingSpinner(false)
if m.top.parentItem.json.Type = "CollectionFolder" if m.top.parentItem.json.Type = "CollectionFolder"
m.top.HomeLibraryItem = m.top.parentItem.Id m.top.HomeLibraryItem = m.top.parentItem.Id
@ -219,7 +216,6 @@ sub loadInitialItems()
end if end if
m.loadItemsTask.observeField("content", "ItemDataLoaded") m.loadItemsTask.observeField("content", "ItemDataLoaded")
m.spinner.visible = true
m.loadItemsTask.control = "RUN" m.loadItemsTask.control = "RUN"
m.getFiltersTask.observeField("filters", "FilterDataLoaded") m.getFiltersTask.observeField("filters", "FilterDataLoaded")
@ -436,7 +432,7 @@ sub ItemDataLoaded(msg)
m.genreList.setFocus(true) m.genreList.setFocus(true)
m.loading = false m.loading = false
m.spinner.visible = false stopLoadingSpinner()
' Return focus to options menu if it was opened while library was loading ' Return focus to options menu if it was opened while library was loading
if m.options.visible if m.options.visible
m.options.setFocus(true) m.options.setFocus(true)
@ -486,7 +482,7 @@ sub ItemDataLoaded(msg)
m.emptyText.visible = true m.emptyText.visible = true
end if end if
m.spinner.visible = false stopLoadingSpinner()
' Return focus to options menu if it was opened while library was loading ' Return focus to options menu if it was opened while library was loading
if m.options.visible if m.options.visible
m.options.setFocus(true) m.options.setFocus(true)
@ -691,7 +687,7 @@ end sub
' '
'Load next set of items 'Load next set of items
sub loadMoreData() sub loadMoreData()
m.spinner.visible = true startLoadingSpinner(false)
if m.Loading = true then return if m.Loading = true then return
m.Loading = true m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems m.loadItemsTask.startIndex = m.loadedItems
@ -736,7 +732,6 @@ sub onItemalphaSelected()
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = "" m.VoiceBox.text = ""
m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -751,7 +746,6 @@ sub onvoiceFilter()
m.loadItemsTask.NameStartsWith = " " m.loadItemsTask.NameStartsWith = " "
m.loadItemsTask.searchTerm = m.voiceBox.text m.loadItemsTask.searchTerm = m.voiceBox.text
m.loadItemsTask.recursive = true m.loadItemsTask.recursive = true
m.spinner.visible = true
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -924,7 +918,6 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if end if
if key = "replay" if key = "replay"
m.spinner.visible = true
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.loadItemsTask.nameStartsWith = "" m.loadItemsTask.nameStartsWith = ""
m.voiceBox.text = "" m.voiceBox.text = ""

View File

@ -39,7 +39,6 @@
<Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" /> <Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" />
<Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" /> <Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" />
<ItemGridOptions id="options" visible="false" /> <ItemGridOptions id="options" visible="false" />
<Spinner id="spinner" translation="[900, 450]" />
<Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear"> <Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear">
<FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 1.00 ]" fieldToInterp="backdropTransition.opacity" /> <FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 1.00 ]" fieldToInterp="backdropTransition.opacity" />
<FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 1.00, 0.00 ]" fieldToInterp="backdrop.opacity" /> <FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 1.00, 0.00 ]" fieldToInterp="backdrop.opacity" />

View File

@ -17,7 +17,6 @@ sub setupNodes()
m.selectedArtistGenres = m.top.findNode("selectedArtistGenres") m.selectedArtistGenres = m.top.findNode("selectedArtistGenres")
m.artistLogo = m.top.findNode("artistLogo") m.artistLogo = m.top.findNode("artistLogo")
m.swapAnimation = m.top.findNode("backroundSwapAnimation") m.swapAnimation = m.top.findNode("backroundSwapAnimation")
m.spinner = m.top.findNode("spinner")
m.Alpha = m.top.findNode("AlphaMenu") m.Alpha = m.top.findNode("AlphaMenu")
m.AlphaSelected = m.top.findNode("AlphaSelected") m.AlphaSelected = m.top.findNode("AlphaSelected")
m.micButton = m.top.findNode("micButton") m.micButton = m.top.findNode("micButton")
@ -77,8 +76,6 @@ sub init()
'set inital counts for overhang before content is loaded. 'set inital counts for overhang before content is loaded.
m.loadItemsTask.totalRecordCount = 0 m.loadItemsTask.totalRecordCount = 0
m.spinner.visible = true
'Get reset folder setting 'Get reset folder setting
m.resetGrid = m.global.session.user.settings["itemgrid.reset"] m.resetGrid = m.global.session.user.settings["itemgrid.reset"]
@ -111,7 +108,7 @@ end sub
'Load initial set of Data 'Load initial set of Data
sub loadInitialItems() sub loadInitialItems()
m.loadItemsTask.control = "stop" m.loadItemsTask.control = "stop"
m.spinner.visible = true startLoadingSpinner()
if LCase(m.top.parentItem.json.Type) = "collectionfolder" if LCase(m.top.parentItem.json.Type) = "collectionfolder"
m.top.HomeLibraryItem = m.top.parentItem.Id m.top.HomeLibraryItem = m.top.parentItem.Id
@ -204,7 +201,6 @@ sub loadInitialItems()
end if end if
m.loadItemsTask.observeField("content", "ItemDataLoaded") m.loadItemsTask.observeField("content", "ItemDataLoaded")
m.spinner.visible = true
m.loadItemsTask.control = "RUN" m.loadItemsTask.control = "RUN"
SetUpOptions() SetUpOptions()
end sub end sub
@ -326,6 +322,7 @@ end sub
' '
'Handle loaded data, and add to Grid 'Handle loaded data, and add to Grid
sub ItemDataLoaded(msg) sub ItemDataLoaded(msg)
stopLoadingSpinner()
m.top.alphaActive = false m.top.alphaActive = false
itemData = msg.GetData() itemData = msg.GetData()
m.loadItemsTask.unobserveField("content") m.loadItemsTask.unobserveField("content")
@ -351,7 +348,6 @@ sub ItemDataLoaded(msg)
m.loadedRows = m.loadedItems / m.genreList.numColumns m.loadedRows = m.loadedItems / m.genreList.numColumns
m.loading = false m.loading = false
m.spinner.visible = false
return return
end if end if
@ -374,8 +370,6 @@ sub ItemDataLoaded(msg)
m.emptyText.text = tr("NO_ITEMS").Replace("%1", m.top.parentItem.Type) m.emptyText.text = tr("NO_ITEMS").Replace("%1", m.top.parentItem.Type)
m.emptyText.visible = true m.emptyText.visible = true
end if end if
m.spinner.visible = false
end sub end sub
' '
@ -612,7 +606,6 @@ sub onItemalphaSelected()
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.VoiceBox.text = "" m.VoiceBox.text = ""
m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected m.loadItemsTask.nameStartsWith = m.alpha.itemAlphaSelected
m.spinner.visible = true
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -627,7 +620,6 @@ sub onvoiceFilter()
m.loadItemsTask.NameStartsWith = " " m.loadItemsTask.NameStartsWith = " "
m.loadItemsTask.searchTerm = m.voiceBox.text m.loadItemsTask.searchTerm = m.voiceBox.text
m.loadItemsTask.recursive = true m.loadItemsTask.recursive = true
m.spinner.visible = true
loadInitialItems() loadInitialItems()
end if end if
end sub end sub
@ -787,7 +779,6 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if end if
if key = "replay" if key = "replay"
m.spinner.visible = true
m.loadItemsTask.searchTerm = "" m.loadItemsTask.searchTerm = ""
m.loadItemsTask.nameStartsWith = "" m.loadItemsTask.nameStartsWith = ""
m.voiceBox.text = "" m.voiceBox.text = ""

View File

@ -24,7 +24,6 @@
<Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" /> <Button id="micButton" maxWidth="20" translation="[20, 120]" iconUri="pkg:/images/icons/mic_icon.png" />
<Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" /> <Label translation="[0,540]" id="emptyText" font="font:LargeSystemFont" width="1910" horizAlign="center" vertAlign="center" height="64" visible="false" />
<ItemGridOptions id="options" visible="false" /> <ItemGridOptions id="options" visible="false" />
<Spinner id="spinner" translation="[900, 450]" />
<Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear"> <Animation id="backroundSwapAnimation" duration="1" repeat="false" easeFunction="linear">
<FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 1.00 ]" fieldToInterp="backdropTransition.opacity" /> <FloatFieldInterpolator id="fadeinLoading" key="[0.0, 1.0]" keyValue="[ 0.00, 1.00 ]" fieldToInterp="backdropTransition.opacity" />
<FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 1.00, 0.00 ]" fieldToInterp="backdrop.opacity" /> <FloatFieldInterpolator id="fadeoutLoaded" key="[0.0, 1.0]" keyValue="[ 1.00, 0.00 ]" fieldToInterp="backdrop.opacity" />

View File

@ -3,6 +3,31 @@ import "pkg:/source/utils/misc.bs"
sub init() sub init()
m.top.backgroundColor = "#262626" '"#101010" m.top.backgroundColor = "#262626" '"#101010"
m.top.backgroundURI = "" m.top.backgroundURI = ""
m.spinner = m.top.findNode("spinner")
end sub
' Triggered when the isLoading boolean component field is changed
sub isLoadingChanged()
if m.top.isLoading
m.spinner.visible = true
else
m.spinner.visible = false
end if
end sub
' Triggered when the disableRemote boolean component field is changed
sub disableRemoteChanged()
if m.top.disableRemote
dialog = createObject("roSGNode", "ProgressDialog")
dialog.id = "invisibiledialog"
dialog.visible = false
dialog.opacity = 0
m.top.dialog = dialog
else
if isValid(m.top.dialog)
m.top.dialog.close = true
end if
end if
end sub end sub
function onKeyEvent(key as string, press as boolean) as boolean function onKeyEvent(key as string, press as boolean) as boolean

View File

@ -3,9 +3,11 @@
<children> <children>
<Group id="content" /> <Group id="content" />
<JFOverhang id="overhang" /> <JFOverhang id="overhang" />
<Spinner id="spinner" translation="[897, 477]" visible="false" />
</children> </children>
<interface> <interface>
<field id="isLoading" type="boolean" value="false" /> <field id="disableRemote" type="boolean" value="false" onchange="disableRemoteChanged" />
<field id="isLoading" type="boolean" value="false" onchange="isLoadingChanged" />
<field id="exit" type="boolean" alwaysNotify="true" /> <field id="exit" type="boolean" alwaysNotify="true" />
</interface> </interface>
</component> </component>

View File

@ -2,5 +2,5 @@ sub init()
m.top.poster.uri = "pkg:/images/spinner.png" m.top.poster.uri = "pkg:/images/spinner.png"
m.top.control = "start" m.top.control = "start"
m.top.clockwise = true m.top.clockwise = true
m.top.spinInterval = 3 m.top.spinInterval = 1
end sub end sub

View File

@ -5,7 +5,6 @@ sub init()
m.log = log.Logger("SetServerScreen") m.log = log.Logger("SetServerScreen")
m.top.setFocus(true) m.top.setFocus(true)
m.spinner = m.top.findNode("spinner")
m.serverPicker = m.top.findNode("serverPicker") m.serverPicker = m.top.findNode("serverPicker")
m.serverUrlTextbox = m.top.findNode("serverUrlTextbox") m.serverUrlTextbox = m.top.findNode("serverUrlTextbox")
m.serverUrlContainer = m.top.findNode("serverUrlContainer") m.serverUrlContainer = m.top.findNode("serverUrlContainer")
@ -76,7 +75,7 @@ sub ScanForServers()
'run the task 'run the task
m.ssdpScanner.observeField("content", "ScanForServersComplete") m.ssdpScanner.observeField("content", "ScanForServersComplete")
m.ssdpScanner.control = "RUN" m.ssdpScanner.control = "RUN"
m.spinner.visible = true startLoadingSpinner(false)
end sub end sub
sub ScanForServersComplete(event) sub ScanForServersComplete(event)
@ -109,7 +108,7 @@ sub ScanForServersComplete(event)
end if end if
m.serverPicker.content = items m.serverPicker.content = items
m.spinner.visible = false stopLoadingSpinner()
'if we have at least one server, focus on the server picker 'if we have at least one server, focus on the server picker
if m.servers.Count() > 0 if m.servers.Count() > 0

View File

@ -15,7 +15,6 @@
</LayoutGroup> </LayoutGroup>
<!--background for server picker--> <!--background for server picker-->
<Rectangle color="0x00000020" width="1620" height="400"> <Rectangle color="0x00000020" width="1620" height="400">
<Spinner id="spinner" translation="[717, 136]" />
<MarkupList id="serverPicker" translation="[50, 20]" itemComponentName="JFServer" itemSpacing="[0, 10]" itemSize="[1520, 100]" numRows="3" vertFocusAnimationStyle="floatingFocus" /> <MarkupList id="serverPicker" translation="[50, 20]" itemComponentName="JFServer" itemSpacing="[0, 10]" itemSize="[1520, 100]" numRows="3" vertFocusAnimationStyle="floatingFocus" />
</Rectangle> </Rectangle>

View File

@ -1,3 +1,5 @@
import "pkg:/source/utils/misc.bs"
sub init() sub init()
m.EPGLaunchCompleteSignaled = false m.EPGLaunchCompleteSignaled = false
m.scheduleGrid = m.top.findNode("scheduleGrid") m.scheduleGrid = m.top.findNode("scheduleGrid")
@ -26,8 +28,6 @@ sub init()
m.top.lastFocus = m.scheduleGrid m.top.lastFocus = m.scheduleGrid
m.channelIndex = {} m.channelIndex = {}
m.spinner = m.top.findNode("spinner")
end sub end sub
sub channelFilterSet() sub channelFilterSet()
@ -48,14 +48,14 @@ sub channelsearchTermSet()
if LCase(m.top.searchTerm) = LCase(tr("all")) or m.LoadChannelsTask.searchTerm = LCase(tr("all")) if LCase(m.top.searchTerm) = LCase(tr("all")) or m.LoadChannelsTask.searchTerm = LCase(tr("all"))
m.top.searchTerm = " " m.top.searchTerm = " "
m.LoadChannelsTask.searchTerm = " " m.LoadChannelsTask.searchTerm = " "
m.spinner.visible = true startLoadingSpinner()
m.LoadChannelsTask.control = "RUN" m.LoadChannelsTask.control = "RUN"
'filter if the searterm is not invalid 'filter if the searterm is not invalid
else if m.top.searchTerm <> invalid and LCase(m.LoadChannelsTask.searchTerm) <> LCase(m.top.searchTerm) else if m.top.searchTerm <> invalid and LCase(m.LoadChannelsTask.searchTerm) <> LCase(m.top.searchTerm)
if m.LoadChannelsTask.state = "run" then m.LoadChannelsTask.control = "stop" if m.LoadChannelsTask.state = "run" then m.LoadChannelsTask.control = "stop"
m.LoadChannelsTask.searchTerm = m.top.searchTerm m.LoadChannelsTask.searchTerm = m.top.searchTerm
m.spinner.visible = true startLoadingSpinner()
m.LoadChannelsTask.control = "RUN" m.LoadChannelsTask.control = "RUN"
end if end if
@ -125,7 +125,7 @@ sub onScheduleLoaded()
m.scheduleGrid.showLoadingDataFeedback = false m.scheduleGrid.showLoadingDataFeedback = false
m.scheduleGrid.setFocus(true) m.scheduleGrid.setFocus(true)
m.LoadScheduleTask.schedule = [] m.LoadScheduleTask.schedule = []
m.spinner.visible = false stopLoadingSpinner()
end sub end sub
sub onProgramFocused() sub onProgramFocused()

View File

@ -12,7 +12,6 @@
programTitleFocusedColor="#ffffff" iconFocusedColor="#ff0000" programTitleFocusedColor="#ffffff" iconFocusedColor="#ff0000"
showPastTimeScreen="true" pastTimeScreenBlendColor="#555555" showPastTimeScreen="true" pastTimeScreenBlendColor="#555555"
/> />
<Spinner id="spinner" translation="[900, 450]" />
<Animation id="gridMoveAnimation" duration="1" repeat="false" easeFunction="outQuad"> <Animation id="gridMoveAnimation" duration="1" repeat="false" easeFunction="outQuad">
<Vector2DFieldInterpolator id="gridMoveAnimationPosition" key="[0.0, 0.5]" fieldToInterp="scheduleGrid.translation" /> <Vector2DFieldInterpolator id="gridMoveAnimationPosition" key="[0.0, 0.5]" fieldToInterp="scheduleGrid.translation" />
</Animation> </Animation>

View File

@ -14,6 +14,7 @@ sub audioStateChanged()
m.top.disableScreenSaver = (currentState = "playing") m.top.disableScreenSaver = (currentState = "playing")
if currentState = "playing" and not m.playReported if currentState = "playing" and not m.playReported
stopLoadingSpinner()
reportedPlaybackState = "start" reportedPlaybackState = "start"
m.playReported = true m.playReported = true
else if currentState = "stopped" or currentState = "finished" else if currentState = "stopped" or currentState = "finished"

View File

@ -21,8 +21,6 @@ sub init()
m.buttonGrp.setFocus(true) m.buttonGrp.setFocus(true)
m.top.lastFocus = m.buttonGrp m.top.lastFocus = m.buttonGrp
m.spinner = m.top.findNode("spinner")
m.top.observeField("itemContent", "itemContentChanged") m.top.observeField("itemContent", "itemContentChanged")
end sub end sub
@ -150,7 +148,7 @@ sub itemContentChanged()
SetUpVideoOptions(itemData.mediaSources) SetUpVideoOptions(itemData.mediaSources)
SetUpAudioOptions(itemData.mediaStreams) SetUpAudioOptions(itemData.mediaStreams)
m.buttonGrp.visible = true m.buttonGrp.visible = true
m.spinner.visible = false stopLoadingSpinner()
end sub end sub

View File

@ -40,7 +40,6 @@
</LayoutGroup> </LayoutGroup>
</LayoutGroup> </LayoutGroup>
<MovieOptions id="movieOptions" visible="false" /> <MovieOptions id="movieOptions" visible="false" />
<Spinner id="spinner" translation="[900, 450]" visible="true" />
<!-- "Cast and Crew" row --> <!-- "Cast and Crew" row -->
<extrasSlider id="movieExtras" /> <extrasSlider id="movieExtras" />

View File

@ -12,8 +12,6 @@ sub init()
m.songListRect = m.top.FindNode("songListRect") m.songListRect = m.top.FindNode("songListRect")
m.songList.observeField("doneLoading", "onDoneLoading") m.songList.observeField("doneLoading", "onDoneLoading")
m.spinner = m.top.findNode("spinner")
m.spinner.visible = true
m.dscr = m.top.findNode("overview") m.dscr = m.top.findNode("overview")
createDialogPallete() createDialogPallete()
@ -99,8 +97,6 @@ end sub
function onKeyEvent(key as string, press as boolean) as boolean function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false if not press then return false
if m.spinner.visible then return false
if key = "options" if key = "options"
if m.dscr.isTextEllipsized if m.dscr.isTextEllipsized
createFullDscrDlg() createFullDscrDlg()
@ -169,9 +165,5 @@ end sub
sub onDoneLoading() sub onDoneLoading()
m.songList.unobservefield("doneLoading") m.songList.unobservefield("doneLoading")
m.spinner.visible = false stopLoadingSpinner()
end sub
sub OnScreenHidden()
m.spinner.visible = false
end sub end sub

View File

@ -20,7 +20,6 @@
</LayoutGroup> </LayoutGroup>
</LayoutGroup> </LayoutGroup>
</LayoutGroup> </LayoutGroup>
<Spinner id="spinner" translation="[920, 540]" visible="false" />
</children> </children>
<interface> <interface>
<field id="pageContent" type="node" onChange="pageContentChanged" /> <field id="pageContent" type="node" onChange="pageContentChanged" />

View File

@ -76,6 +76,7 @@ sub OnScreenShown()
m.overhang.isVisible = false m.overhang.isVisible = false
m.overhang.opacity = "1" m.overhang.opacity = "1"
end if end if
stopLoadingSpinner()
end sub end sub
sub OnScreenHidden() sub OnScreenHidden()

View File

@ -11,8 +11,6 @@ sub init()
m.songListRect = m.top.FindNode("songListRect") m.songListRect = m.top.FindNode("songListRect")
m.songList.observeField("doneLoading", "onDoneLoading") m.songList.observeField("doneLoading", "onDoneLoading")
m.spinner = m.top.findNode("spinner")
m.spinner.visible = true
m.dscr = m.top.findNode("overview") m.dscr = m.top.findNode("overview")
createDialogPallete() createDialogPallete()
@ -98,8 +96,6 @@ end sub
function onKeyEvent(key as string, press as boolean) as boolean function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false if not press then return false
if m.spinner.visible then return false
if key = "options" if key = "options"
if m.dscr.isTextEllipsized if m.dscr.isTextEllipsized
createFullDscrDlg() createFullDscrDlg()
@ -160,9 +156,5 @@ end sub
sub onDoneLoading() sub onDoneLoading()
m.songList.unobservefield("doneLoading") m.songList.unobservefield("doneLoading")
m.spinner.visible = false stopLoadingSpinner()
end sub
sub OnScreenHidden()
m.spinner.visible = false
end sub end sub

View File

@ -19,7 +19,6 @@
</LayoutGroup> </LayoutGroup>
</LayoutGroup> </LayoutGroup>
</LayoutGroup> </LayoutGroup>
<Spinner id="spinner" translation="[920, 540]" visible="false" />
</children> </children>
<interface> <interface>
<field id="pageContent" type="node" onChange="pageContentChanged" /> <field id="pageContent" type="node" onChange="pageContentChanged" />

View File

@ -23,12 +23,14 @@ sub itemContentChanged()
if isValidToContinue(m.top.itemIndex) if isValidToContinue(m.top.itemIndex)
m.LoadLibrariesTask = createObject("roSGNode", "LoadPhotoTask") m.LoadLibrariesTask = createObject("roSGNode", "LoadPhotoTask")
if isValid(m.top.itemsNode) if isValid(m.top.itemsNode)
stopLoadingSpinner()
if isValid(m.top.itemsNode.content) if isValid(m.top.itemsNode.content)
m.LoadLibrariesTask.itemNodeContent = m.top.itemsNode.content.getChild(m.top.itemIndex) m.LoadLibrariesTask.itemNodeContent = m.top.itemsNode.content.getChild(m.top.itemIndex)
else if isValidAndNotEmpty(m.top.itemsNode.id) else if isValidAndNotEmpty(m.top.itemsNode.id)
m.LoadLibrariesTask.itemNodeContent = m.top.itemsNode m.LoadLibrariesTask.itemNodeContent = m.top.itemsNode
end if end if
else if isValid(m.top.itemsArray) else if isValid(m.top.itemsArray)
stopLoadingSpinner()
itemContent = m.top.itemsArray[m.top.itemIndex] itemContent = m.top.itemsArray[m.top.itemIndex]
m.LoadLibrariesTask.itemArrayContent = itemContent m.LoadLibrariesTask.itemArrayContent = itemContent
else else

View File

@ -6,7 +6,6 @@ import "pkg:/source/utils/deviceCapabilities.bs"
sub init() sub init()
m.top.optionsAvailable = false m.top.optionsAvailable = false
m.searchSpinner = m.top.findnode("searchSpinner")
m.searchSelect = m.top.findnode("searchSelect") m.searchSelect = m.top.findnode("searchSelect")
m.searchTask = CreateObject("roSGNode", "SearchTask") m.searchTask = CreateObject("roSGNode", "SearchTask")
@ -20,12 +19,12 @@ sub searchMedias()
query = m.top.searchAlpha query = m.top.searchAlpha
'if user deletes the search string hide the spinner 'if user deletes the search string hide the spinner
if query.len() = 0 if query.len() = 0
m.searchSpinner.visible = false stopLoadingSpinner()
end if end if
'if search task is running and user selectes another letter stop the search and load the next letter 'if search task is running and user selectes another letter stop the search and load the next letter
m.searchTask.control = "stop" m.searchTask.control = "stop"
if query <> invalid and query <> "" if query <> invalid and query <> ""
m.searchSpinner.visible = true startLoadingSpinner(false)
end if end if
m.searchTask.observeField("results", "loadResults") m.searchTask.observeField("results", "loadResults")
m.searchTask.query = query m.searchTask.query = query
@ -37,7 +36,7 @@ end sub
sub loadResults() sub loadResults()
m.searchTask.unobserveField("results") m.searchTask.unobserveField("results")
m.searchSpinner.visible = false stopLoadingSpinner()
m.searchSelect.itemdata = m.searchTask.results m.searchSelect.itemdata = m.searchTask.results
m.searchSelect.query = m.top.SearchAlpha m.searchSelect.query = m.top.SearchAlpha
m.searchHelpText.visible = false m.searchHelpText.visible = false

View File

@ -10,7 +10,6 @@
<SearchRow id="searchSelect" visible="true" focusable="true" /> <SearchRow id="searchSelect" visible="true" focusable="true" />
</LayoutGroup> </LayoutGroup>
<OptionsSlider id="options" /> <OptionsSlider id="options" />
<Spinner id="searchSpinner" visible="false" translation="[1050, 500]" />
</children> </children>
<interface> <interface>
<field id="query" type="string" alwaysNotify="true" /> <field id="query" type="string" alwaysNotify="true" />

View File

@ -299,6 +299,8 @@ sub onVideoContentLoaded()
videoContent = m.LoadMetaDataTask.content videoContent = m.LoadMetaDataTask.content
m.LoadMetaDataTask.content = [] m.LoadMetaDataTask.content = []
stopLoadingSpinner()
' If we have nothing to play, return to previous screen ' If we have nothing to play, return to previous screen
if not isValid(videoContent) if not isValid(videoContent)
showPlaybackErrorDialog(tr("There was an error retrieving the data for this item from the server.")) showPlaybackErrorDialog(tr("There was an error retrieving the data for this item from the server."))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -48,12 +48,11 @@ sub Main (args as dynamic) as void
' remove login scenes from the stack ' remove login scenes from the stack
sceneManager.callFunc("clearScenes") sceneManager.callFunc("clearScenes")
stopLoadingSpinner()
' load home page ' load home page
sceneManager.currentUser = m.global.session.user.name sceneManager.currentUser = m.global.session.user.name
group = CreateHomeGroup() group = CreateHomeGroup()
group.callFunc("loadLibraries") group.callFunc("loadLibraries")
stopLoadingSpinner()
sceneManager.callFunc("pushScene", group) sceneManager.callFunc("pushScene", group)
m.scene.observeField("exit", m.port) m.scene.observeField("exit", m.port)
@ -160,7 +159,7 @@ sub Main (args as dynamic) as void
' can't play the item without knowing what type it is ' can't play the item without knowing what type it is
if isValid(itemType) if isValid(itemType)
startMediaLoadingSpinner() startLoadingSpinner()
m.global.queueManager.callFunc("clear") ' empty queue/playlist m.global.queueManager.callFunc("clear") ' empty queue/playlist
m.global.queueManager.callFunc("resetShuffle") ' turn shuffle off m.global.queueManager.callFunc("resetShuffle") ' turn shuffle off
@ -205,21 +204,18 @@ sub Main (args as dynamic) as void
else if itemType = "photoalbum" else if itemType = "photoalbum"
quickplay.photoAlbum(itemNode) quickplay.photoAlbum(itemNode)
end if end if
stopLoadingSpinner()
m.global.queueManager.callFunc("playQueue") m.global.queueManager.callFunc("playQueue")
end if end if
end if end if
stopLoadingSpinner()
elapsed = timeSpan.TotalMilliseconds() / 1000 elapsed = timeSpan.TotalMilliseconds() / 1000
print "Quick Play finished loading in " + elapsed.toStr() + " seconds." print "Quick Play finished loading in " + elapsed.toStr() + " seconds."
else if isNodeEvent(msg, "selectedItem") else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow ' If you select a library from ANYWHERE, follow this flow
selectedItem = msg.getData() selectedItem = msg.getData()
if isValid(selectedItem) if isValid(selectedItem)
startMediaLoadingSpinner() startLoadingSpinner()
selectedItemType = selectedItem.type selectedItemType = selectedItem.type
if selectedItemType = "CollectionFolder" if selectedItemType = "CollectionFolder"
if selectedItem.collectionType = "movies" if selectedItem.collectionType = "movies"
group = CreateMovieLibraryView(selectedItem) group = CreateMovieLibraryView(selectedItem)
@ -228,7 +224,6 @@ sub Main (args as dynamic) as void
else else
group = CreateItemGrid(selectedItem) group = CreateItemGrid(selectedItem)
end if end if
stopLoadingSpinner()
sceneManager.callFunc("pushScene", group) sceneManager.callFunc("pushScene", group)
else if selectedItemType = "Folder" and selectedItem.json.type = "Genre" else if selectedItemType = "Folder" and selectedItem.json.type = "Genre"
' User clicked on a genre folder ' User clicked on a genre folder
@ -237,15 +232,12 @@ sub Main (args as dynamic) as void
else else
group = CreateItemGrid(selectedItem) group = CreateItemGrid(selectedItem)
end if end if
stopLoadingSpinner()
sceneManager.callFunc("pushScene", group) sceneManager.callFunc("pushScene", group)
else if selectedItemType = "Folder" and selectedItem.json.type = "MusicGenre" else if selectedItemType = "Folder" and selectedItem.json.type = "MusicGenre"
group = CreateMusicLibraryView(selectedItem) group = CreateMusicLibraryView(selectedItem)
stopLoadingSpinner()
sceneManager.callFunc("pushScene", group) sceneManager.callFunc("pushScene", group)
else if selectedItemType = "UserView" or selectedItemType = "Folder" or selectedItemType = "Channel" or selectedItemType = "Boxset" else if selectedItemType = "UserView" or selectedItemType = "Folder" or selectedItemType = "Channel" or selectedItemType = "Boxset"
group = CreateItemGrid(selectedItem) group = CreateItemGrid(selectedItem)
stopLoadingSpinner()
sceneManager.callFunc("pushScene", group) sceneManager.callFunc("pushScene", group)
else if selectedItemType = "Episode" else if selectedItemType = "Episode"
' User has selected a TV episode they want us to play ' User has selected a TV episode they want us to play
@ -255,7 +247,6 @@ sub Main (args as dynamic) as void
end if end if
selectedItem.selectedAudioStreamIndex = audio_stream_idx selectedItem.selectedAudioStreamIndex = audio_stream_idx
stopLoadingSpinner()
' Display playback options dialog ' Display playback options dialog
if selectedItem.json.userdata.PlaybackPositionTicks > 0 if selectedItem.json.userdata.PlaybackPositionTicks > 0
m.global.queueManager.callFunc("hold", selectedItem) m.global.queueManager.callFunc("hold", selectedItem)
@ -268,20 +259,15 @@ sub Main (args as dynamic) as void
else if selectedItemType = "Series" else if selectedItemType = "Series"
group = CreateSeriesDetailsGroup(selectedItem.json.id) group = CreateSeriesDetailsGroup(selectedItem.json.id)
stopLoadingSpinner()
else if selectedItemType = "Season" else if selectedItemType = "Season"
group = CreateSeasonDetailsGroupByID(selectedItem.json.SeriesId, selectedItem.id) group = CreateSeasonDetailsGroupByID(selectedItem.json.SeriesId, selectedItem.id)
stopLoadingSpinner()
else if selectedItemType = "Movie" else if selectedItemType = "Movie"
' open movie detail page ' open movie detail page
group = CreateMovieDetailsGroup(selectedItem) group = CreateMovieDetailsGroup(selectedItem)
stopLoadingSpinner()
else if selectedItemType = "Person" else if selectedItemType = "Person"
CreatePersonView(selectedItem) CreatePersonView(selectedItem)
stopLoadingSpinner()
else if selectedItemType = "TvChannel" or selectedItemType = "Video" or selectedItemType = "Program" else if selectedItemType = "TvChannel" or selectedItemType = "Video" or selectedItemType = "Program"
' User selected a Live TV channel / program ' User selected a Live TV channel / program
stopLoadingSpinner()
' Show Channel Loading spinner ' Show Channel Loading spinner
dialog = createObject("roSGNode", "ProgressDialog") dialog = createObject("roSGNode", "ProgressDialog")
dialog.title = tr("Loading Channel Data") dialog.title = tr("Loading Channel Data")
@ -312,7 +298,6 @@ sub Main (args as dynamic) as void
quickplay.photo(selectedItem) quickplay.photo(selectedItem)
end if end if
stopLoadingSpinner()
else if selectedItemType = "PhotoAlbum" else if selectedItemType = "PhotoAlbum"
print "a photo album was selected" print "a photo album was selected"
print "selectedItem=", selectedItem print "selectedItem=", selectedItem
@ -331,27 +316,21 @@ sub Main (args as dynamic) as void
photoPlayer.itemIndex = 0 photoPlayer.itemIndex = 0
m.global.sceneManager.callfunc("pushScene", photoPlayer) m.global.sceneManager.callfunc("pushScene", photoPlayer)
end if end if
stopLoadingSpinner()
else if selectedItemType = "MusicArtist" else if selectedItemType = "MusicArtist"
group = CreateArtistView(selectedItem.json) group = CreateArtistView(selectedItem.json)
stopLoadingSpinner()
if not isValid(group) if not isValid(group)
message_dialog(tr("Unable to find any albums or songs belonging to this artist")) message_dialog(tr("Unable to find any albums or songs belonging to this artist"))
end if end if
else if selectedItemType = "MusicAlbum" else if selectedItemType = "MusicAlbum"
group = CreateAlbumView(selectedItem.json) group = CreateAlbumView(selectedItem.json)
stopLoadingSpinner()
else if selectedItemType = "MusicVideo" else if selectedItemType = "MusicVideo"
group = CreateMovieDetailsGroup(selectedItem) group = CreateMovieDetailsGroup(selectedItem)
stopLoadingSpinner()
else if selectedItemType = "Playlist" else if selectedItemType = "Playlist"
group = CreatePlaylistView(selectedItem.json) group = CreatePlaylistView(selectedItem.json)
stopLoadingSpinner()
else if selectedItemType = "Audio" else if selectedItemType = "Audio"
m.global.queueManager.callFunc("clear") m.global.queueManager.callFunc("clear")
m.global.queueManager.callFunc("resetShuffle") m.global.queueManager.callFunc("resetShuffle")
m.global.queueManager.callFunc("push", selectedItem.json) m.global.queueManager.callFunc("push", selectedItem.json)
stopLoadingSpinner()
m.global.queueManager.callFunc("playQueue") m.global.queueManager.callFunc("playQueue")
else else
' TODO - switch on more node types ' TODO - switch on more node types
@ -517,7 +496,7 @@ sub Main (args as dynamic) as void
group = sceneManager.callFunc("getActiveScene") group = sceneManager.callFunc("getActiveScene")
if isValid(btn) and btn.id = "play-button" if isValid(btn) and btn.id = "play-button"
' User chose Play button from movie detail view ' User chose Play button from movie detail view
startLoadingSpinner()
' Check if a specific Audio Stream was selected ' Check if a specific Audio Stream was selected
audio_stream_idx = 0 audio_stream_idx = 0
if isValid(group) and isValid(group.selectedAudioStreamIndex) if isValid(group) and isValid(group.selectedAudioStreamIndex)
@ -748,6 +727,7 @@ sub Main (args as dynamic) as void
end if end if
else if isNodeEvent(msg, "dataReturned") else if isNodeEvent(msg, "dataReturned")
popupNode = msg.getRoSGNode() popupNode = msg.getRoSGNode()
stopLoadingSpinner()
if isValid(popupNode) and isValid(popupNode.returnData) if isValid(popupNode) and isValid(popupNode.returnData)
selectedItem = m.global.queueManager.callFunc("getHold") selectedItem = m.global.queueManager.callFunc("getHold")
m.global.queueManager.callFunc("clearHold") m.global.queueManager.callFunc("clearHold")
@ -755,6 +735,7 @@ sub Main (args as dynamic) as void
if isValid(selectedItem) and selectedItem.count() > 0 and isValid(selectedItem[0]) if isValid(selectedItem) and selectedItem.count() > 0 and isValid(selectedItem[0])
if popupNode.returnData.indexselected = 0 if popupNode.returnData.indexselected = 0
'Resume video from resume point 'Resume video from resume point
startLoadingSpinner()
startingPoint = 0 startingPoint = 0
if isValid(selectedItem[0].json) and isValid(selectedItem[0].json.UserData) and isValid(selectedItem[0].json.UserData.PlaybackPositionTicks) if isValid(selectedItem[0].json) and isValid(selectedItem[0].json.UserData) and isValid(selectedItem[0].json.UserData.PlaybackPositionTicks)
@ -769,6 +750,7 @@ sub Main (args as dynamic) as void
m.global.queueManager.callFunc("playQueue") m.global.queueManager.callFunc("playQueue")
else if popupNode.returnData.indexselected = 1 else if popupNode.returnData.indexselected = 1
'Start Over from beginning selected, set position to 0 'Start Over from beginning selected, set position to 0
startLoadingSpinner()
selectedItem[0].startingPoint = 0 selectedItem[0].startingPoint = 0
m.global.queueManager.callFunc("clear") m.global.queueManager.callFunc("clear")
m.global.queueManager.callFunc("push", selectedItem[0]) m.global.queueManager.callFunc("push", selectedItem[0])

View File

@ -92,7 +92,7 @@ function LoginFlow()
unset_setting("server") unset_setting("server")
goto start_login goto start_login
else if userSelected <> "" else if userSelected <> ""
startMediaLoadingSpinner() startLoadingSpinner()
print "A public user was selected with username=" + userSelected print "A public user was selected with username=" + userSelected
session.user.Update("name", userSelected) session.user.Update("name", userSelected)
regex = CreateObject("roRegex", "[^a-zA-Z0-9\ \-\_]", "") regex = CreateObject("roRegex", "[^a-zA-Z0-9\ \-\_]", "")
@ -481,7 +481,7 @@ function CreateSigninGroup(user = "")
else if type(msg) = "roSGNodeEvent" else if type(msg) = "roSGNodeEvent"
node = msg.getNode() node = msg.getNode()
if node = "submit" if node = "submit"
startMediaLoadingSpinner() startLoadingSpinner()
' Validate credentials ' Validate credentials
activeUser = get_token(username.value, password.value) activeUser = get_token(username.value, password.value)
if isValid(activeUser) if isValid(activeUser)
@ -879,7 +879,7 @@ function CreateVideoPlayerGroup(video_id as string, mediaSourceId = invalid as d
' validate video_id ' validate video_id
if not isValid(video_id) or video_id = "" then return invalid if not isValid(video_id) or video_id = "" then return invalid
startMediaLoadingSpinner() startLoadingSpinner()
' Video is Playing ' Video is Playing
video = VideoPlayer(video_id, mediaSourceId, audio_stream_idx, defaultSubtitleTrackFromVid(video_id), forceTranscoding, showIntro, allowResumeDialog) video = VideoPlayer(video_id, mediaSourceId, audio_stream_idx, defaultSubtitleTrackFromVid(video_id), forceTranscoding, showIntro, allowResumeDialog)
@ -938,6 +938,6 @@ sub playbackOptionDialog(time as longinteger, meta as object)
resumeData.push(tr("Go to episode")) resumeData.push(tr("Go to episode"))
end if end if
end if end if
stopLoadingSpinner()
m.global.sceneManager.callFunc("optionDialog", tr("Playback Options"), [], resumeData) m.global.sceneManager.callFunc("optionDialog", tr("Playback Options"), [], resumeData)
end sub end sub

View File

@ -59,7 +59,7 @@ sub AddVideoContent(video as object, mediaSourceId as dynamic, audio_stream_idx
if playbackPosition > 0 if playbackPosition > 0
stopLoadingSpinner() stopLoadingSpinner()
dialogResult = startPlayBackOver(playbackPosition) dialogResult = startPlayBackOver(playbackPosition)
startMediaLoadingSpinner() startLoadingSpinner()
'Dialog returns -1 when back pressed, 0 for resume, and 1 for start over 'Dialog returns -1 when back pressed, 0 for resume, and 1 for start over
if dialogResult = -1 if dialogResult = -1
'User pressed back, return invalid and don't load video 'User pressed back, return invalid and don't load video

View File

@ -451,34 +451,19 @@ function toString(input) as string
return str(input) return str(input)
end function end function
sub startLoadingSpinner() '
' startLoadingSpinner: Start a loading spinner and attach it to the main JFScene.
' Displays an invisible ProgressDialog node by default to disable keypresses while the app is loading.
'
' @param {boolean} [disableRemote=true]
sub startLoadingSpinner(disableRemote = true as boolean)
if not isValid(m.scene) if not isValid(m.scene)
m.scene = m.top.getScene() m.scene = m.top.getScene()
end if end if
if not m.scene.isLoading if not m.scene.isLoading
m.scene.isLoading = true m.scene.isLoading = true
m.scene.disableRemote = disableRemote
m.spinner = createObject("roSGNode", "Spinner")
m.spinner.translation = "[900, 450]"
m.spinner.visible = true
m.scene.appendChild(m.spinner)
end if
end sub
sub startMediaLoadingSpinner()
if not isValid(m.scene)
m.scene = m.top.getScene()
end if
if not m.scene.isLoading
dialog = createObject("roSGNode", "ProgressDialog")
dialog.id = "invisibiledialog"
dialog.visible = false
m.scene.dialog = dialog
startLoadingSpinner()
end if end if
end sub end sub
@ -489,16 +474,7 @@ sub stopLoadingSpinner()
if m.scene.isLoading if m.scene.isLoading
m.scene.isLoading = false m.scene.isLoading = false
if isValid(m.spinner) m.scene.disableRemote = false
m.spinner.visible = false
end if
if isValid(m.scene) and isValid(m.scene.dialog)
if m.scene.dialog.isSubType("ProgressDialog")
m.scene.dialog.close = true
else if m.scene.dialog.isSubType("Spinner")
m.scene.dialog.close = true
end if
end if
end if end if
end sub end sub

View File

@ -584,6 +584,7 @@ namespace quickplay
m.global.sceneManager.callfunc("pushScene", photoPlayer) m.global.sceneManager.callfunc("pushScene", photoPlayer)
end if end if
else else
stopLoadingSpinner()
print "Quick Play WARNING: Unknown collection type" print "Quick Play WARNING: Unknown collection type"
end if end if
end sub end sub
@ -645,6 +646,7 @@ namespace quickplay
quickplay.tvChannel(myChannel) quickplay.tvChannel(myChannel)
end if end if
else else
stopLoadingSpinner()
print "Quick Play CollectionFolder WARNING: Unknown collection type" print "Quick Play CollectionFolder WARNING: Unknown collection type"
end if end if
end sub end sub