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 int 00224 mpd_status_get_song_id(const struct mpd_status *status); 00225 00230 mpd_pure 00231 unsigned 00232 mpd_status_get_elapsed_time(const struct mpd_status *status); 00233 00238 mpd_pure 00239 unsigned 00240 mpd_status_get_elapsed_ms(const struct mpd_status *status); 00241 00245 mpd_pure 00246 unsigned 00247 mpd_status_get_total_time(const struct mpd_status *status); 00248 00252 mpd_pure 00253 unsigned 00254 mpd_status_get_kbit_rate(const struct mpd_status *status); 00255 00260 mpd_pure 00261 const struct mpd_audio_format * 00262 mpd_status_get_audio_format(const struct mpd_status *status); 00263 00267 mpd_pure 00268 unsigned 00269 mpd_status_get_update_id(const struct mpd_status *status); 00270 00274 mpd_pure 00275 const char * 00276 mpd_status_get_error(const struct mpd_status *status); 00277 00278 #ifdef __cplusplus 00279 } 00280 #endif 00281 00282 #endif