#include <metadata_extractor.h>
#include <player.h>
+/*resolve P130805-7070 */
+#define SETTING_DEFAULT_FOLDER_PATH _TZ_SYS_SHARE"/settings/"
+#define SDCARD_PATH _TZ_SYS_MEDIA"/sdcard/"
+#define EXP 0.001
+
typedef struct _SliderIcons {
int index;
char mute[256];
/*{SND_SLIDER_MAX, "", ""} */
};
+static void __mm_player_prepared_cb(void *user_data);
static void __sound_stream_focus_state_changed_cb(
sound_stream_info_h stream_info,
sound_stream_focus_mask_e focus_mask,
int sound_behavior,
const char *extra_info,
void *user_data);
+static Eina_Bool __volume_key_down_cb(void *data, int type, void *event);
+static Eina_Bool __volume_key_up_cb(void *data, int type, void *event);
+static Evas_Object *__sound_slider_icon_get(void *data, Evas_Object *obj,
+ const char *part);
+static int __listen_vconf_change(void *data);
+static int __unlisten_vconf_change(void *data);
+static void __calling_popup_cb(void *data, Evas_Object *obj, void *event_info);
void setting_sound_update_do_not_disturb_item(void *data)
{
return setting_file_basename(path);
}
-/* ------------------------------------------------------------------------- */
-/* | | elm.swallow.icon.0 | elm.text | elm.swallow.icon.1 | | */
-/* | elm.swallow.icon |----------------------------------| elm.swallow.end | */
-/* | | elm.text.sub | elm.text.sub.end | | */
-/* ------------------------------------------------------------------------- */
-static Evas_Object *__sound_slider_icon_get(
- void *data, Evas_Object *obj, const char *part)
-{
- SETTING_TRACE_BEGIN;
- /*appcore_measure_start(); */
- retv_if(data == NULL, NULL);
-
- SETTING_TRACE(" -----------------> EDC part [%s]", part);
- if (safeStrCmp(part, "elm.swallow.content"))
- return NULL;
-
- Evas_Object *layout;
- /* Set custom layout style */
- layout = elm_layout_add(obj);
-
- Setting_GenGroupItem_Data *item_data =
- (Setting_GenGroupItem_Data *)data;
- Evas_Object *slider = setting_create_slider(obj, item_data);
-
- if (slider == NULL)
- return NULL;
-
- char *gl_style = "gl_custom_item";
- elm_layout_file_set(layout, EDJDIR"/setting-theme.edj", gl_style);
- evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
-
- if (0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_MEDIA")) {
- elm_object_style_set(slider, "warning");
-
- Edje_Message_Float_Set *msg =
- alloca(sizeof(Edje_Message_Float_Set)
- + (sizeof(double)));
- msg->count = 1;
- /* Warning area point has to be calculated considering rounding
- * off. For example, value 10's area will be 9.5~10.4.
- * So, if warning area has to be started at 10, we need to
- * calculate the start point with 9.5.
- * Warning start point = (Warning min value - 0.5) /
- * (Max_Value - Min_Value) */
- msg->val[0] = 0.633333;
- edje_object_message_send(
- _EDJ(slider), EDJE_MESSAGE_FLOAT_SET, 0, msg);
- elm_slider_indicator_format_set(slider, "%1.0f");
- elm_slider_indicator_show_set(slider, 1);
- }
-
- item_data->eo_check = slider;
-
- evas_object_pass_events_set(slider, EINA_TRUE);
- evas_object_propagate_events_set(slider, EINA_FALSE);
-
- if (item_data->userdata == NULL)
- return NULL;
-
- /* Set text into layout */
- /*if (0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_MEDIA") */
- /* || 0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_SYSTEM"))
- * { */
- elm_object_part_text_set(layout, "elm.text", _(item_data->keyStr));
- /*} */
- elm_object_part_content_set(layout, "elm.swallow.content", slider);
- return layout;
-}
-
/* ***************************************************
*
*general func
*
***************************************************/
-/*resolve P130805-7070 */
-#define SETTING_DEFAULT_FOLDER_PATH _TZ_SYS_SHARE"/settings/"
-#define SDCARD_PATH _TZ_SYS_MEDIA"/sdcard/"
-
int setting_sound_check_file_exist(void *data, const char *file_path)
{
retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
retv_if(file_path == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
/*resolve P130805-7070 */
- if (0 == safeStrNCmp(
- file_path,
+ if (0 == safeStrNCmp(file_path,
SETTING_DEFAULT_FOLDER_PATH,
safeStrLen(SETTING_DEFAULT_FOLDER_PATH))) {
SETTING_TRACE("Default file[%s]!", file_path);
return SETTING_RETURN_SUCCESS;
}
-static void __enable_sound_menu(void *data)
+bool setting_sound_play_sound(
+ void *data,
+ void *cb,
+ char *ringtone_file,
+ int vol,
+ sound_type_e sound_type)
{
- SETTING_TRACE_BEGIN;
- ret_if(!data);
- SettingSoundData *ad = data;
- ad->sound_on = TRUE;
- Setting_GenGroupItem_Data *item_to_update = NULL;
+ int err = 0;
+ sound_stream_focus_state_e ssfs = SOUND_STREAM_FOCUS_STATE_ACQUIRED;
+ player_state_e state = PLAYER_STATE_NONE;
+ /* error check */
+ retv_if(data == NULL, NULL);
+ SettingSoundData *ad = (SettingSoundData *) data;
+ sound_stream_info_h sound_stream_info_to_set = NULL;
+ int is_existing = setting_sound_check_file_exist(ad, ringtone_file);
- /*1.Enable "Vibrate when ringing" */
- if (ad->data_sound_when_ring) {
- item_to_update = ad->data_sound_when_ring;
- setting_genlist_item_disabled_set(item_to_update, EINA_FALSE);
- }
+ if (is_existing == SETTING_RETURN_FAIL || NULL == ringtone_file) {
+ switch (sound_type) {
+ case SOUND_TYPE_RINGTONE:
+ if (isEmulBin())
+ ad->song_playing = (char *)g_strdup(
+ SETTING_DEFAULT_CALL_TONE_SDK);
+ else
+ ad->song_playing = (char *)g_strdup(
+ SETTING_DEFAULT_CALL_TONE);
+ sound_stream_info_to_set =
+ ad->ringtone_sound_stream_info;
+ break;
+ case SOUND_TYPE_MEDIA:
+ if (isEmulBin())
+ ad->song_playing = (char *)g_strdup(
+ SETTING_DEFAULT_CALL_TONE_SDK);
+ else
+ ad->song_playing = (char *)g_strdup(
+ SETTING_DEFAULT_MEDIA_TONE);
+ sound_stream_info_to_set = ad->media_sound_stream_info;
+ break;
+ case SOUND_TYPE_NOTIFICATION:
+ ad->song_playing = (char *)g_strdup(
+ SETTING_DEFAULT_MSG_TONE);
+ sound_stream_info_to_set = ad->noti_sound_stream_info;
+ break;
+ default:
+ return false;
+ break;
+ }
- if (ad->data_call_volume) {
- elm_object_item_disabled_set(ad->data_call_volume->item,
- EINA_FALSE);
- elm_object_disabled_set(ad->data_call_volume->eo_check,
- EINA_FALSE);
+ } else {
+ if (safeStrCmp(ringtone_file, "Silent") == 0)
+ return false;
+
+ switch (sound_type) {
+ case SOUND_TYPE_RINGTONE:
+ sound_stream_info_to_set =
+ ad->ringtone_sound_stream_info;
+ break;
+ case SOUND_TYPE_MEDIA:
+ sound_stream_info_to_set = ad->media_sound_stream_info;
+ break;
+ case SOUND_TYPE_NOTIFICATION:
+ sound_stream_info_to_set = ad->noti_sound_stream_info;
+ break;
+ default:
+ return false;
+ break;
+ }
+ ad->song_playing = (char *)g_strdup(ringtone_file);
}
- /*2.Enable "Notification", via Sound Manager */
- item_to_update = ad->data_noti_volume;
+ player_get_state(ad->mp_player, &state);
+ if (state != PLAYER_STATE_IDLE) {
+ if (err != player_unprepare(ad->mp_player)) {
+ SETTING_TRACE_ERROR("player_unprepare() failed: [%s]",
+ get_error_message(err));
+ player_unprepare(ad->mp_player);
+ return false;
- /* @todo make sure data_msg_alert_tone is correct for 'Silent' set.
- if (item_to_update && safeStrCmp(item_to_update->sub_desc, "Silent"))*/
- if ((ad->data_msg_alert_tone &&
- safeStrCmp(ad->data_msg_alert_tone->sub_desc, "Silent")) ||
- (!safeStrCmp(ad->viewtype, VOLUME_APP_NAME))
- ) {
- //Enable
- if (item_to_update
- && item_to_update->item
- && item_to_update->eo_check) {
- int mm_value = 0;
- int ret = sound_manager_get_volume(
- SOUND_TYPE_NOTIFICATION, &mm_value);
- SETTING_TRACE("ret:%d", ret);
- item_to_update->chk_status = mm_value;
- elm_slider_value_set(
- item_to_update->eo_check,
- item_to_update->chk_status);
- elm_object_item_disabled_set(item_to_update->item,
- EINA_FALSE);
- elm_object_disabled_set(item_to_update->eo_check,
- EINA_FALSE);
+ }
+ }
- setting_sound_update_slider_icon(
- item_to_update, SND_SLIDER_NOTI);
+ if (sound_type != SOUND_TYPE_NOTIFICATION) {
+ sound_manager_get_focus_state(sound_stream_info_to_set, &ssfs,
+ NULL);
+ if (ssfs == SOUND_STREAM_FOCUS_STATE_RELEASED) {
+ err = sound_manager_acquire_focus(
+ sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ if (err != SOUND_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR(
+ "Could not acquire focus: [%s]",
+ get_error_message(err));
+ player_unprepare(ad->mp_player);
+ return false;
+ }
}
}
- /*3.Enable "System", via Sound Manager */
- item_to_update = ad->data_touch_volume;
- if (item_to_update && item_to_update->item
- && item_to_update->eo_check) {
- int mm_value = 0;
- int ret = sound_manager_get_volume(
- SOUND_TYPE_SYSTEM, &mm_value);
- SETTING_TRACE("ret:%d", ret);
- item_to_update->chk_status = mm_value;
- elm_slider_value_set(
- item_to_update->eo_check,
- item_to_update->chk_status);
- elm_object_item_disabled_set(
- item_to_update->item, EINA_FALSE);
- elm_object_disabled_set(item_to_update->eo_check, EINA_FALSE);
+ player_get_state(ad->mp_player, &state);
+ if (state != PLAYER_STATE_IDLE)
+ player_unprepare(ad->mp_player);
- setting_sound_update_slider_icon(
- item_to_update, SND_SLIDER_SYSTEM);
+ err = player_set_audio_policy_info(ad->mp_player, sound_stream_info_to_set);
+ if (err != PLAYER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("error to set audio policy [%s]",
+ get_error_message(err));
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
}
+ err = player_set_uri(ad->mp_player, ad->song_playing);
+ if (err != PLAYER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("error to set attribute---profile_uri[%s]",
+ get_error_message(err));
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
+ }
- /*4.Enable "Call ringtone", via "Backuped" value */
- item_to_update = ad->data_call_volume;
- if (item_to_update && item_to_update->eo_check) {
- SETTING_TRACE("....ad->is_ringtone_slidering:%d, "
- "ad->data_call_volume->chk_status:%d",
- ad->is_ringtone_slidering,
- item_to_update->chk_status);
- /* do need to restore from BACKUP VOLUME */
+#if SUPPORT_PLAYER_ASYNC
+ err = player_prepare_async(ad->mp_player, __mm_player_prepared_cb, ad);
+ if (err != PLAYER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("realizing the player handle failed[%s]",
+ get_error_message(err));
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
+ }
+ ad->mp_prepare_async = ad->mp_player;
+ SETTING_TRACE("waiting..player (%x)", ad->mp_prepare_async);
+#else
+ err = player_prepare(ad->mp_player);
+ if (err != PLAYER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("player_prepare() error %d", err);
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
+ }
+
+ state = PLAYER_STATE_NONE;
+ err = player_get_state(ad->mp_player, &state);
+ SETTING_TRACE("state:%d", state);
+ if (state != PLAYER_STATE_READY) {
+ SETTING_TRACE_ERROR("state of player is invalid %d", err);
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
+ }
+
+ player_set_completed_cb(ad->mp_player, __mm_player_msg_cb, ad);
+
+ err = player_start(ad->mp_player);
+ if (err != PLAYER_ERROR_NONE) {
+ /* if directly return error.. */
+ SETTING_TRACE_ERROR("player_start [%s]",
+ get_error_message(err));
+ player_unset_completed_cb(ad->mp_player);
+ if (sound_type != SOUND_TYPE_NOTIFICATION)
+ sound_manager_release_focus(sound_stream_info_to_set,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+ player_unprepare(ad->mp_player);
+ return false;
+ }
+#endif
+
+ return true;
+}
+
+void setting_sound_play_sound_origin(void *data, void *cb, char *ringtone_file,
+ float vol, sound_type_e sound_type)
+{
+ SETTING_TRACE_BEGIN;
+ int vconf_value = 0;
+ SettingSoundData *ad = (SettingSoundData *) data;
+
+ ret_if(!ad);
+
+ if (vol < EXP) {
+ SETTING_TRACE_DEBUG("vol < EXP");
+ setting_sound_stop_sound(ad);
+ return;
+ }
+
+ vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS,
+ &vconf_value);
+
+ if (vconf_value == TRUE)
+ return;
+
+ setting_sound_play_sound(ad, cb, ringtone_file, vol, sound_type);
+ SETTING_TRACE("play sound type %d", sound_type);
+}
+
+void setting_sound_stop_sound(SettingSoundData *ad)
+{
+ SETTING_TRACE_BEGIN;
+ sound_stream_focus_state_e ssfs = SOUND_STREAM_FOCUS_STATE_ACQUIRED;
+ player_state_e player_state = PLAYER_STATE_NONE;
+
+ if (ad->song_playing) {
+ g_free(ad->song_playing);
+ ad->song_playing = NULL;
+ }
+
+ player_unset_completed_cb(ad->mp_player);
+
+ sound_manager_get_focus_state(ad->ringtone_sound_stream_info, &ssfs, NULL);
+ if (ssfs == SOUND_STREAM_FOCUS_STATE_ACQUIRED)
+ sound_manager_release_focus(ad->ringtone_sound_stream_info,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+
+ sound_manager_get_focus_state(ad->media_sound_stream_info, &ssfs, NULL);
+ if (ssfs == SOUND_STREAM_FOCUS_STATE_ACQUIRED)
+ sound_manager_release_focus(ad->media_sound_stream_info,
+ SOUND_STREAM_FOCUS_FOR_PLAYBACK,
+ SOUND_BEHAVIOR_NONE, NULL);
+
+ player_get_state(ad->mp_player, &player_state);
+
+ if (player_state != PLAYER_STATE_IDLE)
+ if (player_unprepare(ad->mp_player) != PLAYER_ERROR_NONE)
+ SETTING_TRACE_ERROR("player unrealize failed");
+}
+
+void setting_sound_key_grab(SettingSoundData *ad)
+{
+ SETTING_TRACE_BEGIN;
+
+ /* To prevent conflict with volume app */
+ vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 2);
+
+ if (0 != safeStrCmp(ad->viewtype, VOLUME_APP_NAME))
+ return;
+
+ if (!ad->keydown_handler)
+ ad->keydown_handler = ecore_event_handler_add(
+ ECORE_EVENT_KEY_DOWN, __volume_key_down_cb, ad);
+ if (!ad->keydown_handler)
+ SETTING_TRACE_DEBUG("ecore_event_handler_add() failed");
+
+ if (!ad->keyup_handler)
+ ad->keyup_handler = ecore_event_handler_add(
+ ECORE_EVENT_KEY_UP, __volume_key_up_cb, ad);
+ if (!ad->keyup_handler)
+ SETTING_TRACE_DEBUG("ecore_event_handler_add() failed");
+}
+
+void setting_sound_key_ungrab(SettingSoundData *ad)
+{
+ SETTING_TRACE_BEGIN;
+
+ /* To prevent conflict with volume app */
+ vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 0);
+
+ ecore_timer_del(ad->updown_timer);
+ ad->updown_timer = NULL;
+
+ ecore_event_handler_del(ad->keydown_handler);
+ ad->keydown_handler = NULL;
+
+ ecore_event_handler_del(ad->keyup_handler);
+ ad->keyup_handler = NULL;
+}
+
+Evas_Object *setting_sound_init(SettingSoundData *ad)
+{
+ SETTING_TRACE_BEGIN;
+ int err = 0;
+
+ bindtextdomain(SETTING_PACKAGE, SETTING_LOCALEDIR);
+
+ setting_create_Gendial_itc(SETTING_GENLIST_LEFT_ICON_CONTENT_ICON_STYLE,
+ &(ad->itc_layout));
+
+ ad->itc_layout.func.content_get = __sound_slider_icon_get;
+
+ setting_create_Gendial_itc(SETTING_GENLIST_LEFT_ICON_CONTENT_ICON_STYLE,
+ &(ad->itc_layout_1icon));
+
+ ad->itc_layout_1icon.func.content_get = __sound_slider_icon_get;
+
+ /* register view node table */
+ setting_view_node_table_intialize();
+ setting_view_node_table_register(&setting_view_sound_main, NULL);
+
+ err = player_create(&ad->mp_player);
+ if (PLAYER_ERROR_NONE != err) {
+ SETTING_TRACE_ERROR("Cannot create ringtone player %s",
+ get_error_message(err));
+ return NULL;
+ }
+
+ if (
+ (sound_manager_create_stream_information(
+ SOUND_STREAM_TYPE_RINGTONE_VOIP,
+ __sound_stream_focus_state_changed_cb, ad,
+ &ad->ringtone_sound_stream_info)
+ != SOUND_MANAGER_ERROR_NONE) ||
+ (sound_manager_create_stream_information(
+ SOUND_STREAM_TYPE_MEDIA,
+ __sound_stream_focus_state_changed_cb, ad,
+ &ad->media_sound_stream_info)
+ != SOUND_MANAGER_ERROR_NONE) ||
+ (sound_manager_create_stream_information(
+ SOUND_STREAM_TYPE_NOTIFICATION,
+ __sound_stream_focus_state_changed_cb, ad,
+ &ad->noti_sound_stream_info)
+ != SOUND_MANAGER_ERROR_NONE)
+ ) {
+ SETTING_TRACE_ERROR("Cannot create stream information ");
+ return NULL;
+ }
+ /* creating a view. */
+ setting_view_node_set_cur_view(&setting_view_sound_main);
+ setting_view_create(&setting_view_sound_main, (void *)ad);
+
+ err = feedback_initialize();
+ SETTING_TRACE_DEBUG("Feedback init: %s", get_error_message(err));
+
+ __listen_vconf_change(ad);
+
+ return ad->md.naviframe;
+}
+
+void setting_sound_deinit(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ ret_if(data == NULL);
+ SettingSoundData *ad = data;
+
+ __unlisten_vconf_change(ad);
+ feedback_deinitialize();
+ setting_sound_stop_sound(ad);
+
+ evas_object_del(ad->calling_popup);
+ ad->calling_popup = NULL;
+
+ setting_sound_key_ungrab(ad);
+
+ FREE(ad->viewtype);
+
+ sound_manager_destroy_stream_information(
+ ad->ringtone_sound_stream_info);
+ sound_manager_destroy_stream_information(ad->media_sound_stream_info);
+ sound_manager_destroy_stream_information(ad->noti_sound_stream_info);
+
+ ad->ringtone_sound_stream_info = ad->media_sound_stream_info =
+ ad->noti_sound_stream_info = NULL;
+
+ player_destroy(ad->mp_player);
+ ad->mp_player = NULL;
+
+ /* it is the view manage strategy to invoke view's destory operation */
+ setting_view_destroy(&setting_view_sound_main, ad);
+
+ SETTING_TRACE_END;
+}
+
+/* Show guide popup, when drag or tap slider if during call.
+ Do not provide pre-listening. */
+void setting_sound_create_warning_popup_during_call(void *data)
+{
+ ret_if(data == NULL);
+ SettingSoundData *ad = (SettingSoundData *)data;
+
+ cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
+ cm_client_h cm_handle = NULL;
+ cm_init(&cm_handle);
+ cm_get_call_status(cm_handle, &call_status);
+ cm_deinit(cm_handle);
+ if (CM_CALL_STATUS_IDLE != call_status) {
+ SETTING_TRACE("Call status is not OFF (%d)", call_status);
+ if (!ad->calling_popup) {
+ ad->calling_popup = setting_create_popup(
+ ad,
+ ad->md.window,
+ "IDS_ST_HEADER_UNABLE_TO_PLAY_SAMPLE_ABB",
+ "IDS_ST_POP_SAMPLES_CANNOT_BE_PLAYED_DURING_CALLS",
+ __calling_popup_cb,
+ 0,
+ false,
+ false,
+ 1,
+ "IDS_ST_BUTTON_OK");
+ }
+ }
+}
+
+/* ------------------------------------------------------------------------- */
+/* | | elm.swallow.icon.0 | elm.text | elm.swallow.icon.1 | | */
+/* | elm.swallow.icon |----------------------------------| elm.swallow.end | */
+/* | | elm.text.sub | elm.text.sub.end | | */
+/* ------------------------------------------------------------------------- */
+static Evas_Object *__sound_slider_icon_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ SETTING_TRACE_BEGIN;
+ /*appcore_measure_start(); */
+ retv_if(data == NULL, NULL);
+
+ SETTING_TRACE(" -----------------> EDC part [%s]", part);
+ if (safeStrCmp(part, "elm.swallow.content"))
+ return NULL;
+
+ Evas_Object *layout;
+ /* Set custom layout style */
+ layout = elm_layout_add(obj);
+
+ Setting_GenGroupItem_Data *item_data =
+ (Setting_GenGroupItem_Data *)data;
+ Evas_Object *slider = setting_create_slider(obj, item_data);
+
+ if (slider == NULL)
+ return NULL;
+
+ char *gl_style = "gl_custom_item";
+ elm_layout_file_set(layout, EDJDIR"/setting-theme.edj", gl_style);
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ if (0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_MEDIA")) {
+ elm_object_style_set(slider, "warning");
+
+ Edje_Message_Float_Set *msg =
+ alloca(sizeof(Edje_Message_Float_Set)
+ + (sizeof(double)));
+ msg->count = 1;
+ /* Warning area point has to be calculated considering rounding
+ * off. For example, value 10's area will be 9.5~10.4.
+ * So, if warning area has to be started at 10, we need to
+ * calculate the start point with 9.5.
+ * Warning start point = (Warning min value - 0.5) /
+ * (Max_Value - Min_Value) */
+ msg->val[0] = 0.633333;
+ edje_object_message_send(
+ _EDJ(slider), EDJE_MESSAGE_FLOAT_SET, 0, msg);
+ elm_slider_indicator_format_set(slider, "%1.0f");
+ elm_slider_indicator_show_set(slider, 1);
+ }
+
+ item_data->eo_check = slider;
+
+ evas_object_pass_events_set(slider, EINA_TRUE);
+ evas_object_propagate_events_set(slider, EINA_FALSE);
+
+ if (item_data->userdata == NULL)
+ return NULL;
+
+ /* Set text into layout */
+ /*if (0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_MEDIA") */
+ /* || 0 == safeStrCmp(item_data->keyStr, "IDS_ST_BODY_SYSTEM"))
+ * { */
+ elm_object_part_text_set(layout, "elm.text", _(item_data->keyStr));
+ /*} */
+ elm_object_part_content_set(layout, "elm.swallow.content", slider);
+ return layout;
+}
+
+static void __enable_sound_menu(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ ret_if(!data);
+ SettingSoundData *ad = data;
+ ad->sound_on = TRUE;
+ Setting_GenGroupItem_Data *item_to_update = NULL;
+
+
+ /*1.Enable "Vibrate when ringing" */
+ if (ad->data_sound_when_ring) {
+ item_to_update = ad->data_sound_when_ring;
+ setting_genlist_item_disabled_set(item_to_update, EINA_FALSE);
+ }
+
+ if (ad->data_call_volume) {
+ elm_object_item_disabled_set(ad->data_call_volume->item,
+ EINA_FALSE);
+ elm_object_disabled_set(ad->data_call_volume->eo_check,
+ EINA_FALSE);
+ }
+
+ /*2.Enable "Notification", via Sound Manager */
+ item_to_update = ad->data_noti_volume;
+
+ /* @todo make sure data_msg_alert_tone is correct for 'Silent' set.
+ if (item_to_update && safeStrCmp(item_to_update->sub_desc, "Silent"))*/
+ if ((ad->data_msg_alert_tone &&
+ safeStrCmp(ad->data_msg_alert_tone->sub_desc, "Silent")) ||
+ (!safeStrCmp(ad->viewtype, VOLUME_APP_NAME))
+ ) {
+ /* Enable */
+ if (item_to_update
+ && item_to_update->item
+ && item_to_update->eo_check) {
+ int mm_value = 0;
+ int ret = sound_manager_get_volume(
+ SOUND_TYPE_NOTIFICATION, &mm_value);
+ SETTING_TRACE("ret:%d", ret);
+ item_to_update->chk_status = mm_value;
+ elm_slider_value_set(
+ item_to_update->eo_check,
+ item_to_update->chk_status);
+ elm_object_item_disabled_set(item_to_update->item,
+ EINA_FALSE);
+ elm_object_disabled_set(item_to_update->eo_check,
+ EINA_FALSE);
+
+ setting_sound_update_slider_icon(
+ item_to_update, SND_SLIDER_NOTI);
+ }
+ }
+
+ /*3.Enable "System", via Sound Manager */
+ item_to_update = ad->data_touch_volume;
+ if (item_to_update && item_to_update->item
+ && item_to_update->eo_check) {
+ int mm_value = 0;
+ int ret = sound_manager_get_volume(
+ SOUND_TYPE_SYSTEM, &mm_value);
+ SETTING_TRACE("ret:%d", ret);
+ item_to_update->chk_status = mm_value;
+ elm_slider_value_set(
+ item_to_update->eo_check,
+ item_to_update->chk_status);
+ elm_object_item_disabled_set(
+ item_to_update->item, EINA_FALSE);
+ elm_object_disabled_set(item_to_update->eo_check, EINA_FALSE);
+
+ setting_sound_update_slider_icon(
+ item_to_update, SND_SLIDER_SYSTEM);
+ }
+
+
+ /*4.Enable "Call ringtone", via "Backuped" value */
+ item_to_update = ad->data_call_volume;
+ if (item_to_update && item_to_update->eo_check) {
+ SETTING_TRACE("....ad->is_ringtone_slidering:%d, "
+ "ad->data_call_volume->chk_status:%d",
+ ad->is_ringtone_slidering,
+ item_to_update->chk_status);
+ /* do need to restore from BACKUP VOLUME */
if (ad->is_ringtone_slidering) return;
int mm_value = 0;
}
-static void ___sound_vconf_change_cb(keynode_t *key, void *data)
+static void __sound_vconf_change_cb(keynode_t *key, void *data)
{
+ SETTING_TRACE_BEGIN;
ret_if(data == NULL);
SettingSoundData *ad = data;
int status = 0;
#endif
}
-int setting_sound_listen_vconf_change(void *data)
+static int __listen_vconf_change(void *data)
{
retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
/*Ints */
(void)vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
/*Bools */
(void)vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
(void)vconf_notify_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
(void)vconf_notify_key_changed(
VCONFKEY_SETAPPL_VIBRATE_WHEN_RINGING_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
(void)vconf_notify_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
(void)vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
(void)vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL,
- ___sound_vconf_change_cb, data);
+ __sound_vconf_change_cb, data);
/* (void)vconf_notify_key_changed(VCONFKEY_ISE_KEYSOUND,
- * ___sound_vconf_change_cb, data); */
+ * __sound_vconf_change_cb, data); */
return 0;
}
-int setting_sound_unlisten_vconf_change(void *data)
+static int __unlisten_vconf_change(void *data)
{
/* unused listen */
/*Ints */
(void)vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
/*Bools */
(void)vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
(void)vconf_ignore_key_changed(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
(void)vconf_ignore_key_changed(
VCONFKEY_SETAPPL_VIBRATE_WHEN_RINGING_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
(void)vconf_ignore_key_changed(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
(void)vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCH_SOUNDS_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
(void)vconf_ignore_key_changed(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL,
- ___sound_vconf_change_cb);
+ __sound_vconf_change_cb);
/*(void)vconf_ignore_key_changed(VCONFKEY_ISE_KEYSOUND,
- * ___sound_vconf_change_cb); */
+ * __sound_vconf_change_cb); */
return 0;
}
return EINA_TRUE;
}
-void __setting_sound_key_grab(SettingSoundData *ad)
-{
- SETTING_TRACE_BEGIN;
-
- ret_if(!ad);
-
- /* To prevent conflict with volume app */
- vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 2);
-
- if (0 != safeStrCmp(ad->viewtype, VOLUME_APP_NAME))
- return;
-
- if (!ad->keydown_handler)
- ad->keydown_handler = ecore_event_handler_add(
- ECORE_EVENT_KEY_DOWN, __volume_key_down_cb, ad);
- if (!ad->keydown_handler)
- SETTING_TRACE_DEBUG("ecore_event_handler_add() failed");
-
- if (!ad->keyup_handler)
- ad->keyup_handler = ecore_event_handler_add(
- ECORE_EVENT_KEY_UP, __volume_key_up_cb, ad);
- if (!ad->keyup_handler)
- SETTING_TRACE_DEBUG("ecore_event_handler_add() failed");
-}
-
-void __setting_sound_key_ungrab(SettingSoundData *ad)
-{
- SETTING_TRACE_BEGIN;
-
- ret_if(!ad);
-
- /* To prevent conflict with volume app */
- vconf_set_int(VCONFKEY_STARTER_USE_VOLUME_KEY, 0);
-
- ecore_timer_del(ad->updown_timer);
- ad->updown_timer = NULL;
-
- ecore_event_handler_del(ad->keydown_handler);
- ad->keydown_handler = NULL;
-
- ecore_event_handler_del(ad->keyup_handler);
- ad->keyup_handler = NULL;
-}
-
-Evas_Object *setting_sound_init(void *data)
-{
- int err = 0;
- SETTING_TRACE_BEGIN;
- /*appcore_measure_start(); */
- retv_if(data == NULL, NULL);
- SettingSoundData *ad = data;
-
- bindtextdomain(SETTING_PACKAGE, SETTING_LOCALEDIR);
-
- setting_create_Gendial_itc(SETTING_GENLIST_LEFT_ICON_CONTENT_ICON_STYLE,
- &(ad->itc_layout));
-
- ad->itc_layout.func.content_get = __sound_slider_icon_get;
-
- setting_create_Gendial_itc(SETTING_GENLIST_LEFT_ICON_CONTENT_ICON_STYLE,
- &(ad->itc_layout_1icon));
-
- ad->itc_layout_1icon.func.content_get = __sound_slider_icon_get;
-
- /* register view node table */
- setting_view_node_table_intialize();
- setting_view_node_table_register(&setting_view_sound_main, NULL);
-
- err = player_create(&ad->mp_player);
- if (PLAYER_ERROR_NONE != err) {
- SETTING_TRACE_ERROR("Cannot create ringtone player %s",
- get_error_message(err));
- return NULL;
- }
-
- if (
- (sound_manager_create_stream_information(
- SOUND_STREAM_TYPE_RINGTONE_VOIP,
- __sound_stream_focus_state_changed_cb, ad,
- &ad->ringtone_sound_stream_info)
- != SOUND_MANAGER_ERROR_NONE) ||
- (sound_manager_create_stream_information(
- SOUND_STREAM_TYPE_MEDIA,
- __sound_stream_focus_state_changed_cb, ad,
- &ad->media_sound_stream_info)
- != SOUND_MANAGER_ERROR_NONE) ||
- (sound_manager_create_stream_information(
- SOUND_STREAM_TYPE_NOTIFICATION,
- __sound_stream_focus_state_changed_cb, ad,
- &ad->noti_sound_stream_info)
- != SOUND_MANAGER_ERROR_NONE)
- ) {
- SETTING_TRACE_ERROR("Cannot create stream information ");
- return NULL;
- }
- /* creating a view. */
- setting_view_node_set_cur_view(&setting_view_sound_main);
- setting_view_create(&setting_view_sound_main, (void *)ad);
-
- err = feedback_initialize();
- SETTING_TRACE_DEBUG("Feedback init: %s", get_error_message(err));
-
- setting_sound_listen_vconf_change(ad);
-
- return ad->md.naviframe;
-}
-
-void setting_sound_deinit(void *data)
-{
- SETTING_TRACE_BEGIN;
- ret_if(data == NULL);
- SettingSoundData *ad = data;
-
- setting_sound_unlisten_vconf_change(ad);
- feedback_deinitialize();
- setting_sound_stop_sound(ad);
-
- evas_object_del(ad->calling_popup);
- ad->calling_popup = NULL;
-
- __setting_sound_key_ungrab(ad);
-
- FREE(ad->viewtype);
-
- sound_manager_destroy_stream_information(
- ad->ringtone_sound_stream_info);
- sound_manager_destroy_stream_information(ad->media_sound_stream_info);
- sound_manager_destroy_stream_information(ad->noti_sound_stream_info);
-
- ad->ringtone_sound_stream_info = ad->media_sound_stream_info =
- ad->noti_sound_stream_info = NULL;
-
- player_destroy(ad->mp_player);
- ad->mp_player = NULL;
-
- /* it is the view manage strategy to invoke view's destory operation */
- setting_view_destroy(&setting_view_sound_main, ad);
-
- SETTING_TRACE_END;
-}
-
/* ***************************************************
*
*general func
{
ret_if(data == NULL);
SettingSoundData *ad = (SettingSoundData *) data;
-
- if (ad->calling_popup) {
- evas_object_del(ad->calling_popup);
- ad->calling_popup = NULL;
- }
-}
-
-/* Show guide popup, when drag or tap slider if during call.
- Do not provide pre-listening. */
-void setting_sound_create_warning_popup_during_call(void *data)
-{
- ret_if(data == NULL);
- SettingSoundData *ad = (SettingSoundData *)data;
-
- cm_call_status_e call_status = CM_CALL_STATUS_IDLE;
- cm_client_h cm_handle = NULL;
- cm_init(&cm_handle);
- cm_get_call_status(cm_handle, &call_status);
- cm_deinit(cm_handle);
- if (CM_CALL_STATUS_IDLE != call_status) {
- SETTING_TRACE("Call status is not OFF (%d)", call_status);
- if (!ad->calling_popup) {
- ad->calling_popup = setting_create_popup(
- ad,
- ad->md.window,
- "IDS_ST_HEADER_UNABLE_TO_PLAY_SAMPLE_ABB",
- "IDS_ST_POP_SAMPLES_CANNOT_BE_PLAYED_DURING_CALLS",
- __calling_popup_cb,
- 0,
- false,
- false,
- 1,
- "IDS_ST_BUTTON_OK");
- }
+
+ if (ad->calling_popup) {
+ evas_object_del(ad->calling_popup);
+ ad->calling_popup = NULL;
}
}
-#define EXP 0.001
-
static void __mm_player_msg_cb(void *user_param)
{
+ SETTING_TRACE_BEGIN;
ret_if(user_param == NULL);
SettingSoundData *ad = (SettingSoundData *)user_param;
static Eina_Bool __play_timer_cb(void *data)
{
+ SETTING_TRACE_BEGIN;
int err;
player_state_e state = PLAYER_STATE_NONE;
- SETTING_TRACE_BEGIN;
retv_if(!data, EINA_FALSE);
SettingSoundData *ad = (SettingSoundData *)data;
}
}
-bool setting_sound_play_sound(
- void *data,
- void *cb,
- char *ringtone_file,
- int vol,
- sound_type_e sound_type)
-{
- int err = 0;
- sound_stream_focus_state_e ssfs = SOUND_STREAM_FOCUS_STATE_ACQUIRED;
- player_state_e state = PLAYER_STATE_NONE;
- /* error check */
- retv_if(data == NULL, NULL);
- SettingSoundData *ad = (SettingSoundData *) data;
- sound_stream_info_h sound_stream_info_to_set = NULL;
-
- int is_existing = setting_sound_check_file_exist(ad, ringtone_file);
-
- if (is_existing == SETTING_RETURN_FAIL || NULL == ringtone_file) {
- switch (sound_type) {
- case SOUND_TYPE_RINGTONE:
- if (isEmulBin())
- ad->song_playing = (char *)g_strdup(
- SETTING_DEFAULT_CALL_TONE_SDK);
- else
- ad->song_playing = (char *)g_strdup(
- SETTING_DEFAULT_CALL_TONE);
- sound_stream_info_to_set =
- ad->ringtone_sound_stream_info;
- break;
- case SOUND_TYPE_MEDIA:
- if (isEmulBin())
- ad->song_playing = (char *)g_strdup(
- SETTING_DEFAULT_CALL_TONE_SDK);
- else
- ad->song_playing = (char *)g_strdup(
- SETTING_DEFAULT_MEDIA_TONE);
- sound_stream_info_to_set = ad->media_sound_stream_info;
- break;
- case SOUND_TYPE_NOTIFICATION:
- ad->song_playing = (char *)g_strdup(
- SETTING_DEFAULT_MSG_TONE);
- sound_stream_info_to_set = ad->noti_sound_stream_info;
- break;
- default:
- return false;
- break;
- }
-
- } else {
- if (safeStrCmp(ringtone_file, "Silent") == 0)
- return false;
-
- switch (sound_type) {
- case SOUND_TYPE_RINGTONE:
- sound_stream_info_to_set =
- ad->ringtone_sound_stream_info;
- break;
- case SOUND_TYPE_MEDIA:
- sound_stream_info_to_set = ad->media_sound_stream_info;
- break;
- case SOUND_TYPE_NOTIFICATION:
- sound_stream_info_to_set = ad->noti_sound_stream_info;
- break;
- default:
- return false;
- break;
- }
- ad->song_playing = (char *)g_strdup(ringtone_file);
- }
-
- player_get_state(ad->mp_player, &state);
- if (state != PLAYER_STATE_IDLE) {
- if (err != player_unprepare(ad->mp_player)) {
- SETTING_TRACE_ERROR("player_unprepare() failed: [%s]",
- get_error_message(err));
- player_unprepare(ad->mp_player);
- return false;
-
- }
- }
-
- if (sound_type != SOUND_TYPE_NOTIFICATION) {
- sound_manager_get_focus_state(sound_stream_info_to_set, &ssfs,
- NULL);
- if (ssfs == SOUND_STREAM_FOCUS_STATE_RELEASED) {
- err = sound_manager_acquire_focus(
- sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- if (err != SOUND_MANAGER_ERROR_NONE) {
- SETTING_TRACE_ERROR(
- "Could not acquire focus: [%s]",
- get_error_message(err));
- player_unprepare(ad->mp_player);
- return false;
- }
- }
- }
-
- player_get_state(ad->mp_player, &state);
- if (state != PLAYER_STATE_IDLE)
- player_unprepare(ad->mp_player);
-
- err = player_set_audio_policy_info(ad->mp_player, sound_stream_info_to_set);
- if (err != PLAYER_ERROR_NONE) {
- SETTING_TRACE_ERROR("error to set audio policy [%s]",
- get_error_message(err));
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
-
- err = player_set_uri(ad->mp_player, ad->song_playing);
- if (err != PLAYER_ERROR_NONE) {
- SETTING_TRACE_ERROR("error to set attribute---profile_uri[%s]",
- get_error_message(err));
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
-
-#if SUPPORT_PLAYER_ASYNC
- err = player_prepare_async(ad->mp_player, __mm_player_prepared_cb, ad);
- if (err != PLAYER_ERROR_NONE) {
- SETTING_TRACE_ERROR("realizing the player handle failed[%s]",
- get_error_message(err));
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
- ad->mp_prepare_async = ad->mp_player;
- SETTING_TRACE("waiting..player (%x)", ad->mp_prepare_async);
-#else
- err = player_prepare(ad->mp_player);
- if (err != PLAYER_ERROR_NONE) {
- SETTING_TRACE_ERROR("player_prepare() error %d", err);
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
-
- state = PLAYER_STATE_NONE;
- err = player_get_state(ad->mp_player, &state);
- SETTING_TRACE("state:%d", state);
- if (state != PLAYER_STATE_READY) {
- SETTING_TRACE_ERROR("state of player is invalid %d", err);
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
-
- player_set_completed_cb(ad->mp_player, __mm_player_msg_cb, ad);
-
- err = player_start(ad->mp_player);
- if (err != PLAYER_ERROR_NONE) {
- /* if directly return error.. */
- SETTING_TRACE_ERROR("player_start [%s]",
- get_error_message(err));
- player_unset_completed_cb(ad->mp_player);
- if (sound_type != SOUND_TYPE_NOTIFICATION)
- sound_manager_release_focus(sound_stream_info_to_set,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
- player_unprepare(ad->mp_player);
- return false;
- }
-#endif
-
- return true;
-}
-
-void setting_sound_play_sound_origin(
- void *data,
- void *cb,
- char *ringtone_file,
- float vol,
- sound_type_e sound_type)
-{
- int vconf_value = 0;
- SettingSoundData *ad = (SettingSoundData *) data;
- SETTING_TRACE_BEGIN;
-
- ret_if(data == NULL);
-
- if (vol < EXP) {
- SETTING_TRACE_DEBUG("vol < EXP");
- setting_sound_stop_sound(data);
- return;
- }
-
- vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS,
- &vconf_value);
-
- if (vconf_value == TRUE)
- return;
-
- setting_sound_play_sound(ad, cb, ringtone_file, vol, sound_type);
- SETTING_TRACE("play sound type %d", sound_type);
-
-}
-
-void setting_sound_stop_sound(void *data)
-{
- sound_stream_focus_state_e ssfs = SOUND_STREAM_FOCUS_STATE_ACQUIRED;
- SettingSoundData *ad = (SettingSoundData *)data;
- player_state_e player_state = PLAYER_STATE_NONE;
-
- SETTING_TRACE_BEGIN;
-
- if (!data)
- return;
-
- if (ad->song_playing) {
- g_free(ad->song_playing);
- ad->song_playing = NULL;
- }
-
- player_unset_completed_cb(ad->mp_player);
-
- sound_manager_get_focus_state(ad->ringtone_sound_stream_info, &ssfs,
- NULL);
- if (ssfs == SOUND_STREAM_FOCUS_STATE_ACQUIRED)
- sound_manager_release_focus(ad->ringtone_sound_stream_info,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
-
- sound_manager_get_focus_state(ad->media_sound_stream_info, &ssfs, NULL);
- if (ssfs == SOUND_STREAM_FOCUS_STATE_ACQUIRED)
- sound_manager_release_focus(ad->media_sound_stream_info,
- SOUND_STREAM_FOCUS_FOR_PLAYBACK,
- SOUND_BEHAVIOR_NONE, NULL);
-
- player_get_state(ad->mp_player, &player_state);
-
- if (player_state != PLAYER_STATE_IDLE)
- if (player_unprepare(ad->mp_player) != PLAYER_ERROR_NONE)
- SETTING_TRACE_ERROR("player unrealize failed");
-}
-
#include <notification_setting.h>
#include <notification_setting_internal.h>
-
-#include "setting-profile-sound-main.h"
#include "setting-profile.h"
#include "setting-common-general-func.h"
-#define DO_NOT_DISTURB_OP "http://tizen.org/appcontrol/operation/setting/"\
- "do_not_disturb"
-#define APP_NOTIFICATIONS_OP "http://tizen.org/appcontrol/operation/setting/"\
- "app_notifications"
-#define NOTIFICATIONS_ON_LOCK_SCREEN "http://tizen.org/appcontrol/operation/setting/"\
- "notification_on_lock_screen"
+#define DO_NOT_DISTURB_OP \
+ "http://tizen.org/appcontrol/operation/setting/do_not_disturb"
+#define APP_NOTIFICATIONS_OP \
+ "http://tizen.org/appcontrol/operation/setting/app_notifications"
+#define NOTIFICATIONS_ON_LOCK_SCREEN \
+ "http://tizen.org/appcontrol/operation/setting/notification_on_lock_screen"
#define SETTING_DEFAULT_RINGTONE_VOL_INT 11
#define SETTING_DEFAULT_NOTI_VOL_INT 11
#define SETTING_DEFAULT_MEDIA_VOL_INT 9
#define SETTING_DEFAULT_SYSTEM_VOL_INT 9
-
+#define NOTIFICATION_STR_ON_LOCK_SCREEN \
+ "IDS_QP_TMBODY_NOTIFICATIONS_ON_LOCK_SCREEN"
+#define NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE "IDS_ST_OPT_HIDE_CONTENT"
+#define NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE_SENSITIVE \
+ "IDS_QP_OPT_HIDE_SENSITIVE_CONTENT_ABB"
+#define NOTIFICATION_STR_ON_LOCK_SCREEN_SHOW_ALL \
+ "IDS_QP_OPT_SHOW_ALL_CONTENT_ABB"
#define SILENT_MODE "Silent"
-
-static int setting_sound_main_create(void *cb);
-static int setting_sound_main_destroy(void *cb);
-static Eina_Bool _view_pop_cb(void *data, Elm_Object_Item *it);
-
-setting_view setting_view_sound_main = {
- .create = setting_sound_main_create,
- .destroy = setting_sound_main_destroy,
- .update = NULL,
- .cleanup = NULL
-};
+#define INIT_PATH _TZ_SYS_SHARE"/settings/Vibrations/"
/* should be called in function to return void */
#define ADD_GENLIST2(genlist, parent) \
item = setting_create_Gendial_field_def( \
genlist, \
&(item_style), \
- setting_sound_main_mouse_up_Gendial_list_cb, \
+ __mouse_up_Gendial_list_cb, \
data, \
SWALLOW_Type_1ICON_1RADIO, \
NULL, \
_item = setting_create_Gendial_field_def( \
genlist, \
&(item_style), \
- setting_sound_main_mouse_up_Gendial_list_cb, \
+ __mouse_up_Gendial_list_cb, \
data, \
SWALLOW_Type_1ICON_1RADIO, \
NULL, \
} \
}
+static int __view_create(void *cb);
+static int __view_destroy(void *cb);
+static Eina_Bool __view_pop_cb(void *data, Elm_Object_Item *it);
+static void __mouse_up_Gendial_list_cb(void *data, Evas_Object *obj,
+ void *event_info);
+
+setting_view setting_view_sound_main = {
+ .create = __view_create,
+ .destroy = __view_destroy,
+ .update = NULL,
+ .cleanup = NULL
+};
+
+/* ***************************************************
+ *
+ * Public functions
+ *
+ ***************************************************/
+
+const char *setting_do_not_disturb_is_enable(void *data)
+{
+ int err = NOTIFICATION_ERROR_NONE;
+ bool do_not_disturb;
+ notification_system_setting_h system_setting = NULL;
+
+ err = notification_system_setting_load_system_setting(&system_setting);
+ setting_retvm_if(NULL == system_setting || NOTIFICATION_ERROR_NONE != err,
+ "NULL parameter",
+ "notification_system_setting_load_system_Setting failed");
+ err = notification_system_setting_get_do_not_disturb(
+ system_setting, &do_not_disturb);
+ SETTING_TRACE("do_not_disturb: %d", do_not_disturb);
+
+ if (1 == do_not_disturb) {
+ notification_system_setting_free_system_setting(system_setting);
+ return "IDS_ST_BODY_ON";
+ } else {
+ notification_system_setting_free_system_setting(system_setting);
+ return "IDS_ST_BODY_ALERTTYPE_OFF";
+ }
+}
+
+const char *setting_notifiaction_on_lock_screen(void *data)
+{
+ int err = NOTIFICATION_ERROR_NONE;
+ notification_system_setting_h system_setting = NULL;
+ lock_screen_content_level_e level = 0;
+
+ err = notification_system_setting_load_system_setting(&system_setting);
+ setting_retvm_if(NOTIFICATION_ERROR_NONE != err,
+ "NULL parameter",
+ "notification_system_setting_load_system_setting failed");
+
+ err = notification_system_setting_get_lock_screen_content(
+ system_setting, &level);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ notification_system_setting_free_system_setting(system_setting);
+ SETTING_TRACE_ERROR("notification_system_setting_get_"\
+ "lock_screen_content failed");
+ return "";
+ }
+
+ if (system_setting)
+ notification_system_setting_free_system_setting(system_setting);
+
+ if (level == SHOW_ALL_CONTENT)
+ return NOTIFICATION_STR_ON_LOCK_SCREEN_SHOW_ALL;
+ else if (level == HIDE_SENSITIVE_CONTENT)
+ return NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE_SENSITIVE;
+ else
+ return NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE;
+}
+
/* ***************************************************
*
- *basic func
+ * basic func
*
***************************************************/
+
static Eina_Bool __play_ringtone_sound_idle_cb(void *data)
{
double current;
return EINA_FALSE;
}
-
void __start_change_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
static void __call_slider_change_cb(
void *data, Evas_Object *obj, void *event_info)
{
+ SETTING_TRACE_BEGIN;
SettingSoundData *ad = NULL;
double val = 0.0;
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *)data;
- SETTING_TRACE_BEGIN;
-
+ Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
ret_if(!data);
val = elm_slider_value_get(obj);
if (list_item->chk_status != (int)(val + 0.5)) {
list_item->chk_status = (int)(val + 0.5);
- sound_manager_set_volume(
- SOUND_TYPE_RINGTONE, list_item->chk_status);
+ sound_manager_set_volume(SOUND_TYPE_RINGTONE, list_item->chk_status);
SETTING_TRACE_DEBUG(
"ringtone volume is %d, %f",
list_item->chk_status,
}
}
-
void __stop_change_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
SETTING_TRACE_END;
}
-const char *setting_do_not_disturb_is_enable(void *data)
-{
- int err = NOTIFICATION_ERROR_NONE;
- bool do_not_disturb;
- notification_system_setting_h system_setting = NULL;
-
- err = notification_system_setting_load_system_setting(&system_setting);
- setting_retvm_if(NULL == system_setting
- || NOTIFICATION_ERROR_NONE != err,
- "NULL parameter",
- "notification_system_setting_load_system_Setting failed");
- err = notification_system_setting_get_do_not_disturb(
- system_setting, &do_not_disturb);
- SETTING_TRACE("do_not_disturb: %d", do_not_disturb);
-
- if (1 == do_not_disturb) {
- notification_system_setting_free_system_setting(system_setting);
- return "IDS_ST_BODY_ON";
- } else {
- notification_system_setting_free_system_setting(system_setting);
- return "IDS_ST_BODY_ALERTTYPE_OFF";
- }
-}
-
-const char *setting_notifiaction_on_lock_screen(void *data)
-{
- int err = NOTIFICATION_ERROR_NONE;
- notification_system_setting_h system_setting = NULL;
- lock_screen_content_level_e level = 0;
-
- err = notification_system_setting_load_system_setting(&system_setting);
- setting_retvm_if(NOTIFICATION_ERROR_NONE != err,
- "NULL parameter",
- "notification_system_setting_load_system_setting failed");
-
- err = notification_system_setting_get_lock_screen_content(
- system_setting, &level);
- if (NOTIFICATION_ERROR_NONE != err) {
- notification_system_setting_free_system_setting(system_setting);
- SETTING_TRACE_ERROR("notification_system_setting_get_"\
- "lock_screen_content failed");
- return "";
- }
-
- if (system_setting)
- notification_system_setting_free_system_setting(system_setting);
-
- if (level == SHOW_ALL_CONTENT)
- return NOTIFICATION_STR_ON_LOCK_SCREEN_SHOW_ALL;
- else if (level == HIDE_SENSITIVE_CONTENT)
- return NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE_SENSITIVE;
- else
- return NOTIFICATION_STR_ON_LOCK_SCREEN_HIDE;
-}
-
-static void
-__sound_chk_cb(void *data, Evas_Object *obj,
- void *event_info)
+static void __sound_chk_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
SETTING_TRACE_BEGIN;
/* error check */
list_item->chk_status = elm_check_state_get(obj);
/* rollback */
setting_update_gl_item_chk_status(list_item, !list_item->chk_status);
- setting_sound_main_mouse_up_Gendial_list_cb(ad, NULL, list_item->item);
+ __mouse_up_Gendial_list_cb(ad, NULL, list_item->item);
}
-#define INIT_PATH _TZ_SYS_SHARE"/settings/Vibrations/"
static void __get_lite_main_list(void *data)
{
SETTING_TRACE_BEGIN;
setting_create_Gendial_field_def(
genlist,
&itc_2text_2,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
ad,
SWALLOW_Type_INVALID,
NULL,
setting_create_Gendial_field_def(
genlist,
&itc_2text_2,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
ad,
SWALLOW_Type_INVALID,
NULL,
/* 8. Feedback */
setting_create_Gendial_field_def(genlist, &itc_1text,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
data, SWALLOW_Type_INVALID, NULL,
NULL, 0,
"IDS_ST_HEADER_FEEDBACK", NULL, NULL);
ad->data_do_not_disturb = setting_create_Gendial_field_def(
genlist,
&itc_2text_2,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
data,
SWALLOW_Type_INVALID,
NULL,
setting_create_Gendial_field_def(
genlist,
&itc_2text_2,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
data,
SWALLOW_Type_INVALID,
NULL,
ad->data_notifiaction_on_lock_screen = setting_create_Gendial_field_def(
genlist,
&itc_2text_2,
- setting_sound_main_mouse_up_Gendial_list_cb,
+ __mouse_up_Gendial_list_cb,
data,
SWALLOW_Type_INVALID,
NULL,
}
}
-static void setting_soudn_main_click_softkey_back_cb(void *data,
+static void __click_softkey_back_cb(void *data,
Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
SettingSoundData *ad = (SettingSoundData *)data;
- if (ad)
- elm_naviframe_item_pop(ad->md.naviframe);
+ ret_if(!ad);
+ elm_naviframe_item_pop(ad->md.naviframe);
}
-static int setting_sound_main_create(void *cb)
+static int __view_create(void *cb)
{
Evas_Object *back_button = NULL;
return ret;
/* 1.Grab Hard Key */
- __setting_sound_key_grab(ad);
+ setting_sound_key_grab(ad);
SETTING_TRACE("viewtype: %s", ad->viewtype);
__get_lite_main_list(ad);
back_button = setting_create_button(ad->md.naviframe,
_(NULL), NAVI_BACK_ARROW_BUTTON_STYLE,
- setting_soudn_main_click_softkey_back_cb, ad);
+ __click_softkey_back_cb, ad);
elm_layout_content_set(ad->md.naviframe, "prev_btn",
back_button);
- elm_naviframe_item_pop_cb_set(ad->md.naviframe_it, _view_pop_cb,
- ad);
+ elm_naviframe_item_pop_cb_set(ad->md.naviframe_it, __view_pop_cb, ad);
elm_object_item_domain_text_translatable_set(
ad->md.naviframe_it, SETTING_PACKAGE,
EINA_TRUE);
return SETTING_RETURN_SUCCESS;
}
-static int setting_sound_main_destroy(void *cb)
+static int __view_destroy(void *cb)
{
/* error check */
retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
SettingSoundData *ad = (SettingSoundData *) cb;
/* 1.Ungrab Key */
- __setting_sound_key_ungrab(ad);
+ setting_sound_key_ungrab(ad);
if (ad->play_ringtone_idler) {
ecore_idler_del(ad->play_ringtone_idler);
return SETTING_RETURN_SUCCESS;
}
-static Eina_Bool _view_pop_cb(void *data, Elm_Object_Item *it)
+static Eina_Bool __view_pop_cb(void *data, Elm_Object_Item *it)
{
- setting_sound_stop_sound(data);
+ SETTING_TRACE_BEGIN;
+ SettingSoundData *ad = data;
+ retv_if(!ad, EINA_FALSE);
+ setting_sound_stop_sound(ad);
ui_app_exit();
return EINA_TRUE;
}
*
***************************************************/
-static void _update_slider_item(Setting_GenGroupItem_Data *item_to_update, sound_type_e sound_type_to_update,
- const char *ringtone_file, int icon_type)
+static void __update_slider_item(Setting_GenGroupItem_Data *item_to_update,
+ sound_type_e sound_type_to_update, const char *ringtone_file,
+ int icon_type)
{
int mm_value = 0;
- if (!item_to_update)
- return;
+ SettingSoundData *ad = NULL;
+
+ ret_if(!item_to_update);
+ ad = item_to_update->userdata;
+ ret_if(!ad);
if (!safeStrCmp(ringtone_file, SILENT_MODE)) {
/* Disable */
if (item_to_update && item_to_update->item
&& item_to_update->eo_check) {
+ if (item_to_update->chk_status)
+ ad->backup_ringtone_volume[sound_type_to_update] =
+ item_to_update->chk_status;
item_to_update->chk_status = 0;
elm_slider_value_set(item_to_update->eo_check,
item_to_update->chk_status);
elm_object_disabled_set(item_to_update->eo_check, EINA_TRUE);
/* Change notification slider's icon as mute style */
- setting_sound_update_slider_icon(item_to_update,
- icon_type);
+ setting_sound_update_slider_icon(item_to_update, icon_type);
}
} else {
/* Enable */
item_to_update->chk_status);
elm_object_item_disabled_set(item_to_update->item, EINA_FALSE);
elm_object_disabled_set(item_to_update->eo_check, EINA_FALSE);
- sound_manager_set_volume(sound_type_to_update,
- SETTING_DEFAULT_NOTI_VOL_INT);
- setting_sound_update_slider_icon(
- item_to_update, icon_type);
+ if (mm_value == 0)
+ sound_manager_set_volume(sound_type_to_update,
+ ad->backup_ringtone_volume[sound_type_to_update]);
+ setting_sound_update_slider_icon(item_to_update, icon_type);
}
}
-
-static void _set_ringtone_path(Evas_Object *genlist, char *path, char *vconf,
+static void __set_ringtone_path(Evas_Object *genlist, char *path, char *vconf,
system_settings_key_e key,
- Setting_GenGroupItem_Data *ringtone_item, Setting_GenGroupItem_Data *slider_item,
+ Setting_GenGroupItem_Data *ringtone_item,
+ Setting_GenGroupItem_Data *slider_item,
sound_type_e sound_type, SoundType type)
{
char *ringtone_file = setting_media_basename(path);
if (strnlen(path, PATH_MAX) == 0) {
ret = vconf_set_str(vconf, "");
if (ret != 0)
- dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] vconf_set_str() error: %s", __FILE__, __LINE__, get_error_message(ret));
+ dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] vconf_set_str() error: %s",
+ __FILE__, __LINE__, get_error_message(ret));
ringtone_item->sub_desc = strdup(SILENT_MODE);
} else {
ret = vconf_set_str(vconf, path);
if (ret != 0)
- dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] cause error: %s", __FILE__, __LINE__, get_error_message(ret));
+ dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] cause error: %s",
+ __FILE__, __LINE__, get_error_message(ret));
ret = system_settings_set_value_string(key, path);
if (SYSTEM_SETTINGS_ERROR_NONE == ret)
ringtone_item->sub_desc = strdup(ringtone_file);
else
- SETTING_TRACE_ERROR("system_settings_set_value_string() failed: %s", get_error_message(ret));
+ SETTING_TRACE_ERROR("system_settings_set_value_string() failed: %s",
+ get_error_message(ret));
}
elm_object_item_data_set(ringtone_item->item, ringtone_item);
elm_genlist_item_update(ringtone_item->item);
elm_genlist_realized_items_update(genlist);
- _update_slider_item(slider_item, sound_type, ringtone_file, type);
+ __update_slider_item(slider_item, sound_type, ringtone_file, type);
free(ringtone_file);
SETTING_TRACE_END;
}
-static void _setting_sound_main_result_myfile_cb(app_control_h request,
+static void __result_myfile_cb(app_control_h request,
app_control_h reply, app_control_result_e result,
void *priv)
{
if (APP_CONTROL_RESULT_SUCCEEDED != result)
return;
- (void)app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &paths, &arr_len);
+ (void)app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED,
+ &paths, &arr_len);
if (!paths || arr_len == 0)
return;
if (paths[0] != NULL) {
if (0 == safeStrCmp(ad->ringtone_type, "IDS_ST_MBODY_RINGTONE")) {
-
-
- _set_ringtone_path(ad->md.genlist, paths[0], VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR,
+ __set_ringtone_path(ad->md.genlist, paths[0],
+ VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR,
SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
ad->data_call_alert_tone, ad->data_call_volume,
SOUND_TYPE_RINGTONE, SND_SLIDER_CALL);
} else if (0 == safeStrCmp(ad->ringtone_type, "IDS_ST_BODY_NOTIFICATION")) {
- _set_ringtone_path(ad->md.genlist, paths[0], VCONFKEY_SETAPPL_NOTI_RINGTONE_PATH_STR,
+ __set_ringtone_path(ad->md.genlist, paths[0],
+ VCONFKEY_SETAPPL_NOTI_RINGTONE_PATH_STR,
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
ad->data_msg_alert_tone, ad->data_noti_volume,
SOUND_TYPE_NOTIFICATION, SND_SLIDER_NOTI);
free(paths);
}
-static char *_prepare_ringtone_path(char *vconf, system_settings_key_e key, char *default_emul, char *default_arm)
+static char *__prepare_ringtone_path(char *vconf, system_settings_key_e key, char *default_emul, char *default_arm)
{
int ret = 0;
char *vconf_ringtone = vconf_get_str(vconf);
return pa_cur_ringtone;
}
-static void setting_sound_main_create_myfile_ug(
+static void __create_myfile_ug(
SettingSoundData *ad, char *titleID)
{
ret_if(ad == NULL);
return;
if (0 == safeStrCmp(ad->ringtone_type, "IDS_ST_MBODY_RINGTONE")) {
- pa_cur_ringtone = _prepare_ringtone_path(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR,
+ pa_cur_ringtone = __prepare_ringtone_path(
+ VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR,
SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
SETTING_DEFAULT_CALL_TONE_SDK,
SETTING_DEFAULT_CALL_TONE);
} else if (0 == safeStrCmp(ad->ringtone_type, "IDS_ST_BODY_NOTIFICATION")) {
- pa_cur_ringtone = _prepare_ringtone_path(VCONFKEY_SETAPPL_NOTI_RINGTONE_PATH_STR,
+ pa_cur_ringtone = __prepare_ringtone_path(
+ VCONFKEY_SETAPPL_NOTI_RINGTONE_PATH_STR,
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION,
SETTING_DEFAULT_MSG_TONE,
SETTING_DEFAULT_MSG_TONE);
app_control_set_app_id(svc, "org.tizen.setting-ringtone");
if (APP_CONTROL_ERROR_NONE !=
- app_control_send_launch_request(svc,
- _setting_sound_main_result_myfile_cb, ad)
- ) {
+ app_control_send_launch_request(svc, __result_myfile_cb, ad))
SETTING_TRACE_ERROR("org.tizen.setting-ringtone launch request failed");
- }
app_control_destroy(svc);
free(pa_cur_ringtone);
}
-static void _back_button_click_cb(void *data, Evas_Object *obj, void *event_info)
+static void __back_button_click_cb(void *data, Evas_Object *obj,
+ void *event_info)
{
SettingSoundData *ad = data;
-
- if (ad)
- elm_naviframe_item_pop(ad->md.naviframe);
+ ret_if(!ad);
+ elm_naviframe_item_pop(ad->md.naviframe);
}
-static void
-setting_sound_main_mouse_up_Gendial_list_cb(void *data,
+static void __mouse_up_Gendial_list_cb(void *data,
Evas_Object *obj,
void *event_info)
{
+ SETTING_TRACE_BEGIN;
app_control_h service = 0;
Evas_Object *back_button = NULL;
SettingSoundData *ad = NULL;
if (!safeStrCmp("IDS_ST_MBODY_RINGTONE", list_item->keyStr)
|| !safeStrCmp("IDS_ST_BODY_NOTIFICATION", list_item->keyStr)) {
ad->ringtone_type = list_item->keyStr;
- setting_sound_main_create_myfile_ug(ad, list_item->keyStr);
- __setting_sound_key_ungrab(ad);
+ __create_myfile_ug(ad, list_item->keyStr);
+ setting_sound_key_ungrab(ad);
} else if (!safeStrCmp("IDS_ST_MBODY_DO_NOT_DISTURB_ABB",
list_item->keyStr)) {
app_control_create(&service);
if (vconf_set_bool(VCONFKEY_SETAPPL_VIBRATE_WHEN_RINGING_BOOL,
!old_status) == 0) {
/* new status */
- setting_update_gl_item_chk_status(list_item,
- !old_status);
+ setting_update_gl_item_chk_status(list_item, !old_status);
}
} else if (!safeStrCmp("IDS_ST_BODY_SCREEN_LOCK_SOUND",
list_item->keyStr)) {
!old_status);
}
} else if (!safeStrCmp("IDS_ST_HEADER_FEEDBACK", list_item->keyStr)) {
- __setting_sound_key_ungrab(ad);
+ setting_sound_key_ungrab(ad);
ADD_GENLIST2(genlist, ad->md.naviframe);
/* 1. Touch sounds */
elm_object_item_domain_text_translatable_set(navi_it,
SETTING_PACKAGE, EINA_TRUE);
back_button = setting_create_button(ad->md.naviframe, _("IDS_ST_BUTTON_BACK"),
- NAVI_BACK_ARROW_BUTTON_STYLE, _back_button_click_cb, ad);
+ NAVI_BACK_ARROW_BUTTON_STYLE, __back_button_click_cb, ad);
elm_layout_content_set(ad->md.naviframe, "prev_btn", back_button);
}
}