00001 /* libmpdclient 00002 (c) 2003-2015 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_SONG_H 00040 #define MPD_SONG_H 00041 00042 #include <mpd/tag.h> 00043 #include <mpd/compiler.h> 00044 00045 #include <stdbool.h> 00046 #include <time.h> 00047 00048 struct mpd_pair; 00049 struct mpd_connection; 00050 00058 struct mpd_song; 00059 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 00067 void mpd_song_free(struct mpd_song *song); 00068 00074 mpd_malloc 00075 struct mpd_song * 00076 mpd_song_dup(const struct mpd_song *song); 00077 00083 mpd_pure 00084 const char * 00085 mpd_song_get_uri(const struct mpd_song *song); 00086 00098 mpd_pure 00099 const char * 00100 mpd_song_get_tag(const struct mpd_song *song, 00101 enum mpd_tag_type type, unsigned idx); 00102 00107 mpd_pure 00108 unsigned 00109 mpd_song_get_duration(const struct mpd_song *song); 00110 00115 mpd_pure 00116 unsigned 00117 mpd_song_get_duration_ms(const struct mpd_song *song); 00118 00123 mpd_pure 00124 unsigned 00125 mpd_song_get_start(const struct mpd_song *song); 00126 00132 mpd_pure 00133 unsigned 00134 mpd_song_get_end(const struct mpd_song *song); 00135 00140 mpd_pure 00141 time_t 00142 mpd_song_get_last_modified(const struct mpd_song *song); 00143 00151 void 00152 mpd_song_set_pos(struct mpd_song *song, unsigned pos); 00153 00158 mpd_pure 00159 unsigned 00160 mpd_song_get_pos(const struct mpd_song *song); 00161 00166 mpd_pure 00167 unsigned 00168 mpd_song_get_id(const struct mpd_song *song); 00169 00174 mpd_pure 00175 unsigned 00176 mpd_song_get_prio(const struct mpd_song *song); 00177 00185 mpd_malloc 00186 struct mpd_song * 00187 mpd_song_begin(const struct mpd_pair *pair); 00188 00197 bool 00198 mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair); 00199 00206 mpd_malloc 00207 struct mpd_song * 00208 mpd_recv_song(struct mpd_connection *connection); 00209 00210 #ifdef __cplusplus 00211 } 00212 #endif 00213 00214 #endif