From 064db905c761df7e9e4e3b5d99807d4c44c4a86b Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 5 Mar 2010 12:53:09 +0100 Subject: piano: Make enum values more predictable --- libpiano/src/piano.h | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'libpiano') diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h index 80b9e08..553a465 100644 --- a/libpiano/src/piano.h +++ b/libpiano/src/piano.h @@ -46,12 +46,19 @@ typedef struct PianoStation { struct PianoStation *next; } PianoStation_t; -typedef enum {PIANO_RATE_BAN, PIANO_RATE_LOVE, PIANO_RATE_NONE} - PianoSongRating_t; +typedef enum { + PIANO_RATE_NONE = 0, + PIANO_RATE_LOVE = 1, + PIANO_RATE_BAN = 2 +} PianoSongRating_t; /* UNKNOWN should be 0, because memset sets audio format to 0 */ -typedef enum {PIANO_AF_UNKNOWN = 0, PIANO_AF_AACPLUS, PIANO_AF_MP3, - PIANO_AF_MP3_HI} PianoAudioFormat_t; +typedef enum { + PIANO_AF_UNKNOWN = 0, + PIANO_AF_AACPLUS = 1, + PIANO_AF_MP3 = 2, + PIANO_AF_MP3_HI = 3 +} PianoAudioFormat_t; typedef struct PianoSong { char *artist; @@ -99,13 +106,23 @@ typedef struct PianoSearchResult { PianoArtist_t *artists; } PianoSearchResult_t; -typedef enum {PIANO_RET_OK, PIANO_RET_ERR, PIANO_RET_XML_INVALID, - PIANO_RET_AUTH_TOKEN_INVALID, PIANO_RET_AUTH_USER_PASSWORD_INVALID, - PIANO_RET_NET_ERROR, PIANO_RET_NOT_AUTHORIZED, - PIANO_RET_PROTOCOL_INCOMPATIBLE, PIANO_RET_READONLY_MODE, - PIANO_RET_STATION_CODE_INVALID, PIANO_RET_IP_REJECTED, - PIANO_RET_STATION_NONEXISTENT, PIANO_RET_OUT_OF_MEMORY, - PIANO_RET_OUT_OF_SYNC, PIANO_RET_PLAYLIST_END} PianoReturn_t; +typedef enum { + PIANO_RET_ERR = 0, + PIANO_RET_OK = 1, + PIANO_RET_XML_INVALID = 2, + PIANO_RET_AUTH_TOKEN_INVALID = 3, + PIANO_RET_AUTH_USER_PASSWORD_INVALID = 4, + PIANO_RET_NET_ERROR = 5, + PIANO_RET_NOT_AUTHORIZED = 6, + PIANO_RET_PROTOCOL_INCOMPATIBLE = 7, + PIANO_RET_READONLY_MODE = 8, + PIANO_RET_STATION_CODE_INVALID = 9, + PIANO_RET_IP_REJECTED = 10, + PIANO_RET_STATION_NONEXISTENT = 11, + PIANO_RET_OUT_OF_MEMORY = 12, + PIANO_RET_OUT_OF_SYNC = 13, + PIANO_RET_PLAYLIST_END = 14 +} PianoReturn_t; void PianoInit (PianoHandle_t *); void PianoDestroy (PianoHandle_t *); -- cgit v1.2.3