aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
commit55377fbd9f0f09fd81c031381dcfc111d867d366 (patch)
treeb2a3bf07df30dae717997589dc91dc1d831b4f7f /src
parentae0033028595b96352c1c769eaeeeaa0c12bccb9 (diff)
downloadmpd-55377fbd9f0f09fd81c031381dcfc111d867d366.tar.gz
mpd-55377fbd9f0f09fd81c031381dcfc111d867d366.tar.xz
mpd-55377fbd9f0f09fd81c031381dcfc111d867d366.zip
added enum player_queue_state
Diffstat (limited to '')
-rw-r--r--src/player.c4
-rw-r--r--src/player.h20
-rw-r--r--src/playlist.c6
3 files changed, 19 insertions, 11 deletions
diff --git a/src/player.c b/src/player.c
index 59b8c9237..2df6b6cd1 100644
--- a/src/player.c
+++ b/src/player.c
@@ -176,12 +176,12 @@ int queueSong(Song * song)
return -1;
}
-int getPlayerQueueState(void)
+enum player_queue_state getPlayerQueueState(void)
{
return pc.queueState;
}
-void setQueueState(int queueState)
+void setQueueState(enum player_queue_state queueState)
{
pc.queueState = queueState;
notify_signal(&pc.notify);
diff --git a/src/player.h b/src/player.h
index 5df32e154..09c77e59e 100644
--- a/src/player.h
+++ b/src/player.h
@@ -52,12 +52,14 @@ enum player_command {
/* 0->1->2->3->5 regular playback
* ->4->0 don't play queued song
*/
-#define PLAYER_QUEUE_BLANK 0
-#define PLAYER_QUEUE_FULL 1
-#define PLAYER_QUEUE_DECODE 2
-#define PLAYER_QUEUE_PLAY 3
-#define PLAYER_QUEUE_STOP 4
-#define PLAYER_QUEUE_EMPTY 5
+enum player_queue_state {
+ PLAYER_QUEUE_BLANK = 0,
+ PLAYER_QUEUE_FULL = 1,
+ PLAYER_QUEUE_DECODE = 2,
+ PLAYER_QUEUE_PLAY = 3,
+ PLAYER_QUEUE_STOP = 4,
+ PLAYER_QUEUE_EMPTY = 5
+};
#define PLAYER_QUEUE_UNLOCKED 0
#define PLAYER_QUEUE_LOCKED 1
@@ -76,7 +78,7 @@ typedef struct _PlayerControl {
volatile float fileTime;
Song *volatile next_song;
Song *errored_song;
- volatile mpd_sint8 queueState;
+ volatile enum player_queue_state queueState;
volatile mpd_sint8 queueLockState;
volatile double seekWhere;
volatile float crossFade;
@@ -114,9 +116,9 @@ void playerWait(void);
int queueSong(Song * song);
-int getPlayerQueueState(void);
+enum player_queue_state getPlayerQueueState(void);
-void setQueueState(int queueState);
+void setQueueState(enum player_queue_state queueState);
void playerQueueLock(void);
diff --git a/src/playlist.c b/src/playlist.c
index 2fbe8e126..cc2a67f2f 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -553,6 +553,12 @@ static void clearPlayerQueue(void)
{
playlist.queued = -1;
switch (getPlayerQueueState()) {
+ case PLAYER_QUEUE_BLANK:
+ case PLAYER_QUEUE_DECODE:
+ case PLAYER_QUEUE_STOP:
+ case PLAYER_QUEUE_EMPTY:
+ break;
+
case PLAYER_QUEUE_FULL:
DEBUG("playlist: dequeue song\n");
setQueueState(PLAYER_QUEUE_BLANK);