2 # This file is part of Audio::MPD::Common
3 # Copyright (c) 2007 Jerome Quelin, all rights reserved.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the same terms as Perl itself.
10 package Audio
::MPD
::Common
::Stats
;
15 use base qw
[ Class
::Accessor
::Fast
];
16 __PACKAGE__
->mk_accessors
17 ( qw
[ artists albums songs uptime playtime db_playtime db_update
] );
19 #our ($VERSION) = '$Rev$' =~ /(\d+)/;
28 Audio::MPD::Common::Stats - class representing MPD stats
33 print $stats->artists;
38 The MPD server maintains some general information. Those information can be
39 queried with the mpd modules. Some of those information are served to you as
40 an C<Audio::MPD::Common::Status> object.
42 Note that an C<Audio::MPD::Common::Stats> object does B<not> update itself
43 regularly, and thus should be used immediately.
54 The C<new()> method is the constructor for the C<Audio::MPD::Common::Stats>
57 Note: one should B<never> ever instantiate an C<Audio::MPD::Common::Stats>
58 object directly - use the mpd modules instead.
65 Once created, one can access to the following members of the object:
69 =item $stats->artists()
71 Number of artists in the music database.
74 =item $stats->albums()
76 Number of albums in the music database.
81 Number of songs in the music database.
84 =item $stats->uptime()
86 Daemon uptime (time since last startup) in seconds.
89 =item $stats->playtime()
91 Time length of music played.
94 =item $stats->db_playtime()
96 Sum of all song times in the music database.
99 =item $stats->db_update()
101 Last database update in UNIX time.
107 Please note that those accessors are read-only: changing a value will B<not>
108 change the current settings of MPD server. Use the mpd modules to alter the
118 =item L<POE::Component::Client::MPD>
125 Jerome Quelin, C<< <jquelin at cpan.org> >>
128 =head1 COPYRIGHT & LICENSE
130 Copyright (c) 2007 Jerome Quelin, all rights reserved.
132 This program is free software; you can redistribute it and/or modify
133 it under the same terms as Perl itself.