* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
* @see sound_manager_acquire_focus()
* @see sound_manager_destroy_focus()
* @see sound_manager_create_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
* @see sound_manager_acquire_focus()
* @see sound_manager_destroy_focus()
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_add_device_for_stream_routing(sound_stream_info_h stream_info, sound_device_h device);
/**
- * @brief Removes the device to the stream information for the stream routing.
+ * @brief Removes the device from the stream information for the stream routing.
* @since_tizen 3.0
*
* @remarks Use sound_manager_get_device_list() and sound_manager_get_next_device() to get the device.\n
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_remove_device_for_stream_routing(sound_stream_info_h stream_info, sound_device_h device);
/**
+ * @brief Removes all devices from the stream information for the stream routing.
+ * @since_tizen 4.0
+ *
+ * @param[in] stream_info The handle of stream information
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #SOUND_MANAGER_ERROR_NONE Success
+ * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
+ * @pre Call sound_manager_create_stream_information() before calling this function.
+ * @see sound_manager_create_stream_information()
+ * @see sound_manager_destroy_stream_information()
+ * @see sound_manager_add_device_for_stream_routing()
+ * @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_apply_stream_routing()
+ */
+int sound_manager_remove_all_devices_for_stream_routing(sound_stream_info_h stream_info);
+
+/**
* @brief Applies the stream routing.
* @since_tizen 3.0
*
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
*/
int sound_manager_apply_stream_routing(sound_stream_info_h stream_info);
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
* @see sound_manager_acquire_focus()
* @see sound_manager_destroy_focus()
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_remove_device_id_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_add_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_id_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_remove_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_for_stream_routing()
* @see sound_manager_remove_device_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
* @see sound_manager_acquire_focus()
* @see sound_manager_destroy_focus()
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_remove_device_id_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_add_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
* @see sound_manager_create_stream_information()
* @see sound_manager_destroy_stream_information()
* @see sound_manager_add_device_id_for_stream_routing()
+ * @see sound_manager_remove_all_devices_for_stream_routing()
* @see sound_manager_apply_stream_routing()
*/
int sound_manager_remove_device_id_for_stream_routing(sound_stream_info_h stream_info, int device_id);
int _remove_device_for_stream_routing(sound_stream_info_s *stream_info, sound_device_h device);
+int _remove_all_devices_for_stream_routing(sound_stream_info_s *stream_info);
+
int _add_device_id_for_stream_routing(sound_stream_info_s *stream_info, int device_id);
int _remove_device_id_for_stream_routing(sound_stream_info_s *stream_info, int device_id);
Name: capi-media-sound-manager
Summary: Sound Manager library
-Version: 0.4.17
+Version: 0.4.18
Release: 0
Group: Multimedia/API
License: Apache-2.0
return _convert_sound_manager_error_code(__func__, ret);
}
+int sound_manager_remove_all_devices_for_stream_routing(sound_stream_info_h stream_info)
+{
+ int ret = MM_ERROR_NONE;
+ sound_stream_info_s *stream_h = (sound_stream_info_s*)stream_info;
+
+ LOGI(">> enter");
+
+ ret = _remove_all_devices_for_stream_routing(stream_h);
+
+ return _convert_sound_manager_error_code(__func__, ret);
+}
+
int sound_manager_apply_stream_routing(sound_stream_info_h stream_info)
{
int ret = MM_ERROR_NONE;
return MM_ERROR_NONE;
}
-static int __remove_device_to_stream_info(sound_stream_info_s *stream_info, int device_id, mm_sound_device_io_direction_e device_direction, char *device_type_str)
+static int __remove_device_from_stream_info(sound_stream_info_s *stream_info, int device_id, mm_sound_device_io_direction_e device_direction, char *device_type_str)
{
int i, j;
bool removed_successfully = false;
if ((ret = mm_sound_get_device_io_direction(device, &device_direction)))
return ret;
- if ((ret = __remove_device_to_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)))
return ret;
LOGI("*** removed device[type:%s, id:%d]", device_type_str, device_id);
return MM_ERROR_NONE;
}
+int _remove_all_devices_for_stream_routing(sound_stream_info_s *stream_info)
+{
+ int ret = MM_ERROR_NONE;
+ int i;
+
+ SM_INSTANCE_CHECK_FOR_PRIV(stream_info);
+
+ if ((ret = __check_manual_route_type(stream_info)))
+ return ret;
+
+ for (i = 0; i < AVAIL_DEVICES_MAX; i++) {
+ stream_info->manual_route_info.route_in_devices[i] = 0;
+ stream_info->manual_route_info.route_out_devices[i] = 0;
+ }
+
+ stream_info->manual_route_info.is_set = false;
+
+ LOGI("*** removed all devices");
+
+ return MM_ERROR_NONE;
+}
+
int _add_device_id_for_stream_routing(sound_stream_info_s *stream_info, int device_id)
{
int ret = MM_ERROR_NONE;
if ((ret = mm_sound_get_device_io_direction(device, &device_direction)))
goto LEAVE;
- if ((ret = __remove_device_to_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)))
goto LEAVE;
LOGI("*** removed device by id[type:%s, id:%d]", device_type_str, device_id);
CURRENT_STATUS_CREATE_STREAM_INFO,
CURRENT_STATUS_ADD_DEVICE_FOR_STREAM_ROUTING,
CURRENT_STATUS_REMOVE_DEVICE_FOR_STREAM_ROUTING,
+ CURRENT_STATUS_REMOVE_ALL_DEVICES_FOR_STREAM_ROUTING,
CURRENT_STATUS_ADD_DEVICE_ID_FOR_STREAM_ROUTING,
CURRENT_STATUS_REMOVE_DEVICE_ID_FOR_STREAM_ROUTING,
CURRENT_STATUS_APPLY_STREAM_ROUTING,
g_menu_state = CURRENT_STATUS_ADD_DEVICE_FOR_STREAM_ROUTING;
else if (strncmp(cmd, "rds", 3) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_DEVICE_FOR_STREAM_ROUTING;
+ else if (strncmp(cmd, "rad", 3) == 0)
+ g_menu_state = CURRENT_STATUS_REMOVE_ALL_DEVICES_FOR_STREAM_ROUTING;
else if (strncmp(cmd, "adi", 3) == 0)
g_menu_state = CURRENT_STATUS_ADD_DEVICE_ID_FOR_STREAM_ROUTING;
else if (strncmp(cmd, "rdi", 3) == 0)
g_print("dsi. Destroy Stream Info\n");
g_print("gst. Get Sound Type\n");
g_print("ads. Add Device for Stream Routing\t");
- g_print("rds. Remove Device for Stream Routing\t");
- g_print("aps. Apply devices for Stream Routing\n");
+ g_print("rds. Remove Device for Stream Routing\n");
g_print("adi. *Add Device ID for Stream Routing\t");
g_print("rdi. *Remove Device ID for Stream Routing\n");
+ g_print("aps. Apply devices for Stream Routing\t");
+ g_print("rad. Remove all devices for Stream Routing\n");
g_print("afc. Acquire Focus\t");
g_print("rfc. Release Focus\t");
g_print("gfs. Get Focus State\n");
g_print("*** input device type to add (0:built-in mic, 1:built-in spk, 2:built-in rcv, 3:audio-jack, 4:bt-a2dp, 5:bt-sco 6:usb)\n");
else if (g_menu_state == CURRENT_STATUS_REMOVE_DEVICE_FOR_STREAM_ROUTING)
g_print("*** input device type to remove (0:built-in mic, 1:built-in spk, 2:built-in rcv, 3:audio-jack, 4:bt-a2dp, 5:bt-sco 6:usb)\n");
+ else if (g_menu_state == CURRENT_STATUS_REMOVE_ALL_DEVICES_FOR_STREAM_ROUTING)
+ g_print("*** press enter to remove all devices in stream info\n");
else if (g_menu_state == CURRENT_STATUS_ADD_DEVICE_ID_FOR_STREAM_ROUTING)
g_print("*** input device type to add (0:built-in mic, 1:built-in spk, 2:built-in rcv, 3:audio-jack, 4:bt-a2dp, 5:bt-sco 6:usb)\n");
else if (g_menu_state == CURRENT_STATUS_REMOVE_DEVICE_ID_FOR_STREAM_ROUTING)
}
break;
}
+ case CURRENT_STATUS_REMOVE_ALL_DEVICES_FOR_STREAM_ROUTING: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+
+ if ((ret = sound_manager_remove_all_devices_for_stream_routing(g_stream_info_h)))
+ g_print("fail to remove all devices for stream routing, ret[0x%x]\n", ret);
+
+ reset_menu_state();
+ break;
+ }
case CURRENT_STATUS_ADD_DEVICE_ID_FOR_STREAM_ROUTING: {
int ret = SOUND_MANAGER_ERROR_NONE;
int device_type = 0;