[project @ 6343]
[audio-mpd-common.git] / lib / Audio / MPD / Common / Stats.pm
blob1218dd1376b172d8f7fe32ad87a795a17386810a
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;
12 use warnings;
13 use strict;
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+)/;
23 __END__
25 =pod
27 =head1 NAME
29 Audio::MPD::Common::Stats - class representing MPD stats
32 =head1 SYNOPSIS
34 print $stats->artists;
37 =head1 DESCRIPTION
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.
47 =head1 METHODS
49 =head2 Constructor
51 =over 4
53 =item new( %kv )
55 The C<new()> method is the constructor for the C<Audio::MPD::Common::Stats>
56 class.
58 Note: one should B<never> ever instantiate an C<Audio::MPD::Common::Stats>
59 object directly - use the mpd modules instead.
61 =back
64 =head2 Accessors
66 Once created, one can access to the following members of the object:
68 =over 4
70 =item $stats->artists()
72 Number of artists in the music database.
75 =item $stats->albums()
77 Number of albums in the music database.
80 =item $stats->songs()
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.
105 =back
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
110 settings.
113 =head1 SEE ALSO
115 =over 4
117 =item L<Audio::MPD>
119 =item L<POE::Component::Client::MPD>
121 =back
124 =head1 AUTHOR
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.
136 =cut