libmpdclient  2.7
mpd/song.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_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_start(const struct mpd_song *song);
00118 
00124 mpd_pure
00125 unsigned
00126 mpd_song_get_end(const struct mpd_song *song);
00127 
00132 mpd_pure
00133 time_t
00134 mpd_song_get_last_modified(const struct mpd_song *song);
00135 
00143 void
00144 mpd_song_set_pos(struct mpd_song *song, unsigned pos);
00145 
00150 mpd_pure
00151 unsigned
00152 mpd_song_get_pos(const struct mpd_song *song);
00153 
00158 mpd_pure
00159 unsigned
00160 mpd_song_get_id(const struct mpd_song *song);
00161 
00169 mpd_malloc
00170 struct mpd_song *
00171 mpd_song_begin(const struct mpd_pair *pair);
00172 
00181 bool
00182 mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair);
00183 
00190 mpd_malloc
00191 struct mpd_song *
00192 mpd_recv_song(struct mpd_connection *connection);
00193 
00194 #ifdef __cplusplus
00195 }
00196 #endif
00197 
00198 #endif