libmpdclient.h

Go to the documentation of this file.
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         /* playlist length */
00174         int playlistLength;
00175         /* playlist, use this to determine when the playlist has changed */
00176         long long playlist;
00177         /* The id, used to determine is one of the playlists are changed */
00178         long long storedplaylist;
00179         /* use with MPD_STATUS_STATE_* to determine state of player */
00180         int state;
00181         /* crossfade setting in seconds */
00182         int crossfade;
00183         /* if a song is currently selected (always the case when state is
00184          * PLAY or PAUSE), this is the position of the currently
00185          * playing song in the playlist, beginning with 0
00186          */
00187         int song;
00188         /* Song ID of the currently selected song */
00189         int songid;
00190         /* time in seconds that have elapsed in the currently playing/paused
00191          * song
00192          */
00193         int elapsedTime;
00194         /* length in seconds of the currently playing/paused song */
00195         int totalTime;
00196         /* current bit rate in kbs */
00197         int bitRate;
00198         /* audio sample rate */
00199         unsigned int sampleRate;
00200         /* audio bits */
00201         int bits;
00202         /* audio channels */
00203         int channels;
00204         /* 1 if mpd is updating, 0 otherwise */
00205         int updatingDb;
00206         /* error */
00207         char * error;
00208 } mpd_Status;
00209 
00210 void mpd_sendStatusCommand(mpd_Connection * connection);
00211 
00212 /* mpd_getStatus
00213  * returns status info, be sure to free it with mpd_freeStatus()
00214  * call this after mpd_sendStatusCommand()
00215  */
00216 mpd_Status * mpd_getStatus(mpd_Connection * connection);
00217 
00218 /* mpd_freeStatus
00219  * free's status info malloc'd and returned by mpd_getStatus
00220  */
00221 void mpd_freeStatus(mpd_Status * status);
00222 
00223 typedef struct _mpd_Stats {
00224         int numberOfArtists;
00225         int numberOfAlbums;
00226         int numberOfSongs;
00227         unsigned long uptime;
00228         unsigned long dbUpdateTime;
00229         unsigned long playTime;
00230         unsigned long dbPlayTime;
00231 } mpd_Stats;
00232 
00233 typedef struct _mpd_SearchStats {
00234         int numberOfSongs;
00235         unsigned long playTime;
00236 } mpd_SearchStats;
00237 
00238 void mpd_sendStatsCommand(mpd_Connection * connection);
00239 
00240 mpd_Stats * mpd_getStats(mpd_Connection * connection);
00241 
00242 void mpd_freeStats(mpd_Stats * stats);
00243 
00244 mpd_SearchStats * mpd_getSearchStats(mpd_Connection * connection);
00245 
00246 void mpd_freeSearchStats(mpd_SearchStats * stats);
00247 
00248 /* SONG STUFF */
00249 
00250 #define MPD_SONG_NO_TIME        -1
00251 #define MPD_SONG_NO_NUM         -1
00252 #define MPD_SONG_NO_ID          -1
00253 
00254 /* mpd_Song
00255  * for storing song info returned by mpd
00256  */
00257 typedef struct _mpd_Song {
00258         /* filename of song */
00259         char * file;
00260         /* artist, maybe NULL if there is no tag */
00261         char * artist;
00262         /* title, maybe NULL if there is no tag */
00263         char * title;
00264         /* album, maybe NULL if there is no tag */
00265         char * album;
00266         /* track, maybe NULL if there is no tag */
00267         char * track;
00268         /* name, maybe NULL if there is no tag; it's the name of the current
00269          * song, f.e. the icyName of the stream */
00270         char * name;
00271         /* date */
00272         char *date;
00273 
00274         /* added by qball */
00275         /* Genre */
00276         char *genre;
00277         /* Composer */
00278         char *composer;
00279         /* Performer */
00280         char *performer;
00281         /* Disc */
00282         char *disc;
00283         /* Comment */
00284         char *comment;
00285 
00286     /* AlbumArtist */
00287     char *albumartist;
00288         /* length of song in seconds, check that it is not MPD_SONG_NO_TIME  */
00289         int time;
00290         /* if plchanges/playlistinfo/playlistid used, is the position of the
00291          * song in the playlist */
00292         int pos;
00293         /* song id for a song in the playlist */
00294         int id;
00295 } mpd_Song;
00296 
00297 /* mpd_newSong
00298  * use to allocate memory for a new mpd_Song
00299  * file, artist, etc all initialized to NULL
00300  * if your going to assign values to file, artist, etc
00301  * be sure to malloc or strdup the memory
00302  * use mpd_freeSong to free the memory for the mpd_Song, it will also
00303  * free memory for file, artist, etc, so don't do it yourself
00304  */
00305 mpd_Song * mpd_newSong(void);
00306 
00307 /* mpd_freeSong
00308  * use to free memory allocated by mpd_newSong
00309  * also it will free memory pointed to by file, artist, etc, so be careful
00310  */
00311 void mpd_freeSong(mpd_Song * song);
00312 
00313 /* mpd_songDup
00314  * works like strDup, but for a mpd_Song
00315  */
00316 mpd_Song * mpd_songDup(const mpd_Song * song);
00317 
00318 /* DIRECTORY STUFF */
00319 
00320 /* mpd_Directory
00321  * used to store info fro directory (right now that just the path)
00322  */
00323 typedef struct _mpd_Directory {
00324         char * path;
00325 } mpd_Directory;
00326 
00327 /* mpd_newDirectory
00328  * allocates memory for a new directory
00329  * use mpd_freeDirectory to free this memory
00330  */
00331 mpd_Directory * mpd_newDirectory(void);
00332 
00333 /* mpd_freeDirectory
00334  * used to free memory allocated with mpd_newDirectory, and it frees
00335  * path of mpd_Directory, so be careful
00336  */
00337 void mpd_freeDirectory(mpd_Directory * directory);
00338 
00339 /* mpd_directoryDup
00340  * works like strdup, but for mpd_Directory
00341  */
00342 mpd_Directory * mpd_directoryDup(mpd_Directory * directory);
00343 
00344 /* PLAYLISTFILE STUFF */
00345 
00346 /* mpd_PlaylistFile
00347  * stores info about playlist file returned by lsinfo
00348  */
00349 typedef struct _mpd_PlaylistFile {
00350         char * path;
00351     char * mtime;
00352 } mpd_PlaylistFile;
00353 
00354 /* mpd_newPlaylistFile
00355  * allocates memory for new mpd_PlaylistFile, path is set to NULL
00356  * free this memory with mpd_freePlaylistFile
00357  */
00358 mpd_PlaylistFile * mpd_newPlaylistFile(void);
00359 
00360 /* mpd_freePlaylist
00361  * free memory allocated for freePlaylistFile, will also free
00362  * path, so be careful
00363  */
00364 void mpd_freePlaylistFile(mpd_PlaylistFile * playlist);
00365 
00366 /* mpd_playlistFileDup
00367  * works like strdup, but for mpd_PlaylistFile
00368  */
00369 mpd_PlaylistFile * mpd_playlistFileDup(mpd_PlaylistFile * playlist);
00370 
00371 /* INFO ENTITY STUFF */
00372 
00373 /* the type of entity returned from one of the commands that generates info
00374  * use in conjunction with mpd_InfoEntity.type
00375  */
00376 #define MPD_INFO_ENTITY_TYPE_DIRECTORY          0
00377 #define MPD_INFO_ENTITY_TYPE_SONG               1
00378 #define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE       2
00379 
00380 /* mpd_InfoEntity
00381  * stores info on stuff returned info commands
00382  */
00383 typedef struct mpd_InfoEntity {
00384         /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine
00385          * what this entity is (song, directory, etc...)
00386          */
00387         int type;
00388         /* the actual data you want, mpd_Song, mpd_Directory, etc */
00389         union {
00390                 mpd_Directory * directory;
00391                 mpd_Song * song;
00392                 mpd_PlaylistFile * playlistFile;
00393         } info;
00394 } mpd_InfoEntity;
00395 
00396 mpd_InfoEntity * mpd_newInfoEntity(void);
00397 
00398 void mpd_freeInfoEntity(mpd_InfoEntity * entity);
00399 
00400 /* INFO COMMANDS AND STUFF */
00401 
00402 /* use this function to loop over after calling Info/Listall functions */
00403 mpd_InfoEntity * mpd_getNextInfoEntity(mpd_Connection * connection);
00404 
00405 /* fetches the currently seeletect song (the song referenced by status->song
00406  * and status->songid*/
00407 void mpd_sendCurrentSongCommand(mpd_Connection * connection);
00408 
00409 /* songNum of -1, means to display the whole list */
00410 void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum);
00411 
00412 /* songId of -1, means to display the whole list */
00413 void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId);
00414 
00415 /* use this to get the changes in the playlist since version _playlist_ */
00416 void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist);
00417 
00424 void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist);
00425 
00426 /* recursivel fetches all songs/dir/playlists in "dir* (no metadata is
00427  * returned) */
00428 void mpd_sendListallCommand(mpd_Connection * connection, const char * dir);
00429 
00430 /* same as sendListallCommand, but also metadata is returned */
00431 void mpd_sendListallInfoCommand(mpd_Connection * connection, const char * dir);
00432 
00433 /* non-recursive version of ListallInfo */
00434 void mpd_sendLsInfoCommand(mpd_Connection * connection, const char * dir);
00435 
00436 #define MPD_TABLE_ARTIST        MPD_TAG_ITEM_ARTIST
00437 #define MPD_TABLE_ALBUM         MPD_TAG_ITEM_ALBUM
00438 #define MPD_TABLE_TITLE         MPD_TAG_ITEM_TITLE
00439 #define MPD_TABLE_FILENAME      MPD_TAG_ITEM_FILENAME
00440 
00441 void mpd_sendSearchCommand(mpd_Connection * connection, int table,
00442                 const char * str);
00443 
00444 void mpd_sendFindCommand(mpd_Connection * connection, int table,
00445                 const char * str);
00446 
00447 /* LIST TAG COMMANDS */
00448 
00449 /* use this function fetch next artist entry, be sure to free the returned
00450  * string.  NULL means there are no more.  Best used with sendListArtists
00451  */
00452 char * mpd_getNextArtist(mpd_Connection * connection);
00453 
00454 char * mpd_getNextAlbum(mpd_Connection * connection);
00455 
00456 char * mpd_getNextTag(mpd_Connection *connection, int type);
00457 
00458 /* list artist or albums by artist, arg1 should be set to the artist if
00459  * listing albums by a artist, otherwise NULL for listing all artists or albums
00460  */
00461 void mpd_sendListCommand(mpd_Connection * connection, int table,
00462                 const char * arg1);
00463 
00464 /* SIMPLE COMMANDS */
00465 
00466 void mpd_sendAddCommand(mpd_Connection * connection, const char * file);
00467 
00468 int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file);
00469 
00470 void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum);
00471 
00472 void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum);
00473 
00474 void mpd_sendSaveCommand(mpd_Connection * connection, const char * name);
00475 
00476 void mpd_sendLoadCommand(mpd_Connection * connection, const char * name);
00477 
00478 void mpd_sendRmCommand(mpd_Connection * connection, const char * name);
00479 
00480 void mpd_sendRenameCommand(mpd_Connection *connection, const char *from,
00481                            const char *to);
00482 
00483 void mpd_sendShuffleCommand(mpd_Connection * connection);
00484 
00485 void mpd_sendClearCommand(mpd_Connection * connection);
00486 
00487 /* use this to start playing at the beginning, useful when in random mode */
00488 #define MPD_PLAY_AT_BEGINNING   -1
00489 
00490 void mpd_sendPlayCommand(mpd_Connection * connection, int songNum);
00491 
00492 void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum);
00493 
00494 void mpd_sendStopCommand(mpd_Connection * connection);
00495 
00496 void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode);
00497 
00498 void mpd_sendNextCommand(mpd_Connection * connection);
00499 
00500 void mpd_sendPrevCommand(mpd_Connection * connection);
00501 
00502 void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to);
00503 
00504 void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to);
00505 
00506 void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2);
00507 
00508 void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2);
00509 
00510 void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time);
00511 
00512 void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int time);
00513 
00514 void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode);
00515 
00516 void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode);
00517 
00518 void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange);
00519 
00520 /* WARNING: don't use volume command, its depreacted */
00521 void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange);
00522 
00523 void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);
00524 
00525 void mpd_sendUpdateCommand(mpd_Connection * connection,const char * path);
00526 
00527 /* returns the update job id, call this after a update command*/
00528 int mpd_getUpdateId(mpd_Connection * connection);
00529 
00530 void mpd_sendPasswordCommand(mpd_Connection * connection, const char * pass);
00531 
00532 /* after executing a command, when your done with it to get its status
00533  * (you want to check connection->error for an error)
00534  */
00535 void mpd_finishCommand(mpd_Connection * connection);
00536 
00537 /* command list stuff, use this to do things like add files very quickly */
00538 void mpd_sendCommandListBegin(mpd_Connection * connection);
00539 
00540 void mpd_sendCommandListOkBegin(mpd_Connection * connection);
00541 
00542 void mpd_sendCommandListEnd(mpd_Connection * connection);
00543 
00544 /* advance to the next listOk
00545  * returns 0 if advanced to the next list_OK,
00546  * returns -1 if it advanced to an OK or ACK */
00547 int mpd_nextListOkCommand(mpd_Connection * connection);
00548 
00549 typedef struct _mpd_OutputEntity {
00550         int id;
00551         char * name;
00552         int enabled;
00553 } mpd_OutputEntity;
00554 
00555 void mpd_sendOutputsCommand(mpd_Connection * connection);
00556 
00557 mpd_OutputEntity * mpd_getNextOutput(mpd_Connection * connection);
00558 
00559 void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId);
00560 
00561 void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId);
00562 
00563 void mpd_freeOutputElement(mpd_OutputEntity * output);
00564 
00570 void mpd_sendCommandsCommand(mpd_Connection * connection);
00571 
00577 void mpd_sendNotCommandsCommand(mpd_Connection * connection);
00578 
00586 char *mpd_getNextCommand(mpd_Connection *connection);
00587 
00588 void mpd_sendUrlHandlersCommand(mpd_Connection * connection);
00589 
00590 char *mpd_getNextHandler(mpd_Connection * connection);
00591 
00592 void mpd_sendTagTypesCommand(mpd_Connection * connection);
00593 
00594 char *mpd_getNextTagType(mpd_Connection * connection);
00595 
00603 void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection,const char *path);
00604 
00612 void mpd_sendListPlaylistCommand(mpd_Connection *connection,const char *path);
00613 
00621 void mpd_startSearch(mpd_Connection *connection, int exact);
00622 
00628 void mpd_addConstraintSearch(mpd_Connection *connection, int type, const char *name);
00629 
00633 void mpd_commitSearch(mpd_Connection *connection);
00634 
00656 void mpd_startFieldSearch(mpd_Connection *connection, int type);
00657 
00658 void mpd_startPlaylistSearch(mpd_Connection *connection, int exact);
00659 
00660 void mpd_startStatsSearch(mpd_Connection *connection);
00661 
00662 void mpd_sendPlaylistClearCommand(mpd_Connection *connection,const char *path);
00663 
00664 void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
00665                                 const char *playlist,const char *path);
00666 
00667 void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
00668                                  const char *playlist, int from, int to);
00669 
00670 void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection,
00671                                    const char *playlist, int pos);
00672 
00673 void mpd_sendClearErrorCommand(mpd_Connection * connection);
00674 
00675 void mpd_sendGetEventsCommand(mpd_Connection *connection);
00676 char * mpd_getNextEvent(mpd_Connection *connection);
00677 void mpd_sendListPlaylistsCommand(mpd_Connection * connection);
00678 /* Stickers*/
00679 char * mpd_getNextSticker (mpd_Connection * connection);
00680 
00681 void mpd_sendSetSongSticker(mpd_Connection *connection, const char *song, const char *sticker, const char *value);
00682 void  mpd_sendGetSongSticker(mpd_Connection *connection, const char *song, const char *sticker);
00683 
00684 #ifdef __cplusplus
00685 }
00686 #endif
00687 
00688 #endif

Copyright 2006 Qball Cow