August 6, 2006
A few years ago, when Jen and I lived in a
one-room loft, we both wanted to control the stereo’s music from
our respective computers. All our music was in MP3 format, so I wrote some software to
let us do just that.
The software had two parts. The server
ran on a Linux machine that was hooked up to the stereo through a
sound card. That machine also hosted the MP3
files. The client ran on our desktops and sent commands to the
server over a TCP/IP connection using a simple protocol. I ran it from
my desktop machine and Jen ran it from her laptop, which was
connected to the server using a wireless card and router.
The client looked like this (on Windows XP):
The full list of all your songs is on the left,
the playlist is on the right, and player controls
are in the upper right. Features of the system included:
- Marking songs as “corrupted” so you could keep
track of the ones you needed to get again. (See
the red barfy face in the picture above.)
- Fade out and fade in on pause/unpause.
- Loading and saving of playlists. The lists
were saved on the server, so if you launched the
client from another computer you could still get at
them.
- Kept track of “situation” tags, useful for
grouping songs into “Dinner”, “Mellow”,
“Party”, etc.
- Loading and saving of filters. Filters
let you restrict what you could see in the song
list on the left. You could filter by artist,
directory, genre, or situation. Filters
were also saved on the server. You could also
filter by “corrupted” so you could find them
easily. (We never ended up using filters
very much.)
- A “quick find” feature. It showed you
the list of matching songs as you typed your
search string (similar to iTunes’s search
feature).
- The playlist could be copied to a portable
music player. This was done by transferring
the songs to the client and writing them to
the root directory of a drive you specified.
Presumably this drive was the memory card of
the music player.
- Playlist shuffle and repeat.
- Tag editing. The only tags that were
editable were title, artist, genre, and
situation. You could edit groups of songs
at once if you wanted to set one of their
tags to the same value. There was a button
for breaking up the common title of “Artist - Title”
into title and artist fields.
The server was written in C++. It used the id3
library, and I embedded some code that I grabbed from xmms,
which they grabbed from mpg123.
The client was written in Java and used Swing.
I was going to release the source code, but (a) we stopped
using the program once we moved to a multi-room house, where centralized
control of music no longer made sense; and (b) at work I’ve
since developed a music system, and I’d rather not be releasing
free code that competes with it.
Back to projects