Page 1 of 1
Album > Artist > Track Selection Input
Posted: Thu Dec 07, 2006 5:21 pm
by Osler
So I have created a database file (.mdb) via ZonePlayer query that contains Album, Artist, Track and other info needed for telling the ZonePlayer to Play or AddToQueue.
The problem I am having is envisioning how to allow someone to drill down to the track they want using the list control. I can probably have a static list of Albums and Artists, but a list of Tracks is not possible due to the list size needed (and I only have 1166 tracks). Static Album and Artist lists may be a problem if someones music collection list exceeds the 10k limit. I can pull out individual tracks for albums and artists via SQL, I'm just not seeing how to put this together with the list control.
I am looking at Richards music script to get some ideas, but I know there are others out there who have dealt with this before. Any input would be appreciated.
Osler
Posted: Fri Dec 08, 2006 9:03 am
by Richard Naninck
First of all, you need some unique identifier to be able to drill down correctly, or you will end up with merged lists. For example: Many artists have albums called : The Greatest Hits. So drilling down on an album with that name would display all tracks of all albums with that name. I used the cover art which is unique for all albums as the unique identifier. I have put all of my albums in separate directories and these directories contain a coverart file. So the path to this file name is always unique.
As for keeping my lists under 10K, I used some indexing logic using the LIMIT statement of SQL. I display 100 tracks at most in a list because that will always keep the list under 10K. If the list is longer, I browse through the list with up and down errors. So if a list has 150 tracks, the list displayes the first 100 and after indexing down, I get the next 50.
Maybe you already got that out of the code example I uploaded, but I figured this explanation might give you and/or others ideas to handle it differently. I am very happy with the way this is donw, but if somebody comes up with a different option, I would be glad to read about it and maybe even improve my own code...
Posted: Fri Dec 08, 2006 9:14 pm
by Osler
Good points. Where this differs from what you have done is that the database is not based on file structure. The ZonePlayer does the heavy lifting and provides easy access to all the track data regardless of where the shares reside. Each track (or playlist) is associated with a URI which contains all the info on the track and where it physically lives (NAS, PC, etc.). Simply passing the URI to the ZonePlayer via UPnP allows the track/playlist to be played. The URI is unique to each track.
I am trying to understand the indexing scheme you are using to automatically load another list value as you scroll beyond your 100 item limit. Do you physically have a button called "next" at the bottom of the list control to load the next 100 albums/artists/tracks in the list? If so, this solution may not work for every case (i.e., theme construction for someone with < 100 albums would be different than someone with >100 albums). This could be made more uniform by having alphabet buttons - say a button for A-C, D-F, etc. However, both solutions are not ideal and would be negated if there wasn't a 10k limit on list size.
Thanks for the help Richard. I am slowly starting to understand all this (and see how robust HouseBot actually can be).
Osler
Posted: Sat Dec 09, 2006 5:27 pm
by Richard Naninck
I both have Next and Prev buttons as well as alphabet buttons to make jumps more easy.
When doing a query, I first get the rowcount. This is the max value from the list. It doesn't matter if it is <= 100 or > 100. I just display up to the max count if it is <= 100 or display 100 ifthe list is > 100. If the list is > 100 then my index buttons will function.
So if a query gives me 125 items, the first 100 are displayed and after pressing the Next button, the next 25 are displayed. If a list only has 35 items or so, then these 35 items are displayed and the Next / Prev buttons are inop.