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 POE
::Component
::Client
::MPD
::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+)/;
29 Audio::MPD::Common::Stats - class representing MPD stats
34 print $stats->artists;
39 The MPD server maintains some general information. Those information can be
40 queried with the mpd modules. Some of those information are served to you as
41 an C<Audio::MPD::Common::Status> object.
43 Note that an C<Audio::MPD::Common::Stats> object does B<not> update itself
44 regularly, and thus should be used immediately.
55 The C<new()> method is the constructor for the C<Audio::MPD::Common::Stats>
58 Note: one should B<never> ever instantiate an C<Audio::MPD::Common::Stats>
59 object directly - use the mpd modules instead.
66 Once created, one can access to the following members of the object:
70 =item $stats->artists()
72 Number of artists in the music database.
75 =item $stats->albums()
77 Number of albums in the music database.
82 Number of songs in the music database.
85 =item $stats->uptime()
87 Daemon uptime (time since last startup) in seconds.
90 =item $stats->playtime()
92 Time length of music played.
95 =item $stats->db_playtime()
97 Sum of all song times in the music database.
100 =item $stats->db_update()
102 Last database update in UNIX time.
108 Please note that those accessors are read-only: changing a value will B<not>
109 change the current settings of MPD server. Use the mpd modules to alter the
119 =item L<POE::Component::Client::MPD>
126 Jerome Quelin, C<< <jquelin at cpan.org> >>
129 =head1 COPYRIGHT & LICENSE
131 Copyright (c) 2007 Jerome Quelin, all rights reserved.
133 This program is free software; you can redistribute it and/or modify
134 it under the same terms as Perl itself.