ready...

Create a screen named 'scrWxtest'
Create 5 labels named lblSong0,lblSong1,lblSong2,lblSong3,lblSong4
Create 3 buttons named who cares! Make there captions 'Init' , 'Next page' , 'Prev page'
In Init button add this code:
- Code: Select all
dim v
v = "ttack1$$track2$$track3$$track4$$track5$$track6$$track7$$"
v = v & "track8$$track9$$tracka$$track10$$track11$$track12$$track13$$"
v = v & "track14$$track15$$track16$$track17$$track18$$track19$$track20$$"
v = v & "track21$$track22$$track23$$track24$$track25$$track26$$track27$$"
v = v & "track28$$track29$$track30$$track31$$track32$$track33$$track34$$"
v = v & "track35$$track36$$track37$$track38$$track39$$track40$$track41"
g_oGbl.Cargo_Add v,"LST_ITEM_STR"
SongListManage "INIT","5" '--- 5 is the total labels
In the Prev button
- Code: Select all
SongListManage "PREV",0
Next Button
- Code: Select all
SongListManage "NEXT",0
In your eHomeClient INI add this code.
- Code: Select all
Function SongListManage(sAction, sVars)
Dim xx, nCurrentPage
With g_oGbl
Select Case sAction
Case "SELECT_SONG"
'--- code to select song here
Case "CLEAR"
ehHaLabelChgCaption "scrWxtest", "lblSong0", ""
ehHaLabelChgCaption "scrWxtest", "lblSong1", ""
ehHaLabelChgCaption "scrWxtest", "lblSong2", ""
ehHaLabelChgCaption "scrWxtest", "lblSong3", ""
ehHaLabelChgCaption "scrWxtest", "lblSong4", ""
Case "INIT"
'--- initing! just a flag to let us know
.Cargo_Add "1", "LST_INIT"
'--- spit the list and store
Dim arrList
arrList = Split(.Cargo_Item("LST_ITEM_STR"), "$$")
.Cargo_Add arrList, "LST_ITEMS"
.Cargo_Add sVars, "LST_PAGE_SIZE"
.Cargo_Add UBound(arrList), "LST_ITEM_TTL"
'--- calc total pages
Dim nTotalPage, nAddOne
nAddOne = IIf(((.Cargo_Item("LST_ITEM_TTL") + 1) Mod (sVars)), 1, 0)
nTotalPage = Int(cInt(.Cargo_Item("LST_ITEM_TTL") + 1) / (sVars)) + nAddOne
'--- store total pages
.Cargo_Add nTotalPage, "LST_PAGES_TTL"
'--- store current page
.Cargo_Add 1, "LST_CURR_PAGE"
'--- show the 1st page
SongListManage "SHOW_PAGE",1
Case "SHOW_PAGE"
'--- call myself and clear the list
SongListManage "CLEAR", 0
'--- calc start and end array index pointers
Dim nStart, nEnd, nIndex, nCount
Dim nPage: nPage = sVars
nStart = (nPage * .Cargo_Item("LST_PAGE_SIZE")) - (.Cargo_Item("LST_PAGE_SIZE"))
nEnd = nStart + .Cargo_Item("LST_PAGE_SIZE") - 1
If nEnd > .Cargo_Item("LST_ITEM_TTL") Then
nEnd = .Cargo_Item("LST_ITEM_TTL")
End If
'--- paint them to the screens
nIndex = 0
For nCount = nStart To nEnd
ehHaLabelChgCaption "scrWxtest", "lblSong" & Trim(cStr(nIndex)), Cargo_Item("LST_ITEMS")(nCount)
nIndex = nIndex + 1
Next
Case "PREV"
'--- move to the prev page
nCurrentPage = .Cargo_Item("LST_CURR_PAGE") - 1
If nCurrentPage <= 0 Then
nCurrentPage = 1
Else
SongListManage "SHOW_PAGE", nCurrentPage
End If
.Cargo_Add nCurrentPage, "LST_CURR_PAGE"
Case "NEXT"
'--- move to the next page
nCurrentPage = .Cargo_Item("LST_CURR_PAGE") + 1
If nCurrentPage > .Cargo_Item("LST_PAGES_TTL") Then
nCurrentPage = nCurrentPage - 1
Else
SongListManage "SHOW_PAGE", nCurrentPage
End If
.Cargo_Add nCurrentPage, "LST_CURR_PAGE"
End Select
End With
End Function
Function IIf( expr, truepart, falsepart )
IIf = falsepart
If expr Then IIf = truepart
End Function
Let me know how that works. Once that is done we can get the song select working and the speed issue with playlist