


POE::Component:UsereContrPOE::Component::Client::MPD::Commands(3)


NAME
       POE::Component::Client::MPD::Commands - module handling basic mpd
       commands

DESCRIPTION
       "POCOCM::Commands" is responsible for handling general purpose
       commands. They are in a dedicated module to achieve easier code
       maintenance.

       To achieve those commands, send the corresponding event to the POCOCM
       session you created: it will be responsible for dispatching the event
       where it is needed. Under no circumstance should you call directly subs
       or methods from this module directly.

       Read POCOCM's pod to learn how to deal with answers from those
       commands.

PUBLIC EVENTS
       The following is a list of general purpose events accepted by POCOCM.

   General commands
       o   version()

           Return mpd's version number as advertised during connection. Note
           that mpd returns 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.

       o   kill()

           Kill the mpd server, and request the pococm to be shutdown.

       o   updatedb( [$path] )

           Force mpd to rescan its collection. If $path (relative to MPD's
           music directory) is supplied, MPD will only scan it - otherwise,
           MPD will rescan its whole collection.

       o   urlhandlers()

           Return an array of supported URL schemes.

   Handling volume & output
       o   volume( $volume )

           Sets the audio output volume percentage to absolute $volume. If
           $volume is prefixed by '+' or '-' then the volume is changed
           relatively by that value.

       o   output_enable( $output )

           Enable the specified audio output. $output is the ID of the audio
           output.




perl v5.12.2                2011-03-08                          1





POE::Component:UsereContrPOE::Component::Client::MPD::Commands(3)


       o   output_disable( $output )

           Disable the specified audio output. $output is the ID of the audio
           output.

   Retrieving info from current state
       o   stats()

           Return an "Audio::MPD::Common::Stats" object with the current
           statistics of MPD.

       o   status ()

           Return an "Audio::MPD::Common::Status" object with the current
           status of MPD.

       o   current()

           Return an "Audio::MPD::Common::Item::Song" representing the song
           currently playing.

       o   song( [$song] )

           Return an "Audio::MPD::Common::Item::Song" representing the song
           number $song. If $song is not supplied, returns the current song.

       o   songid( [$songid] )

           Return an "Audio::MPD::Common::Item::Song" representing the song id
           $songid. If $songid is not supplied, returns the current song.

   Altering settings
       o   repeat( [$repeat] )

           Set the repeat mode to $repeat (1 or 0). If $repeat is not
           specified then the repeat mode is toggled.

       o   fade( [$seconds] )

           Enable crossfading and set the duration of crossfade between songs.
           If $seconds is not specified or $seconds is 0, then crossfading is
           disabled.

       o   random( [$random] )

           Set the random mode to $random (1 or 0). If $random is not
           specified then the random mode is toggled.

   Controlling playback
       o   play( [$song] )

           Begin playing playlist at song number $song. If no argument
           supplied, resume playing.




perl v5.12.2                2011-03-08                          2





POE::Component:UsereContrPOE::Component::Client::MPD::Commands(3)


       o   playid( [$song] )

           Begin playing playlist at song ID $song. If no argument supplied,
           resume playing.

       o   pause( [$sate] )

           Pause playback. If $state is 0 then the current track is unpaused,
           if $state is 1 then the current track is paused.

           Note that if $state is not given, pause state will be toggled.

       o   stop()

           Stop playback.

       o   next()

           Play next song in playlist.

       o   prev()

           Play previous song in playlist.

       o   seek( $time, [$song] )

           Seek to $time seconds in song number $song. If $song number is not
           specified then the perl module will try and seek to $time in the
           current song.

       o   seekid( $time, [$songid] )

           Seek to $time seconds in song ID $songid. If $songid number is not
           specified then the perl module will try and seek to $time in the
           current song.

SEE ALSO
       For all related information (bug reporting, mailing-list, pointers to
       MPD and POE, etc.), refer to "POE::Component::Client::MPD"'s pod,
       section "SEE ALSO"

AUTHOR
       Jerome Quelin, "<jquelin@cpan.org>"

COPYRIGHT & LICENSE
       Copyright (c) 2007-2008 Jerome Quelin, all rights reserved.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.








perl v5.12.2                2011-03-08                          3


