bool added_successfully = false;
char *device_type_str = NULL;
int device_id = 0;
+ mm_sound_device_type_e device_type;
mm_sound_device_io_direction_e device_direction;
sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
if (ret) {
return __convert_sound_manager_error_code(__func__, ret);
}
- ret = mm_sound_get_device_type(device, &device_type_str);
+ ret = mm_sound_get_device_type(device, &device_type);
+ if (ret) {
+ return __convert_sound_manager_error_code(__func__, ret);
+ }
+ ret = __convert_device_type(device_type, &device_type_str);
if (ret) {
return __convert_sound_manager_error_code(__func__, ret);
}
bool removed_successfully = false;
char *device_type_str = NULL;
int device_id = 0;
+ mm_sound_device_type_e device_type;
mm_sound_device_io_direction_e device_direction;
sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
if (ret) {
return __convert_sound_manager_error_code(__func__, ret);
}
- ret = mm_sound_get_device_type(device, &device_type_str);
+ ret = mm_sound_get_device_type(device, &device_type);
if (ret) {
return __convert_sound_manager_error_code(__func__, ret);
}
+ ret = __convert_device_type(device_type, &device_type_str);
ret = mm_sound_get_device_io_direction(device, &device_direction);
if (ret) {
return __convert_sound_manager_error_code(__func__, ret);
int sound_manager_get_device_type (sound_device_h device, sound_device_type_e *type)
{
int ret = MM_ERROR_NONE;
- char *device_type = NULL;
- ret = mm_sound_get_device_type(device, &device_type);
- if (ret == MM_ERROR_NONE) {
- ret = __convert_device_type_to_enum(device_type, type);
- }
+ ret = mm_sound_get_device_type(device, (mm_sound_device_type_e*)type);
return __convert_sound_manager_error_code(__func__, ret);
}
goto ERROR_CASE;
} else {
while ((w_ret = mm_sound_get_next_device(device_list, &device)) == MM_ERROR_NONE) {
- char *type = NULL;
- sound_device_type_e type_e;
+ mm_sound_device_type_e type;
ret = mm_sound_get_device_type(device, &type);
- if (ret != MM_ERROR_NONE)
- goto ERROR_CASE;
- ret = __convert_device_type_to_enum(type, &type_e);
if (ret != MM_ERROR_NONE)
goto ERROR_CASE;
switch (mode) {
case _SESSION_MODE_VOICE_WITH_AUDIO_JACK:
- if (type_e == SOUND_DEVICE_AUDIO_JACK) {
+ if (type == MM_SOUND_DEVICE_TYPE_AUDIOJACK) {
mm_sound_device_io_direction_e io_direction;
ret = mm_sound_get_device_io_direction(device, &io_direction);
if (ret != MM_ERROR_NONE)
}
break;
case _SESSION_MODE_VOICE_WITH_BLUETOOTH:
- if (type_e == SOUND_DEVICE_BLUETOOTH) {
+ if (type == MM_SOUND_DEVICE_TYPE_BLUETOOTH) {
mm_sound_device_io_direction_e io_direction;
ret = mm_sound_get_device_io_direction(device, &io_direction);
if (ret != MM_ERROR_NONE)
goto ERROR_CASE;
} else {
while ((w_ret = mm_sound_get_next_device(device_list, &device)) == MM_ERROR_NONE) {
- char *type = NULL;
- sound_device_type_e type_e;
+ mm_sound_device_type_e type;
ret = mm_sound_get_device_type(device, &type);
if (ret != MM_ERROR_NONE)
goto ERROR_CASE;
- ret = __convert_device_type_to_enum(type, &type_e);
- if (ret != MM_ERROR_NONE)
- goto ERROR_CASE;
- switch (type_e) {
- case SOUND_DEVICE_BUILTIN_SPEAKER:
+ switch (type) {
+ case MM_SOUND_DEVICE_TYPE_BUILTIN_SPEAKER:
*mode = _SESSION_MODE_VOICE_WITH_BUILTIN_SPEAKER;
need_to_out = true;
break;
- case SOUND_DEVICE_BUILTIN_RECEIVER:
+ case MM_SOUND_DEVICE_TYPE_BUILTIN_RECEIVER:
*mode = _SESSION_MODE_VOICE_WITH_BUILTIN_RECEIVER;
need_to_out = true;
break;
- case SOUND_DEVICE_AUDIO_JACK:
+ case MM_SOUND_DEVICE_TYPE_AUDIOJACK:
*mode = _SESSION_MODE_VOICE_WITH_AUDIO_JACK;
need_to_out = true;
break;
- case SOUND_DEVICE_BLUETOOTH:
+ case MM_SOUND_DEVICE_TYPE_BLUETOOTH:
*mode = _SESSION_MODE_VOICE_WITH_BLUETOOTH;
need_to_out = true;
break;