+
/*
-* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2015 - 2018 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* @internal
+ * @brief Sets the mute specified for a particular sound type.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/volume.set
+ * @param[in] type The sound type
+ * @param[in] mute The mute state to be set: (@c true = mute, @c false = unmute)
+ * @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_PERMISSION_DENIED Permission denied
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_mute()
+ */
+int sound_manager_set_mute(sound_type_e type, bool mute);
+
+/**
+ * @internal
+ * @brief Gets the mute specified for a particular sound type.
+ * @since_tizen 5.5
+ * @param[in] type The sound type
+ * @param[out] muted The current mute state: (@c true = muted, @c false = unmuted)
+ * @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_INTERNAL Internal error inside the sound system
+ * @see sound_manager_set_mute()
+ */
+int sound_manager_get_mute(sound_type_e type, bool *muted);
+
+/**
+ * @internal
* @brief Creates a handle for stream information.
* @since_tizen 3.0
*
/**
* @internal
- * @brief Disable session backward compatibility.
- * @since_tizen 3.0
+ * @brief Checks if the device is running.
+ * @since_tizen 5.0
+ * @param[in] device_id The device id
+ * @param[out] is_running Whether the device is running or not: (@c true = running, @c false = not running)
+ * @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_device_list()
+ * @see sound_manager_get_next_device()
+ * @see sound_manager_get_prev_device()
+ * @see sound_manager_get_device_id()
+ * @see sound_manager_free_device_list()
+ */
+int sound_manager_is_device_running_by_id(int device_id, bool *is_running);
+
+/**
+ * @internal
+ * @brief Gets the device's supported sample formats.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * The @a formats should be released using free().
+ *
+ * @param[in] device_id The device id
+ * @param[out] formats The supported sample format list
+ * @param[out] num_of_elems The number of elements in the sample format 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
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_set_sample_format_by_id()
+ * @see sound_manager_get_sample_format_by_id()
+ */
+int sound_manager_get_supported_sample_formats_by_id(int device_id, sound_sample_format_e **formats, unsigned int *num_of_elems);
+
+/**
+ * @internal
+ * @brief Sets the device's sample format.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
+ * @a format should be one of the values received from sound_manager_get_supported_sample_formats_by_id(),\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
+ *
+ * @param[in] device_id The device id
+ * @param[in] format The sample format
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_supported_sample_formats_by_id()
+ * @see sound_manager_get_sample_format_by_id()
+ */
+int sound_manager_set_sample_format_by_id(int device_id, sound_sample_format_e format);
+
+/**
+ * @internal
+ * @brief Gets the device's sample format.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
+ *
+ * @param[in] device_id The device id
+ * @param[out] format The sample format
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_supported_sample_formats_by_id()
+ * @see sound_manager_set_sample_format_by_id()
+ */
+int sound_manager_get_sample_format_by_id(int device_id, sound_sample_format_e *format);
+
+/**
+ * @internal
+ * @brief Gets the device's supported sample rates.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * The @a rates should be released using free().
+ *
+ * @param[in] device_id The device id
+ * @param[out] rates The supported sample rate list
+ * @param[out] num_of_elems The number of elements in the sample rate 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
+ * @retval #SOUND_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_set_sample_rate_by_id()
+ * @see sound_manager_get_sample_rate_by_id()
+ */
+int sound_manager_get_supported_sample_rates_by_id(int device_id, sound_sample_rate_e **rates, unsigned int *num_of_elems);
+
+/**
+ * @internal
+ * @brief Sets the device's sample rate.
+ * @since_tizen 5.0
*
- * @remarks Multimedia framework support backward compatibility of legacy sound session. \n
- * If a process does not want legacy sound session behavior in each multimedia framework, \n
- * this function can be used explicitly not to support that.
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device.\n
+ * @a rate should be one of the values received from sound_manager_get_supported_sample_rates(),\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
*
+ * @param[in] device_id The device id
+ * @param[in] rate The sample rate
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_supported_sample_rates_by_id()
+ * @see sound_manager_get_sample_rate_by_id()
+ */
+int sound_manager_set_sample_rate_by_id(int device_id, sound_sample_rate_e rate);
+
+/**
+ * @internal
+ * @brief Gets the device's sample rate.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.
+ *
+ * @param[in] device_id The device id
+ * @param[out] rate The sample rate
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_supported_sample_rates_by_id()
+ * @see sound_manager_set_sample_rate_by_id()
+ */
+int sound_manager_get_sample_rate_by_id(int device_id, sound_sample_rate_e *rate);
+
+/**
+ * @internal
+ * @brief Sets the device's 'avoid resampling' property.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * The 'avoid resampling' property is not enabled as default. With this enabled, the device will\n
+ * use the first stream's original sample format and rate without resampling if supported.
+ *
+ * @param[in] device_id The device id
+ * @param[in] enable The 'avoid resampling' property value to set: (@c true = enable, @c false = disable)
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_avoid_resampling_by_id()
+ */
+int sound_manager_set_avoid_resampling_by_id(int device_id, bool enable);
+
+/**
+ * @internal
+ * @brief Gets the device's 'avoid resampling' property.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * The default value of 'avoid resampling' is false.
+ *
+ * @param[in] device_id The device id
+ * @param[in] enabled The value of 'avoid resampling' property: (@c true = enabled, @c false = disabled)
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_set_avoid_resampling_by_id()
+ */
+int sound_manager_get_avoid_resampling_by_id(int device_id, bool *enabled);
+
+/**
+ * @internal
+ * @brief Sets the restriction of stream type only for media.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * This property is not enabled as default. With this enabled, no other stream types\n
+ * except #SOUND_STREAM_TYPE_MEDIA is not allowed to @a device.
+ *
+ * @param[in] device_id The device id
+ * @param[in] enable The 'media stream only' property value to set: (@c true = enable, @c false = disable)
* @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_INVALID_OPERATION Invalid operation
* @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_get_media_stream_only_by_id()
*/
-int sound_manager_disable_session_backward_compatibility(void);
+int sound_manager_set_media_stream_only_by_id(int device_id, bool enable);
+
+/**
+ * @internal
+ * @brief Gets the restriction of stream type only for media.
+ * @since_tizen 5.0
+ *
+ * @remarks @a device_id should be #SOUND_DEVICE_USB_AUDIO type and an output device,\n
+ * otherwise #SOUND_MANAGER_ERROR_INVALID_OPERATION will be returned.\n
+ * Use sound_manager_get_device_io_direction() to check if it is an output device or not.\n
+ * The property is not enabled as default.
+ *
+ * @param[in] device_id The device id
+ * @param[out] enabled The value of 'media stream only' property: (@c true = enabled, @c false = disabled)
+ * @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_INVALID_OPERATION Invalid operation
+ * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
+ * @see sound_manager_set_media_stream_only_by_id()
+ */
+int sound_manager_get_media_stream_only_by_id(int device_id, bool *enabled);
/**
* @internal
int sound_manager_get_device_product_id(sound_device_h device, int *product_id);
/**
+ * @brief Checks if the stream information is using the device.
+ * @since_tizen 5.5
+ *
+ * @param[in] stream_info The handle of stream information
+ * @param[in] device_id The device id
+ * @param[out] is_on Whether the stream info is using the device or not: (@c true = use, @c false = not use)
+ * @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_INTERNAL Internal error inside the sound system
+ * @see sound_manager_create_stream_information()
+ * @see sound_manager_destroy_stream_information()
+ * @see sound_manager_get_device_list()
+ * @see sound_manager_get_next_device()
+ * @see sound_manager_get_prev_device()
+ * @see sound_manager_get_device_id()
+ * @see sound_manager_get_device_name()
+ * @see sound_manager_free_device_list()
+ */
+int sound_manager_is_stream_on_device_by_id(sound_stream_info_h stream_info, int device_id, bool *is_on);
+
+/**
* @}
*/