libmpdclient  2.25
song.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // Copyright The Music Player Daemon Project
3 
10 #ifndef MPD_SONG_H
11 #define MPD_SONG_H
12 
13 #include "tag.h"
14 #include "compiler.h"
15 
16 #include <stdbool.h>
17 #include <time.h>
18 
19 struct mpd_pair;
21 
29 struct mpd_song;
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 void mpd_song_free(struct mpd_song *song);
39 
45 mpd_malloc
46 struct mpd_song *
47 mpd_song_dup(const struct mpd_song *song);
48 
54 mpd_pure
55 const char *
56 mpd_song_get_uri(const struct mpd_song *song);
57 
69 mpd_pure
70 const char *
71 mpd_song_get_tag(const struct mpd_song *song,
72  enum mpd_tag_type type, unsigned idx);
73 
81 mpd_pure
82 const char *
83 mpd_song_get_real_uri(const struct mpd_song *song);
84 
89 mpd_pure
90 unsigned
91 mpd_song_get_duration(const struct mpd_song *song);
92 
99 mpd_pure
100 unsigned
101 mpd_song_get_duration_ms(const struct mpd_song *song);
102 
109 mpd_pure
110 unsigned
111 mpd_song_get_start(const struct mpd_song *song);
112 
119 mpd_pure
120 unsigned
121 mpd_song_get_start_ms(const struct mpd_song *song);
122 
129 mpd_pure
130 unsigned
131 mpd_song_get_end(const struct mpd_song *song);
132 
139 mpd_pure
140 unsigned
141 mpd_song_get_end_ms(const struct mpd_song *song);
142 
147 mpd_pure
148 time_t
149 mpd_song_get_last_modified(const struct mpd_song *song);
150 
157 mpd_pure
158 time_t
159 mpd_song_get_added(const struct mpd_song *song);
160 
168 void
169 mpd_song_set_pos(struct mpd_song *song, unsigned pos);
170 
175 mpd_pure
176 unsigned
177 mpd_song_get_pos(const struct mpd_song *song);
178 
183 mpd_pure
184 unsigned
185 mpd_song_get_id(const struct mpd_song *song);
186 
193 mpd_pure
194 unsigned
195 mpd_song_get_prio(const struct mpd_song *song);
196 
203 mpd_pure
204 const struct mpd_audio_format *
205 mpd_song_get_audio_format(const struct mpd_song *song);
206 
214 mpd_malloc
215 struct mpd_song *
216 mpd_song_begin(const struct mpd_pair *pair);
217 
226 bool
227 mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair);
228 
235 mpd_malloc
236 struct mpd_song *
237 mpd_recv_song(struct mpd_connection *connection);
238 
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 #endif
const struct mpd_audio_format * mpd_song_get_audio_format(const struct mpd_song *song)
void mpd_song_free(struct mpd_song *song)
unsigned mpd_song_get_duration(const struct mpd_song *song)
unsigned mpd_song_get_end(const struct mpd_song *song)
unsigned mpd_song_get_start(const struct mpd_song *song)
unsigned mpd_song_get_start_ms(const struct mpd_song *song)
struct mpd_song * mpd_song_dup(const struct mpd_song *song)
mpd_tag_type
Definition: tag.h:26
unsigned mpd_song_get_prio(const struct mpd_song *song)
unsigned mpd_song_get_end_ms(const struct mpd_song *song)
bool mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair)
unsigned mpd_song_get_pos(const struct mpd_song *song)
const char * mpd_song_get_tag(const struct mpd_song *song, enum mpd_tag_type type, unsigned idx)
time_t mpd_song_get_last_modified(const struct mpd_song *song)
const char * mpd_song_get_uri(const struct mpd_song *song)
struct mpd_song * mpd_song_begin(const struct mpd_pair *pair)
unsigned mpd_song_get_id(const struct mpd_song *song)
time_t mpd_song_get_added(const struct mpd_song *song)
Definition: song.h:20
const char * mpd_song_get_real_uri(const struct mpd_song *song)
void mpd_song_set_pos(struct mpd_song *song, unsigned pos)
struct mpd_song * mpd_recv_song(struct mpd_connection *connection)
Definition: pair.h:16
unsigned mpd_song_get_duration_ms(const struct mpd_song *song)