NAME

Audio::MPD::Time - class representing time of current song

SYNOPSIS

my $time = $status->time;
print $time->sofar;

DESCRIPTION

Audio::MPD::Status returns some time information with the time() accessor. This information relates to the elapsed time of the current song, as well as the remaining and total time. This information is encapsulated in a Audio::MPD::Time object.

Note that an Audio::MPD::Time object does not update itself regularly, and thus should be used immediately.

METHODS

Constructor

new( $time )

The new() method is the constructor for the Audio::MPD::Time class. It is called internally during the Audio::MPD::Status object creation, with the time line of the status command sent to MPD server.

Note: one should never ever instantiate an Audio::MPD::Time object directly - use the time() method of Audio::MPD::Status.

Accessors

Once created, one can access to the following members of the object:

cooked values:

The sofar(), left() and total() methods return the according values under the form minutes:seconds. Note the existence of a percent() method returning a percentage complete. (one decimal)

values in seconds:

The seconds_sofar(), seconds_left() and seconds_total() return the according values in seconds.

detailled values:

If you want to cook your own value, then the following methods can help. sofar_secs() and sofar_mins() return the seconds and minutes elapsed. Same for left_secs() and left_mins() (time remaining), total_secs() and total_mins(). (total song length)

Please note that those accessors are read-only: changing a value will not change the current state of MPD server. Use Audio::MPD methods to alter the song playing.

SEE ALSO

You can find more information on the mpd project on its homepage at http://www.musicpd.org, or its wiki http://mpd.wikia.com.

Regarding this Perl module, you can report bugs on CPAN via http://rt.cpan.org/Public/Bug/Report.html?Queue=Audio-MPD.

Audio::MPD development takes place on <audio-mpd@googlegroups.com>: feel free to join us. (use http://groups.google.com/group/audio-mpd to sign in). Our subversion repository is located at https://svn.musicpd.org.

AUTHORS

Jerome Quelin <jquelin@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2007 Jerome Quelin <jquelin@cpan.org>

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.