aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:07 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:07 +0200
commitefde884a134a3b9f1468eb743898f579fc88746e (patch)
treedc6b9644d16ecb4c46dbbd821dc643ecb821bead /src/player.h
parentc7384b65ac422e1dd5eadcb06b74931de37a6f58 (diff)
downloadmpd-efde884a134a3b9f1468eb743898f579fc88746e.tar.gz
mpd-efde884a134a3b9f1468eb743898f579fc88746e.tar.xz
mpd-efde884a134a3b9f1468eb743898f579fc88746e.zip
added PlayerControl.command
PlayerControl.command replaces the old attributes play, stop, pause, closeAudio, lockQueue, unlockQueue, seek. The main thread waits for each command synchronously, so there can only be one command enabled at a time anyway.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/player.h b/src/player.h
index e204639e7..aee3b7264 100644
--- a/src/player.h
+++ b/src/player.h
@@ -28,6 +28,17 @@
#define PLAYER_STATE_PAUSE 1
#define PLAYER_STATE_PLAY 2
+enum player_command {
+ PLAYER_COMMAND_NONE = 0,
+ PLAYER_COMMAND_STOP,
+ PLAYER_COMMAND_PLAY,
+ PLAYER_COMMAND_PAUSE,
+ PLAYER_COMMAND_SEEK,
+ PLAYER_COMMAND_CLOSE_AUDIO,
+ PLAYER_COMMAND_LOCK_QUEUE,
+ PLAYER_COMMAND_UNLOCK_QUEUE
+};
+
#define PLAYER_ERROR_NOERROR 0
#define PLAYER_ERROR_FILE 1
#define PLAYER_ERROR_AUDIO 2
@@ -50,11 +61,8 @@
typedef struct _PlayerControl {
Notify notify;
- volatile mpd_sint8 stop;
- volatile mpd_sint8 play;
- volatile mpd_sint8 pause;
+ volatile enum player_command command;
volatile mpd_sint8 state;
- volatile mpd_sint8 closeAudio;
volatile mpd_sint8 error;
volatile mpd_uint16 bitRate;
volatile mpd_sint8 bits;
@@ -67,15 +75,14 @@ typedef struct _PlayerControl {
Song *errored_song;
volatile mpd_sint8 queueState;
volatile mpd_sint8 queueLockState;
- volatile mpd_sint8 lockQueue;
- volatile mpd_sint8 unlockQueue;
- volatile mpd_sint8 seek;
volatile double seekWhere;
volatile float crossFade;
volatile mpd_uint16 softwareVolume;
volatile double totalPlayTime;
} PlayerControl;
+void player_command_finished(void);
+
int playerPlay(int fd, Song * song);
int playerSetPause(int fd, int pause_flag);