XMMS Volume Control

I have a keyboard which contains buttons for multimedia functions, such as "play", "stop", etc.

Using Debian GNU/Linux I wanted to map these buttons to control the software I use, thankfully this turned out to be simple. There is a package called 'xbindkeys' which allows you to specify programs to run when particular keys are pressed.

Configuring my keyboard to play music, skip tracks, etc was very simple because XMMS can be controlled from the command line to do a lot of things.

Controlling XMMS

The following are the buttons I have on my keyboard, along with the commands which I have set xbindkeys to execute when I press them:

ActionXMMS Command
prevxmms --rew
nextxmms --fwd
playxmms --play
pausexmms --pause
stopxmms --stop
volume up???
volume down???

As you can see XMMS allows all the buttons to do something useful except change the volume. To do that I must use my mouse, or adjust the speakers.

After looking over the source to XMMS I was impressed at it's cleanliness. Adding the code to recognise two new options and make them work was very simple.

The Patch

I patched three files to make two new command line options:

    --vol-up   (-l == Louder)
    --vol-down (-q == Quieter)
    

The three diffs are available below.

Less than 1k of code, less than 30 minutes from source code download to working solution, thanks to all the people behind XMMS.

You may use this code under the terms of the original XMMS license (GPL).