Rechercher une page de manuel
Audio::MPD::Common::Time.3pm
Langue: en
Version: 2009-01-06 (debian - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
Audio::MPD::Common::Time - class representing time of current songSYNOPSIS
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 the "Audio::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()" 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 settings of MPD server. Use the mpd modules to alter the settings.
SEE ALSO
- Audio::MPD
- POE::Component::Client::MPD
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.
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre