I am currently engaged in writing another shared jukebox.
If you search Freshmeat for the word “jukebox”, you’ll find several distinct kinds of software. Mostly, you’ll find software like, say, XMMS, which provides an unnecessarily complex GUI for choosing and queuing up tracks for local play. Secondly, you’ll find packages like GNUMP3d which serve a music database for anyone online to listen to. But what I want is the third kind: something like Globecom Jukebox, which offers a web-based interface that allows many users to add to and modify a single playlist, which is played through speakers in one corner of the room. This problem has been solved several times before – GlobeCom is just one example – but in all cases maintaining the music database seems to be very painful, and the local hard drive that stores it is quickly overwhelmed.
To address this, the new jukebox will use a limited web crawler to discover all the music in collections it is pointed at, and (ultimately) use ID3 tags as well as file names as search terms. This means instead of copying your music collection over to it (which can quickly overwhelm the disk space on the music server), you need only make your local music collection available over the Web, and point the jukebox at it. If I can find an easy way to extend it to support SMB collections I’ll add those too.
I’m using Python, Twisted, and Nevow to build the jukebox. Python is a natural fit for a problem of this kind. Because various asynchronous events must be handed, Twisted is essential. After which, integrating the web interface directly into the daemon using Nevow seems easier than writing the web interface with a separate tool and providing a distinct way for the tool to talk to the jukebox.
Twisted and Nevow have the distinction of having, respectively, very little and practically no documentation. By far the most useful documentation on Nevow I’ve found is Meet Stan. “Stan” is a data structure for representing XML trees, and is the key to how Nevow dynamically generates XHTML. In contrast to the DOM, Stan
- is relatively lightweight
- has a convenient data language for representing fragments of XML trees in program code
- includes powerful elements that directly support dynamic generation
I’d recommend anyone trying to get to grips with Nevow to read this first, followed by this [old link: http://divmod.org/users/mg/nevow-doc/ ] Nevow user manual. Having got to grips with Stan, I’ve been able to achieve a very clean separation between content and code using XML templates.
The jukebox code currently consists of a number of separate programlets that are just sufficient to show that we can drive the various tools we’re using (which include not only Nevow, but also pymad and pyao) and make them do the things we need to. Now it’s just simple matter of programming.
I also need to choose a name for it. Any suggestions?