Re: xmltree and mdb

"David Hough" <[email protected]> Sat, 21 May 2005 14:57:19 +0100
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
On Fri, 20 May 2005 20:58:38 +0100, kristian kvilekval <[email protected]>=
 =20
wrote:

>
> I've added checks to make sure we don't search data sources
> that have not been updated since the last time we cached.
>
> However, there is a considerable delay on the first
> time I open an element of the tree.  Every bit of
> metadata is read from my 20gb music tree which is
> taking quite a long time even when most of the data
> is coming from the metakit database.
>
> It would preferable if opening the music/playlist/streams item
> would only do the minimum number of metadata searches i.e.
> one zinf://url?type=3D'P' and then one metadata search for
> the icon/title/expandable of each playlist.  Currently
> it reads all music including the contents of the playlists.
>
> In a possibly related problem,  when I click to open
> the music/playlist/streams list,
> the entire track list is filled out in the librarylist window.
> This might be the root cause of the entirety of the metadata
> being read on the fist click.
>
> I don't know if this is possible, but could we
> do something like for expandable tree-items.
>   on click:
>      if item is a list
>         if list is closed, open list
>            else fill out track list
>   on dbl click
>      same as click, but also add tracks to playlist.
>
>
> I am not really why this behavior is occurring, it may be
> that the single click is calling TreeNode::get_tracks which
> is then doing search down the entire tree.   Any ideas?
>
>
> Kris

Yeah, there's actually a number of things that need to be fixed here. =20
You're right that it's the tracklist being filled out that causes the =20
problem. Whats actually happening is this,

1. The "My Music" node is selected (This is what GTK+ reports the first =20
time any node is expanded in the tree)
2. The TreeNode::get_tracks function is called on the "My Music" node.
2.1. My Music doesn't have a url associated with it (unless you've change=
d =20
the tree definition), so it needs to do a recursive search of all it's =20
children
2.2. The tree metadata for all zinf://album?artist=3D... urls is got to s=
ee =20
if they're expandable/playable
2.3. All the zinf://album?artist=3D... urls are expanded into lists of =20
zinf://url?album=3D...
2.4. The tree metadata for all zinf://url?album=3D... urls is got to see =
if =20
they're expandable/playable
2.5. All the zinf://url?album=3D... urls are expanded into file://... url=
s
2.6. The tree metadata for all file://... urls is got to if they're =20
expandable/playable
2.7. The list of playable file://... urls is returned
3. The tracklist is given the list of file://... url's and creates a =20
TreeNode object for each one
3.1 The TreeNode's are added to the list and GTK+ requests the title for =
=20
each one
3.2 The kTitle metadata is looked up for each TreeNode

When what should really happen is this
1. The "My Music" node is selected (This is what GTK+ reports the first =20
time any node is expanded in the tree)
2. The TreeNode::get_tracks function is called on the "My Music" node.
2.1 "My Music" has the url zinf://artist so we can do a readEntries call =
=20
to get track list
2.2 readEntries(zinf://url) is executed to get the file://... urls
3. The tracklist is given the list of file://... url's and creates a =20
TreeNode object for each one
3.1 The TreeNode's are added to the list and GTK+ requests the title for =
=20
each one
3.2 The kTitle metadata is looked up for each visible TreeNode (probably =
=20
no more then about 10)

A fairly simple workaround for the moment is to simply hide the track lis=
t =20
using the Classic or a Custom Layout. To actually fix this two things nee=
d =20
to be done.
1. Change the default Tree definition to make sure that "My Music" has a =
=20
zinf://... url associated with it
2. Change the library lists (tree, albumlist, tracklist) to make sure the=
y =20
only look up node metadata when the node is visible

2 is actually a regression in zinf--xmltree as zinf--browsermm does do =20
that. It's one of the things on my todo list before I merge xmltree back =
=20
into browsermm/CVS.

On a side note, I suspect that we're going to have to hide the tracklist =
=20
in the default layout, as no matter how well we optimize this, there will=
 =20
always be a performance hit associated with calculating the lists of =20
tracks to display there.

Cheers,
David

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


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=3D7412&alloc_id=3D16344&op=3Dclick