Add showControls, error handling, optimisations
Add a function to show button mappings using L + LEFT. Added preliminary error handling that will be improved later to determine playback issues. Music is not stopped when an unsupported file is selected. Some other minor modifications. TODO: Pause/play status does not show currently. Obtain error status of playback thread. Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
29
source/error.c
Normal file
29
source/error.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "error.h"
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
char* ctrmus_strerror(int err)
|
||||
{
|
||||
char* error;
|
||||
|
||||
switch(err)
|
||||
{
|
||||
case NDSP_INIT_FAIL:
|
||||
error = "NDSP Initialisation failed";
|
||||
break;
|
||||
|
||||
case DECODER_INIT_FAIL:
|
||||
error = "Unable to initialised decoder";
|
||||
break;
|
||||
|
||||
case FILE_NOT_SUPPORTED:
|
||||
error = "File type is not supported";
|
||||
break;
|
||||
|
||||
default:
|
||||
error = strerror(err);
|
||||
break;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
Reference in New Issue
Block a user