Ruby Stuff

What's Ruby ?

My favourite programming language. A more general description would be

Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable. Oh, I need to mention, it's totally free, which means not only free of charge, but also freedom to use, copy, modify, and distribute it.

[from What's Ruby]. To learn more about Ruby, visit the official webpage or take a look at the excellent Programming Ruby book, freely available at RubyCentral.

PowerMate.rb

The Griffin PowerMate is a USB-connected device similar (or better said: exactly) to the volume knob on a stereo. The heavy aluminium and the blue LED on the bottom give it a really great feeling. It is intended for, you guessed it, audio volume control, but the possibilities are only limited by your imagination.

The manufacturer only devlivers MacOS and Windows drivers but William R Sowerbutts has written a driver for Linux. It works very well, but is of course useless if you can't get user programs to respond to it. Here comes:

PowerMate.rb (v0.5, new BSD-style licence)

a simple Ruby library to register call-backs for various events the PowerMate generates: knob rotation, button pressed/released, LED settings changes. Also the brightness of the LED can be set. It relies on the Linux Input Event Interface to communicate with the PowerMate so will obviously only work on Linux.

Read the documentation

xmms.rb

Remote Control Interface Library for XMMS It works by connecting to XMMS' controlsocket.

Download xmms.rb(v0.1.1), read documentation .

xmmsmate

Remote control for XMMS using the Griffin PowerMate. Basically the glue for the above two. Rotation changes volume, skip to next track on button press and pause if the button is pressed for longer than 0.5 secs.

Download xmmsmate.rb (v1.0)