The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Audio::Daemon::Xmms - The Xmms Server portion of Audio::Daemon

SYNOPSIS

  use Audio::Daemon::Xmms;

  # set things up
  my $daemon = new Audio::Daemon::Xmms(Port => 9101);

  # this should never return... it is a daemon after all.
  $daemon->mainloop;
  

DESCRIPTION

The Server portion of Audio::Daemon::Xmms, putting a UDP interface to Xmms, and a single client library. Gives the user full control over how to daemonize, keep running, monitor it, log messages, maintain access control, etc.

CONSTRUCTORS

There is but one method to contruct a new Audio::Daemon::Xmms object:

Audio::Daemon::Xmms->new(Port => $port, [Log => \&logsub], [Allow => <allowips>], [Deny => <denyips>]);

The new method can take the following arguments:

Port

The local port to start listening and accepting commands on.

Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

    <type>, <msg>, [caller(1)]

    where <type> is one of debug, info, error, crit, warn. <msg> is the text message, and [caller] is the array returned by the second form of the perlfunc caller(). This will give you the method, line number, etc. of where the messagee is coming from. With this logging feature, I don't have to worry about syslog, stdout, or how to report errors or debug info... you do!

Allow, Deny

Access Control. If you specify something for the Allow variable, it assumes everything not allowed will be denied. If you specify something to denied it assumes everything else is allowed. Wither neither set, everything is allowed. It accepts multple formats all seperated by a comma for multiple entries:

<ip>/mask

Either set to full 255.255.255.0 format or bitmask format: /24

<ip>

just an IP specified

<low ip>-<high ip>

For example: 192.168.10.15-192.168.10.44 so anythine between those two addresses would match the rule.

METHODS

mainloop

Never returns, and in theory, should never exit.

INFO

The info routine from the client will return the following fields: state, random, repeat, id, rateinfo, frame, title, artist, album, genre, vol and optionally list.

state

0 is stopped, 1 is paused, 2 is playing

random

1 means random is on, 0 means random is off. And this random uses the xmms random feature, not my internal random feature.

repeat

1 means repeat is on, 0 means repeat is off.

id

current track ID (starting at track 0) from the list of current tracks in the playlist.

rateinfo

Directly from xmms, I think it's kbps, something else, and stereo seperated by commas.

frame

I tried to mimick the mpg123 fields for frame so four fields are delivered. The first field is the time passed in milliseconds on the current track. The second is the total number of milliseconds in the current track. The third is a float (%.1f I think) of time passed in current track, and the fourth (pay attention now), is the remaining seconds (%.1f again) of the current track.

title, artist, album, genre

All of these are from the ID3 track

vol

left and right volume from Xmms

list

see Audio::Daemon::Client on this format, it's the same across the board.

AUTHOR

Jay Jacobs jayj@cpan.org

SEE ALSO

Audio::Daemon

Xmms

perl(1).

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 285:

=back doesn't take any parameters, but you said =back 4

Around line 307:

=back doesn't take any parameters, but you said =back 4

Around line 309:

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

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

Around line 368:

=back doesn't take any parameters, but you said =back 4