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/' );
$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( filename )

Send a message to the deck requesting that filename 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()

Tell the deck to start decoding from the cue point.

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_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_filename()

Returns the filename of the track currently loaded in the deck. The filename is stripped of its path and suffix.

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.

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 352:

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