aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmpdclient.h
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-14 18:32:31 +0000
committerKalle Wallin <kaw@linux.se>2004-06-14 18:32:31 +0000
commit39758c8503fb5390afaceeff3dd5b0bca75feb97 (patch)
tree94f42a18c5cb0da8778e8525ded49fb98012bbfc /src/libmpdclient.h
parent7844008980d4d1b9cb7cbd4dda4ae912e12dd7a9 (diff)
downloadmpd-39758c8503fb5390afaceeff3dd5b0bca75feb97.tar.gz
mpd-39758c8503fb5390afaceeff3dd5b0bca75feb97.tar.xz
mpd-39758c8503fb5390afaceeff3dd5b0bca75feb97.zip
Major cleanup of the mpd client code (mpc->mpdclient)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/libmpdclient.h')
-rw-r--r--src/libmpdclient.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/libmpdclient.h b/src/libmpdclient.h
index c4b022cd9..1b5f02dfe 100644
--- a/src/libmpdclient.h
+++ b/src/libmpdclient.h
@@ -43,7 +43,7 @@
#define MPD_ACK_ERROR_ARG 2
#define MPD_ACK_ERROR_PASSWORD 3
#define MPD_ACK_ERROR_PERMISSION 4
-#define MPD_ACK_ERROR_UNKNOWN 5
+#define MPD_ACK_ERROR_UNKNOWN_CMD 5
#define MPD_ACK_ERROR_NO_EXIST 6
#define MPD_ACK_ERROR_PLAYLIST_MAX 7
#define MPD_ACK_ERROR_SYSTEM 8
@@ -80,6 +80,8 @@ typedef struct _mpd_Connection {
int buflen;
int bufstart;
int doneProcessing;
+ int listOks;
+ int doneListOk;
int commandList;
mpd_ReturnElement * returnElement;
struct timeval timeout;
@@ -134,10 +136,11 @@ typedef struct mpd_Status {
int state;
/* crossfade setting in seconds */
int crossfade;
- /* if in PLAY or PAUSE state, this is the number of the currently
+ /* if in PLAY or PAUSE state, this is the position of the currently
* playing song in the playlist, beginning with 0
*/
int song;
+ int songid;
/* time in seconds that have elapsed in the currently playing/paused
* song
*/
@@ -158,6 +161,8 @@ typedef struct mpd_Status {
char * error;
} mpd_Status;
+void mpd_sendStatusCommand(mpd_Connection * connection);
+
/* mpd_getStatus
* returns status info, be sure to free it with mpd_freeStatus()
*/
@@ -178,6 +183,8 @@ typedef struct _mpd_Stats {
unsigned long dbPlayTime;
} mpd_Stats;
+void mpd_sendStatsCommand(mpd_Connection * connection);
+
mpd_Stats * mpd_getStats(mpd_Connection * connection);
void mpd_freeStats(mpd_Stats * stats);
@@ -186,6 +193,7 @@ void mpd_freeStats(mpd_Stats * stats);
#define MPD_SONG_NO_TIME -1
#define MPD_SONG_NO_NUM -1
+#define MPD_SONG_NO_ID -1
/* mpd_Song
* for storing song info returned by mpd
@@ -206,9 +214,10 @@ typedef struct _mpd_Song {
char * name;
/* length of song in seconds, check that it is not MPD_SONG_NO_TIME */
int time;
- /* if plchanges or playlistinfo used, is the number of the song in
+ /* if plchanges or playlistinfo used, is the position of the song in
* the playlist */
- int num;
+ int pos;
+ int id;
} mpd_Song;
/* mpd_newSong
@@ -318,6 +327,8 @@ void mpd_freeInfoEntity(mpd_InfoEntity * entity);
/* use this function to loop over after calling Info/Listall functions */
mpd_InfoEntity * mpd_getNextInfoEntity(mpd_Connection * connection);
+void mpd_sendCurrentSongCommand(mpd_Connection * connection);
+
/* songNum of -1, means to display the whole list */
void mpd_sendPlaylistInfoCommand(mpd_Connection * connection, int songNum);
@@ -362,6 +373,8 @@ 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);
@@ -377,9 +390,11 @@ void mpd_sendClearCommand(mpd_Connection * connection);
void 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);
+void mpd_sendPauseCommand(mpd_Connection * connection, int pauseMode);
void mpd_sendNextCommand(mpd_Connection * connection);
@@ -387,10 +402,16 @@ 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);
@@ -417,8 +438,12 @@ 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);
+int mpd_nextListOkCommand(mpd_Connection * connection);
+
#ifdef __cplusplus
}
#endif