Update API docs
This commit is contained in:
parent
39448b7ceb
commit
1a3313ba11
|
@ -66,9 +66,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")
|
||||||
|
|
||||||
|
@ -94,7 +91,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
|
||||||
|
@ -240,7 +237,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
|
||||||
|
@ -452,6 +449,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")
|
||||||
|
@ -477,7 +475,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
|
||||||
|
|
||||||
|
@ -500,7 +498,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
|
||||||
|
|
||||||
'
|
'
|
||||||
|
@ -573,7 +571,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
|
||||||
|
@ -596,7 +594,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
|
||||||
|
@ -611,7 +609,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
|
||||||
|
@ -847,7 +845,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 = ""
|
||||||
|
|
|
@ -19,7 +19,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")
|
||||||
|
@ -85,8 +84,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"]
|
||||||
|
|
||||||
|
@ -119,7 +116,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
|
||||||
|
@ -221,7 +218,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")
|
||||||
|
@ -438,7 +434,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)
|
||||||
|
@ -488,7 +484,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)
|
||||||
|
@ -693,7 +689,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
|
||||||
|
@ -738,7 +734,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
|
||||||
|
@ -753,7 +748,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
|
||||||
|
@ -926,7 +920,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 = ""
|
||||||
|
|
|
@ -19,7 +19,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")
|
||||||
|
@ -79,8 +78,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"]
|
||||||
|
|
||||||
|
@ -113,7 +110,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
|
||||||
|
@ -206,7 +203,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
|
||||||
|
@ -328,6 +324,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")
|
||||||
|
@ -353,7 +350,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
|
||||||
|
|
||||||
|
@ -376,8 +372,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
|
||||||
|
|
||||||
'
|
'
|
||||||
|
@ -558,7 +552,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
|
||||||
|
@ -614,7 +608,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
|
||||||
|
@ -629,7 +622,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
|
||||||
|
@ -789,7 +781,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 = ""
|
||||||
|
|
|
@ -5,6 +5,27 @@
|
||||||
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()
|
||||||
|
m.spinner.visible = m.top.isLoading
|
||||||
|
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
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,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")
|
||||||
|
@ -78,7 +77,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)
|
||||||
|
@ -111,7 +110,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
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -23,8 +23,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
|
||||||
|
|
||||||
|
@ -152,7 +150,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
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -78,6 +78,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()
|
||||||
|
|
|
@ -449,6 +449,7 @@ sub loadButtons()
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub onAudioStreamLoaded()
|
sub onAudioStreamLoaded()
|
||||||
|
stopLoadingSpinner()
|
||||||
data = m.LoadAudioStreamTask.content[0]
|
data = m.LoadAudioStreamTask.content[0]
|
||||||
m.LoadAudioStreamTask.unobserveField("content")
|
m.LoadAudioStreamTask.unobserveField("content")
|
||||||
if data <> invalid and data.count() > 0
|
if data <> invalid and data.count() > 0
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -43,6 +43,7 @@ sub itemContentChanged()
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub onPhotoLoaded()
|
sub onPhotoLoaded()
|
||||||
|
stopLoadingSpinner()
|
||||||
if m.LoadLibrariesTask.results <> invalid
|
if m.LoadLibrariesTask.results <> invalid
|
||||||
photo = m.top.findNode("photo")
|
photo = m.top.findNode("photo")
|
||||||
photo.uri = m.LoadLibrariesTask.results
|
photo.uri = m.LoadLibrariesTask.results
|
||||||
|
|
|
@ -8,7 +8,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")
|
||||||
|
|
||||||
|
@ -22,12 +21,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
|
||||||
|
@ -39,7 +38,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
|
||||||
|
|
|
@ -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."))
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -50,12 +50,11 @@
|
||||||
' 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)
|
||||||
|
@ -131,8 +130,6 @@
|
||||||
' measure processing time
|
' measure processing time
|
||||||
timeSpan = CreateObject("roTimespan")
|
timeSpan = CreateObject("roTimespan")
|
||||||
|
|
||||||
startMediaLoadingSpinner()
|
|
||||||
|
|
||||||
group = sceneManager.callFunc("getActiveScene")
|
group = sceneManager.callFunc("getActiveScene")
|
||||||
reportingNode = msg.getRoSGNode()
|
reportingNode = msg.getRoSGNode()
|
||||||
itemNode = invalid
|
itemNode = invalid
|
||||||
|
@ -164,6 +161,7 @@
|
||||||
|
|
||||||
' 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)
|
||||||
|
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
|
||||||
|
|
||||||
|
@ -208,20 +206,18 @@
|
||||||
else if itemType = "photoalbum"
|
else if itemType = "photoalbum"
|
||||||
quickplay.photoAlbum(itemNode)
|
quickplay.photoAlbum(itemNode)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
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)
|
||||||
|
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)
|
||||||
|
@ -253,7 +249,6 @@
|
||||||
end if
|
end if
|
||||||
|
|
||||||
selectedItem.selectedAudioStreamIndex = audio_stream_idx
|
selectedItem.selectedAudioStreamIndex = audio_stream_idx
|
||||||
|
|
||||||
' 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)
|
||||||
|
@ -275,7 +270,6 @@
|
||||||
CreatePersonView(selectedItem)
|
CreatePersonView(selectedItem)
|
||||||
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
|
||||||
|
|
||||||
' 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")
|
||||||
|
@ -327,6 +321,7 @@
|
||||||
else if selectedItemType = "MusicArtist"
|
else if selectedItemType = "MusicArtist"
|
||||||
group = CreateArtistView(selectedItem.json)
|
group = CreateArtistView(selectedItem.json)
|
||||||
if not isValid(group)
|
if not isValid(group)
|
||||||
|
stopLoadingSpinner()
|
||||||
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"
|
||||||
|
@ -342,19 +337,23 @@
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
else
|
else
|
||||||
' TODO - switch on more node types
|
' TODO - switch on more node types
|
||||||
|
stopLoadingSpinner()
|
||||||
message_dialog("This type is not yet supported: " + selectedItemType + ".")
|
message_dialog("This type is not yet supported: " + selectedItemType + ".")
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
else if isNodeEvent(msg, "movieSelected")
|
else if isNodeEvent(msg, "movieSelected")
|
||||||
' If you select a movie from ANYWHERE, follow this flow
|
' If you select a movie from ANYWHERE, follow this flow
|
||||||
|
startLoadingSpinner()
|
||||||
node = getMsgPicker(msg, "picker")
|
node = getMsgPicker(msg, "picker")
|
||||||
group = CreateMovieDetailsGroup(node)
|
group = CreateMovieDetailsGroup(node)
|
||||||
else if isNodeEvent(msg, "seriesSelected")
|
else if isNodeEvent(msg, "seriesSelected")
|
||||||
' If you select a TV Series from ANYWHERE, follow this flow
|
' If you select a TV Series from ANYWHERE, follow this flow
|
||||||
|
startLoadingSpinner()
|
||||||
node = getMsgPicker(msg, "picker")
|
node = getMsgPicker(msg, "picker")
|
||||||
group = CreateSeriesDetailsGroup(node.id)
|
group = CreateSeriesDetailsGroup(node.id)
|
||||||
else if isNodeEvent(msg, "seasonSelected")
|
else if isNodeEvent(msg, "seasonSelected")
|
||||||
' If you select a TV Season from ANYWHERE, follow this flow
|
' If you select a TV Season from ANYWHERE, follow this flow
|
||||||
|
startLoadingSpinner()
|
||||||
ptr = msg.getData()
|
ptr = msg.getData()
|
||||||
' ptr is for [row, col] of selected item... but we only have 1 row
|
' ptr is for [row, col] of selected item... but we only have 1 row
|
||||||
series = msg.getRoSGNode()
|
series = msg.getRoSGNode()
|
||||||
|
@ -364,18 +363,27 @@
|
||||||
end if
|
end if
|
||||||
else if isNodeEvent(msg, "musicAlbumSelected")
|
else if isNodeEvent(msg, "musicAlbumSelected")
|
||||||
' If you select a Music Album from ANYWHERE, follow this flow
|
' If you select a Music Album from ANYWHERE, follow this flow
|
||||||
|
startLoadingSpinner()
|
||||||
ptr = msg.getData()
|
ptr = msg.getData()
|
||||||
albums = msg.getRoSGNode()
|
albums = msg.getRoSGNode()
|
||||||
node = albums.musicArtistAlbumData.items[ptr]
|
node = albums.musicArtistAlbumData.items[ptr]
|
||||||
group = CreateAlbumView(node)
|
group = CreateAlbumView(node)
|
||||||
|
if not isValid(group)
|
||||||
|
stopLoadingSpinner()
|
||||||
|
end if
|
||||||
else if isNodeEvent(msg, "appearsOnSelected")
|
else if isNodeEvent(msg, "appearsOnSelected")
|
||||||
' If you select a Music Album from ANYWHERE, follow this flow
|
' If you select a Music Album from ANYWHERE, follow this flow
|
||||||
|
startLoadingSpinner()
|
||||||
ptr = msg.getData()
|
ptr = msg.getData()
|
||||||
albums = msg.getRoSGNode()
|
albums = msg.getRoSGNode()
|
||||||
node = albums.musicArtistAppearsOnData.items[ptr]
|
node = albums.musicArtistAppearsOnData.items[ptr]
|
||||||
group = CreateAlbumView(node)
|
group = CreateAlbumView(node)
|
||||||
|
if not isValid(group)
|
||||||
|
stopLoadingSpinner()
|
||||||
|
end if
|
||||||
else if isNodeEvent(msg, "playSong")
|
else if isNodeEvent(msg, "playSong")
|
||||||
' User has selected audio they want us to play
|
' User has selected audio they want us to play
|
||||||
|
startLoadingSpinner()
|
||||||
selectedIndex = msg.getData()
|
selectedIndex = msg.getData()
|
||||||
screenContent = msg.getRoSGNode()
|
screenContent = msg.getRoSGNode()
|
||||||
|
|
||||||
|
@ -385,6 +393,7 @@
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
else if isNodeEvent(msg, "playItem")
|
else if isNodeEvent(msg, "playItem")
|
||||||
' User has selected audio they want us to play
|
' User has selected audio they want us to play
|
||||||
|
startLoadingSpinner()
|
||||||
selectedIndex = msg.getData()
|
selectedIndex = msg.getData()
|
||||||
screenContent = msg.getRoSGNode()
|
screenContent = msg.getRoSGNode()
|
||||||
|
|
||||||
|
@ -395,8 +404,7 @@
|
||||||
else if isNodeEvent(msg, "playAllSelected")
|
else if isNodeEvent(msg, "playAllSelected")
|
||||||
' User has selected playlist of of audio they want us to play
|
' User has selected playlist of of audio they want us to play
|
||||||
screenContent = msg.getRoSGNode()
|
screenContent = msg.getRoSGNode()
|
||||||
m.spinner = screenContent.findNode("spinner")
|
startLoadingSpinner()
|
||||||
m.spinner.visible = true
|
|
||||||
|
|
||||||
m.global.queueManager.callFunc("clear")
|
m.global.queueManager.callFunc("clear")
|
||||||
m.global.queueManager.callFunc("resetShuffle")
|
m.global.queueManager.callFunc("resetShuffle")
|
||||||
|
@ -404,6 +412,7 @@
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
else if isNodeEvent(msg, "playArtistSelected")
|
else if isNodeEvent(msg, "playArtistSelected")
|
||||||
' User has selected playlist of of audio they want us to play
|
' User has selected playlist of of audio they want us to play
|
||||||
|
startLoadingSpinner()
|
||||||
screenContent = msg.getRoSGNode()
|
screenContent = msg.getRoSGNode()
|
||||||
|
|
||||||
m.global.queueManager.callFunc("clear")
|
m.global.queueManager.callFunc("clear")
|
||||||
|
@ -415,10 +424,7 @@
|
||||||
' User has selected instant mix
|
' User has selected instant mix
|
||||||
' User has selected playlist of of audio they want us to play
|
' User has selected playlist of of audio they want us to play
|
||||||
screenContent = msg.getRoSGNode()
|
screenContent = msg.getRoSGNode()
|
||||||
m.spinner = screenContent.findNode("spinner")
|
startLoadingSpinner()
|
||||||
if isValid(m.spinner)
|
|
||||||
m.spinner.visible = true
|
|
||||||
end if
|
|
||||||
|
|
||||||
viewHandled = false
|
viewHandled = false
|
||||||
|
|
||||||
|
@ -460,6 +466,7 @@
|
||||||
options.query = query
|
options.query = query
|
||||||
else if isNodeEvent(msg, "itemSelected")
|
else if isNodeEvent(msg, "itemSelected")
|
||||||
' Search item selected
|
' Search item selected
|
||||||
|
startLoadingSpinner()
|
||||||
node = getMsgPicker(msg)
|
node = getMsgPicker(msg)
|
||||||
' TODO - swap this based on target.mediatype
|
' TODO - swap this based on target.mediatype
|
||||||
' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist ]
|
' types: [ Series (Show), Episode, Movie, Audio, Person, Studio, MusicArtist ]
|
||||||
|
@ -495,6 +502,7 @@
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
else
|
else
|
||||||
' TODO - switch on more node types
|
' TODO - switch on more node types
|
||||||
|
stopLoadingSpinner()
|
||||||
message_dialog("This type is not yet supported: " + node.type + ".")
|
message_dialog("This type is not yet supported: " + node.type + ".")
|
||||||
end if
|
end if
|
||||||
else if isNodeEvent(msg, "buttonSelected")
|
else if isNodeEvent(msg, "buttonSelected")
|
||||||
|
@ -503,7 +511,7 @@
|
||||||
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)
|
||||||
|
@ -536,6 +544,7 @@
|
||||||
|
|
||||||
else if btn <> invalid and btn.id = "trailer-button"
|
else if btn <> invalid and btn.id = "trailer-button"
|
||||||
' User chose to play a trailer from the movie detail view
|
' User chose to play a trailer from the movie detail view
|
||||||
|
startLoadingSpinner()
|
||||||
dialog = createObject("roSGNode", "ProgressDialog")
|
dialog = createObject("roSGNode", "ProgressDialog")
|
||||||
dialog.title = tr("Loading trailer")
|
dialog.title = tr("Loading trailer")
|
||||||
m.scene.dialog = dialog
|
m.scene.dialog = dialog
|
||||||
|
@ -547,6 +556,8 @@
|
||||||
m.global.queueManager.callFunc("set", trailerData)
|
m.global.queueManager.callFunc("set", trailerData)
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
dialog.close = true
|
dialog.close = true
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if isValid(group) and isValid(group.lastFocus)
|
if isValid(group) and isValid(group.lastFocus)
|
||||||
|
@ -734,6 +745,7 @@
|
||||||
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")
|
||||||
|
@ -741,6 +753,7 @@
|
||||||
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)
|
||||||
|
@ -755,6 +768,7 @@
|
||||||
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])
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61,7 +61,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
|
||||||
|
|
|
@ -453,27 +453,30 @@ function toString(input) as string
|
||||||
return str(input)
|
return str(input)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
sub startLoadingSpinner()
|
'
|
||||||
m.spinner = createObject("roSGNode", "Spinner")
|
' startLoadingSpinner: Start a loading spinner and attach it to the main JFScene.
|
||||||
m.spinner.translation = "[900, 450]"
|
' Displays an invisible ProgressDialog node by default to disable keypresses while loading.
|
||||||
m.spinner.visible = true
|
'
|
||||||
m.scene.appendChild(m.spinner)
|
' @param {boolean} [disableRemote=true]
|
||||||
end sub
|
sub startLoadingSpinner(disableRemote = true as boolean)
|
||||||
|
if not isValid(m.scene)
|
||||||
|
m.scene = m.top.getScene()
|
||||||
|
end if
|
||||||
|
|
||||||
sub startMediaLoadingSpinner()
|
if not m.scene.isLoading
|
||||||
dialog = createObject("roSGNode", "ProgressDialog")
|
m.scene.disableRemote = disableRemote
|
||||||
dialog.id = "invisibiledialog"
|
m.scene.isLoading = true
|
||||||
dialog.visible = false
|
end if
|
||||||
m.scene.dialog = dialog
|
|
||||||
startLoadingSpinner()
|
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub stopLoadingSpinner()
|
sub stopLoadingSpinner()
|
||||||
if isValid(m.spinner)
|
if not isValid(m.scene)
|
||||||
m.spinner.visible = false
|
m.scene = m.top.getScene()
|
||||||
end if
|
end if
|
||||||
if isValid(m.scene) and isValid(m.scene.dialog)
|
|
||||||
m.scene.dialog.close = true
|
if m.scene.isLoading
|
||||||
|
m.scene.disableRemote = false
|
||||||
|
m.scene.isLoading = false
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,8 @@ namespace quickplay
|
||||||
photoPlayer.itemsArray = photoAlbumData.items
|
photoPlayer.itemsArray = photoAlbumData.items
|
||||||
photoPlayer.itemIndex = 0
|
photoPlayer.itemIndex = 0
|
||||||
m.global.sceneManager.callfunc("pushScene", photoPlayer)
|
m.global.sceneManager.callfunc("pushScene", photoPlayer)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -105,6 +107,8 @@ namespace quickplay
|
||||||
})
|
})
|
||||||
if isValid(albumSongs) and isValidAndNotEmpty(albumSongs.items)
|
if isValid(albumSongs) and isValidAndNotEmpty(albumSongs.items)
|
||||||
quickplay.pushToQueue(albumSongs.items)
|
quickplay.pushToQueue(albumSongs.items)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -128,6 +132,8 @@ namespace quickplay
|
||||||
|
|
||||||
if isValid(artistSongs) and isValidAndNotEmpty(artistSongs.items)
|
if isValid(artistSongs) and isValidAndNotEmpty(artistSongs.items)
|
||||||
quickplay.pushToQueue(artistSongs.items, true)
|
quickplay.pushToQueue(artistSongs.items, true)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -144,6 +150,8 @@ namespace quickplay
|
||||||
})
|
})
|
||||||
if isValid(data) and isValidAndNotEmpty(data.Items)
|
if isValid(data) and isValidAndNotEmpty(data.Items)
|
||||||
quickplay.pushToQueue(data.items)
|
quickplay.pushToQueue(data.items)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -199,6 +207,8 @@ namespace quickplay
|
||||||
if isValid(data) and isValidAndNotEmpty(data.Items)
|
if isValid(data) and isValidAndNotEmpty(data.Items)
|
||||||
' add all episodes found to a playlist
|
' add all episodes found to a playlist
|
||||||
quickplay.pushToQueue(data.Items)
|
quickplay.pushToQueue(data.Items)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
@ -242,6 +252,8 @@ namespace quickplay
|
||||||
end for
|
end for
|
||||||
if m.global.queueManager.callFunc("getCount") > 1
|
if m.global.queueManager.callFunc("getCount") > 1
|
||||||
m.global.queueManager.callFunc("toggleShuffle")
|
m.global.queueManager.callFunc("toggleShuffle")
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
@ -307,6 +319,8 @@ namespace quickplay
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -347,6 +361,8 @@ namespace quickplay
|
||||||
|
|
||||||
if m.global.queueManager.callFunc("getCount") > 1
|
if m.global.queueManager.callFunc("getCount") > 1
|
||||||
m.global.queueManager.callFunc("toggleShuffle")
|
m.global.queueManager.callFunc("toggleShuffle")
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -354,8 +370,8 @@ namespace quickplay
|
||||||
sub tvChannel(itemNode as object)
|
sub tvChannel(itemNode as object)
|
||||||
if not isValid(itemNode) or not isValid(itemNode.id) then return
|
if not isValid(itemNode) or not isValid(itemNode.id) then return
|
||||||
|
|
||||||
stopLoadingSpinner()
|
|
||||||
group = CreateVideoPlayerGroup(itemNode.id)
|
group = CreateVideoPlayerGroup(itemNode.id)
|
||||||
|
stopLoadingSpinner()
|
||||||
m.global.sceneManager.callFunc("pushScene", group)
|
m.global.sceneManager.callFunc("pushScene", group)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -363,8 +379,8 @@ namespace quickplay
|
||||||
sub program(itemNode as object)
|
sub program(itemNode as object)
|
||||||
if not isValid(itemNode) or not isValid(itemNode.json) or not isValid(itemNode.json.ChannelId) then return
|
if not isValid(itemNode) or not isValid(itemNode.json) or not isValid(itemNode.json.ChannelId) then return
|
||||||
|
|
||||||
stopLoadingSpinner()
|
|
||||||
group = CreateVideoPlayerGroup(itemNode.json.ChannelId)
|
group = CreateVideoPlayerGroup(itemNode.json.ChannelId)
|
||||||
|
stopLoadingSpinner()
|
||||||
m.global.sceneManager.callFunc("pushScene", group)
|
m.global.sceneManager.callFunc("pushScene", group)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -385,6 +401,8 @@ namespace quickplay
|
||||||
if m.global.queueManager.callFunc("getCount") > 1
|
if m.global.queueManager.callFunc("getCount") > 1
|
||||||
m.global.queueManager.callFunc("toggleShuffle")
|
m.global.queueManager.callFunc("toggleShuffle")
|
||||||
end if
|
end if
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -453,6 +471,8 @@ namespace quickplay
|
||||||
quickplay.pushToQueue(folderData.items, true)
|
quickplay.pushToQueue(folderData.items, true)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -486,6 +506,8 @@ namespace quickplay
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
quickplay.pushToQueue(movieList)
|
quickplay.pushToQueue(movieList)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
else if collectionType = "music"
|
else if collectionType = "music"
|
||||||
' get audio files from under this collection
|
' get audio files from under this collection
|
||||||
|
@ -503,6 +525,8 @@ namespace quickplay
|
||||||
print "songsData=", songsData
|
print "songsData=", songsData
|
||||||
if isValid(songsData) and isValidAndNotEmpty(songsData.items)
|
if isValid(songsData) and isValidAndNotEmpty(songsData.items)
|
||||||
quickplay.pushToQueue(songsData.Items, true)
|
quickplay.pushToQueue(songsData.Items, true)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
else if collectionType = "boxsets"
|
else if collectionType = "boxsets"
|
||||||
' get list of all boxsets inside
|
' get list of all boxsets inside
|
||||||
|
@ -531,6 +555,8 @@ namespace quickplay
|
||||||
if isValid(boxsetData) and isValidAndNotEmpty(boxsetData.items)
|
if isValid(boxsetData) and isValidAndNotEmpty(boxsetData.items)
|
||||||
' add all boxset items to queue
|
' add all boxset items to queue
|
||||||
quickplay.pushToQueue(boxsetData.Items)
|
quickplay.pushToQueue(boxsetData.Items)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
else if collectionType = "tvshows" or collectionType = "collectionfolder"
|
else if collectionType = "tvshows" or collectionType = "collectionfolder"
|
||||||
|
@ -547,7 +573,15 @@ namespace quickplay
|
||||||
print "tvshowsData=", tvshowsData
|
print "tvshowsData=", tvshowsData
|
||||||
|
|
||||||
if isValid(tvshowsData) and isValidAndNotEmpty(tvshowsData.items)
|
if isValid(tvshowsData) and isValidAndNotEmpty(tvshowsData.items)
|
||||||
quickplay.multipleSeries(tvshowsData.items)
|
' the type of media returned from api may change.
|
||||||
|
if LCase(tvshowsData.items[0].Type) = "series"
|
||||||
|
quickplay.multipleSeries(tvshowsData.items)
|
||||||
|
else
|
||||||
|
' if first item is not a series, then assume they are all videos and/or episodes
|
||||||
|
quickplay.pushToQueue(tvshowsData.items)
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
else if collectionType = "musicvideos"
|
else if collectionType = "musicvideos"
|
||||||
' get randomized list of videos inside
|
' get randomized list of videos inside
|
||||||
|
@ -564,6 +598,8 @@ namespace quickplay
|
||||||
print "data=", data
|
print "data=", data
|
||||||
if isValid(data) and isValidAndNotEmpty(data.items)
|
if isValid(data) and isValidAndNotEmpty(data.items)
|
||||||
quickplay.pushToQueue(data.Items)
|
quickplay.pushToQueue(data.Items)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
else if collectionType = "homevideos"
|
else if collectionType = "homevideos"
|
||||||
' Photo library - items can be type video, photo, or photoAlbum
|
' Photo library - items can be type video, photo, or photoAlbum
|
||||||
|
@ -584,8 +620,11 @@ namespace quickplay
|
||||||
photoPlayer.itemsArray = folderData.items
|
photoPlayer.itemsArray = folderData.items
|
||||||
photoPlayer.itemIndex = 0
|
photoPlayer.itemIndex = 0
|
||||||
m.global.sceneManager.callfunc("pushScene", photoPlayer)
|
m.global.sceneManager.callfunc("pushScene", photoPlayer)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
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
|
||||||
|
@ -623,6 +662,8 @@ namespace quickplay
|
||||||
' validate api results
|
' validate api results
|
||||||
if isValid(playlistItems) and isValidAndNotEmpty(playlistItems.items)
|
if isValid(playlistItems) and isValidAndNotEmpty(playlistItems.items)
|
||||||
quickplay.pushToQueue(playlistItems.items, true)
|
quickplay.pushToQueue(playlistItems.items, true)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
else if collectionType = "livetv"
|
else if collectionType = "livetv"
|
||||||
|
@ -645,8 +686,11 @@ namespace quickplay
|
||||||
print "myChannel=", myChannel
|
print "myChannel=", myChannel
|
||||||
' play channel
|
' play channel
|
||||||
quickplay.tvChannel(myChannel)
|
quickplay.tvChannel(myChannel)
|
||||||
|
else
|
||||||
|
stopLoadingSpinner()
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user