jf-roku/components/music/SongItem.bs
2023-10-03 11:42:10 -04:00

32 lines
765 B
Plaintext

import "pkg:/source/utils/misc.brs"
sub init()
m.itemText = m.top.findNode("itemText")
m.trackNumber = m.top.findNode("trackNumber")
m.tracklength = m.top.findNode("tracklength")
m.defaultTextColor = m.itemText.color
end sub
sub itemContentChanged()
itemData = m.top.itemContent
if itemData = invalid then return
m.itemText.text = itemData.title
if itemData.trackNumber <> 0
m.trackNumber.text = itemData.trackNumber
end if
m.tracklength.text = ticksToHuman(itemData.length)
end sub
sub focusChanged()
if m.top.itemHasFocus
color = "#101010FF"
else
color = m.defaultTextColor
end if
m.itemText.color = color
m.trackNumber.color = color
m.tracklength.color = color
end sub