libmpd  11.8.90
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     /* 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 #define MPD_SONG_NO_PRIORITY            0
00264 
00265 /* mpd_Song
00266  * for storing song info returned by mpd
00267  */
00268 typedef struct _mpd_Song {
00269         /* filename of song */
00270         char * file;
00271         /* artist, maybe NULL if there is no tag */
00272         char * artist;
00273         /* title, maybe NULL if there is no tag */
00274         char * title;
00275         /* album, maybe NULL if there is no tag */
00276         char * album;
00277         /* track, maybe NULL if there is no tag */
00278         char * track;
00279         /* name, maybe NULL if there is no tag; it's the name of the current
00280          * song, f.e. the icyName of the stream */
00281         char * name;
00282         /* date */
00283         char *date;
00284 
00285         /* added by qball */
00286         /* Genre */
00287         char *genre;
00288         /* Composer */
00289         char *composer;
00290         /* Performer */
00291         char *performer;
00292         /* Disc */
00293         char *disc;
00294         /* Comment */
00295         char *comment;
00296 
00297     /* AlbumArtist */
00298     char *albumartist;
00299         /* length of song in seconds, check that it is not MPD_SONG_NO_TIME  */
00300         int time;
00301         /* if plchanges/playlistinfo/playlistid used, is the position of the
00302          * song in the playlist */
00303         int pos;
00304         /* song id for a song in the playlist */
00305         int id;
00306     /* Priority  */
00307     int priority;
00308 } mpd_Song;
00309 
00310 /* mpd_newSong
00311  * use to allocate memory for a new mpd_Song
00312  * file, artist, etc all initialized to NULL
00313  * if your going to assign values to file, artist, etc
00314  * be sure to malloc or strdup the memory
00315  * use mpd_freeSong to free the memory for the mpd_Song, it will also
00316  * free memory for file, artist, etc, so don't do it yourself
00317  */
00318 mpd_Song * mpd_newSong(void);
00319 
00320 /* mpd_freeSong
00321  * use to free memory allocated by mpd_newSong
00322  * also it will free memory pointed to by file, artist, etc, so be careful
00323  */
00324 void mpd_freeSong(mpd_Song * song);
00325 
00326 /* mpd_songDup
00327  * works like strDup, but for a mpd_Song
00328  */
00329 mpd_Song * mpd_songDup(const mpd_Song * song);
00330 
00331 /* DIRECTORY STUFF */
00332 
00333 /* mpd_Directory
00334  * used to store info fro directory (right now that just the path)
00335  */
00336 typedef struct _mpd_Directory {
00337         char * path;
00338 } mpd_Directory;
00339 
00340 /* mpd_newDirectory
00341  * allocates memory for a new directory
00342  * use mpd_freeDirectory to free this memory
00343  */
00344 mpd_Directory * mpd_newDirectory(void);
00345 
00346 /* mpd_freeDirectory
00347  * used to free memory allocated with mpd_newDirectory, and it frees
00348  * path of mpd_Directory, so be careful
00349  */
00350 void mpd_freeDirectory(mpd_Directory * directory);
00351 
00352 /* mpd_directoryDup
00353  * works like strdup, but for mpd_Directory
00354  */
00355 mpd_Directory * mpd_directoryDup(mpd_Directory * directory);
00356 
00357 /* PLAYLISTFILE STUFF */
00358 
00359 /* mpd_PlaylistFile
00360  * stores info about playlist file returned by lsinfo
00361  */
00362 typedef struct _mpd_PlaylistFile {
00363         char * path;
00364     char * mtime;
00365 } mpd_PlaylistFile;
00366 
00367 /* mpd_newPlaylistFile
00368  * allocates memory for new mpd_PlaylistFile, path is set to NULL
00369  * free this memory with mpd_freePlaylistFile
00370  */
00371 mpd_PlaylistFile * mpd_newPlaylistFile(void);
00372 
00373 /* mpd_freePlaylist
00374  * free memory allocated for freePlaylistFile, will also free
00375  * path, so be careful
00376  */
00377 void mpd_freePlaylistFile(mpd_PlaylistFile * playlist);
00378 
00379 /* mpd_playlistFileDup
00380  * works like strdup, but for mpd_PlaylistFile
00381  */
00382 mpd_PlaylistFile * mpd_playlistFileDup(mpd_PlaylistFile * playlist);
00383 
00384 /* INFO ENTITY STUFF */
00385 
00386 /* the type of entity returned from one of the commands that generates info
00387  * use in conjunction with mpd_InfoEntity.type
00388  */
00389 #define MPD_INFO_ENTITY_TYPE_DIRECTORY          0
00390 #define MPD_INFO_ENTITY_TYPE_SONG               1
00391 #define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE       2
00392 
00393 /* mpd_InfoEntity
00394  * stores info on stuff returned info commands
00395  */
00396 typedef struct mpd_InfoEntity {
00397         /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine
00398          * what this entity is (song, directory, etc...)
00399          */
00400         int type;
00401         /* the actual data you want, mpd_Song, mpd_Directory, etc */
00402         union {
00403                 mpd_Directory * directory;
00404                 mpd_Song * song;
00405                 mpd_PlaylistFile * playlistFile;
00406         } info;
00407 } mpd_InfoEntity;
00408 
00409 mpd_InfoEntity * mpd_newInfoEntity(void);
00410 
00411 void mpd_freeInfoEntity(mpd_InfoEntity * entity);
00412 
00413 /* INFO COMMANDS AND STUFF */
00414 
00415 /* use this function to loop over after calling Info/Listall functions */
00416 mpd_InfoEntity * mpd_getNextInfoEntity(mpd_Connection * connection);
00417 
00418 /* fetches the currently seeletect song (the song referenced by status->song
00419  * and status->songid*/
00420 void mpd_sendCurrentSongCommand(mpd_Connection * connection);
00421 
00422 /* songNum of -1, means to display the whole list */
00423 void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum);
00424 
00425 /* songId of -1, means to display the whole list */
00426 void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId);
00427 
00428 /* use this to get the changes in the playlist since version _playlist_ */
00429 void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist);
00430 
00437 void mpd_sendPlChangesPosIdCommand(mpd_Connection * connection, long long playlist);
00438 
00439 /* recursivel fetches all songs/dir/playlists in "dir* (no metadata is
00440  * returned) */
00441 void mpd_sendListallCommand(mpd_Connection * connection, const char * dir);
00442 
00443 /* same as sendListallCommand, but also metadata is returned */
00444 void mpd_sendListallInfoCommand(mpd_Connection * connection, const char * dir);
00445 
00446 /* non-recursive version of ListallInfo */
00447 void mpd_sendLsInfoCommand(mpd_Connection * connection, const char * dir);
00448 
00449 #define MPD_TABLE_ARTIST        MPD_TAG_ITEM_ARTIST
00450 #define MPD_TABLE_ALBUM         MPD_TAG_ITEM_ALBUM
00451 #define MPD_TABLE_TITLE         MPD_TAG_ITEM_TITLE
00452 #define MPD_TABLE_FILENAME      MPD_TAG_ITEM_FILENAME
00453 
00454 void mpd_sendSearchCommand(mpd_Connection * connection, int table,
00455                 const char * str);
00456 
00457 void mpd_sendFindCommand(mpd_Connection * connection, int table,
00458                 const char * str);
00459 
00460 /* LIST TAG COMMANDS */
00461 
00462 /* use this function fetch next artist entry, be sure to free the returned
00463  * string.  NULL means there are no more.  Best used with sendListArtists
00464  */
00465 char * mpd_getNextArtist(mpd_Connection * connection);
00466 
00467 char * mpd_getNextAlbum(mpd_Connection * connection);
00468 
00469 char * mpd_getNextTag(mpd_Connection *connection, int type);
00470 
00471 /* list artist or albums by artist, arg1 should be set to the artist if
00472  * listing albums by a artist, otherwise NULL for listing all artists or albums
00473  */
00474 void mpd_sendListCommand(mpd_Connection * connection, int table,
00475                 const char * arg1);
00476 
00477 /* SIMPLE COMMANDS */
00478 
00479 void mpd_sendAddCommand(mpd_Connection * connection, const char * file);
00480 
00481 int mpd_sendAddIdCommand(mpd_Connection *connection, const char *file);
00482 
00483 void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum);
00484 
00485 void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum);
00486 
00487 void mpd_sendSaveCommand(mpd_Connection * connection, const char * name);
00488 
00489 void mpd_sendLoadCommand(mpd_Connection * connection, const char * name);
00490 
00491 void mpd_sendRmCommand(mpd_Connection * connection, const char * name);
00492 
00493 void mpd_sendRenameCommand(mpd_Connection *connection, const char *from,
00494                            const char *to);
00495 
00496 void mpd_sendShuffleCommand(mpd_Connection * connection);
00497 
00498 void mpd_sendClearCommand(mpd_Connection * connection);
00499 
00500 /* use this to start playing at the beginning, useful when in random mode */
00501 #define MPD_PLAY_AT_BEGINNING   -1
00502 
00503 void mpd_sendPlayCommand(mpd_Connection * connection, int songNum);
00504 
00505 void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum);
00506 
00507 void mpd_sendStopCommand(mpd_Connection * connection);
00508 
00509 void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode);
00510 
00511 void mpd_sendNextCommand(mpd_Connection * connection);
00512 
00513 void mpd_sendPrevCommand(mpd_Connection * connection);
00514 
00515 void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to);
00516 
00517 void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to);
00518 
00519 void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2);
00520 
00521 void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2);
00522 
00523 void mpd_sendSeekCommand(mpd_Connection * connection, int song, int seek_time);
00524 
00525 void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int seek_time);
00526 
00527 void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode);
00528 
00529 void mpd_sendSingleCommand(mpd_Connection * connection, int singleMode);
00530 
00531 void mpd_sendConsumeCommand(mpd_Connection * connection, int consumeMode);
00532 
00533 void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode);
00534 
00535 void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange);
00536 
00537 void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);
00538 
00539 void mpd_sendUpdateCommand(mpd_Connection * connection,const char * path);
00540 
00541 /* returns the update job id, call this after a update command*/
00542 int mpd_getUpdateId(mpd_Connection * connection);
00543 
00544 void mpd_sendPasswordCommand(mpd_Connection * connection, const char * pass);
00545 
00546 /* after executing a command, when your done with it to get its status
00547  * (you want to check connection->error for an error)
00548  */
00549 void mpd_finishCommand(mpd_Connection * connection);
00550 
00551 /* command list stuff, use this to do things like add files very quickly */
00552 void mpd_sendCommandListBegin(mpd_Connection * connection);
00553 
00554 void mpd_sendCommandListOkBegin(mpd_Connection * connection);
00555 
00556 void mpd_sendCommandListEnd(mpd_Connection * connection);
00557 
00558 /* advance to the next listOk
00559  * returns 0 if advanced to the next list_OK,
00560  * returns -1 if it advanced to an OK or ACK */
00561 int mpd_nextListOkCommand(mpd_Connection * connection);
00562 
00563 typedef struct _mpd_OutputEntity {
00564         int id;
00565         char * name;
00566         int enabled;
00567 } mpd_OutputEntity;
00568 
00569 void mpd_sendOutputsCommand(mpd_Connection * connection);
00570 
00571 mpd_OutputEntity * mpd_getNextOutput(mpd_Connection * connection);
00572 
00573 void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId);
00574 
00575 void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId);
00576 
00577 void mpd_freeOutputElement(mpd_OutputEntity * output);
00578 
00584 void mpd_sendCommandsCommand(mpd_Connection * connection);
00585 
00591 void mpd_sendNotCommandsCommand(mpd_Connection * connection);
00592 
00600 char *mpd_getNextCommand(mpd_Connection *connection);
00601 
00602 void mpd_sendUrlHandlersCommand(mpd_Connection * connection);
00603 
00604 char *mpd_getNextHandler(mpd_Connection * connection);
00605 
00606 void mpd_sendTagTypesCommand(mpd_Connection * connection);
00607 
00608 char *mpd_getNextTagType(mpd_Connection * connection);
00609 
00617 void mpd_sendListPlaylistInfoCommand(mpd_Connection *connection,const char *path);
00618 
00626 void mpd_sendListPlaylistCommand(mpd_Connection *connection,const char *path);
00627 
00635 void mpd_startSearch(mpd_Connection *connection, int exact);
00636 
00642 void mpd_addConstraintSearch(mpd_Connection *connection, int type, const char *name);
00643 
00647 void mpd_commitSearch(mpd_Connection *connection);
00648 
00670 void mpd_startFieldSearch(mpd_Connection *connection, int type);
00671 
00672 void mpd_startPlaylistSearch(mpd_Connection *connection, int exact);
00673 
00674 void mpd_startStatsSearch(mpd_Connection *connection);
00675 
00676 void mpd_sendPlaylistClearCommand(mpd_Connection *connection,const char *path);
00677 
00678 void mpd_sendPlaylistAddCommand(mpd_Connection *connection,
00679                                 const char *playlist,const char *path);
00680 
00681 void mpd_sendPlaylistMoveCommand(mpd_Connection *connection,
00682                                  const char *playlist, int from, int to);
00683 
00684 void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection,
00685                                    const char *playlist, int pos);
00686 
00687 void mpd_sendClearErrorCommand(mpd_Connection * connection);
00688 
00689 void mpd_sendGetEventsCommand(mpd_Connection *connection);
00690 char * mpd_getNextEvent(mpd_Connection *connection);
00691 void mpd_sendListPlaylistsCommand(mpd_Connection * connection);
00692 /* Stickers*/
00693 char * mpd_getNextSticker (mpd_Connection * connection);
00694 
00695 void mpd_sendSetSongSticker(mpd_Connection *connection, const char *song, const char *sticker, const char *value);
00696 void  mpd_sendGetSongSticker(mpd_Connection *connection, const char *song, const char *sticker);
00697 
00698 void mpd_sendSetReplayGainMode(mpd_Connection *connection, const char *mode);
00699 
00700 void mpd_sendReplayGainModeCommand(mpd_Connection *connection);
00701 char *mpd_getReplayGainMode(mpd_Connection *connection);
00702 
00703 
00704 void mpd_sendSetPrioId(mpd_Connection *connection, int id, int priority);
00705 void mpd_sendSetPrio(mpd_Connection *connection, int pos, int priority);
00706 #ifdef __cplusplus
00707 }
00708 #endif
00709 
00710 #endif