GStreamer, GLib, and Gnome-VFS oh my

I’m getting closer to the 0.1 release of EMP. I finished writing the code to import music this morning. There are some optimizations I’d like to make (mostly, spinning off the reading metadata off to a worker thread), but right now it takes just over six seconds to scan and import 248 songs. Some of the speed may be the drive in my laptop, and a large chunk the reading of metadata. It’s quick enough for the 0.1 release though. My next step is to integrate this with the UI, and then it’s time to finish the main player UI and get this first release out the door. I’m aiming to have 0.1 released around the turning of the new year.

The import code was pretty fun to write. One of the complaints I (and others) had about other music players, especially those using GStreamer, is that it tends to be slow importing, or hang trying to import. With that in mind, I’ve taken a two-step approach to music detection. First, I use Gnome-VFS to check the mime type of a file. I ignore anything that isn’t “audio/*”, then feed the file through GStreamer’s typefinder and checking its found mime type against a static list of playable mime types (essentially ogg, mp3, flac, mod, and wav). Only then do I add a song to the library. From my testing, it does a good job of only adding audio and not hanging on miscellaneous files (Flash seems to be a big problem for GStreamer).

EMP is now in my CVS, and the import code is currently living in test/import.c, if anyone wants to see an example of recursively scanning directories and GStreamer.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>