NAME
Audio::MPD::Common::Time - class representing time of current song
SYNOPSIS
my $time = $status->time;
print $time->sofar;
DESCRIPTION
Audio::MPD::Common::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 an Audio::MPD::Common::Time
object.
Note that an Audio::MPD::Common::Time
object does not update itself regularly, and thus should be used immediately.
METHODS
Constructor
- new( $time )
-
The
new()
method is the constructor for theAudio::MPD::Common::Time
class.Note: one should never ever instantiate an
Audio::MPD::Common::Time
object directly - use the mpd modules instead.
Accessors
Once created, one can access the following members of the object:
- cooked values:
-
The
sofar()
,left()
andtotal()
methods return the according values under the formminutes:seconds
. Note the existence of apercent()
method returning a percentage complete. (one decimal) - values in seconds:
-
The
seconds_sofar()
,seconds_left()
andseconds_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()
andsofar_mins()
return the seconds and minutes elapsed. Same forleft_secs()
andleft_mins()
(time remaining),total_secs()
andtotal_mins()
. (total song length)
Please note that those accessors are read-only: changing a value will not change the current settings of MPD server. Use the mpd modules to alter the settings.
SEE ALSO
AUTHOR
Jerome Quelin, <jquelin at cpan.org>
COPYRIGHT & LICENSE
Copyright (c) 2007 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.