moosicWebGUI -- a graphical user interface for moosic
For the hasty reader
moosicWebGUI is (yet) another client program for the moosic
daemon (moosicd). The features are described here.
The latest version is 0.9.1 and is available here. Older versions
can be found in the history section.
As of today
moosicWebGUI is only known to work with moosic 1.5.1. Skip forward to
the latest news here.
What is moosic?
On his website
Daniel Pearson describes his program as follows:
Moosic is a music player for Unix systems. It focuses on
convenient and powerful playlist management. It consists of a server
process that maintains a queue of songs to be played and one or more
client programs which sends commands to the server.
The moosic jukebox is a nice piece of software as it closely
follows the Unix design principles (KISS — keep it simple, stupid). The
moosic daemon maintains the song queue and controls several players
which do the the heavy lifting. The moosic client program allows the
jukebox to be scriped by shell commands.
While several client
programs for moosic already exist I had my own ideas what a GUI for
moosicd should do.
First of all I wanted a simple -- preferably standalone -- but
extensible program which implements not only basic functions and which
is ready to run out of the box on most systems without the aid of a
large amount of third party libraries.
Although I have been programming computers (as a hobby and
partly for living) since about 25 years I never did any serious standard
GUI stuff. Programming in an event driven environment is just too
tedious, regardless of the language used. Web programming, however, is
pretty much straight forward and much easier for the task of writing a
GUI for moosicd.
The language of choice was Python for a couple of reasons.
With its expressiveness and its huge standard library ("batteries
included") programming in Python is fun again. With a few lines of code
you can create your own webserver and tweak its operation to your
heart's content. This is what I did to create moosicWebGUI.
- general player commands:
start, stop, next, previous, pause, skip +10/-10, repeat (loop), ...
- playlist commands:
shuffle, sort, reverse, delete duplicates, clear, save to file, load from file
- browse and search modes:
browse/search playlist, browse/search history, browse/search local files, tree view
- insert options:
single files or all music files in single directory or whole directory tree;
add to top or bottom of playlist or mixin
The principle of operation of moosicWebGUI is rather simple.
The user launches the program either from the command line or
from his desktop environment of choice. moosicWebGUI
- starts a simple, customized web server based on the
standard Python SimpleHTTPServer module
- tries to connect to a running moosicd and, if necessary,
starts a new moosicd server
- launches the system's web browser (via the Python
webbrowser module) with the initial URL pointing to the server just
For each request sent by the user moosicWebGUI's http request handler does
- analyze the request, i.e. extract the command to be
performend and additional parameters
- get current status information from the moosic daemon
- execute the request and send one or more commands to
- get updated status information from moosicd
- create a result page based the command performed using a simple HTML template file
- send result page back to the browser
With version 0.9 moosicWebGUI is entering beta stage. As of version 0.8.3 moosicWebGUI was
pretty much feature complete (as far as I am concerned).
The code is stable. Currently moosicWebGUI
has only been tested with moosic 1.5.1.
The documentation is still far from perfect, but I'm working on it...
It is nice to see that OSS works even for niche projects. As of version
0.8.3 moosicWebGUI contains contributions from
- improve documentation (prio +)
- validate filenames in stored playlist (prio -)
- create graphical icons (prio --)
moosicWebGUI version 0.9.1
is online. New in version 0.9.1:
- Nothing new in moosicWebGUI itself ...
However, a tool to create hard links from the contents of a .m3u (m3u2link) added -- see tools directory.
The basic idea is to use moosicWebGUI (or any other .m3u file format aware player for that matter) to
create playlists and to create (hard) links of the files stored in the playlist by means of m3u2link.
This way CDs containing the songs from the playlist can easily be created. After burning just throw away
the links and you are done.
moosicWebGUI version 0.9
is online. New in version 0.9:
- startup accelerated:
after scanning the contents of jukeboxdir some data is stored in
the file .moosicWebGUI-dump.dat (located in configdir). Upon startup the
content of the dumped data is read. If the stored jukeboxdir and the
current jukeboxdir match the initial scan of the jukeboxdir is omitted.
This speeds up the program's start-up significantly when dealing with
extraordinarily large jukeboxes.
- .moosicWebGUI-memo.m3u moved from jukebox dir to configdir
(where it really belongs)
- online handbook started (roughly more than a skeleton currently),
links to online handbook and to manual page added to template
- man page improved
- link to wdg html validator (on local machine) added in debug mode,
in order to use the validator the wdg-html-validator package
(debian/ubuntu) needs to be installed
moosicWebGUI version 0.8.5
is online. New in version 0.8.5:
- HTML improved:
- validates correctly against W3C DTD HTML 4.0 Transitional//EN
- minor HTML quirks in genertated HTML fixed
- template reorganized, memo now has its own navigation box
- functions exit, clear, clearmemo and list no longer show their content
in the message box but rather in the main box
- new function: re-scan of jukebox directory, template updated accordingly
- minor code clean-up: 0 / 1 changed to False / True where appropriate
- Forest's template replaced with improved version (fab-template.html)
moosicWebGUI version 0.8.4
is online. New in version 0.8.4:
- minor bug introduced in version 0.8.3 fixed (@@cform was not expanded,
I guess I tried to over-optimize the page generation....)
- additional template file fab-template.html (contributed by
Forest Bond) added
moosicWebGUI version 0.8.3
is online. New in version 0.8.3:
- support for .m3u files (general file format for playlists) added, extension
.moo is deprecated (simply rename existing .moo files to .m3u)
- .m3u filenames in jukeboxdir are scanned during startup and stored globally
- memo function implemented: current track is stored in a special
memo playlist ($jukeboxdir/.moosicWebGUI-memo.m3u) upon request.
New methods: memo, list_memo, clearmemo, clearmemo2; template
- new method list_pl: show content of playlist (.m3u) file
- new option -i: ignore exit, exit requests via HTTP are ignored,
the link to the exit function is created dynamically; template
- patch from Forest Bond implementing options -c, -n and -t included:
-c: use alternate config file
-n: add network spec to new ACL allowed_networks
-t: use alternate template file
parsing of moosic option file for valid filename extensions
- maximum number of displayed entries increased from 100 to 250
as version 0.8 is much faster than previous versions
moosicWebGUI version 0.8
is online. New in version 0.8:
- dramatic speed-up escpecially when dealing with large jukeboxes.
Instead of += all content new content is appended to a list;
after completion the list is joined (as it should have been done in
the first place). On my slowest machine (Duron 700 MHz) the time for
the generation of the tree view of my Jukebox decreased from 15 sec
to approx 0.5 sec (!) as reported by /usr/sbin/ab.
- fixed error in do_HEAD (wrong status codes).
- added support for favicon.ico, icon added.
moosicWebGUI version 0.7
is online. New in version 0.7:
- Access control list for security added. By default only the localhost can
connect to the server. New option -a adds an allowed host to the ACL.
- Check against the API version implemented (minimum version is 1.7, possibly
earlier versions work as well).
- As of version 0.7 moosicWebGUI comes with a preformatted man page. Currently
it is still necessary to move the man page to /usr/local/man/man1/
- Some code cleanup, rearrangements and some minor and obscure bugs fixed.
moosicWebGUI version 0.6
is online. New in version 0.6:
- upon startup: search a free port that the webserver can connect to
- option -j to explicitly specify a "jukebox" directory
- tree view of jukebox directory
- search files in playlist, history and filesystem
- playlists can be saved and restored to file
- improved template and nicer look
|Sunday, September 5, 2004
Now that my new website is up and running here
is my first contribution to the Free Software community:
of moosicWebGUI. Enjoy.