NAME

POE::Component::Client::MPD::Stats - class representing MPD stats

SYNOPSIS

print $stats->artists;

DESCRIPTION

The MPD server maintains some general information. Those information can be queried with the stats event of POCOCM. This method fires back an event with a POCOCM::Message, which data() is an POCOCM::Stats object, containing all relevant information.

Note that an POCOCM::Stats object does not update itself regularly, and thus should be used immediately.

METHODS

Constructor

new( %kv )

The new() method is the constructor for the POCOCM::Status class. It is called internally by PCOCOM::Commands, with the result of the stats command sent to MPD server.

Note: one should never ever instantiate an POCOCM::Stats object directly - use the stats event of POCOCM.

Accessors

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

$stats->artists()

Number of artists in the music database.

$stats->albums()

Number of albums in the music database.

$stats->songs()

Number of songs in the music database.

$stats->uptime()

Daemon uptime (time since last startup) in seconds.

$stats->playtime()

Time length of music played.

$stats->db_playtime()

Sum of all song times in the music database.

$stats->db_update()

Last database update in UNIX time.

Please note that those accessors are read-only: changing a value will not change the current settings of MPD server. Use POCOCM events to alter the settings.

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 2007 Jerome Quelin, all rights reserved.

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.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA