goto LEAVE;
}
- if ((ret = _convert_stream_type_to_change_reason(reason, &change_reason))) {
+ if ((ret = _convert_stream_type_to_change_reason(reason, &change_reason)) != SOUND_MANAGER_ERROR_NONE) {
LOGE("failed to _convert_stream_type_to_enum(), reason(%s), err(0x%08x)", reason, ret);
goto LEAVE;
}
goto LEAVE;
}
- if ((ret = _convert_stream_type_to_change_reason(reason, &change_reason))) {
+ if ((ret = _convert_stream_type_to_change_reason(reason, &change_reason)) != SOUND_MANAGER_ERROR_NONE) {
LOGE("failed to _convert_stream_type_to_enum(), reason(%s), err(0x%08x)", reason, ret);
goto LEAVE;
}
assert(stream_type);
assert(info);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(info);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
LOGI("stream info index(%u)", index);
assert(name);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
LOGI("[OPTION] %s(%d)", name, value);
assert(volume_type);
assert(max_level);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(volume_type);
assert(level);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(direction);
assert(volume_type);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(direction);
assert(volume_type);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(direction);
assert(device_type);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
assert(is_running);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(formats);
SM_ARG_CHECK(num);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
GError *err = NULL;
char *format_str = NULL;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = _convert_sample_format_enum_to_str(format, &format_str)))
+ if ((ret = _convert_sample_format_enum_to_str(format, &format_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(format);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(rates);
SM_ARG_CHECK(num);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
GError *err = NULL;
unsigned int _rate;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = _convert_sample_rate_enum_to_uint(rate, &_rate)))
+ if ((ret = _convert_sample_rate_enum_to_uint(rate, &_rate)) != SOUND_MANAGER_ERROR_NONE)
return ret;
g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(rate);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
GDBusConnection *conn = NULL;
GError *err = NULL;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(enabled);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
GError *err = NULL;
const char *stream_type;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
if (enable)
SM_ARG_CHECK(enabled);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
int i = 0;
bool is_focus_cb_thread = false;
- if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
+ if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
if (is_focus_cb_thread)
return SOUND_MANAGER_ERROR_INVALID_OPERATION;
/* get configuration information of this stream type */
- if ((ret = _get_stream_conf_info(stream_h->stream_type, &stream_h->stream_conf_info)))
+ if ((ret = _get_stream_conf_info(stream_h->stream_type, &stream_h->stream_conf_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
LOGI("stream_conf_info : stream type[%s], priority[%d], route type[%d]",
stream_h->stream_type, stream_h->stream_conf_info.priority, stream_h->stream_conf_info.route_type);
- if ((ret = _make_pa_connection(&stream_h->pa_info, "SOUND_MANAGER_STREAM_INFO")))
+ if ((ret = _make_pa_connection(&stream_h->pa_info, "SOUND_MANAGER_STREAM_INFO")) != SOUND_MANAGER_ERROR_NONE)
goto ERROR;
/* register focus */
int mm_ret = MM_ERROR_NONE;
bool is_focus_cb_thread = false;
- if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)))
+ if ((mm_ret = mm_sound_focus_is_cb_thread(&is_focus_cb_thread, NULL)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
if (is_focus_cb_thread)
SM_ARG_CHECK(stream_info);
SM_ARG_CHECK(device);
- if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)))
+ if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((ret = _convert_device_type(mm_sound_device_type, &device_type)))
+ if ((ret = _convert_device_type(mm_sound_device_type, &device_type)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)))
+ if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)))
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
if (device_direction & MM_SOUND_DEVICE_IO_DIRECTION_OUT) {
SM_ARG_CHECK(stream_info);
SM_ARG_CHECK(device);
- if ((ret = __check_manual_route_type(stream_info)))
+ if ((ret = __check_manual_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_id(device, &device_id)))
+ if ((mm_ret = mm_sound_get_device_id(device, &device_id)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)))
+ if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((ret = _convert_device_type(mm_sound_device_type, &device_type)))
+ if ((ret = _convert_device_type(mm_sound_device_type, &device_type)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)))
+ if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)))
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((ret = __add_device_to_stream_info(stream_info, device_id, device_direction, device_type_str)))
+ if ((ret = __add_device_to_stream_info(stream_info, device_id, device_direction, device_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
LOGI("*** added device[type:%s, id:%d]", device_type_str, device_id);
SM_ARG_CHECK(stream_info);
SM_ARG_CHECK(device);
- if ((ret = __check_manual_route_type(stream_info)))
+ if ((ret = __check_manual_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_id(device, &device_id)))
+ if ((mm_ret = mm_sound_get_device_id(device, &device_id)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)))
+ if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((ret = _convert_device_type(mm_sound_device_type, &device_type)))
+ if ((ret = _convert_device_type(mm_sound_device_type, &device_type)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)))
+ if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)))
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((ret = __remove_device_from_stream_info(stream_info, device_id, device_direction, device_type_str)))
+ if ((ret = __remove_device_from_stream_info(stream_info, device_id, device_direction, device_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
LOGI("*** removed device[type:%s, id:%d]", device_type_str, device_id);
SM_ARG_CHECK(stream_info);
- if ((ret = __check_manual_route_type(stream_info)))
+ if ((ret = __check_manual_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
SM_ARG_CHECK(stream_info);
- if ((ret = __check_manual_route_type(stream_info)))
+ if ((ret = __check_manual_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_by_id(device_id, &device)))
+ if ((mm_ret = mm_sound_get_device_by_id(device_id, &device)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type))) {
+ if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE) {
ret = _convert_sound_manager_error_code(__func__, mm_ret);
goto LEAVE;
}
- if ((ret = _convert_device_type(mm_sound_device_type, &device_type)))
+ if ((ret = _convert_device_type(mm_sound_device_type, &device_type)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
- if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)))
+ if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
- if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction))) {
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)) != MM_ERROR_NONE) {
ret = _convert_sound_manager_error_code(__func__, mm_ret);
goto LEAVE;
}
- if ((ret = __add_device_to_stream_info(stream_info, device_id, device_direction, device_type_str)))
+ if ((ret = __add_device_to_stream_info(stream_info, device_id, device_direction, device_type_str)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
LOGI("*** added device by id[type:%s, id:%d]", device_type_str, device_id);
SM_ARG_CHECK(stream_info);
- if ((ret = __check_manual_route_type(stream_info)))
+ if ((ret = __check_manual_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((mm_ret = mm_sound_get_device_by_id(device_id, &device)))
+ if ((mm_ret = mm_sound_get_device_by_id(device_id, &device)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type))) {
+ if ((mm_ret = mm_sound_get_device_type(device, &mm_sound_device_type)) != MM_ERROR_NONE) {
ret = _convert_sound_manager_error_code(__func__, mm_ret);
goto LEAVE;
}
- if ((ret = _convert_device_type(mm_sound_device_type, &device_type)))
+ if ((ret = _convert_device_type(mm_sound_device_type, &device_type)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
- if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)))
+ if ((ret = _convert_device_type_enum_to_str(device_type, &device_type_str)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
- if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction))) {
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &device_direction)) != MM_ERROR_NONE) {
ret = _convert_sound_manager_error_code(__func__, mm_ret);
goto LEAVE;
}
- if ((ret = __remove_device_from_stream_info(stream_info, device_id, device_direction, device_type_str)))
+ if ((ret = __remove_device_from_stream_info(stream_info, device_id, device_direction, device_type_str)) != SOUND_MANAGER_ERROR_NONE)
goto LEAVE;
LOGI("*** removed device by id[type:%s, id:%d]", device_type_str, device_id);
GVariant *result = NULL;
const gchar *dbus_ret = NULL;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
for (i = 0; i < SOUND_STREAM_DIRECTION_MAX; i++) {
if (virtual_stream->pa_stream[i]) {
index = pa_stream_get_index(virtual_stream->pa_stream[i]);
- if ((ret = _set_volume_ratio(index, i + 1, ratio))) {
+ if ((ret = _set_volume_ratio(index, i + 1, ratio)) != SOUND_MANAGER_ERROR_NONE) {
if (ret == SOUND_MANAGER_ERROR_NO_DATA) {
LOGE("something wrong, no match index of %u", index);
ret = SOUND_MANAGER_ERROR_INTERNAL;
GDBusConnection *conn = NULL;
GError *err = NULL;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
GVariant *result = NULL;
const gchar *dbus_ret = NULL;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
return SOUND_MANAGER_ERROR_INTERNAL;
}
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(stream_info);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
for (i = SOUND_DEVICE_IO_DIRECTION_IN; i < SOUND_DEVICE_IO_DIRECTION_BOTH; i++) {
SM_ARG_CHECK(stream_info);
/* allow only auto route type */
- if ((ret = __check_auto_route_type(stream_info)))
+ if ((ret = __check_auto_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
/* check if this device belongs to available devices of the stream info */
/* In case device is null, it's for unsetting preferred device, device_id will be 0. */
if (device) {
- if ((ret = __is_available_device(stream_info, device, &available)))
+ if ((ret = __is_available_device(stream_info, device, &available)) != SOUND_MANAGER_ERROR_NONE)
return ret;
if (!available)
return SOUND_MANAGER_ERROR_POLICY;
- if ((mm_ret = mm_sound_get_device_id(device, &device_id)))
+ if ((mm_ret = mm_sound_get_device_id(device, &device_id)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
- if ((mm_ret = mm_sound_get_device_io_direction(device, &io_direction)))
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &io_direction)) != MM_ERROR_NONE)
return _convert_sound_manager_error_code(__func__, mm_ret);
if (!(io_direction & (direction + 1)) || ((int)io_direction < (int)(direction + 1))) {
LOGE("device direction(0x%x), request direction(0x%x)", io_direction, (direction + 1));
SM_ARG_CHECK(stream_info);
/* allow only auto route type */
- if ((ret = __check_auto_route_type(stream_info)))
+ if ((ret = __check_auto_route_type(stream_info)) != SOUND_MANAGER_ERROR_NONE)
return ret;
/* check if this device belongs to available devices of the stream info */
if (device_id) {
MMSoundDevice_t device = NULL;
- if ((mm_ret = mm_sound_get_device_by_id(device_id, &device))) {
+ if ((mm_ret = mm_sound_get_device_by_id(device_id, &device)) != MM_ERROR_NONE) {
LOGE("failed to mm_sound_get_device_by_id()");
return _convert_sound_manager_error_code(__func__, mm_ret);
}
- if ((ret = __is_available_device(stream_info, (sound_device_h)device, &available)))
+ if ((ret = __is_available_device(stream_info, (sound_device_h)device, &available)) != SOUND_MANAGER_ERROR_NONE)
goto device_free;
if (!available) {
ret = SOUND_MANAGER_ERROR_POLICY;
goto device_free;
}
- if ((mm_ret = mm_sound_get_device_io_direction(device, &io_direction))) {
+ if ((mm_ret = mm_sound_get_device_io_direction(device, &io_direction)) != MM_ERROR_NONE) {
ret = _convert_sound_manager_error_code(__func__, mm_ret);
goto device_free;
}
SM_ARG_CHECK(stream_info);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
if ((ret = _convert_stream_type(stream_type, &stream_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
for (i = SOUND_DEVICE_IO_DIRECTION_IN; i < SOUND_DEVICE_IO_DIRECTION_BOTH; i++) {
if ((ret = _convert_stream_type(stream_type, &stream_type_str)) != SOUND_MANAGER_ERROR_NONE)
return ret;
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
result = g_dbus_connection_call_sync(conn,
SM_ARG_CHECK(pid);
- if ((ret = __get_dbus_connection(&conn)))
+ if ((ret = __get_dbus_connection(&conn)) != SOUND_MANAGER_ERROR_NONE)
return ret;
builder_for_stream_types = g_variant_builder_new(G_VARIANT_TYPE("as"));