diff options
author | jinwang.an <jinwang.an@samsung.com> | 2018-02-26 19:53:31 +0900 |
---|---|---|
committer | jinwang.an <jinwang.an@samsung.com> | 2018-02-28 16:20:21 +0900 |
commit | 84e8b16538982d9f307c66f8fd8e01dd35db97dd (patch) | |
tree | b185b09d8badc1109c82fa31259bb697657dc2ae | |
parent | 01c2cc12b0f0ac09e7e1123e154ce8b91b79f97e (diff) | |
download | watch-setting-84e8b16538982d9f307c66f8fd8e01dd35db97dd.tar.gz watch-setting-84e8b16538982d9f307c66f8fd8e01dd35db97dd.tar.bz2 watch-setting-84e8b16538982d9f307c66f8fd8e01dd35db97dd.zip |
Applied deprecated player API.
- player_set_sound_type()
Change-Id: I90b7eeb485361f7d3fbc3591c8cf195749fe75fc
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
-rw-r--r-- | include/setting-common-sound.h | 11 | ||||
-rw-r--r-- | include/setting-sound.h | 1 | ||||
-rw-r--r-- | include/setting-vibration.h | 1 | ||||
-rw-r--r-- | include/setting-volume.h | 1 | ||||
-rw-r--r-- | src/setting-common-sound.c | 71 | ||||
-rw-r--r-- | src/setting-sound.c | 26 | ||||
-rw-r--r-- | src/setting-volume-page.c | 54 | ||||
-rw-r--r-- | src/setting-volume.c | 126 |
8 files changed, 166 insertions, 125 deletions
diff --git a/include/setting-common-sound.h b/include/setting-common-sound.h index 7fa04c3..790ab57 100644 --- a/include/setting-common-sound.h +++ b/include/setting-common-sound.h @@ -20,6 +20,7 @@ #include <player.h> #include <sound_manager.h> +#include <sound_manager_internal.h> #include <mm_sound_private.h> #include <wav_player.h> /*#include <player_product.h> */ @@ -54,14 +55,16 @@ enum { }; int get_sound_mode(); +int get_sound_type(sound_stream_type_e stream_type); +int get_sound_internal_type(sound_stream_type_internal_e stream_type); int is_created_player(); int is_player_paused(); void set_looping(int); -void play_sound(char *file_path, float volume, sound_type_e sound_type); -void play_sound_for_sound_mode_setting(char *file_path, float volume, sound_type_e sound_type); -int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, sound_type_e sound_type, int prelistening_enable); -int _close_player(void *data, sound_type_e type); +void play_sound(char *file_path, float volume, sound_stream_type_e sound_type); +void play_sound_for_sound_mode_setting(char *file_path, float volume, sound_stream_type_e sound_type); +int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, int sound_type, int prelistening_enable); +int _close_player(void *data); int _profile_stop_sound(void *data); #endif /* SETTING_COMMON_SOUND_H_ */ diff --git a/include/setting-sound.h b/include/setting-sound.h index fb89b2d..326ecc1 100644 --- a/include/setting-sound.h +++ b/include/setting-sound.h @@ -24,6 +24,7 @@ #include <player.h> #include <sound_manager.h> +#include <sound_manager_internal.h> #ifdef FEATURE_SETTING_TELEPHONY #define ITEM_SIZE 5 diff --git a/include/setting-vibration.h b/include/setting-vibration.h index 8ec04b4..b41b290 100644 --- a/include/setting-vibration.h +++ b/include/setting-vibration.h @@ -30,6 +30,7 @@ #include <player.h> #include <sound_manager.h> +#include <sound_manager_internal.h> char *_gl_vibration_title_get(void *data, Evas_Object *obj, const char *part); diff --git a/include/setting-volume.h b/include/setting-volume.h index da51c25..bcf12de 100644 --- a/include/setting-volume.h +++ b/include/setting-volume.h @@ -22,6 +22,7 @@ #include <libintl.h> #include <string.h> #include <sound_manager.h> +#include <sound_manager_internal.h> #include "setting-common-sound.h" diff --git a/src/setting-common-sound.c b/src/setting-common-sound.c index e635932..d2cafb8 100644 --- a/src/setting-common-sound.c +++ b/src/setting-common-sound.c @@ -23,9 +23,9 @@ static player_h player; static int is_player_created = 0; -static sound_type_e _sound_type; +static sound_stream_info_h g_stream_info = NULL; -/*player_prelistening_mode_e _get_prelistening_mode(sound_type_e sound_type); */ +/*player_prelistening_mode_e _get_prelistening_mode(sound_stream_type_e stream_type); */ /** * @return zero on successful @@ -50,6 +50,27 @@ int get_sound_mode() return mode; } + +int get_sound_type(sound_stream_type_e stream_type) +{ + sound_stream_info_h stream_info = NULL; + sound_manager_create_stream_information(stream_type, NULL, NULL, &stream_info); + sound_type_e type; + sound_manager_get_sound_type(stream_info, &type); + sound_manager_destroy_stream_information(stream_info); + return type; +} + +int get_sound_internal_type(sound_stream_type_internal_e stream_type) +{ + sound_stream_info_h stream_info = NULL; + sound_manager_create_stream_information_internal(stream_type, NULL, NULL, &stream_info); + sound_type_e type; + sound_manager_get_sound_type(stream_info, &type); + sound_manager_destroy_stream_information(stream_info); + return type; +} + static void _profile_player_prepare_cb(void *data) { DBG("Player is prepared. Start player"); @@ -90,7 +111,7 @@ int is_player_paused() return ret; } -static int _profile_restart_player(void *data, char *ringtone_file, sound_type_e sound_type, int prelistening_enable) +static int _profile_restart_player(void *data, char *ringtone_file, sound_stream_type_e stream_type, int prelistening_enable) { player_state_e state = -1; int ret = TRUE; @@ -103,17 +124,17 @@ static int _profile_restart_player(void *data, char *ringtone_file, sound_type_e return ret; } #if 0 -player_prelistening_mode_e _get_prelistening_mode(sound_type_e sound_type) +player_prelistening_mode_e _get_prelistening_mode(sound_stream_type_e stream_type) { player_prelistening_mode_e mode = mode = PLAYER_PRELISTENING_MODE_RINGTONE; - switch (sound_type) { - case SOUND_TYPE_MEDIA: + switch (stream_type) { + case SOUND_STREAM_TYPE_MEDIA: mode = PLAYER_PRELISTENING_MODE_MEDIA; break; - case SOUND_TYPE_RINGTONE: + case SOUND_STREAM_TYPE_RINGTONE_CALL: mode = PLAYER_PRELISTENING_MODE_RINGTONE; break; - case SOUND_TYPE_NOTIFICATION: + case SOUND_STREAM_TYPE_NOTIFICATION: mode = PLAYER_PRELISTENING_MODE_NOTIFICATION; break; } @@ -121,11 +142,17 @@ player_prelistening_mode_e _get_prelistening_mode(sound_type_e sound_type) return mode; } #endif -int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, sound_type_e sound_type, int prelistening_enable) +int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, int stream_type, int prelistening_enable) { DBG("Setting - profile_play_sound is started. path: %s", ringtone_file); DBG("Setting - profile_play_sound is creating."); + sound_stream_info_h stream_info = NULL; + if (stream_type == SOUND_STREAM_TYPE_RINGTONE_CALL) + sound_manager_create_stream_information_internal(stream_type, NULL, NULL, &stream_info); + else + sound_manager_create_stream_information(stream_type, NULL, NULL, &stream_info); + int err = 0; err = player_create(&player); if (err != PLAYER_ERROR_NONE) { @@ -135,11 +162,13 @@ int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, sou DBG("Setting - profile_play_sound is setting sound type."); - err = player_set_sound_type(player, sound_type); + + err = player_set_sound_stream_info(player, stream_info); if (err != PLAYER_ERROR_NONE) { - DBG("Setting - error to set sound_type[%d]", err); + DBG("Setting - error to set stream_info[%d]", err); player_destroy(player); is_player_created = 0; + sound_manager_destroy_stream_information(stream_info); return err; } @@ -150,6 +179,7 @@ int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, sou DBG("Setting - error to set attribute---profile_uri[%d]", err); player_destroy(player); is_player_created = 0; + sound_manager_destroy_stream_information(stream_info); return err; } @@ -160,12 +190,13 @@ int profile_play_sound(void *data, void *cb, char *ringtone_file, float vol, sou DBG("Setting - realizing the player handle failed[%d]", err); player_destroy(player); is_player_created = 0; + sound_manager_destroy_stream_information(stream_info); return err; } DBG("Setting - waiting.."); - _sound_type = sound_type; + g_stream_info = stream_info; is_player_created = 1; @@ -202,6 +233,10 @@ int _profile_stop_sound(void *data) } is_player_created = 0; + if (g_stream_info) { + sound_manager_destroy_stream_information(g_stream_info); + g_stream_info = NULL; + } return ret; } @@ -219,7 +254,7 @@ void set_looping(int enable) ERR("player is not created!!"); } -int _close_player(void *data, sound_type_e type) +int _close_player(void *data) { if (is_created_player()) { if (_profile_stop_sound(data)) { @@ -231,24 +266,24 @@ int _close_player(void *data, sound_type_e type) return TRUE; } -void play_sound(char *file_path, float volume, sound_type_e sound_type) +void play_sound(char *file_path, float volume, sound_stream_type_e stream_type) { DBG("Setting - profile_play_sound function start ... : is_created_player() => (%d)", is_created_player()); if (!is_created_player()) { DBG("Setting - profile_play_sound)"); - profile_play_sound(NULL, NULL, file_path, volume, sound_type, TRUE); + profile_play_sound(NULL, NULL, file_path, volume, stream_type, TRUE); set_looping(TRUE); } } -void play_sound_for_sound_mode_setting(char *file_path, float volume, sound_type_e sound_type) +void play_sound_for_sound_mode_setting(char *file_path, float volume, sound_stream_type_e stream_type) { DBG("Setting - play_sound_for_sound_mode_setting function start ..."); if (!is_created_player()) { DBG("Setting - play_sound_for_sound_mode_setting)"); - profile_play_sound(NULL, NULL, file_path, volume, sound_type, FALSE); + profile_play_sound(NULL, NULL, file_path, volume, stream_type, FALSE); set_looping(TRUE); } else { - _profile_restart_player(NULL, file_path, sound_type, FALSE); + _profile_restart_player(NULL, file_path, stream_type, FALSE); } } diff --git a/src/setting-sound.c b/src/setting-sound.c index 567d930..8bb6b9c 100644 --- a/src/setting-sound.c +++ b/src/setting-sound.c @@ -216,7 +216,7 @@ void _stop_player() { DBG("Setting - _stop_player() is called!"); if (is_created_player()) { - _close_player(NULL, cur_sound_type); + _close_player(NULL); } } @@ -734,15 +734,15 @@ static void _sound_mode_gl_cb(void *data, Evas_Object *obj, void *event_info) vconf_set_int(VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, ringtone_level); if (is_created_player()) { - _close_player(NULL, SOUND_TYPE_RINGTONE); + _close_player(NULL); } - play_sound_for_sound_mode_setting(SETTING_DEFAULT_SILENT_OFF_TONE, 0.0, SOUND_TYPE_RINGTONE); + play_sound_for_sound_mode_setting(SETTING_DEFAULT_SILENT_OFF_TONE, 0.0, SOUND_STREAM_TYPE_RINGTONE_CALL); set_looping(FALSE); - sound_manager_get_volume(SOUND_TYPE_RINGTONE, &ringtone_level); + sound_manager_get_volume(SOUND_STREAM_TYPE_RINGTONE_CALL, &ringtone_level); if (ringtone_level == 0) { DBG("Setting - Ringtone volume is 0!! Restore to 1!!"); - sound_manager_set_volume(SOUND_TYPE_RINGTONE, 1); + sound_manager_set_volume(SOUND_STREAM_TYPE_RINGTONE_CALL, 1); } vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, TRUE); @@ -1008,7 +1008,7 @@ static void _ringtone_type_gl_cb(void *data, Evas_Object *obj, void *event_info) ringtone_type = (uintptr_t)data; DBG("ringtone type = %d ", ringtone_type); - play_sound(ringtone_arr[ringtone_type], 0.0, SOUND_TYPE_RINGTONE); + play_sound(ringtone_arr[ringtone_type], 0.0, SOUND_STREAM_TYPE_RINGTONE_CALL); if (g_ringtone_type_genlist) elm_genlist_realized_items_update(g_ringtone_type_genlist); @@ -1070,7 +1070,7 @@ void _show_ringtone_layer_cb(void *data, Evas_Object *obj, void *event_info) /*qsort (ringtone_name_arr, ringtone_count-1, sizeof(char*), cstring_cmp); */ } - cur_sound_type = SOUND_TYPE_RINGTONE; + cur_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; layer = elm_layout_add(ad->nf); @@ -1167,7 +1167,7 @@ static void _response_notification_ok_cb(void *data, Evas_Object *obj, void *eve /*stop_wav(); */ if (is_created_player()) { - _close_player(NULL, SOUND_TYPE_NOTIFICATION); + _close_player(NULL); } /* save a notification type. */ @@ -1210,7 +1210,7 @@ static void _response_notification_cancel_cb(void *data, Evas_Object *obj, void notification_type = confirmed_Notification_type; if (is_created_player()) { - _close_player(NULL, SOUND_TYPE_RINGTONE); + _close_player(NULL); } /*stop_wav(); */ @@ -1263,11 +1263,11 @@ static void _notification_gl_cb(void *data, Evas_Object *obj, void *event_info) #if 0 is_wav_playing = SOUND_STATE_PLAY; - wav_player_start(notification_arr[notification_type], SOUND_TYPE_NOTIFICATION, NULL, (void *)2, &sound_id); + wav_player_start(notification_arr[notification_type], SOUND_STREAM_TYPE_NOTIFICATION, NULL, (void *)2, &sound_id); #endif int volume = 0; - sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &volume); + sound_manager_get_volume(SOUND_STREAM_TYPE_NOTIFICATION, &volume); if (volume == 0 || get_sound_mode() != SOUND_MODE_SOUND) { if (g_app_context) { @@ -1277,7 +1277,7 @@ static void _notification_gl_cb(void *data, Evas_Object *obj, void *event_info) } } } else { - play_sound(notification_arr[notification_type], 0.0, SOUND_TYPE_NOTIFICATION); + play_sound(notification_arr[notification_type], 0.0, SOUND_STREAM_TYPE_NOTIFICATION); set_looping(FALSE); } @@ -1304,7 +1304,7 @@ void _show_notification_popup_cb(void *data, Evas_Object *obj, void *event_info) /*sorting_file_list(0); */ } - cur_sound_type = SOUND_TYPE_NOTIFICATION; + cur_sound_type = SOUND_STREAM_TYPE_NOTIFICATION; popup = elm_layout_add(ad->win_main); elm_layout_file_set(popup, EDJE_PATH, "setting/genlist/2button-layout"); diff --git a/src/setting-volume-page.c b/src/setting-volume-page.c index f1ed5a9..413302d 100644 --- a/src/setting-volume-page.c +++ b/src/setting-volume-page.c @@ -74,7 +74,7 @@ static char *vconf_name[VOLUME_LIST_COUNT] = { EAPI Evas_Object *elm_widget_top_get(const Evas_Object *obj); -static void _set_volumn(sound_type_e type, int volume_index, char *vconf_key); +static void _set_volumn(sound_stream_type_e type, int volume_index, char *vconf_key); /*static void _change_to_vibrate_mode(); */ static void _play_sound_all_type(int sound_type, float volume); @@ -128,7 +128,7 @@ multimedia_value_changed_page(int idx) volume_index = idx; DBG("Setting - volume_index : %d", volume_index); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { if (!is_play_media_sound) { _play_sound_all_type(curr_sound_type, 0.0); is_play_media_sound = 0; @@ -167,10 +167,10 @@ void _initialize_volume() is_vibrate_changed = 0; is_play_media_sound = 0; - curr_sound_type = SOUND_TYPE_RINGTONE; + curr_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; if (is_created_player()) { - _close_player(NULL, SOUND_TYPE_RINGTONE); + _close_player(NULL); } } @@ -197,7 +197,7 @@ void _stop_all_volume_sound() DBG("Setting - stop all volume sound."); if (is_created_player()) { - _close_player(NULL, curr_sound_type); + _close_player(NULL); } stop_wav(); @@ -208,7 +208,7 @@ void _clear_volume_resources() DBG("Setting - _clear_volume_resources()"); if (is_created_player()) { - _close_player(NULL, curr_sound_type); + _close_player(NULL); } stop_wav(); @@ -358,7 +358,7 @@ _scroll(void *data, Evas_Object *obj, void *ei) _index_sync(pd); if (is_created_player()) { - _close_player(g_ad, curr_sound_type); + _close_player(g_ad); } stop_wav(); @@ -372,16 +372,16 @@ _scroll(void *data, Evas_Object *obj, void *ei) } switch (page_idx) { case 0: /*ringtone*/ - curr_sound_type = SOUND_TYPE_RINGTONE; + curr_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; break; case 1: /*media */ - curr_sound_type = SOUND_TYPE_MEDIA; + curr_sound_type = SOUND_STREAM_TYPE_MEDIA; break; case 2: /*nodification */ - curr_sound_type = SOUND_TYPE_NOTIFICATION; + curr_sound_type = SOUND_STREAM_TYPE_NOTIFICATION; break; case 3: /*system */ - curr_sound_type = SOUND_TYPE_SYSTEM; + curr_sound_type = SOUND_STREAM_TYPE_SYSTEM; break; default: break; @@ -514,7 +514,7 @@ void _clear_volume_setting_cb(void *data, Evas_Object *obj, void *event_info) { if (is_created_player()) { - _close_player(g_ad, curr_sound_type); + _close_player(g_ad); } if (g_ad == NULL) { @@ -916,11 +916,11 @@ Evas_Object *_create_volume_page(void *data) pd->index = index; pd->last_it = pd->it[0]; - curr_sound_type = SOUND_TYPE_RINGTONE; + curr_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; if (!is_telephony_enable()) { /* Ringtone supports only telephony feature */ - curr_sound_type = SOUND_TYPE_MEDIA; + curr_sound_type = SOUND_STREAM_TYPE_MEDIA; } evas_object_event_callback_add(index, EVAS_CALLBACK_MOUSE_DOWN, _on_index_mouse_down_cb, pd); @@ -1163,24 +1163,24 @@ Evas_Object *_media_create_volume_page(void *data) eext_rotary_object_event_activated_set(slider, EINA_TRUE); - curr_sound_type = SOUND_TYPE_MEDIA; + curr_sound_type = SOUND_STREAM_TYPE_MEDIA; return layout; } -static void _set_volumn(sound_type_e type, int volume_index, char *vconf_key) +static void _set_volumn(sound_stream_type_e type, int volume_index, char *vconf_key) { DBG("Setting - set_volume() is called!"); int err = -1; - err = sound_manager_set_volume(type, volume_index); + err = sound_manager_set_volume(get_sound_type(type), volume_index); /* save system vulume value */ if (err == SOUND_MANAGER_ERROR_NONE) { int vret = vconf_set_int(vconf_key, volume_index); DBG(" ret = %d , %s :: %d ", vret, vconf_key, volume_index); - if (curr_sound_type == SOUND_TYPE_RINGTONE) { + if (curr_sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Ringtone volume is changed....!"); if (volume_index == 0 && get_sound_mode() == SOUND_MODE_SOUND) { @@ -1205,7 +1205,7 @@ static void _play_sound_all_type(int sound_type, float volume) const char *sound_path = NULL; int temp_volume_index = 0; switch (sound_type) { - case SOUND_TYPE_RINGTONE: + case SOUND_STREAM_TYPE_RINGTONE_CALL: temp_volume_index = volume_index; int ret_vconf = vconf_set_int(VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, temp_volume_index); @@ -1223,12 +1223,12 @@ static void _play_sound_all_type(int sound_type, float volume) } break; - case SOUND_TYPE_MEDIA: + case SOUND_STREAM_TYPE_MEDIA: _set_volumn(sound_type, volume_index, VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT); snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_MEDIA_TONE); break; - case SOUND_TYPE_NOTIFICATION: + case SOUND_STREAM_TYPE_NOTIFICATION: vconf_set_int(VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT, volume_index); temp_volume_index = volume_index; @@ -1239,7 +1239,7 @@ static void _play_sound_all_type(int sound_type, float volume) snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_MSG_TONE); } break; - case SOUND_TYPE_SYSTEM: + case SOUND_STREAM_TYPE_SYSTEM: vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT, volume_index); snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_SYS_TONE); @@ -1250,17 +1250,17 @@ static void _play_sound_all_type(int sound_type, float volume) int err = -1; - if (sound_type == SOUND_TYPE_RINGTONE) { + if (sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Setting - ringtone safety volume!!"); DBG("Setting - real volume : %d", temp_volume_index); - sound_manager_set_volume(sound_type, temp_volume_index); - } else if (sound_type == SOUND_TYPE_NOTIFICATION) { + sound_manager_set_volume(get_sound_internal_type(sound_type), temp_volume_index); + } else if (sound_type == SOUND_STREAM_TYPE_NOTIFICATION) { ERR("Setting - notification safety volume!!"); - sound_manager_set_volume(sound_type, temp_volume_index); + sound_manager_set_volume(get_sound_type(sound_type), temp_volume_index); } else { ERR("Setting - normal volume!! ----- volume_index : %d ", volume_index); - err = sound_manager_set_volume(sound_type, volume_index); + err = sound_manager_set_volume(get_sound_type(sound_type), volume_index); if (err != SOUND_MANAGER_ERROR_NONE) { ERR("Setting - sound_manager_set_volume() is failed! : %d", err); } diff --git a/src/setting-volume.c b/src/setting-volume.c index a243828..84fd4ff 100644 --- a/src/setting-volume.c +++ b/src/setting-volume.c @@ -31,7 +31,7 @@ static struct _volume_menu_item volume_menu_its[] = { { NULL, NULL } }; -static void _set_volumn(sound_type_e type, int volume_index, char *vconf_key); +static void _set_volumn(sound_stream_type_e type, int volume_index, char *vconf_key); /*static void _change_to_vibrate_mode(); */ static void vibrate_vconf_changed_cb(keynode_t *key, void *data); static void sound_vconf_changed_cb(keynode_t *key, void *data); @@ -67,7 +67,7 @@ multimedia_value_changed(void *data, Evas_Object *obj, void *event_info) DBG(">>>>>>>>>>>>>>>>>>>>>>>>>>> Slider value = %s", buf); elm_object_text_set(label, buf); - if (curr_sound_type != SOUND_TYPE_MEDIA) { + if (curr_sound_type != SOUND_STREAM_TYPE_MEDIA) { if (is_changing_level_by_vconf) { DBG("Setting - is_changing_level_by_vconf!!!!"); @@ -86,7 +86,7 @@ multimedia_value_changed(void *data, Evas_Object *obj, void *event_info) DBG("Setting - volume_index : %d", volume_index); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { if (!is_play_media_sound) { _play_sound_all_type(curr_sound_type, 0.0); is_play_media_sound = 0; @@ -114,7 +114,7 @@ ringtone_value_changed(void *data, Evas_Object *obj, void *event_info) if (get_sound_mode() == SOUND_MODE_SOUND) { elm_object_text_set(label, buf); - if (curr_sound_type != SOUND_TYPE_MEDIA) { + if (curr_sound_type != SOUND_STREAM_TYPE_MEDIA) { if (is_changing_level_by_vconf) { DBG("Setting - is_changing_level_by_vconf!!!!"); @@ -133,7 +133,7 @@ ringtone_value_changed(void *data, Evas_Object *obj, void *event_info) DBG("Setting - volume_index : %d", volume_index); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { if (!is_play_media_sound) { _play_sound_all_type(curr_sound_type, 0.0); is_play_media_sound = 0; @@ -196,10 +196,10 @@ void _initialize_volume() is_vibrate_changed = 0; is_play_media_sound = 0; - curr_sound_type = SOUND_TYPE_RINGTONE; + curr_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; if (is_created_player()) { - _close_player(NULL, SOUND_TYPE_RINGTONE); + _close_player(NULL); } } @@ -226,7 +226,7 @@ void _stop_all_volume_sound() DBG("Setting - stop all volume sound."); if (is_created_player()) { - _close_player(NULL, curr_sound_type); + _close_player(NULL); } stop_wav(); @@ -237,7 +237,7 @@ void _clear_volume_resources() DBG("Setting - _clear_volume_resources()"); if (is_created_player()) { - _close_player(NULL, curr_sound_type); + _close_player(NULL); } stop_wav(); @@ -264,7 +264,7 @@ static void _update_volume_popup_for_changing_sound_mode() if (sound_mode == SOUND_MODE_VIBRATE) { DBG("Setting - vibrate!!!"); - if (curr_sound_type == SOUND_TYPE_RINGTONE) { + if (curr_sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { volume_index = 0; } elm_spinner_value_set(g_volume_spinner, 0); @@ -276,8 +276,8 @@ static void _update_volume_popup_for_changing_sound_mode() edje_object_part_drag_value_set(elm_layout_edje_get(g_volume_spinner), "elm.dragable.slider", 0, 0); edje_object_signal_emit(elm_layout_edje_get(g_volume_spinner), "elm,spinner,vibrate", "elm"); - if (curr_sound_type == SOUND_TYPE_NOTIFICATION || - curr_sound_type == SOUND_TYPE_SYSTEM) { + if (curr_sound_type == SOUND_STREAM_TYPE_NOTIFICATION || + curr_sound_type == SOUND_STREAM_TYPE_SYSTEM) { DBG("current_sound_type!!"); elm_object_disabled_set(g_volume_spinner, EINA_TRUE); @@ -299,18 +299,18 @@ static void _update_volume_popup_for_changing_sound_mode() } else { DBG("Setting - Mute!!!"); - if (curr_sound_type == SOUND_TYPE_NOTIFICATION || - curr_sound_type == SOUND_TYPE_SYSTEM) { + if (curr_sound_type == SOUND_STREAM_TYPE_NOTIFICATION || + curr_sound_type == SOUND_STREAM_TYPE_SYSTEM) { elm_object_disabled_set(g_volume_spinner, EINA_FALSE); edje_object_signal_emit(elm_layout_edje_get(g_volume_spinner), "elm,spinner,min", "elm"); edje_object_part_drag_value_set(elm_layout_edje_get(g_volume_spinner), "elm.dragable.slider", 0, 0); elm_object_disabled_set(g_volume_spinner, EINA_TRUE); - } else if (curr_sound_type == SOUND_TYPE_RINGTONE) { + } else if (curr_sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { _stop_all_volume_sound(); - if (curr_sound_type == SOUND_TYPE_RINGTONE) { + if (curr_sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { volume_index = 0; } elm_spinner_value_set(g_volume_spinner, 0); @@ -327,7 +327,7 @@ static void sound_vconf_changed_cb(keynode_t *key, void *data) { DBG("Setting - sound_vconf_changed_cb() is called!!"); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { return; } @@ -348,7 +348,7 @@ static void vibrate_vconf_changed_cb(keynode_t *key, void *data) { DBG("Setting - vibrate_vconf_changed_cb() is called!!"); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { return; } @@ -378,11 +378,11 @@ static void pm_state_vconf_changed_cb_for_volume(keynode_t *key, void *data) } } -static void _rigngtone_volume_changed_cb(sound_type_e type, unsigned int volume, void *user_data) +static void _rigngtone_volume_changed_cb(sound_stream_type_e type, unsigned int volume, void *user_data) { DBG("Setting - _rigngtone_volume_changed_cb() is called!"); - if (type != SOUND_TYPE_RINGTONE) { + if (type != SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Setting - sound_type is not media!!"); return; } @@ -403,11 +403,11 @@ static void _rigngtone_volume_changed_cb(sound_type_e type, unsigned int volume, } } -static void _media_volume_changed_cb(sound_type_e type, unsigned int volume, void *user_data) +static void _media_volume_changed_cb(sound_stream_type_e type, unsigned int volume, void *user_data) { DBG("Setting - _media_volume_changed_cb() is called!"); - if (type == SOUND_TYPE_RINGTONE) { + if (type == SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Setting - sound_type is ringtone!!"); return; } @@ -568,16 +568,16 @@ static void _set_cancel_cb(void *data, Evas_Object *obj, void *event_info) char vconf_key[512] = {0,}; switch (curr_sound_type) { - case SOUND_TYPE_MEDIA: + case SOUND_STREAM_TYPE_MEDIA: strncpy(vconf_key, VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT, 512); break; - case SOUND_TYPE_RINGTONE: + case SOUND_STREAM_TYPE_RINGTONE_CALL: strncpy(vconf_key, VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, 512); break; - case SOUND_TYPE_SYSTEM: + case SOUND_STREAM_TYPE_SYSTEM: strncpy(vconf_key, VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT, 512); break; - case SOUND_TYPE_NOTIFICATION: + case SOUND_STREAM_TYPE_NOTIFICATION: strncpy(vconf_key, VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT, 512); break; } @@ -593,7 +593,7 @@ static void _set_cancel_cb(void *data, Evas_Object *obj, void *event_info) /*original_volume = 0; */ if (is_created_player()) { - _close_player(ad, curr_sound_type); + _close_player(ad); } stop_wav(); @@ -613,7 +613,7 @@ static void _back_volume_naviframe_cb(void *data, Evas *e, Evas_Object *obj, voi } if (is_created_player()) { - _close_player(data, curr_sound_type); + _close_player(data); } g_volume_spinner = NULL; @@ -633,7 +633,7 @@ static void _back_volume_naviframe_cb(void *data, Evas *e, Evas_Object *obj, voi return; } -static void _set_volumn(sound_type_e type, int volume_index, char *vconf_key) +static void _set_volumn(sound_stream_type_e type, int volume_index, char *vconf_key) { DBG("Setting - set_volume() is called!"); @@ -645,7 +645,7 @@ static void _set_volumn(sound_type_e type, int volume_index, char *vconf_key) int vret = vconf_set_int(vconf_key, volume_index); DBG(" ret = %d , %s :: %d ", vret, vconf_key, volume_index); - if (curr_sound_type == SOUND_TYPE_RINGTONE) { + if (curr_sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Ringtone volume is changed....!"); if (volume_index == 0 && get_sound_mode() == SOUND_MODE_SOUND) { @@ -676,11 +676,11 @@ static void _set_multimedia_clicked_cb(void *data, Evas_Object *obj, void *event } /* save multimedia vulume value */ - _set_volumn(SOUND_TYPE_MEDIA, volume_index, VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT); + _set_volumn(SOUND_STREAM_TYPE_MEDIA, volume_index, VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT); if (is_created_player()) { - _close_player(ad, curr_sound_type); + _close_player(ad); } stop_wav(); @@ -700,7 +700,7 @@ static void _play_sound_all_type(int sound_type, float volume) const char *sound_path = NULL; int temp_volume_index = 0; switch (sound_type) { - case SOUND_TYPE_RINGTONE: + case SOUND_STREAM_TYPE_RINGTONE_CALL: temp_volume_index = volume_index; vconf_set_int(VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, temp_volume_index); @@ -714,12 +714,12 @@ static void _play_sound_all_type(int sound_type, float volume) } break; - case SOUND_TYPE_MEDIA: + case SOUND_STREAM_TYPE_MEDIA: _set_volumn(sound_type, volume_index, VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT); snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_MEDIA_TONE); break; - case SOUND_TYPE_NOTIFICATION: + case SOUND_STREAM_TYPE_NOTIFICATION: vconf_set_int(VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT, volume_index); temp_volume_index = volume_index; @@ -730,7 +730,7 @@ static void _play_sound_all_type(int sound_type, float volume) snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_MSG_TONE); } break; - case SOUND_TYPE_SYSTEM: + case SOUND_STREAM_TYPE_SYSTEM: vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT, volume_index); snprintf(buf, sizeof(buf)-1, "%s", SETTING_DEFAULT_SYS_TONE); @@ -743,12 +743,12 @@ static void _play_sound_all_type(int sound_type, float volume) int err = -1; - if (sound_type == SOUND_TYPE_RINGTONE) { + if (sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { DBG("Setting - ringtone safety volume!!"); DBG("Setting - real volume : %d", temp_volume_index); sound_manager_set_volume(sound_type, temp_volume_index); - } else if (sound_type == SOUND_TYPE_NOTIFICATION) { + } else if (sound_type == SOUND_STREAM_TYPE_NOTIFICATION) { DBG("Setting - notification safety volume!!"); sound_manager_set_volume(sound_type, temp_volume_index); } else { @@ -759,19 +759,19 @@ static void _play_sound_all_type(int sound_type, float volume) } } - if (sound_type == SOUND_TYPE_RINGTONE) { + if (sound_type == SOUND_STREAM_TYPE_RINGTONE_CALL) { if (!is_created_player() || is_player_paused()) { - play_sound(buf, volume, SOUND_TYPE_RINGTONE); + play_sound(buf, volume, SOUND_STREAM_TYPE_RINGTONE_CALL); set_looping(TRUE); } is_myself_ringtone_changing = 1; - } else if (sound_type == SOUND_TYPE_SYSTEM || sound_type == SOUND_TYPE_MEDIA) { + } else if (sound_type == SOUND_STREAM_TYPE_SYSTEM || sound_type == SOUND_STREAM_TYPE_MEDIA) { - play_sound(buf, volume, SOUND_TYPE_SYSTEM); + play_sound(buf, volume, SOUND_STREAM_TYPE_SYSTEM); set_looping(FALSE); return; - } else if (sound_type == SOUND_TYPE_NOTIFICATION) { - play_sound(buf, volume, SOUND_TYPE_NOTIFICATION); + } else if (sound_type == SOUND_STREAM_TYPE_NOTIFICATION) { + play_sound(buf, volume, SOUND_STREAM_TYPE_NOTIFICATION); set_looping(FALSE); return; @@ -783,7 +783,7 @@ static void _change_to_vibrate_mode() { DBG("Setting - _change_to_vibrate_mode() is called!"); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { return; } @@ -805,7 +805,7 @@ static void _change_to_sound_mode() { DBG("Setting - _change_to_sound_mode() is called!"); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { return; } @@ -845,7 +845,7 @@ static void _update_volume_circle(Evas_Object *spiner) edje_object_signal_emit(elm_layout_edje_get(spiner), "elm,spinner,default", "elm"); if (idx == min) { edje_object_signal_emit(elm_layout_edje_get(spiner), "elm,spinner,min", "elm"); - if (curr_sound_type != SOUND_TYPE_MEDIA && get_sound_mode() == SOUND_MODE_VIBRATE) { + if (curr_sound_type != SOUND_STREAM_TYPE_MEDIA && get_sound_mode() == SOUND_MODE_VIBRATE) { edje_object_signal_emit(elm_layout_edje_get(spiner), "elm,spinner,vibrate", "elm"); } } @@ -936,7 +936,7 @@ static void _on_media_volume_spinner_change_cb(void *data, Evas_Object *obj, voi { DBG("Setting - _on_media_volume_spinner_change_cb() is called!"); - if (curr_sound_type != SOUND_TYPE_MEDIA) { + if (curr_sound_type != SOUND_STREAM_TYPE_MEDIA) { if (is_changing_level_by_vconf) { DBG("Setting - is_changing_level_by_vconf!!!!"); @@ -956,7 +956,7 @@ static void _on_media_volume_spinner_change_cb(void *data, Evas_Object *obj, voi DBG("Setting - volume_index : %d", volume_index); - if (curr_sound_type == SOUND_TYPE_MEDIA) { + if (curr_sound_type == SOUND_STREAM_TYPE_MEDIA) { if (!is_play_media_sound) { _play_sound_all_type(curr_sound_type, 0.0); is_play_media_sound = 0; @@ -1004,12 +1004,12 @@ void _show_multimedia_popup(void *data, Evas_Object *obj, void *event_info) original_sound_mode = get_sound_mode(); - curr_sound_type = SOUND_TYPE_MEDIA; + curr_sound_type = SOUND_STREAM_TYPE_MEDIA; vconf_get_int(VCONFKEY_SETAPPL_MEDIA_SOUND_VOLUME_INT, &volume_index); int real_volume_index = 0; - sound_manager_get_volume(SOUND_TYPE_MEDIA, &real_volume_index); + sound_manager_get_volume(SOUND_STREAM_TYPE_MEDIA, &real_volume_index); DBG("Setting - vconf vol: %d, real vol: %d", volume_index, real_volume_index); @@ -1087,10 +1087,10 @@ static void _set_ringtone_clicked_cb(void *data, Evas_Object *obj, void *event_i } /* save ringtone vulume value */ - _set_volumn(SOUND_TYPE_RINGTONE, volume_index, VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT); + _set_volumn(SOUND_STREAM_TYPE_RINGTONE_CALL, volume_index, VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT); if (is_created_player()) { - _close_player(ad, curr_sound_type); + _close_player(ad); } stop_wav(); @@ -1110,7 +1110,7 @@ void _show_ringtone_popup(void *data, Evas_Object *obj, void *event_info) original_sound_mode = get_sound_mode(); - curr_sound_type = SOUND_TYPE_RINGTONE; + curr_sound_type = SOUND_STREAM_TYPE_RINGTONE_CALL; vconf_get_int(VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT, &volume_index); @@ -1119,7 +1119,7 @@ void _show_ringtone_popup(void *data, Evas_Object *obj, void *event_info) sound_mode = get_sound_mode(); int real_volume_index = 0; - sound_manager_get_volume(SOUND_TYPE_RINGTONE, &real_volume_index); + sound_manager_get_volume(SOUND_STREAM_TYPE_RINGTONE_CALL, &real_volume_index); int virtual_index = real_volume_index; @@ -1219,10 +1219,10 @@ static void _set_notification_clicked_cb(void *data, Evas_Object *obj, void *eve return; } - _set_volumn(SOUND_TYPE_NOTIFICATION, volume_index, VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT); + _set_volumn(SOUND_STREAM_TYPE_NOTIFICATION, volume_index, VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT); if (is_created_player()) { - _close_player(ad, curr_sound_type); + _close_player(ad); } stop_wav(); @@ -1242,7 +1242,7 @@ void _show_notification_popup(void *data, Evas_Object *obj, void *event_info) original_sound_mode = get_sound_mode(); - curr_sound_type = SOUND_TYPE_NOTIFICATION; + curr_sound_type = SOUND_STREAM_TYPE_NOTIFICATION; vconf_get_int(VCONFKEY_SETAPPL_NOTI_SOUND_VOLUME_INT, &volume_index); @@ -1250,7 +1250,7 @@ void _show_notification_popup(void *data, Evas_Object *obj, void *event_info) sound_mode = get_sound_mode(); int real_volume_index = 0; - sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &real_volume_index); + sound_manager_get_volume(SOUND_STREAM_TYPE_NOTIFICATION, &real_volume_index); int virtual_index = real_volume_index; @@ -1353,10 +1353,10 @@ static void _set_system_clicked_cb(void *data, Evas_Object *obj, void *event_inf } /* save system vulume value */ - _set_volumn(SOUND_TYPE_SYSTEM, volume_index, VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT); + _set_volumn(SOUND_STREAM_TYPE_SYSTEM, volume_index, VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT); if (is_created_player()) { - _close_player(ad, curr_sound_type); + _close_player(ad); } stop_wav(); @@ -1377,7 +1377,7 @@ void _show_system_popup(void *data, Evas_Object *obj, void *event_info) original_sound_mode = get_sound_mode(); - curr_sound_type = SOUND_TYPE_SYSTEM; + curr_sound_type = SOUND_STREAM_TYPE_SYSTEM; vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_SOUND_VOLUME_INT, &volume_index); @@ -1385,7 +1385,7 @@ void _show_system_popup(void *data, Evas_Object *obj, void *event_info) sound_mode = get_sound_mode(); int real_volume_index = 0; - sound_manager_get_volume(SOUND_TYPE_SYSTEM, &real_volume_index); + sound_manager_get_volume(SOUND_STREAM_TYPE_SYSTEM, &real_volume_index); int virtual_index = real_volume_index; |