MusicDB: Possible new implementation of readEntries(...)

"David Hough" <[email protected]> Mon, 28 Mar 2005 16:33:21 +0100
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Hi,

I've been looking at the implementation of the readEntries(...) function,=
 =20
and the current method of the MusicCollection class needing to know how t=
o =20
expand all URLs doesn't seem particularly extendable.

Instead I think we could have a system of multiple MusicListing sources =20
which can expand different types of URL (e.g. one for zinf:// urls, one =20
for file://*.m3u urls, etc.). The MusicCollection class would then pick =20
the appropriate source to expand a URL and use that when readEntries(...)=
 =20
is called.

To deal with clashes where two or more MusicListing's think they can =20
expand a URL, we could assign each source a priority and simply pick the =
=20
single source with the highest priority. We could even make the prioritie=
s =20
user definable similar to the way we want to define the priorities for th=
e =20
metadata sources.

Where it makes sense for a metadata source and a listing source to be =20
implemented in the same class, e.g. the database, I see no reason why it =
=20
couldn't simply implement the two interfaces MusicListing and MetadataDB.=
 =20
To avoid any confusion, it makes sense to make sure there are no clashes =
=20
in function names between the two interfaces so I propose that the =20
MusicListing interface would have the following 3 functions,

bool canExpand(url)
int getListingPriority()
void readEntries(url, entries) //Same as the readEntries function in =20
MusicCollection

Anybody any comments? Feel free to suggest better names for any part of =20
the the proposed interfaces. I'm currently working on implementing this s=
o =20
that there's a decent framework for implementing the support for cd:// =20
urls.

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