libmpdclient  2.18
playlist.h
Go to the documentation of this file.
1 /* libmpdclient
2  (c) 2003-2019 The Music Player Daemon Project
3  This project's homepage is: http://www.musicpd.org
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  - Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  - Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  - Neither the name of the Music Player Daemon nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
41 #ifndef LIBMPDCLIENT_PLAYLIST_H
42 #define LIBMPDCLIENT_PLAYLIST_H
43 
44 #include "compiler.h"
45 
46 #include <stdbool.h>
47 #include <time.h>
48 
49 struct mpd_pair;
51 
59 struct mpd_playlist;
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
68 void
69 mpd_playlist_free(struct mpd_playlist *playlist);
70 
76 mpd_malloc
77 struct mpd_playlist *
78 mpd_playlist_dup(const struct mpd_playlist *playlist);
79 
84 mpd_pure
85 const char *
86 mpd_playlist_get_path(const struct mpd_playlist *playlist);
87 
92 mpd_pure
93 time_t
94 mpd_playlist_get_last_modified(const struct mpd_playlist *playlist);
95 
104 mpd_malloc
105 struct mpd_playlist *
106 mpd_playlist_begin(const struct mpd_pair *pair);
107 
116 bool
117 mpd_playlist_feed(struct mpd_playlist *playlist, const struct mpd_pair *pair);
118 
128 bool
129 mpd_send_list_playlists(struct mpd_connection *connection);
130 
137 mpd_malloc
138 struct mpd_playlist *
139 mpd_recv_playlist(struct mpd_connection *connection);
140 
149 bool
150 mpd_send_list_playlist(struct mpd_connection *connection, const char *name);
151 
160 bool
161 mpd_send_list_playlist_meta(struct mpd_connection *connection, const char *name);
162 
170 bool
171 mpd_send_playlist_clear(struct mpd_connection *connection, const char *name);
172 
180 bool
181 mpd_run_playlist_clear(struct mpd_connection *connection, const char *name);
182 
192 bool
193 mpd_send_playlist_add(struct mpd_connection *connection, const char *name,
194  const char *path);
195 
204 bool
205 mpd_run_playlist_add(struct mpd_connection *connection,
206  const char *name, const char *path);
207 
217 bool
218 mpd_send_playlist_move(struct mpd_connection *connection, const char *name,
219  unsigned from, unsigned to);
220 
229 bool
230 mpd_send_playlist_delete(struct mpd_connection *connection, const char *name,
231  unsigned pos);
232 
241 bool
242 mpd_run_playlist_delete(struct mpd_connection *connection,
243  const char *name, unsigned pos);
244 
253 bool
254 mpd_send_save(struct mpd_connection *connection, const char *name);
255 
263 bool
264 mpd_run_save(struct mpd_connection *connection, const char *name);
265 
275 bool
276 mpd_send_load(struct mpd_connection *connection, const char *name);
277 
287 bool
288 mpd_run_load(struct mpd_connection *connection, const char *name);
289 
302 bool
303 mpd_send_load_range(struct mpd_connection *connection, const char *name,
304  unsigned start, unsigned end);
305 
318 bool
319 mpd_run_load_range(struct mpd_connection *connection, const char *name,
320  unsigned start, unsigned end);
321 
330 bool
331 mpd_send_rename(struct mpd_connection *connection,
332  const char *from, const char *to);
333 
342 bool
343 mpd_run_rename(struct mpd_connection *connection,
344  const char *from, const char *to);
345 
353 bool
354 mpd_send_rm(struct mpd_connection *connection, const char *name);
355 
363 bool
364 mpd_run_rm(struct mpd_connection *connection, const char *name);
365 
366 #ifdef __cplusplus
367 }
368 #endif
369 
370 #endif