aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:08 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:08 +0200
commitb1de50f994841e1803da365965512b925dfcc027 (patch)
treeb4064cada0b0b0bb523cd9fa7fea57151eb352ed /src/player.h
parentefde884a134a3b9f1468eb743898f579fc88746e (diff)
downloadmpd-b1de50f994841e1803da365965512b925dfcc027.tar.gz
mpd-b1de50f994841e1803da365965512b925dfcc027.tar.xz
mpd-b1de50f994841e1803da365965512b925dfcc027.zip
converted PlayerControl.state to enum
Don't write CPP when you can express the same in C... macros vs enum is a good example for that.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/player.h b/src/player.h
index aee3b7264..08405032d 100644
--- a/src/player.h
+++ b/src/player.h
@@ -24,9 +24,11 @@
#include "song.h"
#include "os_compat.h"
-#define PLAYER_STATE_STOP 0
-#define PLAYER_STATE_PAUSE 1
-#define PLAYER_STATE_PLAY 2
+enum player_state {
+ PLAYER_STATE_STOP = 0,
+ PLAYER_STATE_PAUSE,
+ PLAYER_STATE_PLAY
+};
enum player_command {
PLAYER_COMMAND_NONE = 0,
@@ -62,7 +64,7 @@ enum player_command {
typedef struct _PlayerControl {
Notify notify;
volatile enum player_command command;
- volatile mpd_sint8 state;
+ volatile enum player_state state;
volatile mpd_sint8 error;
volatile mpd_uint16 bitRate;
volatile mpd_sint8 bits;
@@ -99,7 +101,7 @@ int getPlayerElapsedTime(void);
unsigned long getPlayerBitRate(void);
-int getPlayerState(void);
+enum player_state getPlayerState(void);
void clearPlayerError(void);