XML Tree in MusicBrowser

"David Hough" <[email protected]> Mon, 21 Mar 2005 23:17:28 -0000
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Hi,

I've now got a working implementation of this, avaliable as the branch =20
[email protected]/zinf--xmltree, if anyone wants to play =20
around with it. The Arch archive can be found =20
http://www-users.york.ac.uk/~djh123/arch2005/

The default tree is represented by this snippet of XML:

<node text=3D'My Music' icon=3D'zinf-music-library'>
   <node text=3D'All Tracks' icon=3D'zinf-all-tracks' url=3D'zinf://url?t=
ype=3DF' />
   <node text=3D'Uncatogorized Tracks' icon=3D'zinf-uncatagorised-tracks'=
 =20
url=3D'zinf://url?artist=3D;type=3DF' />
   <list type=3D'artist'>
     <list type=3D'album'>
       <list type=3D'url' />
     </list>
   </list>
</node>
<node text=3D'My Playlists' icon=3D'zinf-playlist'>
   <list url=3D'file:///home/david/.zinf/playlists/' />
   <list url=3D'zinf://url?type=3DP' />
</node>
<node text=3D'My Streams' icon=3D'zinf-stream-icon' url=3D'zinf://url?typ=
e=3DS' />
<node text=3D'CD Audio' icon=3D'zinf-cd' url=3D'cd://' />

Directory browsing is supported by simply adding a node with the correct =
=20
url, e.g.
<node url=3D'file:///home/david/mp3/' />

The XML parser is currently quite fragile (almost no error catching at =20
all), so be careful if change the XML. I haven't yet made the XML a =20
preference (it seems a bit big for a one line setting in the preference =20
file), so it's hardcoded into ui/musicbrowsermm/src/items/librarytree.cpp=
.

Unfortunately the CD Node doesn't work as cd:// urls are not yet supporte=
d =20
by the MusicDB. Another problem is that the URL for the default location =
=20
of playlists is hardcoded instead of being read from the preferences.

The "Edit Info" and "Remove" menu items from the popup menu in the tree =20
have been temporarily removed as they lack any sort of implementation or =
=20
way of deciding when to enable/disable them.

All items in the tree can now be added to the playlist, including "My =20
Playlists", etc. Where an item does not directly represent a track it wil=
l =20
be recursively expanded before adding to the playlist. So, for instance, =
=20
if you add the "My Playlists" node, you will actually get all the tracks =
=20
mentioned in all of your playlists.

I'll hopefully promote this to CVS once I've got the remaining regression=
s =20
like cd support working, and cleaned various things up.

Cheers,
David
--=20
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick