delete sound policy API,sound_manager_get_current_sound_device 2.0alpha master 2.0_alpha submit/master/20120920.151032
authorSeungKeun Lee <sngn.lee@samsung.com>
Tue, 4 Sep 2012 23:31:25 +0000 (08:31 +0900)
committerSeungKeun Lee <sngn.lee@samsung.com>
Tue, 4 Sep 2012 23:31:25 +0000 (08:31 +0900)
change sound_call_session_type_e type's value symbols

include/sound_manager.h
packaging/capi-media-sound-manager.spec [changed mode: 0644->0755]
src/sound_manager.c

index edad930..fac2324 100755 (executable)
@@ -67,24 +67,6 @@ typedef enum
 } volume_key_type_e;
 
 /**
- * @brief Enumerations of sound route policy
- */
-typedef enum {
-    SOUND_ROUTE_DEFAULT,        /**< Audio device priority: 1. bluetooth headset, 2. wired headset 3. built-in speaker and microphone. */
-    SOUND_ROUTE_IGNORE_A2DP,    /**< Audio device priority: 1. wired headset, 2. built-in speaker and microphone. */
-    SOUND_ROUTE_HANDSET_ONLY    /**< Use only built-in speaker and microphone */
-} sound_route_policy_e;
-
-/**
- * @brief Enumerations of sound device
- */
-typedef enum {
-    SOUND_DEVICE_NONE,          /**< Abnormal case */
-    SOUND_DEVICE_HANDSET,       /**< Speaker, Wired headset, Wired earpiece */
-    SOUND_DEVICE_BLUETOOTH      /**< Bluetooth */
-} sound_device_e;
-
-/**
  * @brief error codes for sound manager
  */
 typedef enum{
@@ -151,17 +133,19 @@ typedef enum{
  * @brief Enumerations of call session type
  */
 typedef enum{
-       SOUND_SESSION_TYPE_CALL = 0,    /**< call type */
-       SOUND_SESSION_TYPE_VOIP,                        /**<  voip type */
+       SOUND_CALL_SESSION_TYPE_CALL = 0,       /**< call type */
+       SOUND_CALL_SESSION_TYPE_VOIP = 1,                       /**<  voip type */
+       SOUND_SESSION_TYPE_CALL = 0,
+       SOUND_SESSION_TYPE_VOIP = 1,
 } sound_call_session_type_e;
 
 /**
  * @brief Enumerations of communication session type
  */
 typedef enum{
-       SOUND_CALL_SESSION_MODE_VOICE = 0,              /**< normal voicecall mode */
+       SOUND_CALL_SESSION_MODE_VOICE = 0,              /**< normal talking mode */
        SOUND_CALL_SESSION_MODE_RINGTONE,               /**< ringtone mode */
-       SOUND_CALL_SESSION_MODE_MEDIA,                  /**< media on call mode */
+       SOUND_CALL_SESSION_MODE_MEDIA,                  /**< notification sound in call*/
 } sound_call_session_mode_e;
 
 /**
@@ -213,16 +197,6 @@ typedef void(* sound_interrupted_cb)(sound_interrupted_code_e code, void *user_d
 typedef void (*sound_manager_volume_changed_cb)(sound_type_e type, unsigned int volume, void *user_data);
 
 /**
- * @brief Called when the sound route policy has changes.
- * @param[in]   route The new sound route policy
- * @param[in]   user_data The user data passed from the callback registration function
- * @pre sound_manager_set_route_policy() will invoke this callback if you register it using sound_manager_set_route_policy_changed_cb()
- * @see sound_manager_set_route_policy_changed_cb()
- * @see sound_manager_unset_route_policy_changed_cb()
- */
-typedef void (*sound_manager_route_policy_changed_cb)(sound_route_policy_e route, void *user_data);
-
-/**
  * @brief Gets the maximum volume level supported for a particular sound type
  * @param[in]          type The sound type
  * @param[out] max     The maximum volume level
@@ -264,7 +238,6 @@ int sound_manager_get_volume(sound_type_e type, int *volume);
  * @retval #SOUND_MANAGER_ERROR_NONE Success
  * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #SOUND_MANAGER_ERROR_NO_PLAYING_SOUND No playing sound
- * @see sound_manager_get_current_sound_device()
  * @see player_set_sound_type()
  * @see audio_out_create()
  * @see wav_player_start()
@@ -272,17 +245,6 @@ int sound_manager_get_volume(sound_type_e type, int *volume);
 int sound_manager_get_current_sound_type(sound_type_e *type);
 
 /**
- * @brief Gets the current device type
- * @param[out] device The current sound device
- * @return 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_PLAYING_SOUND No playing sound
- * @see sound_manager_get_current_sound_type()
- */
-int sound_manager_get_current_sound_device(sound_device_e *device);
-
-/**
  * @brief Registers a callback function to be invoked when the volume level is changed.
  * @param[in]  callback        Callback function to indicate change in volume
  * @param[in]  user_data       The user data to be passed to the callback function
@@ -531,12 +493,6 @@ int sound_manager_call_session_destroy(sound_call_session_h session);
  * @}
  */
 
-__attribute__ ((deprecated)) int sound_manager_set_route_policy (sound_route_policy_e route);
-__attribute__ ((deprecated)) int sound_manager_get_route_policy (sound_route_policy_e *route);
-__attribute__ ((deprecated)) int sound_manager_set_route_policy_changed_cb(sound_manager_route_policy_changed_cb callback, void *user_data);
-__attribute__ ((deprecated)) void sound_manager_unset_route_policy_changed_cb(void);
-
-
 #ifdef __cplusplus
 }
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index 683c2bf..92be364
@@ -1,7 +1,7 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
 Version: 0.1.0
-Release:    13
+Release:    14
 Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN
 Source0:    %{name}-%{version}.tar.gz
index 555d7c2..d636e38 100755 (executable)
@@ -37,11 +37,6 @@ typedef struct {
 }_changed_volume_info_s;
 
 typedef struct {
-       void *user_data;
-       sound_manager_route_policy_changed_cb user_cb;
-}_changed_policy_info_s;
-
-typedef struct {
        int is_registered;
        void *user_data;
        sound_session_notify_cb user_cb;
@@ -60,7 +55,6 @@ typedef struct {
 }_changed_active_device_info_s;
 
 static _changed_volume_info_s g_volume_changed_cb_table;
-static _changed_policy_info_s g_policy_changed_cb_table;
 static _session_notify_info_s g_session_notify_cb_table = {0, NULL, NULL, NULL, NULL};
 
 static void __volume_changed_cb(void *user_data)
@@ -73,18 +67,13 @@ static void __volume_changed_cb(void *user_data)
                (g_volume_changed_cb_table.user_cb)(type, new_volume, g_volume_changed_cb_table.user_data);
 }
 
-static void __policy_changed_cb(void *user_data,  system_audio_route_t policy){
-       if( g_policy_changed_cb_table.user_cb)
-               g_policy_changed_cb_table.user_cb(policy, g_policy_changed_cb_table.user_data);
-}
-
 static void __session_notify_cb(session_msg_t msg, session_event_t event, void *user_data){
        if(g_session_notify_cb_table.user_cb){
                g_session_notify_cb_table.user_cb(msg, g_session_notify_cb_table.user_data);
        }
        if( g_session_notify_cb_table.interrupted_cb ){
                sound_interrupted_code_e e = SOUND_INTERRUPTED_COMPLETED;
-               if( msg == MM_SESSION_MSG_STOP )
+               if( msg == MM_SESSION_MSG_RESUME )
                        e = SOUND_INTERRUPTED_COMPLETED;
                else{
                        switch(event){
@@ -188,27 +177,6 @@ int sound_manager_get_volume(sound_type_e type, int *volume)
        return __convert_sound_manager_error_code(__func__, ret);
 }
 
-int sound_manager_set_route_policy (sound_route_policy_e route)
-{
-       if( route < 0 || route > SOUND_ROUTE_HANDSET_ONLY)
-               return __convert_sound_manager_error_code(__func__, SOUND_MANAGER_ERROR_INVALID_PARAMETER);
-
-       int ret;
-       ret = mm_sound_route_set_system_policy(route);
-
-       return __convert_sound_manager_error_code(__func__, ret);
-}
-
-int sound_manager_get_route_policy (sound_route_policy_e *route)
-{
-       if( route == NULL)
-               return __convert_sound_manager_error_code(__func__, SOUND_MANAGER_ERROR_INVALID_PARAMETER);
-       int ret;
-       ret= mm_sound_route_get_system_policy((system_audio_route_t *)route);
-       
-       return __convert_sound_manager_error_code(__func__, ret);
-}
-
 int sound_manager_get_current_sound_type(sound_type_e *type)
 {
        if(type == NULL)
@@ -219,15 +187,6 @@ int sound_manager_get_current_sound_type(sound_type_e *type)
        return __convert_sound_manager_error_code(__func__, ret);
 }
 
-int sound_manager_get_current_sound_device(sound_device_e *device)
-{
-       if( device == NULL)
-               return __convert_sound_manager_error_code(__func__, SOUND_MANAGER_ERROR_INVALID_PARAMETER);
-       int ret;
-       ret = mm_sound_route_get_playing_device((system_audio_route_device_t*)device);
-       return __convert_sound_manager_error_code(__func__, ret);
-}
-
 int sound_manager_set_volume_changed_cb(sound_manager_volume_changed_cb callback, void* user_data)
 {
        if(callback == NULL)
@@ -253,23 +212,6 @@ void sound_manager_unset_volume_changed_cb(void)
        g_volume_changed_cb_table.user_data = NULL;     
 }
 
-int sound_manager_set_route_policy_changed_cb(sound_manager_route_policy_changed_cb callback, void* user_data)
-{
-       if( callback == NULL)
-               return __convert_sound_manager_error_code(__func__, SOUND_MANAGER_ERROR_INVALID_PARAMETER);
-       g_policy_changed_cb_table.user_cb = callback;
-       g_policy_changed_cb_table.user_data = user_data;
-       mm_sound_route_add_change_callback(__policy_changed_cb, user_data);
-       return 0;
-}
-
-void sound_manager_unset_route_policy_changed_cb(void)
-{
-       mm_sound_route_remove_change_callback();
-       g_policy_changed_cb_table.user_cb = NULL;
-       g_policy_changed_cb_table.user_data = NULL;
-}
-
 int sound_manager_get_a2dp_status(bool *connected , char** bt_name){
        int ret = mm_sound_route_get_a2dp_status((int*)connected , bt_name);