XSPF support in Amarok

Sebastian Pipping webmaster at hartwork.org
Wed Sep 19 21:47:26 UTC 2007


Ian Monroe wrote:
> The main reason to not use a library is because XSPF is a pretty
> simple format, and we already have have a couple of XML libraries in
> Qt. Reading XML of any format is pretty easy to do with these
> libraries, at least if the XML format is logical like XSPF is. For
> instance a library that reads podcasts would be more useful since
> there are so many crazy podcast formats out there, and Apple screwing
> things up time-to-time, but XSPF doesn't have this problem.

-------------------------------------------------------------------------
Yes, XSPF is quite simple compared to other formats.
However there are details hard to do right e.g. whitespace
handling. It's easy to write an XSPF reader and writer that
understand each other within a single application. What is not
simple is to be interoperable with other applications.
Choosing libSpiff automatically makes Amarok interoperable with
any other application using libSpiff. And that is what especially
the XML Sharable Playlist Format is about.

Btw libSpiff has more than 140 testcases already.
It also does proper indentation for you when writing XSPF files
so you also make sure to really produce human-readable output.
-------------------------------------------------------------------------



> Currently I don't think we have a dependency of the Expat XML library
> and depending on a new XML library when we already have Qt doesn't
> seem logical.

-------------------------------------------------------------------------
I found out Amarok already is linked against Expat.
Actually the list of programs linking against Expat is not only
quite long but also includes many big names (like vim):

  for i in /usr/bin/* ; do (ldd $i 2> /dev/null | \
      grep expat > /dev/null) && echo $i ; done

There is no problem "adding" Expat as a dependency. :-)
-------------------------------------------------------------------------



> But you said you were willing to work on new stuff. :) A XSPF library
> that depended on Qt 4 would be great. Our current XSPF code is a bit
> wonky and uses the memory-intensive QDom. An QXmlStreamReader/Writer
> implementation would be highly appreciated.

-------------------------------------------------------------------------
Expat is a streaming parser so libSpiff gives you exactly that.

Yes, I offered help on a new library. But after thinking more
about this, creating another library clearly is the wrong way:
next week Gnome people using libxml2 will want a third libxml2-based
libary - I hope that shows where it would lead us.



Sebastian



More information about the Amarok mailing list