Nicholas J Humfrey
and 1 contributors

NAME

Audio::MadJACK - Talk to MadJACK server using Object Oriented Perl

SYNOPSIS

  use Audio::MadJACK;

  my $mj = new Audio::MadJACK( 'osc.udp://madjack.example.net:4444/' );
  $mj->load( 'Playlist_A/mymusic.mp3' );
  $mj->play();

DESCRIPTION

The Audio::MadJACK module uses Net::LibLO to talk to a MadJACK (MPEG Audio Deck) server. It has an Object Oriented style API making it simple to control multiple decks from a single script.

new( oscurl )

Connect to MadJACK deck specified by oscurl. A ping is sent to the MadJACK deck to check to see if it is there. If a reply is not recieved or there was an error then undef is returned.

load( filepath )

Send a message to the deck requesting that filepath is loaded. Note: it is up to the developer to check to see if the file was successfully loaded, by calling the get_state() method.

Returns 1 if command was successfully received or 0 on error.

play()

Tell the deck to start playing the current track.

Returns 1 if command was successfully received or 0 on error.

pause()

Tell the deck to pause the current track.

Returns 1 if command was successfully received or 0 on error.

stop()

Tell the deck to stop decoding and playback of the current track.

Returns 1 if command was successfully received or 0 on error.

cue( [$cuepoint] )

Tell the deck to start decoding from $cuepoint, which is the position in the track in seconds. If no $cuepoint is specified, the the deck will start decoding from the start of the track.

Returns 1 if command was successfully received or 0 on error.

eject()

Close the currect track loaded.

Returns 1 if command was successfully received or 0 on error.

get_state()

Returns the current state of the MadJACK deck. Returns one of the following strings:

   - PLAYING
   - PAUSED
   - READY
   - LOADING
   - STOPPED
   - EMPTY
   - ERROR
   

If no reply if received from the server or there is an error then undef is returned.

get_error()

Returns the a string describing the current error (if state is ERROR).

get_version()

Returns the version number of the MadJACK server.

get_duration()

Returns the durtion (in seconds) of the current track.

If no reply if received from the server or there is an error then undef is returned.

get_position()

Returns the deck's position (in seconds) in the current track.

If no reply if received from the server or there is an error then undef is returned.

get_filepath()

Returns the file path of the track currently loaded in the deck (path will be in the same form as originally passed to load()).

If no track is currently loaded then an empty string is returned. If no reply if received from the server or there is an error then undef is returned.

ping()

Pings the remote deck to see if it is there.

Returns 1 if the server responds, or 0 if there is no reply.

get_url()

Returns the OSC URL of the MadJACK deck.

SEE ALSO

Net::LibLO

http://www.ecs.soton.ac.uk/~njh/madjack/

AUTHOR

Nicholas J. Humfrey <njh@aelius.com>

COPYRIGHT AND LICENSE

Copyright (C) 2005 Nicholas J. Humfrey

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 401:

You forgot a '=back' before '=head1'