]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - config/mpfire/perl/Audio/MPD/Common/Stats.pm
Finalized core13 and redirector fixes
[people/pmueller/ipfire-2.x.git] / config / mpfire / perl / Audio / MPD / Common / Stats.pm
1 #
2 # This file is part of Audio::MPD::Common
3 # Copyright (c) 2007 Jerome Quelin, all rights reserved.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the same terms as Perl itself.
7 #
8 #
9
10 package Audio::MPD::Common::Stats;
11
12 use warnings;
13 use strict;
14
15 use base qw[ Class::Accessor::Fast ];
16 __PACKAGE__->mk_accessors
17 ( qw[ artists albums songs uptime playtime db_playtime db_update ] );
18
19 #our ($VERSION) = '$Rev$' =~ /(\d+)/;
20
21 1;
22
23 __END__
24
25
26 =head1 NAME
27
28 Audio::MPD::Common::Stats - class representing MPD stats
29
30
31 =head1 SYNOPSIS
32
33 print $stats->artists;
34
35
36 =head1 DESCRIPTION
37
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.
41
42 Note that an C<Audio::MPD::Common::Stats> object does B<not> update itself
43 regularly, and thus should be used immediately.
44
45
46 =head1 METHODS
47
48 =head2 Constructor
49
50 =over 4
51
52 =item new( %kv )
53
54 The C<new()> method is the constructor for the C<Audio::MPD::Common::Stats>
55 class.
56
57 Note: one should B<never> ever instantiate an C<Audio::MPD::Common::Stats>
58 object directly - use the mpd modules instead.
59
60 =back
61
62
63 =head2 Accessors
64
65 Once created, one can access to the following members of the object:
66
67 =over 4
68
69 =item $stats->artists()
70
71 Number of artists in the music database.
72
73
74 =item $stats->albums()
75
76 Number of albums in the music database.
77
78
79 =item $stats->songs()
80
81 Number of songs in the music database.
82
83
84 =item $stats->uptime()
85
86 Daemon uptime (time since last startup) in seconds.
87
88
89 =item $stats->playtime()
90
91 Time length of music played.
92
93
94 =item $stats->db_playtime()
95
96 Sum of all song times in the music database.
97
98
99 =item $stats->db_update()
100
101 Last database update in UNIX time.
102
103
104 =back
105
106
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
109 settings.
110
111
112 =head1 SEE ALSO
113
114 =over 4
115
116 =item L<Audio::MPD>
117
118 =item L<POE::Component::Client::MPD>
119
120 =back
121
122
123 =head1 AUTHOR
124
125 Jerome Quelin, C<< <jquelin at cpan.org> >>
126
127
128 =head1 COPYRIGHT & LICENSE
129
130 Copyright (c) 2007 Jerome Quelin, all rights reserved.
131
132 This program is free software; you can redistribute it and/or modify
133 it under the same terms as Perl itself.
134
135 =cut