Tizen Native API
4.0
|
The Session API provides functions to control a session. (Deprecated)
Required Header
#include <sound_manager.h>
Overview
The Sound Manager Session API allows you to:
- determine a sound session policy
- handle the notification of a sound session interruption
The Sound Manager has predefined sound sessions (media, alarm, notification, emergency, voip)
Related Features
APIs for voip sound session and voip stream type are related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | sound_manager_set_session_type (sound_session_type_e type) TIZEN_DEPRECATED_API |
Sets the application's sound session type. | |
int | sound_manager_get_session_type (sound_session_type_e *type) TIZEN_DEPRECATED_API |
Gets the application's sound session type. | |
int | sound_manager_set_media_session_option (sound_session_option_for_starting_e s_option, sound_session_option_for_during_play_e d_option) TIZEN_DEPRECATED_API |
Sets the media sound session option. | |
int | sound_manager_get_media_session_option (sound_session_option_for_starting_e *s_option, sound_session_option_for_during_play_e *d_option) TIZEN_DEPRECATED_API |
Gets the media sound session option. | |
int | sound_manager_set_media_session_resumption_option (sound_session_option_for_resumption_e option) TIZEN_DEPRECATED_API |
Sets the media sound session resumption option. | |
int | sound_manager_get_media_session_resumption_option (sound_session_option_for_resumption_e *option) TIZEN_DEPRECATED_API |
Gets the media sound session resumption option. | |
int | sound_manager_set_voip_session_mode (sound_session_voip_mode_e mode) TIZEN_DEPRECATED_API |
Sets the mode of the voip sound session. | |
int | sound_manager_get_voip_session_mode (sound_session_voip_mode_e *mode) TIZEN_DEPRECATED_API |
Gets the mode of the voip sound session. | |
int | sound_manager_set_session_interrupted_cb (sound_session_interrupted_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Registers a callback function to be invoked when the sound session being played was interrupted. | |
int | sound_manager_unset_session_interrupted_cb (void) TIZEN_DEPRECATED_API |
Unregisters the callback function which is called when the sound session being played is interrupted. | |
Typedefs | |
typedef void(* | sound_session_interrupted_cb )(sound_session_interrupted_code_e code, void *user_data) |
Called when the playing sound session is interrupted. |
Typedef Documentation
typedef void(* sound_session_interrupted_cb)(sound_session_interrupted_code_e code, void *user_data) |
Called when the playing sound session is interrupted.
- Deprecated:
- Deprecated since 3.0. Use sound_stream_focus_state_changed_cb instead.
- Since :
- 2.3.1
- Parameters:
-
[in] code The interrupted code [in] user_data The user data passed from the callback registration function
- Precondition:
- You should register this callback using sound_manager_set_session_interrupted_cb().
Enumeration Type Documentation
Enumeration for sound session interrupted type.
- Deprecated:
- Deprecated since 3.0. Use sound_stream_focus_state_changed_cb instead.
- Since :
- 2.3.1
- Enumerator:
Enumeration for session option during play.
- Deprecated:
- Deprecated since 3.0. In sound_stream_focus_state_changed_cb, you can choose to stop playing or not.
- Since :
- 2.3.1
Enumeration for session option for resumption.
- Deprecated:
- Deprecated since 3.0. In sound_stream_focus_state_changed_cb, you can choose to resume playing or not.
- Since :
- 2.3.1
- Enumerator:
Enumeration for session option for starting.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_acquire_focus() or not instead.
- Since :
- 2.3.1
enum sound_session_type_e |
Enumeration for session type.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() and sound_stream_type_e instead.
- Since :
- 2.3.1
Enumeration for voip session mode.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_apply_stream_routing() instead.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int sound_manager_get_media_session_option | ( | sound_session_option_for_starting_e * | s_option, |
sound_session_option_for_during_play_e * | d_option | ||
) |
Gets the media sound session option.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[out] s_option The session option for starting [out] d_option The session option for during play
- 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_INVALID_OPERATION Invalid operation SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
int sound_manager_get_media_session_resumption_option | ( | sound_session_option_for_resumption_e * | option | ) |
Gets the media sound session resumption option.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[out] option The session resumption option
- 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_INVALID_OPERATION Invalid operation SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
int sound_manager_get_session_type | ( | sound_session_type_e * | type | ) |
Gets the application's sound session type.
- Deprecated:
- Deprecated since 3.0.
- Since :
- 2.3.1
- Parameters:
-
[in] type The session type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
SOUND_MANAGER_ERROR_NONE Success SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- sound_manager_set_session_type()
- sound_manager_set_media_session_option()
- sound_manager_get_media_session_option()
- sound_manager_set_media_session_resumption_option()
- sound_manager_get_media_session_resumption_option()
- sound_manager_set_voip_session_mode()
- sound_manager_get_voip_session_mode()
int sound_manager_get_voip_session_mode | ( | sound_session_voip_mode_e * | mode | ) |
Gets the mode of the voip sound session.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[out] mode The voip session mode
- 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_NOT_SUPPORTED Not supported SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
- Precondition:
- Call sound_manager_set_session_type(SOUND_SESSION_TYPE_VOIP) before calling this function.
int sound_manager_set_media_session_option | ( | sound_session_option_for_starting_e | s_option, |
sound_session_option_for_during_play_e | d_option | ||
) |
Sets the media sound session option.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] s_option The session option for starting [in] d_option The session option for during play
- 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_INVALID_OPERATION Invalid operation SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
int sound_manager_set_media_session_resumption_option | ( | sound_session_option_for_resumption_e | option | ) |
Sets the media sound session resumption option.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] option The session resumption option
- 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_INVALID_OPERATION Invalid operation SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
int sound_manager_set_session_interrupted_cb | ( | sound_session_interrupted_cb | callback, |
void * | user_data | ||
) |
Registers a callback function to be invoked when the sound session being played was interrupted.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[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_POLICY Noncompliance with the sound system policy
- Postcondition:
- sound_session_interrupted_cb() will be invoked.
int sound_manager_set_session_type | ( | sound_session_type_e | type | ) |
Sets the application's sound session type.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] type The session type to set
- 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_NOT_SUPPORTED Not supported SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
- See also:
- sound_manager_get_session_type()
- sound_manager_set_media_session_option()
- sound_manager_get_media_session_option()
- sound_manager_set_media_session_resumption_option()
- sound_manager_get_media_session_resumption_option()
- sound_manager_set_voip_session_mode()
- sound_manager_get_voip_session_mode()
Sets the mode of the voip sound session.
- Deprecated:
- Deprecated since 3.0. Use sound_manager_create_stream_information() instead.
- Since :
- 2.3.1
- Parameters:
-
[in] mode The voip session mode
- 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_NOT_SUPPORTED Not supported SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy
- Precondition:
- Call sound_manager_set_session_type(SOUND_SESSION_TYPE_VOIP) before calling this function.
int sound_manager_unset_session_interrupted_cb | ( | void | ) |
Unregisters the callback function which is called when the sound session being played is interrupted.
- Deprecated:
- Deprecated since 3.0.
- 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