Its easy, heres another snip from my playlist group
- Code: Select all
<event>
<name>sort by ??????</name>
<multithreaded>False</multithreaded>
<commands>
<command>
<type>xlobby</type>
<execute>close overlay</execute>
</command>
<command>
<type>category</type>
<execute>set sort order</execute>
<parameter>playlist</parameter>
<parameter>??????</parameter>
</command>
</commands>
</event>
you just replace ?????? by whatever you are interested in -
artist = artistname:tracknumber:trackname
genre = genre:= albumname:tracknumber:trackname
albums = albumname:tracknumber:trackname
So you can map buttons onto these events to swap them arround...
I knocked a plugin up over xmas to add some extras to the music database - it adds albumname.sort, artistname.sort ('the name' is stored as 'name, the') and adds the album.artist/album.artist.sort to each track.
Whenever a track is played it automatically updates a lastplayed tag (time string, sortable number and the no times played) you can also set a rating (* to *****) for the playing track.
The last thing that it does is "shuffle" the playlist by writing a "shuffle.pos" field into each track, this factors in the tracks lastplayed time/ratings to try and ensure that all of the songs are played eventually (for some reason the shuffle in xlobby always used to play ac-dc for some reason!!)
You can then sort the playlist on shuffle.pos and its ramomised but you can see whats being played next ect...
Using these the sorts i have on the playlist are
random = shuffle.pos
artist = artist.sort:albumname.sort:tracknumber:trackname:trackfilename
album = album.artist.sort:albumname.sort:tracknumber:artist.sort:trackname:trackfilename
rating = stars:shuffle.pos
last played = last.played:shuffle.pos
I will probably get someone to host the plugin at some point (i guess it would suit the way you listen to music as well?), but the info on playlist sorting should help you out.