libmpdclient  2.7
mpd/status.h
Go to the documentation of this file.
00001 /* libmpdclient
00002    (c) 2003-2010 The Music Player Daemon Project
00003    This project's homepage is: http://www.musicpd.org
00004 
00005    Redistribution and use in source and binary forms, with or without
00006    modification, are permitted provided that the following conditions
00007    are met:
00008 
00009    - Redistributions of source code must retain the above copyright
00010    notice, this list of conditions and the following disclaimer.
00011 
00012    - Redistributions in binary form must reproduce the above copyright
00013    notice, this list of conditions and the following disclaimer in the
00014    documentation and/or other materials provided with the distribution.
00015 
00016    - Neither the name of the Music Player Daemon nor the names of its
00017    contributors may be used to endorse or promote products derived from
00018    this software without specific prior written permission.
00019 
00020    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00023    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00024    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00027    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00028    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00029    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031 */
00032 
00039 #ifndef MPD_STATUS_H
00040 #define MPD_STATUS_H
00041 
00042 #include <mpd/compiler.h>
00043 
00044 #include <stdbool.h>
00045 
00049 enum mpd_state {
00051         MPD_STATE_UNKNOWN = 0,
00052 
00054         MPD_STATE_STOP = 1,
00055 
00057         MPD_STATE_PLAY = 2,
00058 
00060         MPD_STATE_PAUSE = 3,
00061 };
00062 
00063 struct mpd_connection;
00064 struct mpd_pair;
00065 struct mpd_audio_format;
00066 
00072 struct mpd_status;
00073 
00074 #ifdef __cplusplus
00075 extern "C" {
00076 #endif
00077 
00085 mpd_malloc
00086 struct mpd_status *
00087 mpd_status_begin(void);
00088 
00093 void
00094 mpd_status_feed(struct mpd_status *status, const struct mpd_pair *pair);
00095 
00102 bool
00103 mpd_send_status(struct mpd_connection *connection);
00104 
00110 mpd_malloc
00111 struct mpd_status *
00112 mpd_recv_status(struct mpd_connection *connection);
00113 
00120 mpd_malloc
00121 struct mpd_status *
00122 mpd_run_status(struct mpd_connection *connection);
00123 
00127 void mpd_status_free(struct mpd_status * status);
00128 
00133 mpd_pure
00134 int mpd_status_get_volume(const struct mpd_status *status);
00135 
00139 mpd_pure
00140 bool
00141 mpd_status_get_repeat(const struct mpd_status *status);
00142 
00146 mpd_pure
00147 bool
00148 mpd_status_get_random(const struct mpd_status *status);
00149 
00153 mpd_pure
00154 bool
00155 mpd_status_get_single(const struct mpd_status *status);
00156 
00160 mpd_pure
00161 bool
00162 mpd_status_get_consume(const struct mpd_status *status);
00163 
00168 mpd_pure
00169 unsigned
00170 mpd_status_get_queue_length(const struct mpd_status *status);
00171 
00176 mpd_pure
00177 unsigned
00178 mpd_status_get_queue_version(const struct mpd_status *status);
00179 
00183 mpd_pure
00184 enum mpd_state
00185 mpd_status_get_state(const struct mpd_status *status);
00186 
00191 mpd_pure
00192 unsigned
00193 mpd_status_get_crossfade(const struct mpd_status *status);
00194 
00198 mpd_pure
00199 float
00200 mpd_status_get_mixrampdb(const struct mpd_status *status);
00201 
00206 mpd_pure
00207 float
00208 mpd_status_get_mixrampdelay(const struct mpd_status *status);
00209 
00215 mpd_pure
00216 int
00217 mpd_status_get_song_pos(const struct mpd_status *status);
00218 
00223 mpd_pure
00224 int
00225 mpd_status_get_song_id(const struct mpd_status *status);
00226 
00231 mpd_pure
00232 int
00233 mpd_status_get_next_song_pos(const struct mpd_status *status);
00234 
00239 mpd_pure
00240 int
00241 mpd_status_get_next_song_id(const struct mpd_status *status);
00242 
00247 mpd_pure
00248 unsigned
00249 mpd_status_get_elapsed_time(const struct mpd_status *status);
00250 
00255 mpd_pure
00256 unsigned
00257 mpd_status_get_elapsed_ms(const struct mpd_status *status);
00258 
00262 mpd_pure
00263 unsigned
00264 mpd_status_get_total_time(const struct mpd_status *status);
00265 
00269 mpd_pure
00270 unsigned
00271 mpd_status_get_kbit_rate(const struct mpd_status *status);
00272 
00277 mpd_pure
00278 const struct mpd_audio_format *
00279 mpd_status_get_audio_format(const struct mpd_status *status);
00280 
00284 mpd_pure
00285 unsigned
00286 mpd_status_get_update_id(const struct mpd_status *status);
00287 
00291 mpd_pure
00292 const char *
00293 mpd_status_get_error(const struct mpd_status *status);
00294 
00295 #ifdef __cplusplus
00296 }
00297 #endif
00298 
00299 #endif