📄 libmpdclient.h
字号:
*/mpd_Song * mpd_newSong();/* mpd_freeSong * use to free memory allocated by mpd_newSong * also it will free memory pointed to by file, artist, etc, so be careful */void mpd_freeSong(mpd_Song * song);/* mpd_songDup * works like strDup, but for a mpd_Song */mpd_Song * mpd_songDup(mpd_Song * song);/* DIRECTORY STUFF *//* mpd_Directory * used to store info fro directory (right now that just the path) */typedef struct _mpd_Directory { char * path;} mpd_Directory;/* mpd_newDirectory * allocates memory for a new directory * use mpd_freeDirectory to free this memory */mpd_Directory * mpd_newDirectory ();/* mpd_freeDirectory * used to free memory allocated with mpd_newDirectory, and it frees * path of mpd_Directory, so be careful */void mpd_freeDirectory(mpd_Directory * directory);/* mpd_directoryDup * works like strdup, but for mpd_Directory */mpd_Directory * mpd_directoryDup(mpd_Directory * directory);/* PLAYLISTFILE STUFF *//* mpd_PlaylistFile * stores info about playlist file returned by lsinfo */typedef struct _mpd_PlaylistFile { char * path;} mpd_PlaylistFile;/* mpd_newPlaylistFile * allocates memory for new mpd_PlaylistFile, path is set to NULL * free this memory with mpd_freePlaylistFile */mpd_PlaylistFile * mpd_newPlaylistFile();/* mpd_freePlaylist * free memory allocated for freePlaylistFile, will also free * path, so be careful */void mpd_freePlaylistFile(mpd_PlaylistFile * playlist);/* mpd_playlistFileDup * works like strdup, but for mpd_PlaylistFile */mpd_PlaylistFile * mpd_playlistFileDup(mpd_PlaylistFile * playlist);/* INFO ENTITY STUFF *//* the type of entity returned from one of the commands that generates info * use in conjunction with mpd_InfoEntity.type */#define MPD_INFO_ENTITY_TYPE_DIRECTORY 0#define MPD_INFO_ENTITY_TYPE_SONG 1#define MPD_INFO_ENTITY_TYPE_PLAYLISTFILE 2/* mpd_InfoEntity * stores info on stuff returned info commands */typedef struct mpd_InfoEntity { /* the type of entity, use with MPD_INFO_ENTITY_TYPE_* to determine * what this entity is (song, directory, etc...) */ int type; /* the actual data you want, mpd_Song, mpd_Directory, etc */ union { mpd_Directory * directory; mpd_Song * song; mpd_PlaylistFile * playlistFile; } info;} mpd_InfoEntity;mpd_InfoEntity * mpd_newInfoEntity();void mpd_freeInfoEntity(mpd_InfoEntity * entity);/* INFO COMMANDS AND STUFF *//* use this function to loop over after calling Info/Listall functions */mpd_InfoEntity * mpd_getNextInfoEntity(mpd_Connection * connection);/* fetches the currently seeletect song (the song referenced by status->song * and status->songid*/void mpd_sendCurrentSongCommand(mpd_Connection * connection);/* songNum of -1, means to display the whole list */void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum);/* songId of -1, means to display the whole list */void mpd_sendPlaylistIdCommand(mpd_Connection * connection, int songId);/* use this to get the changes in the playlist since version _playlist_ */void mpd_sendPlChangesCommand(mpd_Connection * connection, long long playlist);/* recursivel fetches all songs/dir/playlists in "dir* (no metadata is * returned) */void mpd_sendListallCommand(mpd_Connection * connection, const char * dir);/* same as sendListallCommand, but also metadata is returned */void mpd_sendListallInfoCommand(mpd_Connection * connection, const char * dir);/* non-recursive version of ListallInfo */void mpd_sendLsInfoCommand(mpd_Connection * connection, const char * dir);#define MPD_TABLE_ARTIST 0#define MPD_TABLE_ALBUM 1#define MPD_TABLE_TITLE 2#define MPD_TABLE_FILENAME 3void mpd_sendSearchCommand(mpd_Connection * connection, int table, const char * str);void mpd_sendFindCommand(mpd_Connection * connection, int table, const char * str);/* LIST TAG COMMANDS *//* use this function fetch next artist entry, be sure to free the returned * string. NULL means there are no more. Best used with sendListArtists */char * mpd_getNextArtist(mpd_Connection * connection);char * mpd_getNextAlbum(mpd_Connection * connection);/* list artist or albums by artist, arg1 should be set to the artist if * listing albums by a artist, otherwise NULL for listing all artists or albums */void mpd_sendListCommand(mpd_Connection * connection, int table, const char * arg1);/* SIMPLE COMMANDS */void mpd_sendAddCommand(mpd_Connection * connection, const char * file);void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum);void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum);void mpd_sendSaveCommand(mpd_Connection * connection, const char * name);void mpd_sendLoadCommand(mpd_Connection * connection, const char * name);void mpd_sendRmCommand(mpd_Connection * connection, const char * name);void mpd_sendShuffleCommand(mpd_Connection * connection);void mpd_sendClearCommand(mpd_Connection * connection);/* use this to start playing at the beginning, useful when in random mode */#define MPD_PLAY_AT_BEGINNING -1void mpd_sendPlayCommand(mpd_Connection * connection, int songNum);void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum);void mpd_sendStopCommand(mpd_Connection * connection);void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode);void mpd_sendNextCommand(mpd_Connection * connection);void mpd_sendPrevCommand(mpd_Connection * connection);void mpd_sendMoveCommand(mpd_Connection * connection, int from, int to);void mpd_sendMoveIdCommand(mpd_Connection * connection, int from, int to);void mpd_sendSwapCommand(mpd_Connection * connection, int song1, int song2);void mpd_sendSwapIdCommand(mpd_Connection * connection, int song1, int song2);void mpd_sendSeekCommand(mpd_Connection * connection, int song, int time);void mpd_sendSeekIdCommand(mpd_Connection * connection, int song, int time);void mpd_sendRepeatCommand(mpd_Connection * connection, int repeatMode);void mpd_sendRandomCommand(mpd_Connection * connection, int randomMode);void mpd_sendSetvolCommand(mpd_Connection * connection, int volumeChange);/* WARNING: don't use volume command, its depreacted */void mpd_sendVolumeCommand(mpd_Connection * connection, int volumeChange);void mpd_sendCrossfadeCommand(mpd_Connection * connection, int seconds);void mpd_sendUpdateCommand(mpd_Connection * connection, char * path);/* returns the update job id, call this after a update command*/int mpd_getUpdateId(mpd_Connection * connection);void mpd_sendPasswordCommand(mpd_Connection * connection, const char * pass);/* after executing a command, when your done with it to get its status * (you want to check connection->error for an error) */void mpd_finishCommand(mpd_Connection * connection);/* command list stuff, use this to do things like add files very quickly */void mpd_sendCommandListBegin(mpd_Connection * connection);void mpd_sendCommandListOkBegin(mpd_Connection * connection);void mpd_sendCommandListEnd(mpd_Connection * connection);/* advance to the next listOk * returns 0 if advanced to the next list_OK, * returns -1 if it advanced to an OK or ACK */int mpd_nextListOkCommand(mpd_Connection * connection);typedef struct _mpd_OutputEntity { int id; char * name; int enabled;} mpd_OutputEntity;void mpd_sendOutputsCommand(mpd_Connection * connection);mpd_OutputEntity * mpd_getNextOutput(mpd_Connection * connection);void mpd_sendEnableOutputCommand(mpd_Connection * connection, int outputId);void mpd_sendDisableOutputCommand(mpd_Connection * connection, int outputId);void mpd_freeOutputElement(mpd_OutputEntity * output);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -