Doug MacEachern > Audio-RaveMP-0.04 > Audio::RaveMP

Download:
Audio-RaveMP-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Audio::RaveMP - Perl interface to Sensory Science RaveMP player

SYNOPSIS ^

  use Audio::RaveMP ();

DESCRIPTION ^

The Audio::RaveMP module provides a Perl interface to the Sensory Science RaveMP player.

METHODS ^

new
 my $rmp = Audio::RaveMP->new;
permitted

Check parallel port permissions (must be root at the moment):

 unless ($rmp->permitted) {
     print "$!\n";
     exit 1;
 }
is_ready

Check that RaveMP is connected and powered up:

 unless ($rmp->is_ready) {
      print "Device is not ready (not connected or powered up?)\n";
      exit 2;
 }
show_status

Show status messages:

 $rmp->show_status(1);

 $rmp->show_status(0);
upload

Upload a file. The second argument is the name to upload to, which is optional and defaults to the upload name:

 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";
 }
remove

Remove a file specified by the give slot number:

 unless ($rmp->remove(8)) {
     print "unable to remove file at slot 8\n";
 }
download

Download the file specified by the give slot number. The last argument is the name of the destination file, which is optional and defaults to the name of the downloaded file:

 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";
 }
contents

Return an array reference of file contents in the player. Each element is an object blessed into the Audio::RaveMPSlot class:

 my $contents = $rmp->contents;
 for my $slot (@$contents) {
     printf "%d, %s -> %s\n", 
            $slot->number, $slot->type, $slot->filename;
 }

The Audio::RaveMPSlot Class

number

The slot number:

 my $number = $slot->number;
type

The file type:

 my $type = $slot->type;
filename

The filename:

 my $filename = $slot->filename;
remove

Remove file in the given slot:

 $slot->remove;
download

Download the file in the given slot:

 $slot->download;

Audio::RaveMPServer ^

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;

Xmms::shell plugin ^

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:

ravemp_track

List mp3 files in the player:

 xmms> ravemp_track
ravemp_upload

Upload files:

 xmms> ravemp_upload /usr/local/mp3/prodigy/what_evil_lurks/*.mp3
ravemp_download

Download files specified by slot or filename:

 xmms> ravemp_download rythm_of_life.mp3.mp3 ~/mp3/
ravemp_delete

Remove files from the player specified by slot or filename:

 xmms> ravemp_delete rythm_of_life.mp3

To remove all files from the player:

 xmms> ravemp_delete all

SEE ALSO ^

Xmms(3)

AUTHOR ^

Doug MacEachern

ravemp.c derived from "ravemp-0.0.2" by: The Snowblind Alliance: http://www.world.co.uk/sba/

syntax highlighting: