parent
5aa26f39aa
commit
8bf164ba29
|
@ -388,6 +388,33 @@ end sub
|
|||
' Update values on screen when page content changes
|
||||
sub pageContentChanged()
|
||||
|
||||
m.LoadAudioStreamTask.control = "STOP"
|
||||
|
||||
currentItem = m.global.queueManager.callFunc("getCurrentItem")
|
||||
|
||||
m.LoadAudioStreamTask.itemId = currentItem.id
|
||||
m.LoadAudioStreamTask.observeField("content", "onAudioStreamLoaded")
|
||||
m.LoadAudioStreamTask.control = "RUN"
|
||||
end sub
|
||||
|
||||
' If we have more and 1 song to play, fade in the next and previous controls
|
||||
sub loadButtons()
|
||||
' Don't show audio buttons if we have a mixed playlist
|
||||
if m.playlistTypeCount > 1 then return
|
||||
|
||||
if m.global.queueManager.callFunc("getCount") > 1
|
||||
m.shuffleIndicator.opacity = ".4"
|
||||
m.loopIndicator.opacity = ".4"
|
||||
m.displayButtonsAnimation.control = "start"
|
||||
setLoopButtonImage()
|
||||
end if
|
||||
end sub
|
||||
|
||||
sub onAudioStreamLoaded()
|
||||
stopLoadingSpinner()
|
||||
data = m.LoadAudioStreamTask.content[0]
|
||||
m.LoadAudioStreamTask.unobserveField("content")
|
||||
if data <> invalid and data.count() > 0
|
||||
' Reset buffer bar without animation
|
||||
m.bufferPosition.width = 0
|
||||
|
||||
|
@ -428,29 +455,6 @@ sub pageContentChanged()
|
|||
m.totalLengthTimestamp.text = ticksToHuman(currentItem.RunTimeTicks)
|
||||
end if
|
||||
|
||||
m.LoadAudioStreamTask.itemId = currentItem.id
|
||||
m.LoadAudioStreamTask.observeField("content", "onAudioStreamLoaded")
|
||||
m.LoadAudioStreamTask.control = "RUN"
|
||||
end sub
|
||||
|
||||
' If we have more and 1 song to play, fade in the next and previous controls
|
||||
sub loadButtons()
|
||||
' Don't show audio buttons if we have a mixed playlist
|
||||
if m.playlistTypeCount > 1 then return
|
||||
|
||||
if m.global.queueManager.callFunc("getCount") > 1
|
||||
m.shuffleIndicator.opacity = ".4"
|
||||
m.loopIndicator.opacity = ".4"
|
||||
m.displayButtonsAnimation.control = "start"
|
||||
setLoopButtonImage()
|
||||
end if
|
||||
end sub
|
||||
|
||||
sub onAudioStreamLoaded()
|
||||
stopLoadingSpinner()
|
||||
data = m.LoadAudioStreamTask.content[0]
|
||||
m.LoadAudioStreamTask.unobserveField("content")
|
||||
if data <> invalid and data.count() > 0
|
||||
m.global.audioPlayer.content = data
|
||||
m.global.audioPlayer.control = "none"
|
||||
m.global.audioPlayer.control = "play"
|
||||
|
|
Loading…
Reference in New Issue
Block a user