Re: XML Tree in MusicBrowser

kristian kvilekval <[email protected]> Thu, 07 Apr 2005 15:13:41 -0700
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Hi David,

   I finally got a chance to try out your new stuff.  
I think it's really cool that you've got this working.

I've got a couple of comments/questions.

1.  I think treemetadata is great.. 
1a. You should define string constants for all your 
    default strings (maybe in a toplevel file) i.e.
    const std::string kTrue = "1"
    which will help with insert and delete times.
    
2.  I also like musiclistings, but am wondering if
    we can provide the functionality in a single
    hierarchy.  For example mbcd and filemetadata
    could be improved to provide the readEntries function
    for urls that each of the modules can parse.  
    mbcd would take on expanding cd urls and filemetadata
    would do the playlist urls.

3.  It seems an opportune moment to try to integrate
    cachedb which should speed things up considerably.
    I am not sure if it was implemented correctly, but
    the idea was that once a deep metadata search had
    been performed, each metadata provider layer would be 
    given the chance to update its metadata.  In fact,
    the code is commented out at the 
     bottom of  MetadataPath::ReadMetadata

Metadata direction
^   cachedb
|   treedb
|   local  (metakitdb)
|   pathdb   
|   tags
|   musicbrainsdb

   The diagram does not include priorities assign which metadata
   can overwriten from a deeper source.

   We would also need an option of last resort so that missing
   metadata field would be filled in with defaults such that most
   queries will be satisfied with a hit from cachedb after at most
   1 deep search.   

   Finally we need something to let us know when the cached entry
   is invalid.  Seems like I started something and never finished with
   the routine time_t MetadataDB::modified (const url_t&)
   I see these options:
   1.  Ignore it, valid for run of program
   2.  Test source for change.  i.e. time on usr)

I'll try and to see if I can get this code functioning
based on your tree and let you know.. 

Nice work,
kris




On Wed, 2005-04-06 at 00:03 +0100, David Hough wrote:
> Hi,
> 
> Just a quick update if anyone is interested. The definition of the tree is  
> now a preference, and can be changed at run time using the editor found at  
> "View -> Custom Tree...". The XML parser is hopefully much more error  
> tolerent as well. So feel free to give it a whirl. If anyone wants some  
> help with how to define trees, I'll be happy to help.
> 
> As to my other email ("Possible new implementation of readEntries(...)") I  
> have now got a working implementation of this, which now provides support  
> for CD listings in the tree again.
> 
> There are still things that need work, including re-adding the Edit  
> Info/Remove pop-up menu items, so I won't be adding this to CVS quite yet  
> unless anyone wants me too.
> 
> As mentioned below, its avaliable from the  
> [email protected]/zinf--xmltree Arch branch.
> 
> Cheers,
> David
> 
> On Mon, 21 Mar 2005 23:17:28 -0000, David Hough <[email protected]>  
> wrote:
> 
> > Hi,
> >
> > I've now got a working implementation of this, avaliable as the branch  
> > [email protected]/zinf--xmltree, if anyone wants to play  
> > around with it. The Arch archive can be found  
> > http://www-users.york.ac.uk/~djh123/arch2005/
> >
> > The default tree is represented by this snippet of XML:
> >
> > <node text='My Music' icon='zinf-music-library'>
> >    <node text='All Tracks' icon='zinf-all-tracks'  
> > url='zinf://url?type=F' />
> >    <node text='Uncatogorized Tracks' icon='zinf-uncatagorised-tracks'  
> > url='zinf://url?artist=;type=F' />
> >    <list type='artist'>
> >      <list type='album'>
> >        <list type='url' />
> >      </list>
> >    </list>
> > </node>
> > <node text='My Playlists' icon='zinf-playlist'>
> >    <list url='file:///home/david/.zinf/playlists/' />
> >    <list url='zinf://url?type=P' />
> > </node>
> > <node text='My Streams' icon='zinf-stream-icon' url='zinf://url?type=S'  
> > />
> > <node text='CD Audio' icon='zinf-cd' url='cd://' />
> >
> > Directory browsing is supported by simply adding a node with the correct  
> > url, e.g.
> > <node url='file:///home/david/mp3/' />
> >
> > The XML parser is currently quite fragile (almost no error catching at  
> > all), so be careful if change the XML. I haven't yet made the XML a  
> > preference (it seems a bit big for a one line setting in the preference  
> > 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  
> > supported by the MusicDB. Another problem is that the URL for the  
> > default location 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  
> > have been temporarily removed as they lack any sort of implementation or  
> > way of deciding when to enable/disable them.
> >
> > All items in the tree can now be added to the playlist, including "My  
> > Playlists", etc. Where an item does not directly represent a track it  
> > will be recursively expanded before adding to the playlist. So, for  
> > instance, if you add the "My Playlists" node, you will actually get all  
> > the tracks mentioned in all of your playlists.
> >
> > I'll hopefully promote this to CVS once I've got the remaining  
> > regressions like cd support working, and cleaned various things up.
> >
> > Cheers,
> > David
> 
> 
> 
-- 
Kristian Kvilekval
[email protected]  http://www.cs.ucsb.edu/~kris w:805-893-2526 h:504-9756



-------------------------------------------------------
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=6595&alloc_id=14396&op=click