Reformatted all code
[monky] / src / libmpdclient.h
1 /* libmpdclient
2  * (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com)
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 #ifndef LIBMPDCLIENT_H
33 #define LIBMPDCLIENT_H
34
35 #ifdef WIN32
36 #  define __W32API_USE_DLLIMPORT__ 1
37 #endif
38
39 #include <sys/time.h>
40 #include <stdarg.h>
41 #define MPD_BUFFER_MAX_LENGTH   50000
42 #define MPD_ERRORSTR_MAX_LENGTH 1000
43 #define MPD_WELCOME_MESSAGE             "OK MPD "
44
45 #define MPD_ERROR_TIMEOUT               10      /* timeout trying to talk to mpd */
46 #define MPD_ERROR_SYSTEM                11      /* system error */
47 #define MPD_ERROR_UNKHOST               12      /* unknown host */
48 #define MPD_ERROR_CONNPORT              13      /* problems connecting to port on host */
49 #define MPD_ERROR_NOTMPD                14      /* mpd not running on port at host */
50 #define MPD_ERROR_NORESPONSE    15      /* no response on attempting to connect */
51 #define MPD_ERROR_SENDING               16      /* error sending command */
52 #define MPD_ERROR_CONNCLOSED    17      /* connection closed by mpd */
53 #define MPD_ERROR_ACK                   18      /* ACK returned! */
54 #define MPD_ERROR_BUFFEROVERRUN 19      /* Buffer was overrun! */
55
56 #define MPD_ACK_ERROR_UNK       -1
57 #define MPD_ERROR_AT_UNK        -1
58
59 #define MPD_ACK_ERROR_NOT_LIST          1
60 #define MPD_ACK_ERROR_ARG                       2
61 #define MPD_ACK_ERROR_PASSWORD          3
62 #define MPD_ACK_ERROR_PERMISSION        4
63 #define MPD_ACK_ERROR_UNKNOWN_CMD       5
64
65 #define MPD_ACK_ERROR_NO_EXIST                  50
66 #define MPD_ACK_ERROR_PLAYLIST_MAX              51
67 #define MPD_ACK_ERROR_SYSTEM                    52
68 #define MPD_ACK_ERROR_PLAYLIST_LOAD             53
69 #define MPD_ACK_ERROR_UPDATE_ALREADY    54
70 #define MPD_ACK_ERROR_PLAYER_SYNC               55
71 #define MPD_ACK_ERROR_EXIST                             56
72
73 typedef enum mpd_TagItems {
74         MPD_TAG_ITEM_ARTIST,
75         MPD_TAG_ITEM_ALBUM,
76         MPD_TAG_ITEM_TITLE,
77         MPD_TAG_ITEM_TRACK,
78         MPD_TAG_ITEM_NAME,
79         MPD_TAG_ITEM_GENRE,
80         MPD_TAG_ITEM_DATE,
81         MPD_TAG_ITEM_COMPOSER,
82         MPD_TAG_ITEM_PERFORMER,
83         MPD_TAG_ITEM_COMMENT,
84         MPD_TAG_ITEM_DISC,
85         MPD_TAG_ITEM_FILENAME,
86         MPD_TAG_ITEM_ANY,
87         MPD_TAG_NUM_OF_ITEM_TYPES
88 } mpd_TagItems;
89
90 extern char *mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES];
91
92 /* internal stuff don't touch this struct */
93 typedef struct _mpd_ReturnElement {
94         char *name;
95         char *value;
96 } mpd_ReturnElement;
97
98 /* mpd_Connection
99  * holds info about connection to mpd
100  * use error, and errorStr to detect errors */
101 typedef struct _mpd_Connection {
102         /* use this to check the version of mpd */
103         int version[3];
104         /* IMPORTANT, you want to get the error messages from here */
105         char errorStr[MPD_ERRORSTR_MAX_LENGTH + 1];
106         int errorCode;
107         int errorAt;
108         /* this will be set to MPD_ERROR_* if there is an error, 0 if not */
109         int error;
110         /* DON'T TOUCH any of the rest of this stuff */
111         int sock;
112         char buffer[MPD_BUFFER_MAX_LENGTH + 1];
113         int buflen;
114         int bufstart;
115         int doneProcessing;
116         int listOks;
117         int doneListOk;
118         int commandList;
119         mpd_ReturnElement *returnElement;
120         struct timeval timeout;
121         char *request;
122 } mpd_Connection;
123
124 /* mpd_newConnection
125  * use this to open a new connection
126  * you should use mpd_closeConnection when you're done with the connection,
127  * even if an error has occurred
128  * _timeout_ is the connection timeout period in seconds */
129 mpd_Connection *mpd_newConnection(const char *host, int port, float timeout);
130
131 void mpd_setConnectionTimeout(mpd_Connection *connection, float timeout);
132
133 /* mpd_closeConnection
134  * use this to close a connection and free subsequent memory */
135 void mpd_closeConnection(mpd_Connection *connection);
136
137 /* mpd_clearError
138  * clears error */
139 void mpd_clearError(mpd_Connection *connection);
140
141 /* STATUS STUFF */
142
143 /* use these with status.state to determine what state the player is in */
144 #define MPD_STATUS_STATE_UNKNOWN        0
145 #define MPD_STATUS_STATE_STOP           1
146 #define MPD_STATUS_STATE_PLAY           2
147 #define MPD_STATUS_STATE_PAUSE          3
148
149 /* use this with status.volume to determine if mpd has volume support */
150 #define MPD_STATUS_NO_VOLUME            -1
151
152 /* mpd_Status
153  * holds info return from status command */
154 typedef struct mpd_Status {
155         /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */
156         int volume;
157         /* 1 if repeat is on, 0 otherwise */
158         int repeat;
159         /* 1 if random is on, 0 otherwise */
160         int random;
161         /* playlist length */
162         int playlistLength;
163         /* playlist, use this to determine when the playlist has changed */
164         long long playlist;
165         /* use with MPD_STATUS_STATE_* to determine state of player */
166         int state;
167         /* crossfade setting in seconds */
168         int crossfade;
169         /* if a song is currently selected (always the case when state is PLAY
170          * or PAUSE), this is the position of the currently playing song in the
171          * playlist, beginning with 0 */
172         int song;
173         /* Song ID of the currently selected song */
174         int songid;
175         /* time in seconds that have elapsed in the currently playing/paused song */
176         int elapsedTime;
177         /* length in seconds of the currently playing/paused song */
178         int totalTime;
179         /* current bit rate in kbs */
180         int bitRate;
181         /* audio sample rate */
182         unsigned int sampleRate;
183         /* audio bits */
184         int bits;
185         /* audio channels */
186         int channels;
187         /* 1 if mpd is updating, 0 otherwise */
188         int updatingDb;
189         /* error */
190         char *error;
191 } mpd_Status;
192
193 void mpd_sendStatusCommand(mpd_Connection *connection);
194
195 /* mpd_getStatus
196  * returns status info, be sure to free it with mpd_freeStatus()
197  * call this after mpd_sendStatusCommand() */
198 mpd_Status *mpd_getStatus(mpd_Connection *connection);
199
200 /* mpd_freeStatus
201  * free's status info malloc'd and returned by mpd_getStatus */
202 void mpd_freeStatus(mpd_Status *status);
203
204 typedef struct _mpd_Stats {
205         int numberOfArtists;
206         int numberOfAlbums;
207         int numberOfSongs;
208         unsigned long uptime;
209         unsigned long dbUpdateTime;
210         unsigned long playTime;
211         unsigned long dbPlayTime;
212 } mpd_Stats;
213
214 typedef struct _mpd_SearchStats {
215         int numberOfSongs;
216         unsigned long playTime;
217 } mpd_SearchStats;
218
219 void mpd_sendStatsCommand(mpd_Connection *connection);
220
221 mpd_Stats *mpd_getStats(mpd_Connection *connection);
222
223 void mpd_freeStats(mpd_Stats *stats);
224
225 mpd_SearchStats *mpd_getSearchStats(mpd_Connection *connection);
226
227 void mpd_freeSearchStats(mpd_SearchStats *stats);
228
229 /* SONG STUFF */
230
231 #define MPD_SONG_NO_TIME        -1
232 #define MPD_SONG_NO_NUM         -1
233 #define MPD_SONG_NO_ID          -1
234
235 /* mpd_Song
236  * for storing song info returned by mpd */
237 typedef struct _mpd_Song {
238         /* filename of song */
239         char *file;
240         /* artist, maybe NULL if there is no tag */
241         char *artist;
242         /* title, maybe NULL if there is no tag */
243         char *title;
244         /* album, maybe NULL if there is no tag */
245         char *album;
246         /* track, maybe NULL if there is no tag */
247         char *track;
248         /* name, maybe NULL if there is no tag; it's the name of the current song,
249          * f.e. the icyName of the stream */
250         char *name;
251         /* date */
252         char *date;
253
254         /* added by qball */
255         /* Genre */
256         char *genre;
257         /* Composer */
258         char *composer;
259         /* Performer */
260         char *performer;
261         /* Disc */
262         char *disc;
263         /* Comment */
264         char *comment;
265
266         /* length of song in seconds, check that it is not MPD_SONG_NO_TIME */
267         int time;
268         /* if plchanges/playlistinfo/playlistid used, is the position of the song
269          * in the playlist */
270         int pos;
271         /* song id for a song in the playlist */
272         int id;
273 } mpd_Song;
274
275 /* mpd_newSong
276  * use to allocate memory for a new mpd_Song
277  * file, artist, etc all initialized to NULL
278  * if you're going to assign values to file, artist, etc., be sure to
279  * malloc or strdup the memory
280  * use mpd_freeSong to free the memory for the mpd_Song, it will also
281  * free memory for file, artist, etc, so don't do it yourself */
282 mpd_Song *mpd_newSong(void);
283
284 /* mpd_freeSong
285  * use to free memory allocated by mpd_newSong
286  * also it will free memory pointed to by file, artist, etc, so be careful */
287 void mpd_freeSong(mpd_Song *song);
288
289 /* mpd_songDup
290  * works like strDup, but for a mpd_Song */
291 mpd_Song *mpd_songDup(mpd_Song *song);
292
293 /* DIRECTORY STUFF */
294
295 /* mpd_Directory
296  * used to store info from directory (right now just the path) */
297 typedef struct _mpd_Directory {
298         char *path;
299 } mpd_Directory;
300
301 /* mpd_newDirectory
302  * allocates memory for a new directory
303  * use mpd_freeDirectory to free this memory */
304 mpd_Directory *mpd_newDirectory(void);
305
306 /* mpd_freeDirectory
307  * used to free memory allocated with mpd_newDirectory, and it frees
308  * path of mpd_Directory, so be careful */
309 void mpd_freeDirectory(mpd_Directory *directory);
310
311 /* mpd_directoryDup
312  * works like strdup, but for mpd_Directory */
313 mpd_Directory *mpd_directoryDup(mpd_Directory *directory);
314
315 /* PLAYLISTFILE STUFF */
316
317 /* mpd_PlaylistFile
318  * stores info about playlist file returned by lsinfo */
319 typedef struct _mpd_PlaylistFile {
320         char *path;
321 } mpd_PlaylistFile;
322
323 /* mpd_newPlaylistFile
324  * allocates memory for new mpd_PlaylistFile, path is set to NULL
325  * free this memory with mpd_freePlaylistFile */
326 mpd_PlaylistFile *mpd_newPlaylistFile(void);
327
328 /* mpd_freePlaylist
329  * free memory allocated for freePlaylistFile
330  * will also free path, so be careful */
331 void mpd_freePlaylistFile(mpd_PlaylistFile *playlist);
332
333 /* mpd_playlistFileDup
334  * works like strdup, but for mpd_PlaylistFile */
335 mpd_PlaylistFile *mpd_playlistFileDup(mpd_PlaylistFile *playlist);
336
337 /* INFO ENTITY STUFF */
338
339 /* the type of entity returned from one of the commands that generates info
340  * use in conjunction with mpd_InfoEntity.type */
341 #define MPD_INFO_ENTITY_TYPE_DIRECTORY          0
342 #define MPD_INFO_ENTITY_TYPE_SONG               1
343 #define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE       2
344
345 /* mpd_InfoEntity
346  * stores info on stuff returned info commands */
347 typedef struct mpd_InfoEntity {
348         /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine
349          * what this entity is (song, directory, etc...) */
350         int type;
351         /* the actual data you want, mpd_Song, mpd_Directory, etc */
352         union {
353                 mpd_Directory *directory;
354                 mpd_Song *song;
355                 mpd_PlaylistFile *playlistFile;
356         } info;
357 } mpd_InfoEntity;
358
359 mpd_InfoEntity *mpd_newInfoEntity(void);
360
361 void mpd_freeInfoEntity(mpd_InfoEntity *entity);
362
363 /* INFO COMMANDS AND STUFF */
364
365 /* use this function to loop over after calling Info/Listall functions */
366 mpd_InfoEntity *mpd_getNextInfoEntity(mpd_Connection *connection);
367
368 /* fetches the currently selected song (the song referenced by status->song
369  * and status->songid */
370 void mpd_sendCurrentSongCommand(mpd_Connection *connection);
371
372 /* songNum of -1, means to display the whole list */
373 void mpd_sendPlaylistInfoCommand(mpd_Connection *connection, int songNum);
374
375 /* songId of -1, means to display the whole list */
376 void mpd_sendPlaylistIdCommand(mpd_Connection *connection, int songId);
377
378 /* use this to get the changes in the playlist since version _playlist_ */
379 void mpd_sendPlChangesCommand(mpd_Connection *connection, long long playlist);
380
381 /**
382  * @param connection: A valid and connected mpd_Connection.
383  * @param playlist: The playlist version you want the diff with.
384  *
385  * A more bandwidth efficient version of the mpd_sendPlChangesCommand.
386  * It only returns the pos+id of the changes song. */
387 void mpd_sendPlChangesPosIdCommand(mpd_Connection *connection,
388         long long playlist);
389
390 /* recursively fetches all songs/dir/playlists in "dir*
391  * (no metadata is returned) */
392 void mpd_sendListallCommand(mpd_Connection *connection, const char *dir);
393
394 /* same as sendListallCommand, but also metadata is returned */
395 void mpd_sendListallInfoCommand(mpd_Connection *connection, const char *dir);
396
397 /* non-recursive version of ListallInfo */
398 void mpd_sendLsInfoCommand(mpd_Connection *connection, const char *dir);
399
400 #define MPD_TABLE_ARTIST        MPD_TAG_ITEM_ARTIST
401 #define MPD_TABLE_ALBUM         MPD_TAG_ITEM_ALBUM
402 #define MPD_TABLE_TITLE         MPD_TAG_ITEM_TITLE
403 #define MPD_TABLE_FILENAME      MPD_TAG_ITEM_FILENAME
404
405 void mpd_sendSearchCommand(mpd_Connection *connection, int table,
406         const char *str);
407
408 void mpd_sendFindCommand(mpd_Connection *connection, int table,
409         const char *str);
410
411 /* LIST TAG COMMANDS */
412
413 /* use this function fetch next artist entry, be sure to free the
414  * returned string.
415  * NULL means there are no more.
416  * Best used with sendListArtists */
417 char *mpd_getNextArtist(mpd_Connection *connection);
418
419 char *mpd_getNextAlbum(mpd_Connection *connection);
420
421 char *mpd_getNextTag(mpd_Connection *connection, int type);
422
423 /* list artist or albums by artist
424  * arg1 should be set to the artist if listing albums by a artist
425  * otherwise NULL for listing all artists or albums */
426 void mpd_sendListCommand(mpd_Connection *connection, int table,
427         const char *arg1);
428
429 /* SIMPLE COMMANDS */
430
431 void mpd_sendAddCommand(mpd_Connection *connection, const char *file);
432
433 int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file);
434
435 void mpd_sendDeleteCommand(mpd_Connection *connection, int songNum);
436
437 void mpd_sendDeleteIdCommand(mpd_Connection *connection, int songNum);
438
439 void mpd_sendSaveCommand(mpd_Connection *connection, const char *name);
440
441 void mpd_sendLoadCommand(mpd_Connection *connection, const char *name);
442
443 void mpd_sendRmCommand(mpd_Connection *connection, const char *name);
444
445 void mpd_sendRenameCommand(mpd_Connection *connection, const char *from,
446         const char *to);
447
448 void mpd_sendShuffleCommand(mpd_Connection *connection);
449
450 void mpd_sendClearCommand(mpd_Connection *connection);
451
452 /* use this to start playing at the beginning, useful when in random mode */
453 #define MPD_PLAY_AT_BEGINNING   -1
454
455 void mpd_sendPlayCommand(mpd_Connection *connection, int songNum);
456
457 void mpd_sendPlayIdCommand(mpd_Connection *connection, int songNum);
458
459 void mpd_sendStopCommand(mpd_Connection *connection);
460
461 void mpd_sendPauseCommand(mpd_Connection *connection, int pauseMode);
462
463 void mpd_sendNextCommand(mpd_Connection *connection);
464
465 void mpd_sendPrevCommand(mpd_Connection *connection);
466
467 void mpd_sendMoveCommand(mpd_Connection *connection, int from, int to);
468
469 void mpd_sendMoveIdCommand(mpd_Connection *connection, int from, int to);
470
471 void mpd_sendSwapCommand(mpd_Connection *connection, int song1, int song2);
472
473 void mpd_sendSwapIdCommand(mpd_Connection *connection, int song1, int song2);
474
475 void mpd_sendSeekCommand(mpd_Connection *connection, int song, int time);
476
477 void mpd_sendSeekIdCommand(mpd_Connection *connection, int song, int time);
478
479 void mpd_sendRepeatCommand(mpd_Connection *connection, int repeatMode);
480
481 void mpd_sendRandomCommand(mpd_Connection *connection, int randomMode);
482
483 void mpd_sendSetvolCommand(mpd_Connection *connection, int volumeChange);
484
485 /* WARNING: don't use volume command, its depreacted */
486 void mpd_sendVolumeCommand(mpd_Connection *connection, int volumeChange);
487
488 void mpd_sendCrossfadeCommand(mpd_Connection *connection, int seconds);
489
490 void mpd_sendUpdateCommand(mpd_Connection *connection, char *path);
491
492 /* returns the update job id, call this after a update command */
493 int mpd_getUpdateId(mpd_Connection *connection);
494
495 void mpd_sendPasswordCommand(mpd_Connection *connection, const char *pass);
496
497 /* after executing a command, when you're done with it to get its status
498  * (you want to check connection->error for an error) */
499 void mpd_finishCommand(mpd_Connection *connection);
500
501 /* command list stuff, use this to do things like add files very quickly */
502 void mpd_sendCommandListBegin(mpd_Connection *connection);
503
504 void mpd_sendCommandListOkBegin(mpd_Connection *connection);
505
506 void mpd_sendCommandListEnd(mpd_Connection *connection);
507
508 /* advance to the next listOk
509  * returns 0 if advanced to the next list_OK,
510  * returns -1 if it advanced to an OK or ACK */
511 int mpd_nextListOkCommand(mpd_Connection *connection);
512
513 typedef struct _mpd_OutputEntity {
514         int id;
515         char *name;
516         int enabled;
517 } mpd_OutputEntity;
518
519 void mpd_sendOutputsCommand(mpd_Connection *connection);
520
521 mpd_OutputEntity *mpd_getNextOutput(mpd_Connection *connection);
522
523 void mpd_sendEnableOutputCommand(mpd_Connection *connection, int outputId);
524
525 void mpd_sendDisableOutputCommand(mpd_Connection *connection, int outputId);
526
527 void mpd_freeOutputElement(mpd_OutputEntity *output);
528
529 /**
530  * @param connection a #mpd_Connection
531  *
532  * Queries mpd for the allowed commands */
533 void mpd_sendCommandsCommand(mpd_Connection *connection);
534
535 /**
536  * @param connection a #mpd_Connection
537  *
538  * Queries mpd for the not allowed commands */
539 void mpd_sendNotCommandsCommand(mpd_Connection *connection);
540
541 /**
542  * @param connection a #mpd_Connection
543  *
544  * returns the next supported command.
545  *
546  * @returns a string, needs to be freed */
547 char *mpd_getNextCommand(mpd_Connection *connection);
548
549 void mpd_sendUrlHandlersCommand(mpd_Connection *connection);
550
551 char *mpd_getNextHandler(mpd_Connection *connection);
552
553 void mpd_sendTagTypesCommand(mpd_Connection *connection);
554
555 char *mpd_getNextTagType(mpd_Connection *connection);
556
557 /**
558  * @param connection    a MpdConnection
559  * @param path                  the path to the playlist.
560  *
561  * List the content, with full metadata, of a stored playlist. */
562 void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection, char *path);
563
564 /**
565  * @param connection    a MpdConnection
566  * @param path                  the path to the playlist.
567  *
568  * List the content of a stored playlist. */
569 void mpd_sendListPlaylistCommand(mpd_Connection *connection, char *path);
570
571 /**
572  * @param connection    a #mpd_Connection
573  * @param exact                 if to match exact
574  *
575  * starts a search
576  * use mpd_addConstraintSearch to add a constraint to the search
577  * use mpd_commitSearch to do the actual search */
578 void mpd_startSearch(mpd_Connection *connection, int exact);
579
580 /**
581  * @param connection a #mpd_Connection
582  * @param type
583  * @param name */
584 void mpd_addConstraintSearch(mpd_Connection *connection, int type,
585         const char *name);
586
587 /**
588  * @param connection a #mpd_Connection */
589 void mpd_commitSearch(mpd_Connection *connection);
590
591 /**
592  * @param connection    a #mpd_Connection
593  * @param type                  The type to search for
594  *
595  * starts a search for fields... f.e. get a list of artists would be:
596  * @code
597  * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST);
598  * mpd_commitSearch(connection);
599  * @endcode
600  *
601  * or get a list of artist in genre "jazz" would be:
602  * @code
603  * mpd_startFieldSearch(connection, MPD_TAG_ITEM_ARTIST);
604  * mpd_addConstraintSearch(connection, MPD_TAG_ITEM_GENRE, "jazz")
605  * mpd_commitSearch(connection);
606  * @endcode
607  *
608  * mpd_startSearch will return a list of songs
609  * (and you need mpd_getNextInfoEntity)
610  * this will return a list of only one field (the one specified with type)
611  * you need mpd_getNextTag to get the results */
612 void mpd_startFieldSearch(mpd_Connection *connection, int type);
613
614 void mpd_startPlaylistSearch(mpd_Connection *connection, int exact);
615
616 void mpd_startStatsSearch(mpd_Connection *connection);
617
618 void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path);
619
620 void mpd_sendPlaylistAddCommand(mpd_Connection *connection, char *playlist,
621         char *path);
622
623 void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, char *playlist,
624         int from, int to);
625
626 void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, char *playlist,
627         int pos);
628
629 #endif