-typedef struct _cb_data_{
- wav_player_playback_completed_cb cb;
- void * uesr_data;
- int id;
-} _cb_data;
-
-
-
-static int __convert_wav_player_error_code(const char *func, int code){
- int ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
- char *errorstr = NULL;
- switch(code)
- {
- case MM_ERROR_NONE:
- ret = WAV_PLAYER_ERROR_NONE;
- errorstr = "ERROR_NONE";
- break;
- case MM_ERROR_INVALID_ARGUMENT:
- case MM_ERROR_SOUND_INVALID_POINTER:
- case WAV_PLAYER_ERROR_INVALID_PARAMETER:
- ret = WAV_PLAYER_ERROR_INVALID_PARAMETER;
- errorstr = "INVALID_PARAMETER";
- break;
- case MM_ERROR_SOUND_INTERNAL:
- ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
- errorstr = "INVALID_OPERATION";
- break;
- case MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE:
- ret = WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED;
- errorstr = "FORMAT_NOT_SUPPORTED";
- break;
- default:
- ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
- errorstr = "INVALID_OPERATION";
-
- }
- LOGE( "[%s] %s(0x%08x)",func, errorstr, ret);
- return ret;
-}
-
-
-static void __internal_complete_cb(void *user_data){
- _cb_data * cb_data = (_cb_data*)user_data;
- if(!cb_data)
- return;
-
- if( cb_data->cb )
- cb_data->cb(cb_data->id, cb_data->uesr_data);
- free(cb_data);
-}
-
-
-int wav_player_start(const char *path, sound_type_e type , wav_player_playback_completed_cb cb, void *user_data, int * id){
- int ret ;
- int player;