libmpdclient  2.23
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 
78 mpd_pure
79 unsigned
80 mpd_song_get_duration(const struct mpd_song *song);
81 
88 mpd_pure
89 unsigned
90 mpd_song_get_duration_ms(const struct mpd_song *song);
91 
98 mpd_pure
99 unsigned
100 mpd_song_get_start(const struct mpd_song *song);
101 
108 mpd_pure
109 unsigned
110 mpd_song_get_end(const struct mpd_song *song);
111 
116 mpd_pure
117 time_t
118 mpd_song_get_last_modified(const struct mpd_song *song);
119 
126 mpd_pure
127 time_t
128 mpd_song_get_added(const struct mpd_song *song);
129 
137 void
138 mpd_song_set_pos(struct mpd_song *song, unsigned pos);
139 
144 mpd_pure
145 unsigned
146 mpd_song_get_pos(const struct mpd_song *song);
147 
152 mpd_pure
153 unsigned
154 mpd_song_get_id(const struct mpd_song *song);
155 
162 mpd_pure
163 unsigned
164 mpd_song_get_prio(const struct mpd_song *song);
165 
172 mpd_pure
173 const struct mpd_audio_format *
174 mpd_song_get_audio_format(const struct mpd_song *song);
175 
183 mpd_malloc
184 struct mpd_song *
185 mpd_song_begin(const struct mpd_pair *pair);
186 
195 bool
196 mpd_song_feed(struct mpd_song *song, const struct mpd_pair *pair);
197 
204 mpd_malloc
205 struct mpd_song *
206 mpd_recv_song(struct mpd_connection *connection);
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #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)
struct mpd_song * mpd_song_dup(const struct mpd_song *song)
mpd_tag_type
Definition: tag.h:25
unsigned mpd_song_get_prio(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
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)