* @brief Adds the device to the stream information for the stream routing.
* @since_tizen 3.0
*
- * @remarks Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
+ * @remarks Use sound_manager_get_device_list() and sound_manager_get_next_device() to get the device.\n
* #SOUND_MANAGER_ERROR_POLICY could be returned according to the stream type of the @a stream_info.\n
* The available types of the @a stream_info for this function are #SOUND_STREAM_TYPE_VOIP and #SOUND_STREAM_TYPE_MEDIA_EXTERNAL_ONLY.
*
* @brief Removes the device to the stream information for the stream routing.
* @since_tizen 3.0
*
- * @remarks Use sound_manager_get_current_device_list() and sound_manager_get_next_device() to get the device.\n
+ * @remarks Use sound_manager_get_device_list() and sound_manager_get_next_device() to get the device.\n
*
* @param[in] stream_info The handle of stream information
* @param[in] device The device item from sound_device_list_h
*/
/**
+ * @deprecated Deprecated since 3.0. Use sound_manager_get_device_list() instead.
* @brief Gets the list consisting of connected devices.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @remarks @a device_list should be freed using sound_manager_free_device_list() since 3.0.\n
+ * @remarks @a Calling this API will deallocate previously obtained list and each item.\n
* Use sound_manager_get_next_device() to get the first node of the list.
*
* @param[in] device_mask The mask value
* @see sound_manager_get_device_id()
* @see sound_manager_get_device_name()
* @see sound_manager_get_device_state()
+ */
+int sound_manager_get_current_device_list(sound_device_mask_e device_mask, sound_device_list_h *device_list) TIZEN_DEPRECATED_API;
+
+/**
+ * @addtogroup CAPI_MEDIA_SOUND_MANAGER_DEVICE_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets the list consisting of connected devices.
+ * @since_tizen 3.0
+ *
+ * @remarks @a device_list should be freed using sound_manager_free_device_list().\n
+ * Use sound_manager_get_next_device() to get the first node of the list.
+ *
+ * @param[in] device_mask The mask values of #sound_device_mask_e combined with bitwise 'or'
+ * @param[out] device_list The list of connected devices
+ * @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_NO_DATA No data
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_next_device()
+ * @see sound_manager_get_prev_device()
+ * @see sound_manager_get_device_type()
+ * @see sound_manager_get_device_io_direction()
+ * @see sound_manager_get_device_id()
+ * @see sound_manager_get_device_name()
+ * @see sound_manager_get_device_state()
* @see sound_manager_free_device_list()
*/
-int sound_manager_get_current_device_list(sound_device_mask_e device_mask, sound_device_list_h *device_list);
+int sound_manager_get_device_list(int device_mask, sound_device_list_h *device_list);
/**
* @brief Frees device list and each item of list.
*
* @remarks This function will deallocate not only device list itself but also each item.
*
- * @param[in] device_list The device list got with sound_manager_get_current_device_list.
+ * @param[in] device_list The device list got with sound_manager_get_device_list.
* @return @c 0 on success,
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
*
*
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SOUND_MANAGER_ERROR_NO_DATA No data
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* @see sound_manager_get_device_io_direction()
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SOUND_MANAGER_ERROR_NO_DATA No data
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_device_type()
* @see sound_manager_get_device_io_direction()
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_io_direction()
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
* otherwise a negative error value
* @retval #SOUND_MANAGER_ERROR_NONE Success
* @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sound_manager_get_current_device_list()
+ * @see sound_manager_get_device_list()
* @see sound_manager_get_next_device()
* @see sound_manager_get_prev_device()
* @see sound_manager_get_device_type()
CURRENT_STATUS_UNSET_SESSION_INTERRUPTED_CB,
CURRENT_STATUS_SET_DEVICE_MASK,
CURRENT_STATUS_GET_DEVICE_MASK,
- CURRENT_STATUS_GET_DEVICE_LIST,
+ CURRENT_STATUS_GET_CURRENT_DEVICE_LIST,
CURRENT_STATUS_PRINT_DEVICE_LIST,
+ CURRENT_STATUS_GET_DEVICE_LIST,
CURRENT_STATUS_FREE_DEVICE_LIST,
CURRENT_STATUS_GET_DEVICE_NEXT,
CURRENT_STATUS_GET_DEVICE_PREV,
g_menu_state = CURRENT_STATUS_SET_DEVICE_MASK;
else if (strncmp(cmd, "gk", 3) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_MASK;
+ else if (strncmp(cmd, "gcl", 3) == 0)
+ g_menu_state = CURRENT_STATUS_GET_CURRENT_DEVICE_LIST;
else if (strncmp(cmd, "gl", 3) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_LIST;
else if (strncmp(cmd, "pl", 3) == 0)
g_print("-----------------------------------------------------------------------------------------\n");
g_print("sk. Set Devices Mask(default ALL)\t");
g_print("gk. Get Devices Mask\n");
- g_print("gl. Get Devices List\t");
+ g_print("gcl. Get Devices List\t");
g_print("pl. Print Devices List\t");
+ g_print("gl. Get Devices List\t");
g_print("fl. Free Devices List\n");
g_print("gn. Get Next Device\t\t");
g_print("gp. Get Prev Device\n");
g_print("*** input device mask (0:ALL, 1:INTERNAL, 2:EXTERNAL, 3:INPUT, 4:OUTPUT, 5:BOTH, 6:ACTIVATED, 7:DEACTIVATED, b:back to the menu\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_MASK)
g_print("*** press enter to get device mask\n");
+ else if (g_menu_state == CURRENT_STATUS_GET_CURRENT_DEVICE_LIST)
+ g_print("*** press enter to get current device list\n");
else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_LIST)
g_print("*** press enter to get device list\n");
else if (g_menu_state == CURRENT_STATUS_PRINT_DEVICE_LIST)
reset_menu_state();
break;
}
- case CURRENT_STATUS_GET_DEVICE_LIST: {
+ case CURRENT_STATUS_GET_CURRENT_DEVICE_LIST: {
int ret = SOUND_MANAGER_ERROR_NONE;
if (!(ret = sound_manager_get_current_device_list(g_device_mask, &g_device_list)))
g_print("success to get current device list\n");
reset_menu_state();
break;
}
+ case CURRENT_STATUS_GET_DEVICE_LIST: {
+ int ret = SOUND_MANAGER_ERROR_NONE;
+ if (!(ret = sound_manager_get_device_list(g_device_mask, &g_device_list)))
+ g_print("success to get device list\n");
+ else
+ g_print("fail to get device list, ret[0x%x]\n", ret);
+ reset_menu_state();
+ break;
+ }
case CURRENT_STATUS_PRINT_DEVICE_LIST: {
sound_device_list_h device_list;
sound_device_h device;
g_print("[ Device #%d %s %s ]\n", id, type, name);
g_print(" Direc[ %-4s ] State[ %-12s ] Avail-Modes[ %s ]\n", direc, state, avail_modes);
}
- if ((ret = sound_manager_free_device_list(device_list)))
- g_print("fail to free device list, ret[0x%x]\n", ret);
} else {
g_print("fail to get current device list, ret[0x%x]\n", ret);
}