Audio-MPD
view release on metacpan or search on metacpan
lib/Audio/MPD.pm view on Meta::CPAN
=head1 METHODS
=head2 new
my $mpd = Audio::MPD->new( \%opts );
This is the constructor for L<Audio::MPD>. One can specify any of the
attributes (cf above).
=head1 CONTROLLING THE SERVER
=head2 ping
$mpd->ping;
Sends a ping command to the mpd server.
=head2 version
my $version = $mpd->version;
Return mpd's version number as advertised during connection. Note that
mpd returns B<protocol> version when connected. This protocol version
can differ from the real mpd version. eg, mpd version 0.13.2 is
"speaking" and thus advertising version 0.13.0.
=head2 kill
$mpd->kill;
Send a message to the MPD server telling it to shut down.
=head2 set_password
$mpd->set_password( [$password] );
Change password used to communicate with MPD server to C<$password>.
Empty string is assumed if C<$password> is not supplied.
=head2 updatedb
$mpd->updatedb( [$path] );
Force mpd to recan its collection. If C<$path> (relative to MPD's music
directory) is supplied, MPD will only scan it - otherwise, MPD will
rescan its whole collection.
=head2 urlhandlers
my @handlers = $mpd->urlhandlers;
Return an array of supported URL schemes.
=head1 HANDLING VOLUME & OUTPUT
=head2 volume
$mpd->volume( [+][-]$volume );
Sets the audio output volume percentage to absolute C<$volume>. If
C<$volume> is prefixed by '+' or '-' then the volume is changed
relatively by that value.
=head2 outputs
my @outputs = $mpd->outputs( );
Return a list of C<Audio::MPD::Common::Outputs> with all outputs
available within MPD.
=head2 output_enable
$mpd->output_enable( $output );
Enable the specified audio output. C<$output> is the ID of the audio
output.
=head2 output_disable
$mpd->output_disable( $output );
Disable the specified audio output. C<$output> is the ID of the audio
output.
=head1 RETRIEVING INFO FROM CURRENT STATE
=head2 stats
my $stats = $mpd->stats;
Return an L<Audio::MPD::Common::Stats> object with the current statistics
of MPD. See the associated pod for more information.
=head2 status
my $status = $mpd->status;
Return an L<Audio::MPD::Common::Status> object with various information on
current MPD server settings. See the associated pod for more information.
=head2 current
my $song = $mpd->current;
Return an L<Audio::MPD::Common::Item::Song> representing the song currently
playing.
=head2 song
my $song = $mpd->song( [$song] );
Return an L<Audio::MPD::Common::Item::Song> representing the song number
C<$song>. If C<$song> is not supplied, returns the current song.
=head2 songid
my $song = $mpd->songid( [$songid] );
Return an L<Audio::MPD::Common::Item::Song> representing the song with id
C<$songid>. If C<$songid> is not supplied, returns the current song.
( run in 3.122 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )