|
Audio::RaveMP - Perl interface to Sensory Science RaveMP player |
Audio::RaveMP - Perl interface to Sensory Science RaveMP player
use Audio::RaveMP ();
The Audio::RaveMP module provides a Perl interface to the Sensory Science RaveMP player.
my $rmp = Audio::RaveMP->new;
unless ($rmp->permitted) {
print "$!\n";
exit 1;
}
unless ($rmp->is_ready) {
print "Device is not ready (not connected or powered up?)\n";
exit 2;
}
$rmp->show_status(1);
$rmp->show_status(0);
unless ($rmp->upload("we_eat_rhythm.mp3")) {
print "upload failed\n";
}
unless ($rmp->upload("we_eat_rhythm.mp3", "We Eat Rhythm")) {
print "upload failed\n";
}
unless ($rmp->remove(8)) {
print "unable to remove file at slot 8\n";
}
unless ($rmp->download("we_eat_rhythm.mp3")) {
print "download failed\n";
}
unless ($rmp->download("We Eat Rhythm", "we_eat_rhythm.mp3")) {
print "download failed\n";
}
my $contents = $rmp->contents;
for my $slot (@$contents) {
printf "%d, %s -> %s\n",
$slot->number, $slot->type, $slot->filename;
}
my $number = $slot->number;
my $type = $slot->type;
my $filename = $slot->filename;
$slot->remove;
$slot->download;
Access to the parallel port requires root permissions. To ``minimize risk'', a client/server package is included where the server runs as root and client runs as any user. Access to the server is restricted to the loopback address (127.0.0.1). To use the server you must install the PlRPC and Net::Daemon packages from CPAN. To start the server:
% sudo perl -MAudio::RaveMPServer -s start
The same client API is used to talk to the server, the name is simply changed from Audio::RaveMP to Audio::RaveMPClient:
use Audio::RaveMPClient (); my $rmp = Audio::RaveMPClient->new;
To enable the Xmms::shell plugin, add the following line to your ~/.xmms/.perlrc:
+require Audio::RaveMP
The following commands become available in the shell:
xmms> ravemp_track
xmms> ravemp_upload /usr/local/mp3/prodigy/what_evil_lurks/*.mp3
xmms> ravemp_download rythm_of_life.mp3.mp3 ~/mp3/
xmms> ravemp_delete rythm_of_life.mp3
To remove all files from the player:
xmms> ravemp_delete all
Xmms(3)
Doug MacEachern
ravemp.c derived from ``ravemp-0.0.2'' by: The Snowblind Alliance: http://www.world.co.uk/sba/
|
Audio::RaveMP - Perl interface to Sensory Science RaveMP player |