libmpd 0.19.0
|
00001 /* libmpdclient 00002 (c)2003-2006 by Warren Dukes (warren.dukes@gmail.com) 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 00033 #ifndef LIBMPDCLIENT_H 00034 #define LIBMPDCLIENT_H 00035 00036 #ifdef WIN32 00037 # define __W32API_USE_DLLIMPORT__ 1 00038 #endif 00039 00040 #include <sys/time.h> 00041 #include <stdarg.h> 00042 #define MPD_BUFFER_MAX_LENGTH 50000 00043 #define MPD_ERRORSTR_MAX_LENGTH 1000 00044 #define MPD_WELCOME_MESSAGE "OK MPD " 00045 00046 #define MPD_ERROR_TIMEOUT 10 /* timeout trying to talk to mpd */ 00047 #define MPD_ERROR_SYSTEM 11 /* system error */ 00048 #define MPD_ERROR_UNKHOST 12 /* unknown host */ 00049 #define MPD_ERROR_CONNPORT 13 /* problems connecting to port on host */ 00050 #define MPD_ERROR_NOTMPD 14 /* mpd not running on port at host */ 00051 #define MPD_ERROR_NORESPONSE 15 /* no response on attempting to connect */ 00052 #define MPD_ERROR_SENDING 16 /* error sending command */ 00053 #define MPD_ERROR_CONNCLOSED 17 /* connection closed by mpd */ 00054 #define MPD_ERROR_ACK 18 /* ACK returned! */ 00055 #define MPD_ERROR_BUFFEROVERRUN 19 /* Buffer was overrun! */ 00056 00057 #define MPD_ACK_ERROR_UNK -1 00058 #define MPD_ERROR_AT_UNK -1 00059 00060 #define MPD_ACK_ERROR_NOT_LIST 1 00061 #define MPD_ACK_ERROR_ARG 2 00062 #define MPD_ACK_ERROR_PASSWORD 3 00063 #define MPD_ACK_ERROR_PERMISSION 4 00064 #define MPD_ACK_ERROR_UNKNOWN_CMD 5 00065 00066 #define MPD_ACK_ERROR_NO_EXIST 50 00067 #define MPD_ACK_ERROR_PLAYLIST_MAX 51 00068 #define MPD_ACK_ERROR_SYSTEM 52 00069 #define MPD_ACK_ERROR_PLAYLIST_LOAD 53 00070 #define MPD_ACK_ERROR_UPDATE_ALREADY 54 00071 #define MPD_ACK_ERROR_PLAYER_SYNC 55 00072 #define MPD_ACK_ERROR_EXIST 56 00073 00074 #ifdef __cplusplus 00075 extern "C" { 00076 #endif 00077 00078 typedef enum mpd_TagItems 00079 { 00080 MPD_TAG_ITEM_ARTIST, 00081 MPD_TAG_ITEM_ALBUM, 00082 MPD_TAG_ITEM_TITLE, 00083 MPD_TAG_ITEM_TRACK, 00084 MPD_TAG_ITEM_NAME, 00085 MPD_TAG_ITEM_GENRE, 00086 MPD_TAG_ITEM_DATE, 00087 MPD_TAG_ITEM_COMPOSER, 00088 MPD_TAG_ITEM_PERFORMER, 00089 MPD_TAG_ITEM_COMMENT, 00090 MPD_TAG_ITEM_DISC, 00091 MPD_TAG_ITEM_FILENAME, 00092 MPD_TAG_ITEM_ALBUM_ARTIST, 00093 MPD_TAG_ITEM_ANY, 00094 MPD_TAG_NUM_OF_ITEM_TYPES 00095 } mpd_TagItems; 00096 00097 extern char * mpdTagItemKeys[MPD_TAG_NUM_OF_ITEM_TYPES]; 00098 00099 /* internal stuff don't touch this struct */ 00100 typedef struct _mpd_ReturnElement { 00101 char * name; 00102 char * value; 00103 } mpd_ReturnElement; 00104 00105 /* mpd_Connection 00106 * holds info about connection to mpd 00107 * use error, and errorStr to detect errors 00108 */ 00109 typedef struct _mpd_Connection { 00110 /* use this to check the version of mpd */ 00111 int version[3]; 00112 /* IMPORTANT, you want to get the error messages from here */ 00113 char errorStr[MPD_ERRORSTR_MAX_LENGTH+1]; 00114 int errorCode; 00115 int errorAt; 00116 /* this will be set to MPD_ERROR_* if there is an error, 0 if not */ 00117 int error; 00118 /* DON'T TOUCH any of the rest of this stuff */ 00119 int sock; 00120 char buffer[MPD_BUFFER_MAX_LENGTH+1]; 00121 int buflen; 00122 int bufstart; 00123 int doneProcessing; 00124 int listOks; 00125 int doneListOk; 00126 int commandList; 00127 mpd_ReturnElement * returnElement; 00128 struct timeval timeout; 00129 char *request; 00130 } mpd_Connection; 00131 00132 /* mpd_newConnection 00133 * use this to open a new connection 00134 * you should use mpd_closeConnection, when your done with the connection, 00135 * even if an error has occurred 00136 * _timeout_ is the connection timeout period in seconds 00137 */ 00138 mpd_Connection * mpd_newConnection(const char * host, int port, float timeout); 00139 00140 void mpd_setConnectionTimeout(mpd_Connection * connection, float timeout); 00141 00142 /* mpd_closeConnection 00143 * use this to close a connection and free'ing subsequent memory 00144 */ 00145 void mpd_closeConnection(mpd_Connection * connection); 00146 00147 /* mpd_clearError 00148 * clears error 00149 */ 00150 void mpd_clearError(mpd_Connection * connection); 00151 00152 /* STATUS STUFF */ 00153 00154 /* use these with status.state to determine what state the player is in */ 00155 #define MPD_STATUS_STATE_UNKNOWN 0 00156 #define MPD_STATUS_STATE_STOP 1 00157 #define MPD_STATUS_STATE_PLAY 2 00158 #define MPD_STATUS_STATE_PAUSE 3 00159 00160 /* us this with status.volume to determine if mpd has volume support */ 00161 #define MPD_STATUS_NO_VOLUME -1 00162 00163 /* mpd_Status 00164 * holds info return from status command 00165 */ 00166 typedef struct mpd_Status { 00167 /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */ 00168 int volume; 00169 /* 1 if repeat is on, 0 otherwise */ 00170 int repeat; 00171 /* 1 if random is on, 0 otherwise */ 00172 int random; 00173 /* 1 if single in on, 0 otherwise */ 00174 int single; 00175 /* 1 if single is on, 0 otherwise */ 00176 int consume; 00177 /* playlist length */ 00178 int playlistLength; 00179 /* playlist, use this to determine when the playlist has changed */ 00180 long long playlist; 00181 /* The id, used to determine is one of the playlists are changed */ 00182 long long storedplaylist; 00183 /* use with MPD_STATUS_STATE_* to determine state of player */ 00184 int state; 00185 /* crossfade setting in seconds */ 00186 int crossfade; 00187 /* if a song is currently selected (always the case when state is 00188 * PLAY or PAUSE), this is the position of the currently 00189 * playing song in the playlist, beginning with 0 00190 */ 00191 int song; 00192 /* Song ID of the currently selected song */ 00193 int songid; 00194 00195 /* The next song pos */ 00196 int nextsong; 00197 /* The next song id */ 00198 int nextsongid; 00199 00200 /* time in seconds that have elapsed in the currently playing/paused 00201 * song 00202 */ 00203 int elapsedTime; 00204 /* length in seconds of the currently playing/paused song */ 00205 int totalTime; 00206 /* current bit rate in kbs */ 00207 int bitRate; 00208 /* audio sample rate */ 00209 unsigned int sampleRate; 00210 /* audio bits */ 00211 int bits; 00212 /* audio channels */ 00213 int channels; 00214 /* 1 if mpd is updating, 0 otherwise */ 00215 int updatingDb; 00216 /* error */ 00217 char * error; 00218 } mpd_Status; 00219 00220 void mpd_sendStatusCommand(mpd_Connection * connection); 00221 00222 /* mpd_getStatus 00223 * returns status info, be sure to free it with mpd_freeStatus() 00224 * call this after mpd_sendStatusCommand() 00225 */ 00226 mpd_Status * mpd_getStatus(mpd_Connection * connection); 00227 00228 /* mpd_freeStatus 00229 * free's status info malloc'd and returned by mpd_getStatus 00230 */ 00231 void mpd_freeStatus(mpd_Status * status); 00232 00233 typedef struct _mpd_Stats { 00234 int numberOfArtists; 00235 int numberOfAlbums; 00236 int numberOfSongs; 00237 unsigned long uptime; 00238 unsigned long dbUpdateTime; 00239 unsigned long playTime; 00240 unsigned long dbPlayTime; 00241 } mpd_Stats; 00242 00243 typedef struct _mpd_SearchStats { 00244 int numberOfSongs; 00245 unsigned long playTime; 00246 } mpd_SearchStats; 00247 00248 void mpd_sendStatsCommand(mpd_Connection * connection); 00249 00250 mpd_Stats * mpd_getStats(mpd_Connection * connection); 00251 00252 void mpd_freeStats(mpd_Stats * stats); 00253 00254 mpd_SearchStats * mpd_getSearchStats(mpd_Connection * connection); 00255 00256 void mpd_freeSearchStats(mpd_SearchStats * stats); 00257 00258 /* SONG STUFF */ 00259 00260 #define MPD_SONG_NO_TIME -1 00261 #define MPD_SONG_NO_NUM -1 00262 #define MPD_SONG_NO_ID -1 00263 00264 /* mpd_Song 00265 * for storing song info returned by mpd 00266 */ 00267 typedef struct _mpd_Song { 00268 /* filename of song */ 00269 char * file; 00270 /* artist, maybe NULL if there is no tag */ 00271 char * artist; 00272 /* title, maybe NULL if there is no tag */ 00273 char * title; 00274 /* album, maybe NULL if there is no tag */ 00275 char * album; 00276 /* track, maybe NULL if there is no tag */ 00277 char * track; 00278 /* name, maybe NULL if there is no tag; it's the name of the current 00279 * song, f.e. the icyName of the stream */ 00280 char * name; 00281 /* date */ 00282 char *date; 00283 00284 /* added by qball */ 00285 /* Genre */ 00286 char *genre; 00287 /* Composer */ 00288 char *composer; 00289 /* Performer */ 00290 char *performer; 00291 /* Disc */ 00292 char *disc; 00293 /* Comment */ 00294 char *comment; 00295 00296 /* AlbumArtist */ 00297 char *albumartist; 00298 /* length of song in seconds, check that it is not MPD_SONG_NO_TIME */ 00299 int time; 00300 /* if plchanges/playlistinfo/playlistid used, is the position of the 00301 * song in the playlist */ 00302 int pos; 00303 /* song id for a song in the playlist */ 00304 int id; 00305 } mpd_Song; 00306 00307 /* mpd_newSong 00308 * use to allocate memory for a new mpd_Song 00309 * file, artist, etc all initialized to NULL 00310 * if your going to assign values to file, artist, etc 00311 * be sure to malloc or strdup the memory 00312 * use mpd_freeSong to free the memory for the mpd_Song, it will also 00313 * free memory for file, artist, etc, so don't do it yourself 00314 */ 00315 mpd_Song * mpd_newSong(void); 00316 00317 /* mpd_freeSong 00318 * use to free memory allocated by mpd_newSong 00319 * also it will free memory pointed to by file, artist, etc, so be careful 00320 */ 00321 void mpd_freeSong(mpd_Song * song); 00322 00323 /* mpd_songDup 00324 * works like strDup, but for a mpd_Song 00325 */ 00326 mpd_Song * mpd_songDup(const mpd_Song * song); 00327 00328 /* DIRECTORY STUFF */ 00329 00330 /* mpd_Directory 00331 * used to store info fro directory (right now that just the path) 00332 */ 00333 typedef struct _mpd_Directory { 00334 char * path; 00335 } mpd_Directory; 00336 00337 /* mpd_newDirectory 00338 * allocates memory for a new directory 00339 * use mpd_freeDirectory to free this memory 00340 */ 00341 mpd_Directory * mpd_newDirectory(void); 00342 00343 /* mpd_freeDirectory 00344 * used to free memory allocated with mpd_newDirectory, and it frees 00345 * path of mpd_Directory, so be careful 00346 */ 00347 void mpd_freeDirectory(mpd_Directory * directory); 00348 00349 /* mpd_directoryDup 00350 * works like strdup, but for mpd_Directory 00351 */ 00352 mpd_Directory * mpd_directoryDup(mpd_Directory * directory); 00353 00354 /* PLAYLISTFILE STUFF */ 00355 00356 /* mpd_PlaylistFile 00357 * stores info about playlist file returned by lsinfo 00358 */ 00359 typedef struct _mpd_PlaylistFile { 00360 char * path; 00361 char * mtime; 00362 } mpd_PlaylistFile; 00363 00364 /* mpd_newPlaylistFile 00365 * allocates memory for new mpd_PlaylistFile, path is set to NULL 00366 * free this memory with mpd_freePlaylistFile 00367 */ 00368 mpd_PlaylistFile * mpd_newPlaylistFile(void); 00369 00370 /* mpd_freePlaylist 00371 * free memory allocated for freePlaylistFile, will also free 00372 * path, so be careful 00373 */ 00374 void mpd_freePlaylistFile(mpd_PlaylistFile * playlist); 00375 00376 /* mpd_playlistFileDup 00377 * works like strdup, but for mpd_PlaylistFile 00378 */ 00379 mpd_PlaylistFile * mpd_playlistFileDup(mpd_PlaylistFile * playlist); 00380 00381 /* INFO ENTITY STUFF */ 00382 00383 /* the type of entity returned from one of the commands that generates info 00384 * use in conjunction with mpd_InfoEntity.type 00385 */ 00386 #define MPD_INFO_ENTITY_TYPE_DIRECTORY 0 00387 #define MPD_INFO_ENTITY_TYPE_SONG 1 00388 #define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE 2 00389 00390 /* mpd_InfoEntity 00391 * stores info on stuff returned info commands 00392 */ 00393 typedef struct mpd_InfoEntity { 00394 /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine 00395 * what this entity is (song, directory, etc...) 00396 */ 00397 int type; 00398 /* the actual data you want, mpd_Song, mpd_Directory, etc */ 00399 union { 00400 mpd_Directory * directory; 00401 mpd_Song * song; 00402 mpd_PlaylistFile * playlistFile; 00403 } info; 00404 } mpd_InfoEntity; 00405 00406 mpd_InfoEntity * mpd_newInfoEntity(void); 00407 00408 void mpd_freeInfoEntity(mpd_InfoEntity * entity); 00409 00410 /* INFO COMMANDS AND STUFF */ 00411 00412 /* use this function to loop over after calling Info/Listall functions */ 00413 mpd_InfoEntity * mpd_getNextInfoEntity(mpd_Connection * connection); 00414 00415 /* fetches the currently seeletect song (the song referenced by status->song 00416 * and status->songid*/ 00417 void mpd_sendCurrentSongCommand(mpd_Connection * connection); 00418 00419 /* songNum of -1, means to display the whole list */ 00420 void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum); 00421 00422 /* songId of -1, means to display the whole list */ 00423 void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId); 00424 00425 /* use this to get the changes in the playlist since version _playlist_ */ 00426 void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist); 00427 00434 void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist); 00435 00436 /* recursivel fetches all songs/dir/playlists in "dir* (no metadata is 00437 * returned) */ 00438 void mpd_sendListallCommand(mpd_Connection * connection, const char * dir); 00439 00440 /* same as sendListallCommand, but also metadata is returned */ 00441 void mpd_sendListallInfoCommand(mpd_Connection * connection, const char * dir); 00442 00443 /* non-recursive version of ListallInfo */ 00444 void mpd_sendLsInfoCommand(mpd_Connection * connection, const char * dir); 00445 00446 #define MPD_TABLE_ARTIST MPD_TAG_ITEM_ARTIST 00447 #define MPD_TABLE_ALBUM MPD_TAG_ITEM_ALBUM 00448 #define MPD_TABLE_TITLE MPD_TAG_ITEM_TITLE 00449 #define MPD_TABLE_FILENAME MPD_TAG_ITEM_FILENAME 00450 00451 void mpd_sendSearchCommand(mpd_Connection * connection, int table, 00452 const char * str); 00453 00454 void mpd_sendFindCommand(mpd_Connection * connection, int table, 00455 const char * str); 00456 00457 /* LIST TAG COMMANDS */ 00458 00459 /* use this function fetch next artist entry, be sure to free the returned 00460 * string. NULL means there are no more. Best used with sendListArtists 00461 */ 00462 char * mpd_getNextArtist(mpd_Connection * connection); 00463 00464 char * mpd_getNextAlbum(mpd_Connection * connection); 00465 00466 char * mpd_getNextTag(mpd_Connection *connection, int type); 00467 00468 /* list artist or albums by artist, arg1 should be set to the artist if 00469 * listing albums by a artist, otherwise NULL for listing all artists or albums 00470 */ 00471 void mpd_sendListCommand(mpd_Connection * connection, int table, 00472 const char * arg1); 00473 00474 /* SIMPLE COMMANDS */ 00475 00476 void mpd_sendAddCommand(mpd_Connection * connection, const char * file); 00477 00478 int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file); 00479 00480 void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum); 00481 00482 void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum); 00483 00484 void mpd_sendSaveCommand(mpd_Connection * connection, const char * name); 00485 00486 void mpd_sendLoadCommand(mpd_Connection * connection, const char * name); 00487 00488 void mpd_sendRmCommand(mpd_Connection * connection, const char * name); 00489 00490 void mpd_sendRenameCommand(mpd_Connection *connection, const char *from, 00491 const char *to); 00492 00493 void mpd_sendShuffleCommand(mpd_Connection * connection); 00494 00495 void mpd_sendClearCommand(mpd_Connection * connection); 00496 00497 /* use this to start playing at the beginning, useful when in random mode */ 00498 #define MPD_PLAY_AT_BEGINNING -1 00499 00500 void mpd_sendPlayCommand(mpd_Connection * connection, int songNum); 00501 00502 void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum); 00503 00504 void mpd_sendStopCommand(mpd_Connection * connection); 00505 00506 void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode); 00507 00508 void mpd_sendNextCommand(mpd_Connection * connection); 00509 00510 void mpd_sendPrevCommand(mpd_Connection * connection); 00511 00512 void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to); 00513 00514 void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to); 00515 00516 void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2); 00517 00518 void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2); 00519 00520 void mpd_sendSeekCommand(mpd_Connection * connection, int song, int seek_time); 00521 00522 void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int seek_time); 00523 00524 void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode); 00525 00526 void mpd_sendSingleCommand(mpd_Connection * connection, int singleMode); 00527 00528 void mpd_sendConsumeCommand(mpd_Connection * connection, int consumeMode); 00529 00530 void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode); 00531 00532 void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange); 00533 00534 void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds); 00535 00536 void mpd_sendUpdateCommand(mpd_Connection * connection,const char * path); 00537 00538 /* returns the update job id, call this after a update command*/ 00539 int mpd_getUpdateId(mpd_Connection * connection); 00540 00541 void mpd_sendPasswordCommand(mpd_Connection * connection, const char * pass); 00542 00543 /* after executing a command, when your done with it to get its status 00544 * (you want to check connection->error for an error) 00545 */ 00546 void mpd_finishCommand(mpd_Connection * connection); 00547 00548 /* command list stuff, use this to do things like add files very quickly */ 00549 void mpd_sendCommandListBegin(mpd_Connection * connection); 00550 00551 void mpd_sendCommandListOkBegin(mpd_Connection * connection); 00552 00553 void mpd_sendCommandListEnd(mpd_Connection * connection); 00554 00555 /* advance to the next listOk 00556 * returns 0 if advanced to the next list_OK, 00557 * returns -1 if it advanced to an OK or ACK */ 00558 int mpd_nextListOkCommand(mpd_Connection * connection); 00559 00560 typedef struct _mpd_OutputEntity { 00561 int id; 00562 char * name; 00563 int enabled; 00564 } mpd_OutputEntity; 00565 00566 void mpd_sendOutputsCommand(mpd_Connection * connection); 00567 00568 mpd_OutputEntity * mpd_getNextOutput(mpd_Connection * connection); 00569 00570 void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId); 00571 00572 void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId); 00573 00574 void mpd_freeOutputElement(mpd_OutputEntity * output); 00575 00581 void mpd_sendCommandsCommand(mpd_Connection * connection); 00582 00588 void mpd_sendNotCommandsCommand(mpd_Connection * connection); 00589 00597 char *mpd_getNextCommand(mpd_Connection *connection); 00598 00599 void mpd_sendUrlHandlersCommand(mpd_Connection * connection); 00600 00601 char *mpd_getNextHandler(mpd_Connection * connection); 00602 00603 void mpd_sendTagTypesCommand(mpd_Connection * connection); 00604 00605 char *mpd_getNextTagType(mpd_Connection * connection); 00606 00614 void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection,const char *path); 00615 00623 void mpd_sendListPlaylistCommand(mpd_Connection *connection,const char *path); 00624 00632 void mpd_startSearch(mpd_Connection *connection, int exact); 00633 00639 void mpd_addConstraintSearch(mpd_Connection *connection, int type, const char *name); 00640 00644 void mpd_commitSearch(mpd_Connection *connection); 00645 00667 void mpd_startFieldSearch(mpd_Connection *connection, int type); 00668 00669 void mpd_startPlaylistSearch(mpd_Connection *connection, int exact); 00670 00671 void mpd_startStatsSearch(mpd_Connection *connection); 00672 00673 void mpd_sendPlaylistClearCommand(mpd_Connection *connection,const char *path); 00674 00675 void mpd_sendPlaylistAddCommand(mpd_Connection *connection, 00676 const char *playlist,const char *path); 00677 00678 void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, 00679 const char *playlist, int from, int to); 00680 00681 void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, 00682 const char *playlist, int pos); 00683 00684 void mpd_sendClearErrorCommand(mpd_Connection * connection); 00685 00686 void mpd_sendGetEventsCommand(mpd_Connection *connection); 00687 char * mpd_getNextEvent(mpd_Connection *connection); 00688 void mpd_sendListPlaylistsCommand(mpd_Connection * connection); 00689 /* Stickers*/ 00690 char * mpd_getNextSticker (mpd_Connection * connection); 00691 00692 void mpd_sendSetSongSticker(mpd_Connection *connection, const char *song, const char *sticker, const char *value); 00693 void mpd_sendGetSongSticker(mpd_Connection *connection, const char *song, const char *sticker); 00694 00695 #ifdef __cplusplus 00696 } 00697 #endif 00698 00699 #endif