NAME
POE::Component::Client::MPD::Time - class representing time of current song
SYNOPSIS
my $time = $status->time;
print $time->sofar;
DESCRIPTION
POCOCM::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 POCOCM::Time
object.
Note that an POCOCM::Time
object does not update itself regularly, and thus should be used immediately.
METHODS
Constructor
- new( $time )
-
The
new()
method is the constructor for thePOCOCM::Time
class. It is called internally during thePOCOCM::Status
object creation, with thetime
line of thestatus
command sent to MPD server.Note: one should never ever instantiate an
POCOCM::Time
object directly - use thetime()
method ofPOCOCM::Status
.
Accessors
Once created, one can access to 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 state of MPD server. Use Audio::MPD
methods to alter the song playing.
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 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.