From 890f31fc3d69c8f7c2f847ff82d886a7edb44395 Mon Sep 17 00:00:00 2001 From: jq Date: Wed, 4 Apr 2007 16:30:10 +0000 Subject: [PATCH] [project @ 5828] unifying pod presentation of the methods --- lib/Audio/MPD/Collection.pm | 34 +++++++++++++++++----------------- lib/Audio/MPD/Playlist.pm | 34 +++++++++++++++++----------------- lib/Audio/MPD/Status.pm | 40 ++++++++++++++++++++++++++-------------- 3 files changed, 60 insertions(+), 48 deletions(-) diff --git a/lib/Audio/MPD/Collection.pm b/lib/Audio/MPD/Collection.pm index 45bbcb4..c2193be 100644 --- a/lib/Audio/MPD/Collection.pm +++ b/lib/Audio/MPD/Collection.pm @@ -27,7 +27,7 @@ use base qw[ Class::Accessor::Fast ]; __PACKAGE__->mk_accessors( qw[ _mpd ] ); -#our ($VERSION) = '$Rev: 5805 $' =~ /(\d+)/; +#our ($VERSION) = '$Rev: 5828 $' =~ /(\d+)/; #-- @@ -319,7 +319,7 @@ of an C object. =over 4 -=item all_items( [$path] ) +=item $coll->all_items( [$path] ) Return B Cs (both songs & directories) currently known by mpd. @@ -328,7 +328,7 @@ If C<$path> is supplied (relative to mpd root), restrict the retrieval to songs and dirs in this directory. -=item all_items_simple( [$path] ) +=item $coll->all_items_simple( [$path] ) Return B Cs (both songs & directories) currently known by mpd. @@ -341,7 +341,7 @@ tag file filled. Any other tag will be empty, so don't use this sub for any other thing than a quick scan! -=item items_in_dir( [$path] ) +=item $coll->items_in_dir( [$path] ) Return the items in the given C<$path>. If no C<$path> supplied, do it on mpd's root directory. @@ -356,22 +356,22 @@ Note that this sub does not work recusrively on all directories. =over 4 -=item all_albums() +=item $coll->all_albums( ) Return the list of all albums (strings) currently known by mpd. -=item all_artists() +=item $coll->all_artists( ) Return the list of all artists (strings) currently known by mpd. -=item all_titles() +=item $coll->all_titles( ) Return the list of all song titles (strings) currently known by mpd. -=item all_pathes() +=item $coll->all_pathes( ) Return the list of all pathes (strings) currently known by mpd. @@ -383,12 +383,12 @@ Return the list of all pathes (strings) currently known by mpd. =over 4 -=item song( $path ) +=item $coll->song( $path ) Return the C which correspond to C<$path>. -=item songs_with_filename_partial( $path ) +=item $coll->songs_with_filename_partial( $path ) Return the Cs containing $string in their path. @@ -400,39 +400,39 @@ Return the Cs containing $string in their path. =over 4 -=item albums_by_artist( $artist ) +=item $coll->albums_by_artist( $artist ) Return all albums (strings) performed by C<$artist> or where C<$artist> participated. -=item songs_by_artist( $artist ) +=item $coll->songs_by_artist( $artist ) Return all Cs performed by C<$artist>. -=item songs_by_artist_partial( $string ) +=item $coll->songs_by_artist_partial( $string ) Return all Cs performed by an artist with C<$string> in her name. -=item songs_from_album( $album ) +=item $coll->songs_from_album( $album ) Return all Cs appearing in C<$album>. -=item songs_from_album_partial( $string ) +=item $coll->songs_from_album_partial( $string ) Return all Cs appearing in album containing C<$string>. -=item songs_with_title( $title ) +=item $coll->songs_with_title( $title ) Return all Cs which title is exactly C<$title>. -=item songs_with_title_partial( $string ) +=item $coll->songs_with_title_partial( $string ) Return all Cs where C<$string> is part of the title. diff --git a/lib/Audio/MPD/Playlist.pm b/lib/Audio/MPD/Playlist.pm index 77ae944..97f50f5 100644 --- a/lib/Audio/MPD/Playlist.pm +++ b/lib/Audio/MPD/Playlist.pm @@ -256,11 +256,11 @@ of an C object. =back -=head2 Methods to retrieve information +=head2 Retrieving information =over 4 -=item as_items() +=item $pl->as_items( ) Return an array of Cs, one for each of the songs in the current playlist. @@ -269,34 +269,34 @@ songs in the current playlist. =back -=head2 Methods to add / remove songs +=head2 Adding / removing songs =over 4 -=item add( $path ) +=item $pl->add( $path ) Add the song identified by C<$path> (relative to MPD's music directory) to the current playlist. No return value. -=item delete( $song [, $song [...] ] ) +=item $pl->delete( $song [, $song [...] ] ) Remove song number C<$song>s (starting from 0) from the current playlist. No return value. -=item deleteid( $songid [, $songid [...] ] ) +=item $pl->deleteid( $songid [, $songid [...] ] ) Remove the specified C<$songid>s (as assigned by mpd when inserted in playlist) from the current playlist. No return value. -=item clear() +=item $pl->clear() Remove all the songs from the current playlist. No return value. -=item crop() +=item $pl->crop() Remove all of the songs from the current playlist *except* the song currently playing. @@ -305,49 +305,49 @@ song currently playing. =back -=head2 Methods to change playlist order +=head2 Changing playlist order =over 4 -=item swap( $song1, $song2 ) +=item $pl->swap( $song1, $song2 ) Swap positions of song number $song1 and $song2 on the current playlist. No return value. -=item $mpd->swapid( $songid1, $songid2 ) +=item $pl->swapid( $songid1, $songid2 ) Swap the postions of song ID $songid1 with song ID $songid2 on the current playlist. No return value. -=item $mpd->move( $song, $newpos ) +=item $pl->move( $song, $newpos ) Move song number $song to the position $newpos. No return value. -=item $mpd->moveid( $songid, $newpos ) +=item $pl->moveid( $songid, $newpos ) Move song ID $songid to the position $newpos. No return value. -=item $mpd->shuffle() +=item $pl->shuffle() Shuffle the current playlist. No return value. -=item $mpd->load( $playlist ) +=item $pl->load( $playlist ) Load list of songs from specified $playlist file. No return value. -=item $mpd->save( $playlist ) +=item $pl->save( $playlist ) Save the current playlist to a file called $playlist in MPD's playlist directory. No return value. -=item $mpd->rm( $playlist ) +=item $pl->rm( $playlist ) Delete playlist named $playlist from MPD's playlist directory. No return value. diff --git a/lib/Audio/MPD/Status.pm b/lib/Audio/MPD/Status.pm index 17343cf..5e077e4 100644 --- a/lib/Audio/MPD/Status.pm +++ b/lib/Audio/MPD/Status.pm @@ -25,7 +25,7 @@ __PACKAGE__->mk_accessors ( qw[ audio bitrate error playlist playlistlength random repeat song songid state time volume xfade ] ); -#our ($VERSION) = '$Rev: 5645 $' =~ /(\d+)/; +#our ($VERSION) = '$Rev: 5828 $' =~ /(\d+)/; #-- @@ -100,61 +100,73 @@ Once created, one can access to the following members of the object: =over 4 -=item audio() +=item $status->audio( ) A string with the sample rate of the song currently playing, number of bits of the output and number of channels (2 for stereo) - separated by a colon. -=item bitrate() + +=item $status->bitrate( ) The instantaneous bitrate in kbps. -=item error() + +=item $status->error( ) May appear in special error cases, such as when disabling output. -=item playlist() +=item $status->playlist( ) The playlist version number, that changes every time the playlist is updated. -=item playlistlength() + +=item $status->playlistlength( ) The number of songs in the playlist. -=item random() + +=item $status->random( ) Whether the playlist is read randomly or not. -=item repeat() + +=item $status->repeat( ) Whether the song is repeated or not. -=item song() + +=item $status->song( ) The offset of the song currently played in the playlist. -=item songid() + +=item $status->songid( ) The song id (MPD id) of the song currently played. -=item state() + +=item $status->state( ) The state of MPD server. Either C, C or C. -=item time() + +=item $status->time( ) A string with the time played so far and the total time of the current song, separated by a colon. -=item volume() + +=item $status->volume( ) The current MPD volume - an integer between 0 and 100. -=item xfade() + +=item $status->xfade( ) The crossfade in seconds. + =back Please note that those accessors are read-only: changing a value will B -- 2.11.4.GIT