player: converted PLAYER_ERROR_* to enum
This commit is contained in:
parent
eca0e6db3b
commit
fdf0d46e3d
@ -135,7 +135,7 @@ void clearPlayerError(void)
|
|||||||
pc.error = 0;
|
pc.error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getPlayerError(void)
|
enum player_error getPlayerError(void)
|
||||||
{
|
{
|
||||||
return pc.error;
|
return pc.error;
|
||||||
}
|
}
|
||||||
@ -149,6 +149,9 @@ char *getPlayerErrorStr(void)
|
|||||||
*error = '\0'; /* likely */
|
*error = '\0'; /* likely */
|
||||||
|
|
||||||
switch (pc.error) {
|
switch (pc.error) {
|
||||||
|
case PLAYER_ERROR_NOERROR:
|
||||||
|
break;
|
||||||
|
|
||||||
case PLAYER_ERROR_FILENOTFOUND:
|
case PLAYER_ERROR_FILENOTFOUND:
|
||||||
snprintf(error, errorlen,
|
snprintf(error, errorlen,
|
||||||
"file \"%s\" does not exist or is inaccessible",
|
"file \"%s\" does not exist or is inaccessible",
|
||||||
|
@ -50,12 +50,14 @@ enum player_command {
|
|||||||
PLAYER_COMMAND_CANCEL,
|
PLAYER_COMMAND_CANCEL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PLAYER_ERROR_NOERROR 0
|
enum player_error {
|
||||||
#define PLAYER_ERROR_FILE 1
|
PLAYER_ERROR_NOERROR = 0,
|
||||||
#define PLAYER_ERROR_AUDIO 2
|
PLAYER_ERROR_FILE,
|
||||||
#define PLAYER_ERROR_SYSTEM 3
|
PLAYER_ERROR_AUDIO,
|
||||||
#define PLAYER_ERROR_UNKTYPE 4
|
PLAYER_ERROR_SYSTEM,
|
||||||
#define PLAYER_ERROR_FILENOTFOUND 5
|
PLAYER_ERROR_UNKTYPE,
|
||||||
|
PLAYER_ERROR_FILENOTFOUND,
|
||||||
|
};
|
||||||
|
|
||||||
struct player_control {
|
struct player_control {
|
||||||
unsigned int buffered_before_play;
|
unsigned int buffered_before_play;
|
||||||
@ -63,7 +65,7 @@ struct player_control {
|
|||||||
struct notify notify;
|
struct notify notify;
|
||||||
volatile enum player_command command;
|
volatile enum player_command command;
|
||||||
volatile enum player_state state;
|
volatile enum player_state state;
|
||||||
volatile int8_t error;
|
volatile enum player_error error;
|
||||||
uint16_t bit_rate;
|
uint16_t bit_rate;
|
||||||
struct audio_format audio_format;
|
struct audio_format audio_format;
|
||||||
float total_time;
|
float total_time;
|
||||||
@ -108,7 +110,7 @@ void clearPlayerError(void);
|
|||||||
|
|
||||||
char *getPlayerErrorStr(void);
|
char *getPlayerErrorStr(void);
|
||||||
|
|
||||||
int getPlayerError(void);
|
enum player_error getPlayerError(void);
|
||||||
|
|
||||||
void playerWait(void);
|
void playerWait(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user