Re: genre browser

"David Hough" <[email protected]> Fri, 08 Apr 2005 20:44:40 +0100
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
On Fri, 08 Apr 2005 19:28:07 +0100, kristian kvilekval <[email protected]>=
 =20
wrote:

>
> This line actually worked:
>
> <node text=3D'Genres' icon=3D'zinf-music-library' url=3D'zinf://genre'>
>
> Could you explain or point me to the code how
> "node" and "list" work?
>

Ok, I'll have a go.

"node" represents a single item on the tree (implmented using the TreeNod=
e =20
class in ui/musicbrowsermm/src/items/treeitem.cpp), and has 3 properties =
=20
and a list of children (if any) which are
	- text
	- icon
	- url
None or all of these can be specified. Where a url is set it's metadata =20
will be used for text and icon unless already set by the XML. If a url is=
 =20
set and it is expandable, the node will append a new "list" with that url=
 =20
to it's list of children.


"list" represents a generated list of "node"s (implemented using the =20
TreeList class in ui/musicbrowsermm/src/items/treeitem.cpp). When the tre=
e =20
is displayed, the generated children of a list appear to be the children =
=20
of the "list"s parent "node", so the list object itself is not shown =20
directly. It has 2 properties
	- url
	- child-target (actually called sub-list-type in the code I think)
Url must always be specified as it is this that gets passed to readEntrie=
s =20
to generate the list. Where url is a zinf:// url, child-target specifies =
=20
the target of it's child urls.

For instance, where the url is 'zinf://artist', readEntries will normally=
 =20
return a list of urls of the format 'zinf://album?artist=3DAnArtist'. If =
=20
child-target is set to 'url', it will convert these to =20
'zinf://url?artist=3DAnArtist'. When the list's url is not zinf://* =20
child-target is ignored.

To specify the child-target property in XML you give a list a child list =
=20
of the type you want e.g.
<list url=3D'zinf://artist'>
	<list type=3D'url' />
</list>
When you only specify type and not a url for a list, and it's parent is =20
also a list, you are actually setting the parent list's child-target =20
property. When it's parent is a node, the XML parser generates a =20
'zinf://type' url instead.

I admit the whole child-target/type thing is a bit confusing and could =20
probably be done in a better way, anybody any thoughts?

Hope that helps, any questions?

Cheers,
David

> On Fri, 2005-04-08 at 19:00 +0100, David Hough wrote:
>> On Thu, 07 Apr 2005 23:22:08 +0100, kristian kvilekval =20
>> <[email protected]>
>> wrote:
>>
>> >
>> > Dave does your new XML tree allow
>> > one to browse by genre?
>> >
>> > i.e.
>> >
>> > <node text=3D'Genre' icon=3D'zinf-Genre' url=3D'zinf://genre' />
>> >    <list type=3D'url'>
>> >    </list>
>> > </node>
>> >
>>

...

--=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