Tizen Native API
3.0
|
The Device API provides functions to query the information of sound devices.
Required Header
#include <sound_manager.h>
Overview
The Sound Manager Device API allows you to:
- query the basic information of connected sound devices.
- handle the sound device's connection and information change notification.
The list of currently connected sound device can be obtained by calling sound_manager_get_current_device_list(). To get the handle of each sound device, call sound_manager_get_next_device() and sound_manager_get_prev_device().
Device information, such as "type", "IO direction", "state", "ID", "name", can be obtained by calling corresponding APIs.
Functions | |
int | sound_manager_get_current_device_list (sound_device_mask_e device_mask, sound_device_list_h *device_list) TIZEN_DEPRECATED_API |
Gets the list consisting of connected devices. | |
int | sound_manager_get_device_list (int device_mask, sound_device_list_h *device_list) |
Gets the list consisting of connected devices. | |
int | sound_manager_free_device_list (sound_device_list_h device_list) |
Frees device list and each item of list. | |
int | sound_manager_get_next_device (sound_device_list_h device_list, sound_device_h *device) |
Gets the next item of the device list. | |
int | sound_manager_get_prev_device (sound_device_list_h device_list, sound_device_h *device) |
Gets the previous item of the device list. | |
int | sound_manager_get_device_type (sound_device_h device, sound_device_type_e *type) |
Gets the type of the device. | |
int | sound_manager_get_device_io_direction (sound_device_h device, sound_device_io_direction_e *io_direction) |
Gets the io direction of the device. | |
int | sound_manager_get_device_id (sound_device_h device, int *id) |
Gets the id of the device. | |
int | sound_manager_get_device_name (sound_device_h device, char **name) |
Gets the name of the device. | |
int | sound_manager_get_device_state (sound_device_h device, sound_device_state_e *state) |
Gets the state of the device. | |
int | sound_manager_set_device_connected_cb (sound_device_mask_e device_mask, sound_device_connected_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Registers a callback function to be invoked when the state of connection of a sound device was changed. | |
int | sound_manager_unset_device_connected_cb (void) TIZEN_DEPRECATED_API |
Unregisters the callback function which is called when the state of connection of a sound device was changed. | |
int | sound_manager_add_device_connection_changed_cb (int device_mask, sound_device_connection_changed_cb callback, void *user_data, int *id) |
Adds a callback function to be invoked when the connection state of a sound device was changed. | |
int | sound_manager_remove_device_connection_changed_cb (int id) |
Removes a callback function invoked when the connection of a sound device was changed. | |
int | sound_manager_set_device_information_changed_cb (sound_device_mask_e device_mask, sound_device_information_changed_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Registers a callback function to be invoked when the information of a sound device was changed. | |
int | sound_manager_unset_device_information_changed_cb (void) TIZEN_DEPRECATED_API |
Unregisters the callback function which is called when the information of a sound device was changed. | |
int | sound_manager_add_device_state_changed_cb (int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id) |
Adds a callback function to be invoked when the state of a sound device was changed. | |
int | sound_manager_remove_device_state_changed_cb (int id) |
Removes a callback function invoked when the state of a sound device was changed. | |
Typedefs | |
typedef void * | sound_device_h |
Sound device handle. | |
typedef void * | sound_device_list_h |
Sound device list handle. | |
typedef void(* | sound_device_connected_cb )(sound_device_h device, bool is_connected, void *user_data) |
Called when the state of connection of a sound device was changed. | |
typedef void(* | sound_device_information_changed_cb )(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data) |
Called when the information of a sound device was changed. | |
typedef void(* | sound_device_connection_changed_cb )(sound_device_h device, bool is_connected, void *user_data) |
Called when the connection state of a sound device was changed. | |
typedef void(* | sound_device_state_changed_cb )(sound_device_h device, sound_device_state_e state, void *user_data) |
Called when the state of a sound device was changed. |
Typedef Documentation
typedef void(* sound_device_connected_cb)(sound_device_h device, bool is_connected, void *user_data) |
Called when the state of connection of a sound device was changed.
- Deprecated:
- Deprecated since 3.0. Use sound_device_connection_changed_cb() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] sound_device_h The sound_device [in] is_connected The state of device connection: ( true
= connected,false
= disconnected)[in] user_data The user data passed from the callback registration function
- Precondition:
- You should register this callback using sound_manager_set_device_connected_cb().
typedef void(* sound_device_connection_changed_cb)(sound_device_h device, bool is_connected, void *user_data) |
Called when the connection state of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] device The sound_device [in] is_connected The state of device connection: true
= connected,false
= disconnected[in] user_data The user data passed from the callback registration function
- Precondition:
- You should add this callback using sound_manager_add_device_connection_changed_cb().
typedef void* sound_device_h |
Sound device handle.
- Since :
- 2.3.1
typedef void(* sound_device_information_changed_cb)(sound_device_h device, sound_device_changed_info_e changed_info, void *user_data) |
Called when the information of a sound device was changed.
- Deprecated:
- Deprecated since 3.0.
- Since :
- 2.3.1
- Parameters:
-
[in] sound_device_h The sound_device [in] changed_info The entry of sound device information [in] user_data The user data passed from the callback registration function
- Precondition:
- You should register this callback using sound_manager_set_device_information_changed_cb().
typedef void* sound_device_list_h |
Sound device list handle.
- Since :
- 2.3.1
typedef void(* sound_device_state_changed_cb)(sound_device_h device, sound_device_state_e state, void *user_data) |
Called when the state of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] device The sound_device [in] state The state of the device [in] user_data The user data passed from the callback registration function
- Precondition:
- You should add this callback using sound_manager_add_device_state_changed_cb().
Enumeration Type Documentation
Enumeration for changed information of sound device.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_add_device_state_changed_cb() instead.
- Since :
- 2.3.1
enum sound_device_mask_e |
Enumeration for sound device mask.
- Since :
- 2.3.1
- Enumerator:
enum sound_device_state_e |
enum sound_device_type_e |
Enumeration for sound device type.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int sound_manager_add_device_connection_changed_cb | ( | int | device_mask, |
sound_device_connection_changed_cb | callback, | ||
void * | user_data, | ||
int * | id | ||
) |
Adds a callback function to be invoked when the connection state of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] device_mask Device masks for which changes should be tracked, values of sound_device_mask_e combined with bitwise 'or' [in] callback The device connection state changed callback function [in] user_data The user data to be passed to the callback function [out] id The callback id
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
- Postcondition:
- sound_device_connected_cb() will be invoked.
int sound_manager_add_device_state_changed_cb | ( | int | device_mask, |
sound_device_state_changed_cb | callback, | ||
void * | user_data, | ||
int * | id | ||
) |
Adds a callback function to be invoked when the state of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] device_mask Device masks for which changes should be tracked, values of sound_device_mask_e combined with bitwise 'or' [in] callback The device state changed callback function [in] user_data The user data to be passed to the callback function [out] id The callback id
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
- Postcondition:
- sound_device_state_changed_cb() will be invoked.
- See also:
- sound_manager_remove_device_state_changed_cb()
- sound_device_state_connected_cb()
int sound_manager_free_device_list | ( | sound_device_list_h | device_list | ) |
Frees device list and each item of list.
- Since :
- 3.0
- Remarks:
- This function will deallocate not only device list itself but also each item.
- Parameters:
-
[in] device_list The device list got with sound_manager_get_device_list.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
int sound_manager_get_current_device_list | ( | sound_device_mask_e | device_mask, |
sound_device_list_h * | device_list | ||
) |
Gets the list consisting of connected devices.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_get_device_list() instead.
- Since :
- 2.3.1
- Remarks:
- Calling this API will deallocate previously obtained list and each item.
Use sound_manager_get_next_device() to get the first node of the list.
- Parameters:
-
[in] device_mask The mask value [out] device_list The list of connected devices
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_NO_DATA No data SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_get_device_id | ( | sound_device_h | device, |
int * | id | ||
) |
Gets the id of the device.
- Since :
- 2.3.1
- Parameters:
-
[in] device The device item [out] id The id of the device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
int sound_manager_get_device_io_direction | ( | sound_device_h | device, |
sound_device_io_direction_e * | io_direction | ||
) |
Gets the io direction of the device.
- Since :
- 2.3.1
- Parameters:
-
[in] device The device item [out] io_direction The io direction of the device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
int sound_manager_get_device_list | ( | int | device_mask, |
sound_device_list_h * | device_list | ||
) |
Gets the list consisting of connected devices.
- Since :
- 3.0
- Remarks:
- device_list should be freed using sound_manager_free_device_list().
Use sound_manager_get_next_device() to get the first node of the list.
- Parameters:
-
[in] device_mask The mask values of sound_device_mask_e combined with bitwise 'or' [out] device_list The list of connected devices
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_NO_DATA No data SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_get_device_name | ( | sound_device_h | device, |
char ** | name | ||
) |
Gets the name of the device.
- Since :
- 2.3.1
- Parameters:
-
[in] device The device item [out] name The name of the device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_get_device_state | ( | sound_device_h | device, |
sound_device_state_e * | state | ||
) |
Gets the state of the device.
- Since :
- 2.3.1
- Parameters:
-
[in] device The device item [out] state The state of the device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
int sound_manager_get_device_type | ( | sound_device_h | device, |
sound_device_type_e * | type | ||
) |
Gets the type of the device.
- Since :
- 2.3.1
- Parameters:
-
[in] device The device item [out] type The type of the device
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
int sound_manager_get_next_device | ( | sound_device_list_h | device_list, |
sound_device_h * | device | ||
) |
Gets the next item of the device list.
- Since :
- 2.3.1
- Parameters:
-
[in] device_list The list of connected devices [out] device The device item
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_NO_DATA No data
int sound_manager_get_prev_device | ( | sound_device_list_h | device_list, |
sound_device_h * | device | ||
) |
Gets the previous item of the device list.
- Since :
- 2.3.1
- Parameters:
-
[in] device_list The list of connected devices [out] device The device item
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_NO_DATA No data
int sound_manager_remove_device_connection_changed_cb | ( | int | id | ) |
Removes a callback function invoked when the connection of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] id The id of the callback to remove
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_remove_device_state_changed_cb | ( | int | id | ) |
Removes a callback function invoked when the state of a sound device was changed.
- Since :
- 3.0
- Parameters:
-
[in] id The id of the callback to remove
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_set_device_connected_cb | ( | sound_device_mask_e | device_mask, |
sound_device_connected_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when the state of connection of a sound device was changed.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_add_device_connection_changed_cb() instead.
- Since :
- 2.3.1
- Remarks:
- The initial state of sound devices connected is deactivated.
- Parameters:
-
[in] device_mask The mask value [in] callback The interrupted callback function [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
- Postcondition:
- sound_device_connected_cb() will be invoked.
int sound_manager_set_device_information_changed_cb | ( | sound_device_mask_e | device_mask, |
sound_device_information_changed_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when the information of a sound device was changed.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_add_device_state_changed_cb() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] device_mask The mask value [in] callback The interrupted callback function [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
- Postcondition:
- sound_device_information_changed_cb() will be invoked.
int sound_manager_unset_device_connected_cb | ( | void | ) |
Unregisters the callback function which is called when the state of connection of a sound device was changed.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_remove_device_connection_changed_cb() instead.
- Since :
- 2.3.1
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system
int sound_manager_unset_device_information_changed_cb | ( | void | ) |
Unregisters the callback function which is called when the information of a sound device was changed.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_remove_device_state_changed_cb() instead.
- Since :
- 2.3.1
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system