[Database::Update] Fix API breakage on MPD side.
[libmpd.git] / src / libmpd-status.h
blobe0d27fb0e30c5154f5ca2c01172686e1d5f2fba6
1 /* libmpd (high level libmpdclient library)
2 * Copyright (C) 2004-2009 Qball Cow <qball@sarine.nl>
3 * Project homepage: http://gmpcwiki.sarine.nl/
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef __MPD_LIB_STATUS__
22 #define __MPD_LIB_STATUS__
23 /**\defgroup 20status Status
24 * Functions to get and modify the status/state of mpd.
26 /*@{*/
28 /**
29 * @param mi a #MpdObj
31 * Checks if there is status information available. if not available, it tries to fetch it.
32 * This function is called from within libmpd, and shouldn't be called from the program.
34 * @returns 0 when successful
36 int mpd_status_check (MpdObj *mi);
40 /**
41 * @param mi a #MpdObj
43 * Marks the current status invalid, the next time status is needed it will be fetched from mpd.
45 * @returns 0 when successful
47 int mpd_status_queue_update (MpdObj *mi);
51 /**
52 * @param mi a #MpdObj
54 * Updates the status field from mpd.
55 * Call this function every 0.x seconds from the program's main-loop to receive signals when mpd's status has changed.
57 * @returns 0 when succesfull
59 int mpd_status_update (MpdObj *mi);
63 /**
64 * @param mi a #MpdObj
65 * @param fvol a float between 0.0 and 1.0
67 * Set the output volume
68 * @returns the new volume or a value below 0 when failed.
70 float mpd_status_set_volume_as_float (MpdObj *mi, float fvol);
73 /**
74 * @param mi a #MpdObj
75 * @param volume a value between 0 and 100.
77 * Set the output volume
79 * @returns the new volume or < 0 when failed.
81 int mpd_status_set_volume (MpdObj *mi,int volume);
85 /**
86 * @param mi a #MpdObj
88 * Get the audio output volume.
90 * @returns the audio output volume between 0 and 100 or < 0 when failed
92 int mpd_status_get_volume (MpdObj *mi);
96 /**
97 * @param mi a #MpdObj
99 * get the bitrate of the currently playing song in kbs. This is a constantly updating value. (for vbr songs)
101 * @returns bitrate in kbs
103 int mpd_status_get_bitrate (MpdObj *mi);
108 * @param mi a #MpdObj
110 * get the samplerate of the currently playing song in bps.
112 * @returns samplerate in bps
114 unsigned int mpd_status_get_samplerate (MpdObj *mi);
119 * @param mi a #MpdObj
121 * get the number of channels in the currently playing song. This is usually only 1(mono) or 2(stereo), but this might change in the future.
123 * @returns number of channels
125 int mpd_status_get_channels (MpdObj *mi);
130 * @param mi a #MpdObj
132 * get the number of bits per sample of the currently playing song.
134 * @returns bits per sample
136 int mpd_status_get_bits (MpdObj *mi);
141 * @param mi a #MpdObj
143 * get the total length of the currently playing song.
145 * @returns time in seconds or <0 when failed.
147 int mpd_status_get_total_song_time (MpdObj *mi);
151 * @param mi a #MpdObj
153 * Gets the elapsed time of the currently playing song.
155 * @returns Time in seconds
157 int mpd_status_get_elapsed_song_time (MpdObj *mi);
161 * @param mi a #MpdObj
163 * Get the crossfade time. 0 is disabled.
165 * @returns The crossfade time in seconds
167 int mpd_status_get_crossfade (MpdObj *mi);
172 * @param mi a #MpdObj
173 * @param crossfade_time the time to crossfade in seconds
175 * Sets the crossfade time. 0 to disable crossfade.
177 * @returns 0 when successful
179 int mpd_status_set_crossfade (MpdObj *mi, int crossfade_time);
184 * @param mi a #MpdObj
186 * Checks if mpd is updating it's music db.
188 * @returns TRUE if mpd is still updating, FALSE if not.
190 int mpd_status_db_is_updating (MpdObj *mi);
193 * @param mi a #MpdObj
195 * @returns the error message that mpd last reported, or NULL. Needs to be freed.
198 char * mpd_status_get_mpd_error(MpdObj *mi);
200 /*@}*/
202 /**\defgroup 20stats Stats
203 * Functions to get mpd statistics
205 /*@{*/
211 * @param mi a #MpdObj
213 * Shouldn't be used from the program.
215 int mpd_stats_update (MpdObj *mi);
219 * @param mi a #MpdObj
221 * Gets the total number of songs in the database
223 * @returns The total number of songs
225 int mpd_stats_get_total_songs (MpdObj *mi);
229 * @param mi a #MpdObj
231 * Gets the total number of artists in the database.
233 * @returns The number of artists in the database
235 int mpd_stats_get_total_artists (MpdObj *mi);
240 * @param mi a #MpdObj
242 * Gets the total number of albums in the database
244 * @returns The number of albums in the database
246 int mpd_stats_get_total_albums (MpdObj *mi);
251 * @param mi a #MpdObj
253 * Gets the time since mpd has been running
255 * @returns time since mpd has been running in seconds
257 int mpd_stats_get_uptime (MpdObj *mi);
259 * @param mi a #MpdObj
261 * Gets the total time of the database
263 * @returns the total time of the database
265 int mpd_stats_get_db_playtime (MpdObj *mi);
270 * @param mi a #MpdObj
272 * Gets the time mpd is playing
274 * @returns time that mpd is playing in seconds
276 int mpd_stats_get_playtime (MpdObj *mi);
281 /*@}*/
282 #endif