00001 /* libmpdclient 00002 (c) 2003-2009 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 time_t 00117 mpd_song_get_last_modified(const struct mpd_song *song); 00118 00126 void 00127 mpd_song_set_pos(struct mpd_song *song, unsigned pos); 00128 00133 mpd_pure 00134 unsigned 00135 mpd_song_get_pos(const struct mpd_song *song); 00136 00141 mpd_pure 00142 unsigned 00143 mpd_song_get_id(const struct mpd_song *song); 00144 00152 mpd_malloc 00153 struct mpd_song * 00154 mpd_song_begin(const struct mpd_pair *pair); 00155 00164 bool 00165 mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair); 00166 00173 mpd_malloc 00174 struct mpd_song * 00175 mpd_recv_song(struct mpd_connection *connection); 00176 00177 #ifdef __cplusplus 00178 } 00179 #endif 00180 00181 #endif