4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
21 #include <setting-profile-sound-main.h>
23 #define VOLUME_STR _("IDS_ST_SK_VOLUME")
24 #define RINGTONE_STR _("IDS_COM_BODY_RINGTONES")
26 #define SOUND_DESC "IDS_ST_BODY_ADJUST_VOLUME_AND_INTENSITY_FOR_SOUNDS_WHEN_MSG"
28 static int setting_profile_sound_main_create(void *cb);
29 static int setting_profile_sound_main_destroy(void *cb);
30 static int setting_profile_sound_main_update(void *cb);
31 static int setting_profile_sound_main_cleanup(void *cb);
33 static void setting_profile_layout_ug_cb(ui_gadget_h ug,
34 enum ug_mode mode, void *priv);
36 setting_view setting_view_profile_sound_main = {
37 .create = setting_profile_sound_main_create,
38 .destroy = setting_profile_sound_main_destroy,
39 .update = setting_profile_sound_main_update,
40 .cleanup = setting_profile_sound_main_cleanup,
43 /* ***************************************************
47 ***************************************************/
48 void __change_state_of_sliderbars(void *data)
51 SettingProfileUG *ad = (SettingProfileUG *) data;
54 int vibration_on = TRUE;
56 if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &sound_on) == 0) {
57 if (sound_on == FALSE) {
58 /* disable slider bar of call ringtone, notification, media, and system volume */
59 if (ad->data_call_volume) {
60 setting_disable_genlist_item(ad->data_call_volume->item);
62 if (ad->data_noti_volume) {
63 setting_disable_genlist_item(ad->data_noti_volume->item);
65 if (ad->data_media_volume) {
66 setting_disable_genlist_item(ad->data_media_volume->item);
68 if (ad->data_touch_volume) {
69 setting_disable_genlist_item(ad->data_touch_volume->item);
75 (VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vibration_on) == 0) {
76 if (vibration_on == FALSE) {
77 /* disable slider bar of notification and system vibration */
78 if (ad->data_vib_volume) {
79 setting_disable_genlist_item(ad->data_vib_volume->item);
81 if (ad->data_touch_vib) {
82 setting_disable_genlist_item(ad->data_touch_vib->item);
88 void __sound_sub_list_sel_cb(void *data, Evas_Object *obj, void *event_info)
91 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
92 retm_if(data == NULL, "Invalid argument: data is NULL");
94 SettingProfileUG *ad = (SettingProfileUG *) data;
95 Elm_Object_Item *subitem = (Elm_Object_Item *) event_info;
96 Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subitem);
97 elm_genlist_item_selected_set(subitem, 0);
98 Setting_GenGroupItem_Data *data_subItem =
99 elm_object_item_data_get(subitem);
100 Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);
101 if (NULL == data_subItem || NULL == data_parentItem)
104 elm_radio_value_set(data_subItem->rgd, data_subItem->chk_status);
106 setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
107 data_subItem->chk_status, &err);
109 if (data_parentItem) {
110 data_parentItem->sub_desc =
111 (char *)g_strdup(_(data_subItem->keyStr));
112 elm_object_item_data_set(data_parentItem->item, data_parentItem);
113 elm_genlist_item_update(data_parentItem->item);
116 if (data_parentItem->int_slp_setting_binded ==
117 INT_SLP_SETTING_CALL_ALERT_VIB) {
118 if (device_haptic_stop_play(ad->hnd_hpt) != 0) {
119 SETTING_TRACE("ERROR device_haptic_stop_play");
122 setting_profile_play_vibration(ad,
123 setting_profile_get_call_playing_vib_by_vconf_value
124 (data_subItem->chk_status));
128 static void __sound_exp_cb(void *data, Evas_Object *obj, void *event_info)
130 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
131 retm_if(data == NULL, "Invalid argument: data is NULL");
133 SettingProfileUG *ad = (SettingProfileUG *) data;
134 Elm_Object_Item *parentItem = event_info; /* parent item */
135 Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
136 Evas_Object *scroller = elm_object_item_widget_get(parentItem);
139 if (data_parentItem == ad->data_call_alert_vib) {
140 rgd = elm_radio_add(scroller);
141 elm_radio_value_set(rgd, -1);
142 setting_create_Gendial_exp_sub_field(scroller,
143 &(ad->itc_1icon_1text_sub),
144 __sound_sub_list_sel_cb,
146 SWALLOW_Type_1RADIO, rgd,
148 "IDS_ST_BODY_VIBRATION_1",
151 setting_create_Gendial_exp_sub_field(scroller,
152 &(ad->itc_1icon_1text_sub),
153 __sound_sub_list_sel_cb,
155 SWALLOW_Type_1RADIO, rgd,
157 "IDS_ST_BODY_VIBRATION_2",
160 setting_create_Gendial_exp_sub_field(scroller,
161 &(ad->itc_1icon_1text_sub),
162 __sound_sub_list_sel_cb,
164 SWALLOW_Type_1RADIO, rgd,
166 "IDS_ST_BODY_VIBRATION_3",
169 setting_update_chk_status(rgd,
171 int_slp_setting_binded);
173 } else if (data_parentItem == ad->data_msg_alert_repeat
174 || data_parentItem == ad->data_email_alert_repeat) {
175 rgd = elm_radio_add(scroller);
176 elm_radio_value_set(rgd, -1);
177 setting_create_Gendial_exp_sub_field(scroller,
178 &(ad->itc_1icon_1text_sub),
179 __sound_sub_list_sel_cb,
181 SWALLOW_Type_1RADIO, rgd,
183 SETTING_SOUND_TEXT_REPEAT_ONCE,
186 setting_create_Gendial_exp_sub_field(scroller,
187 &(ad->itc_1icon_1text_sub),
188 __sound_sub_list_sel_cb,
190 SWALLOW_Type_1RADIO, rgd,
192 SETTING_SOUND_TEXT_REPEAT_2MIN,
195 setting_create_Gendial_exp_sub_field(scroller,
196 &(ad->itc_1icon_1text_sub),
197 __sound_sub_list_sel_cb,
199 SWALLOW_Type_1RADIO, rgd,
201 SETTING_SOUND_TEXT_REPEAT_5MIN,
203 setting_create_Gendial_exp_sub_field(scroller,
204 &(ad->itc_1icon_1text_sub),
205 __sound_sub_list_sel_cb,
207 SWALLOW_Type_1RADIO, rgd,
209 SETTING_SOUND_TEXT_REPEAT_10MIN,
212 setting_update_chk_status(rgd,
214 int_slp_setting_binded);
218 static void __mm_player_msg_cb(void *user_param)
220 ret_if(user_param == NULL);
221 SettingProfileUG *ad = (SettingProfileUG *)user_param;
224 case MM_MESSAGE_END_OF_STREAM:
225 SETTING_TRACE_DEBUG("End of Stream");
226 setting_profile_close_all_mm_players(ad);
231 SETTING_TRACE("completed_cb is called.");
232 setting_profile_close_all_mm_players(ad);
235 void __ringtone_start_change_cb(void *data, Evas_Object *obj, void *event_info)
237 ret_if(data == NULL);
239 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
240 SettingProfileUG *ad = list_item->userdata;
242 ad->cur_vol_type = SETTING_VOL_TYPE_RINGTONE;
243 setting_profile_close_other_mm_players_but_type(ad, SOUND_TYPE_RINGTONE);
245 void __noti_start_change_cb(void *data, Evas_Object *obj, void *event_info)
247 ret_if(data == NULL);
249 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
250 SettingProfileUG *ad = list_item->userdata;
252 ad->cur_vol_type = SETTING_VOL_TYPE_NOTIFICATION;
253 setting_profile_close_other_mm_players_but_type(ad, SOUND_TYPE_NOTIFICATION);
255 void __media_start_change_cb(void *data, Evas_Object *obj, void *event_info)
257 ret_if(data == NULL);
259 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
260 SettingProfileUG *ad = list_item->userdata;
262 ad->cur_vol_type = SETTING_VOL_TYPE_MEDIA;
263 setting_profile_close_other_mm_players_but_type(ad, SOUND_TYPE_MEDIA);
265 void __system_start_change_cb(void *data, Evas_Object *obj, void *event_info)
267 ret_if(data == NULL);
269 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
270 SettingProfileUG *ad = list_item->userdata;
272 ad->cur_vol_type = SETTING_VOL_TYPE_SYSTEM;
273 setting_profile_close_other_mm_players_but_type(ad, SOUND_TYPE_SYSTEM);
276 void __volume_stop_change_cb(void *data, Evas_Object *obj, void *event_info)
279 ret_if(data == NULL);
281 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
282 SettingProfileUG *ad = list_item->userdata;
284 char *pa_tone_path = NULL;
285 player_h **player = NULL;
287 double value = elm_slider_value_get(obj);
289 switch(ad->cur_vol_type)
291 case SETTING_VOL_TYPE_RINGTONE:
292 sound_manager_set_volume(SOUND_TYPE_RINGTONE, (unsigned int)(value+0.5));
293 player = &(ad->mp_ringtone);
296 SETTING_TRACE_DEBUG("ringtone player will be created");
297 pa_tone_path = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR);
298 if(pa_tone_path == NULL)
300 pa_tone_path = SETTING_DEFAULT_CALL_TONE;
302 if(vconf_set_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, pa_tone_path) < 0)
305 setting_profile_play_sound_origin(player, ad, __mm_player_msg_cb,
308 SOUND_TYPE_RINGTONE);
310 case SETTING_VOL_TYPE_NOTIFICATION:
311 sound_manager_set_volume(SOUND_TYPE_NOTIFICATION, (unsigned int)(value+0.5));
312 player = &(ad->mp_noti);
315 SETTING_TRACE_DEBUG("noti player will be created");
316 pa_tone_path = vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR);
317 if(pa_tone_path == NULL)
319 pa_tone_path = SETTING_DEFAULT_MSG_TONE;
320 if(vconf_set_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SETTING_DEFAULT_MSG_TONE) < 0)
323 setting_profile_play_sound_origin(player, ad, __mm_player_msg_cb,
326 SOUND_TYPE_NOTIFICATION);
328 case SETTING_VOL_TYPE_MEDIA:
329 sound_manager_set_volume(SOUND_TYPE_MEDIA, (unsigned int)(value+0.5));
330 player = &(ad->mp_media);
333 SETTING_TRACE_DEBUG("media player will be created");
334 pa_tone_path = (char*)strdup(SETTING_DEFAULT_MEDIA_TONE);
336 setting_profile_play_sound_origin(player, ad, __mm_player_msg_cb,
341 case SETTING_VOL_TYPE_SYSTEM:
342 sound_manager_set_volume(SOUND_TYPE_SYSTEM, (unsigned int)(value+0.5));
343 player = &(ad->mp_sys);
346 SETTING_TRACE_DEBUG("ringtone player will be created");
347 char pattern_file[MAX_COMMON_BUFFER_LEN] = {0,};
348 svi_get_path(SVI_TYPE_SND, SVI_SND_TOUCH_TOUCH1, pattern_file, sizeof(pattern_file));
350 setting_profile_play_sound_origin(player, ad, __mm_player_msg_cb,
364 static Evas_Object *__get_main_list(void *data)
366 retv_if(data == NULL, NULL);
368 SettingProfileUG *ad = (SettingProfileUG *) data;
370 if(ad->sub_view[SETTING_PROF_VIEW_VOL])
371 return ad->sub_view[SETTING_PROF_VIEW_VOL];
373 Evas_Object *genlist = elm_genlist_add(ad->navi_bar);
374 elm_object_style_set(genlist, "dialogue");
375 retvm_if(genlist == NULL, NULL,
376 "Cannot set genlist object as contento of layout");
377 elm_genlist_clear(genlist); /* first to clear list */
382 Elm_Object_Item *item = elm_genlist_item_append(genlist,
383 &(ad->itc_seperator), NULL, NULL,
384 ELM_GENLIST_ITEM_NONE, NULL, NULL);
385 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
388 if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &vconf_value) < 0)
389 vconf_value = TRUE; /* default value of sound : on */
391 setting_create_Gendial_field_def(genlist, &(ad->itc_1text_1icon),
392 setting_profile_sound_main_mouse_up_Gendial_list_cb,
393 ad, SWALLOW_Type_1TOGGLE, NULL,
395 SETTING_SOUND_TEXT_SOUND, NULL,
396 setting_profile_sound_main_Gendial_chk_cb);
397 if (ad->data_sound) {
398 ad->data_sound->userdata = ad;
400 SETTING_TRACE_ERROR("ad->data_sound is NULL");
403 (void)setting_create_Gendial_field_titleItem(genlist,
404 &(ad->itc_group_item),
405 "IDS_ST_BODY_VOLUME", NULL);
408 if(sound_manager_get_volume(SOUND_TYPE_RINGTONE, &mm_value) < 0)
409 mm_value = SETTING_DEFAULT_RINGTONE_VOL_INT;
410 ad->data_call_volume =
411 setting_create_Gendial_field_def(genlist, &(ad->itc_layout), NULL,
413 SWALLOW_Type_LAYOUT_SLIDER,
414 IMG_SLIDER_BTN_VOLUME01,
415 IMG_SLIDER_BTN_VOLUME02, mm_value,
416 SETTING_SOUND_TEXT_INCOMING_CALL,
418 setting_profile_sound_main_call_ringtone_sound_slider_value_change_cb);
419 if (ad->data_call_volume) {
420 ad->data_call_volume->win_main = ad->win_main_layout;
421 ad->data_call_volume->evas = ad->evas;
422 ad->data_call_volume->isIndicatorVisible = true;
423 ad->data_call_volume->slider_min = 0;
424 ad->data_call_volume->slider_max = SETTING_SOUND_VOL_MAX;
425 ad->data_call_volume->userdata = ad;
426 ad->data_call_volume->start_change_cb = __ringtone_start_change_cb;
427 ad->data_call_volume->stop_change_cb = __volume_stop_change_cb;
428 ad->data_call_volume->belongs_to = SETTING_VOL_SOUND_GROUP;
430 SETTING_TRACE_ERROR("ad->data_call_volume is NULL");
434 if(sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &mm_value) < 0)
435 mm_value = SETTING_DEFAULT_NOTI_VOL_INT;
436 ad->data_noti_volume =
437 setting_create_Gendial_field_def(genlist, &(ad->itc_layout), NULL,
439 SWALLOW_Type_LAYOUT_SLIDER,
440 IMG_SLIDER_BTN_VOLUME01,
441 IMG_SLIDER_BTN_VOLUME02, mm_value,
442 SETTING_SOUND_TEXT_NOTIFICATION,
444 setting_profile_sound_main_noti_sound_slider_value_change_cb);
445 if (ad->data_noti_volume) {
446 ad->data_noti_volume->win_main = ad->win_main_layout;
447 ad->data_noti_volume->evas = ad->evas;
448 ad->data_noti_volume->isIndicatorVisible = true;
449 ad->data_noti_volume->slider_min = 0;
450 ad->data_noti_volume->slider_max = SETTING_SOUND_VOL_MAX;
451 ad->data_noti_volume->userdata = ad;
452 ad->data_noti_volume->start_change_cb = __noti_start_change_cb;
453 ad->data_noti_volume->stop_change_cb = __volume_stop_change_cb;
454 ad->data_noti_volume->belongs_to = SETTING_VOL_SOUND_GROUP;
456 SETTING_TRACE_ERROR("ad->data_noti_volume is NULL");
460 if(sound_manager_get_volume(SOUND_TYPE_MEDIA, &mm_value) < 0)
461 mm_value = SETTING_DEFAULT_MEDIA_VOL_INT;
462 ad->data_media_volume =
463 setting_create_Gendial_field_def(genlist, &(ad->itc_layout), NULL,
465 SWALLOW_Type_LAYOUT_SLIDER,
466 IMG_SLIDER_BTN_VOLUME01,
467 IMG_SLIDER_BTN_VOLUME02, mm_value,
468 SETTING_SOUND_TEXT_MEDIA, NULL,
469 setting_profile_sound_main_media_sound_slider_value_change_cb);
470 if (ad->data_media_volume) {
471 ad->data_media_volume->win_main = ad->win_main_layout;
472 ad->data_media_volume->evas = ad->evas;
473 ad->data_media_volume->isIndicatorVisible = true;
474 ad->data_media_volume->slider_min = 0;
475 ad->data_media_volume->slider_max = SETTING_SOUND_VOL_MAX;
476 ad->data_media_volume->userdata = ad;
477 ad->data_media_volume->start_change_cb = __media_start_change_cb;
478 ad->data_media_volume->stop_change_cb = __volume_stop_change_cb;
479 ad->data_media_volume->belongs_to = SETTING_VOL_SOUND_GROUP;
481 SETTING_TRACE_ERROR("ad->data_media_volume is NULL");
484 /* h.system volume */
485 if(sound_manager_get_volume(SOUND_TYPE_SYSTEM, &mm_value) < 0)
486 mm_value = SETTING_DEFAULT_SYSTEM_VOL_INT;
487 ad->data_touch_volume =
488 setting_create_Gendial_field_def(genlist, &(ad->itc_layout), NULL,
490 SWALLOW_Type_LAYOUT_SLIDER,
491 IMG_SLIDER_BTN_VOLUME01,
492 IMG_SLIDER_BTN_VOLUME02, mm_value,
493 SETTING_SOUND_TEXT_SYSTEM, NULL,
494 settings_profile_sound_main_sys_sound_slider_value_change_cb);
495 if (ad->data_touch_volume) {
496 ad->data_touch_volume->win_main = ad->win_main_layout;
497 ad->data_touch_volume->evas = ad->evas;
498 ad->data_touch_volume->isIndicatorVisible = true;
499 ad->data_touch_volume->slider_min = 0;
500 ad->data_touch_volume->slider_max = SETTING_SOUND_VOL_MAX;
501 ad->data_touch_volume->userdata = ad;
502 ad->data_touch_volume->start_change_cb = __system_start_change_cb;
503 ad->data_touch_volume->stop_change_cb = __volume_stop_change_cb;
504 ad->data_touch_volume->belongs_to = SETTING_VOL_SOUND_GROUP;
506 SETTING_TRACE_ERROR("ad->data_touch_volume is NULL");
509 setting_create_Gendial_field_def(genlist, &(ad->itc_bg_1icon),
511 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
512 NULL, NULL, 0, SOUND_DESC, NULL, NULL);
513 elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
514 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
517 ad->data_touch_sounds =
518 setting_create_Gendial_field_def(genlist, &(ad->itc_1text_1icon),
519 setting_profile_sound_main_mouse_up_Gendial_list_cb,
520 ad, SWALLOW_Type_1TOGGLE, NULL,
522 "IDS_ST_BODY_TOUCH_SOUNDS",
524 setting_profile_sound_main_Gendial_chk_cb);
525 if (ad->data_touch_sounds) {
526 ad->data_touch_sounds->userdata = ad;
528 SETTING_TRACE_ERROR("ad->data_lock_sound is NULL");
531 setting_create_Gendial_field_def(genlist, &(ad->itc_bg_1icon),
533 SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
534 NULL, NULL, 0, "IDS_ST_BODY_PLAY_SOUND_WHEN_MAKING_SCREEN_SELECTION", NULL, NULL);
535 elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
536 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
538 item = elm_genlist_item_append(genlist, &itc_bottom_seperator, NULL, NULL,
539 ELM_GENLIST_ITEM_NONE, NULL, NULL);
540 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
542 __change_state_of_sliderbars(ad);
544 ad->sub_view[SETTING_PROF_VIEW_VOL] = genlist;
546 return ad->sub_view[SETTING_PROF_VIEW_VOL];
549 static Evas_Object *__get_ringtone_list(void *data)
551 retv_if(data == NULL, NULL);
552 SettingProfileUG *ad = (SettingProfileUG *) data;
554 if(ad->sub_view[SETTING_PROF_VIEW_RTN])
555 return ad->sub_view[SETTING_PROF_VIEW_RTN];
557 Evas_Object *genlist = elm_genlist_add(ad->navi_bar);
558 elm_object_style_set(genlist, "dialogue");
559 retvm_if(genlist == NULL, NULL,
560 "Cannot set genlist object as contento of layout");
561 elm_genlist_clear(genlist); /* first to clear list */
562 setting_enable_expandable_genlist(genlist, ad, __sound_exp_cb, NULL);
564 /* a. incoming call group */
565 (void)setting_create_Gendial_field_titleItem(genlist,
566 &(ad->itc_group_item),
567 SETTING_SOUND_TEXT_INCOMING_CALL,
572 char *sub_desc = NULL;
573 char *pa_ringtone = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR);
574 if(setting_profile_check_file_exist(ad, pa_ringtone) == SETTING_RETURN_FAIL)
576 pa_ringtone = (char *)strdup(SETTING_DEFAULT_CALL_TONE);
577 vconf_ret = vconf_set_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, pa_ringtone);
579 SETTING_TRACE_DEBUG("failed to set vconf");
581 sub_desc = setting_file_basename(pa_ringtone);
583 ad->data_call_alert_tone =
584 setting_create_Gendial_field_def(genlist, &(ad->itc_2text_2),
585 setting_profile_sound_main_mouse_up_Gendial_list_cb,
586 ad, SWALLOW_Type_INVALID, NULL,
587 NULL, 0, SETTING_SOUND_TEXT_CALL_RINGTONE,
589 if (ad->data_call_alert_tone) {
590 ad->data_call_alert_tone->userdata = ad;
592 SETTING_TRACE_ERROR("ad->data_call_alert_tone is NULL");
598 /* b. notification */
599 (void)setting_create_Gendial_field_titleItem(genlist,
600 &(ad->itc_group_item),
601 SETTING_SOUND_TEXT_NOTIFICATION,
604 char *repeat_type[SETTING_SOUND_REPEAT_TYPE_LEN] = {
605 _(SETTING_SOUND_TEXT_REPEAT_ONCE),
606 _(SETTING_SOUND_TEXT_REPEAT_2MIN),
607 _(SETTING_SOUND_TEXT_REPEAT_5MIN),
608 _(SETTING_SOUND_TEXT_REPEAT_10MIN)
610 int repeat_value = 0;
612 /* b-1. msg ringtone */
613 pa_ringtone = vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR);
614 if(setting_profile_check_file_exist(ad, pa_ringtone) == SETTING_RETURN_FAIL)
616 pa_ringtone = (char *)strdup(SETTING_DEFAULT_MSG_TONE);
617 vconf_ret = vconf_set_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, SETTING_DEFAULT_MSG_TONE);
619 SETTING_TRACE_DEBUG("failed to set vconf");
621 sub_desc = setting_file_basename(pa_ringtone);
623 ad->data_msg_alert_tone =
624 setting_create_Gendial_field_def(genlist, &(ad->itc_2text_2),
625 setting_profile_sound_main_mouse_up_Gendial_list_cb,
626 ad, SWALLOW_Type_INVALID, NULL,
628 SETTING_SOUND_TEXT_MSG_ALERT,
630 if (ad->data_msg_alert_tone) {
631 ad->data_msg_alert_tone->userdata = ad;
633 SETTING_TRACE_ERROR("ad->data_msg_alert_tone is NULL");
638 /* b-2. msg alert repetition */
640 (VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, &repeat_value) != 0)
641 repeat_value = SETTING_DEFAULT_ALERT_REPEAT_TYPE_INT; /* default 0 : repeat once */
642 ad->data_msg_alert_repeat =
643 setting_create_Gendial_exp_parent_field(genlist,
644 &(ad->itc_2text_3_parent),
645 setting_profile_sound_main_mouse_up_Gendial_list_cb,
646 ad, SWALLOW_Type_INVALID,
647 SETTING_SOUND_TEXT_MSG_RINGTONE_REPEAT,
648 repeat_type[repeat_value]);
649 if (ad->data_msg_alert_repeat) {
650 ad->data_msg_alert_repeat->int_slp_setting_binded =
651 INT_SLP_SETTING_MSG_ALERT_REPEAT;
653 SETTING_TRACE_ERROR("ad->data_msg_alert_repeat is NULL");
656 /* b-3. email ringtone */
657 pa_ringtone = vconf_get_str(VCONFKEY_SETAPPL_NOTI_EMAIL_RINGTONE_PATH_STR);
658 if(setting_profile_check_file_exist(ad, pa_ringtone) == SETTING_RETURN_FAIL)
660 pa_ringtone = (char *)strdup(SETTING_DEFAULT_EMAIL_TONE);
661 vconf_ret = vconf_set_str(VCONFKEY_SETAPPL_NOTI_EMAIL_RINGTONE_PATH_STR, SETTING_DEFAULT_EMAIL_TONE);
663 SETTING_TRACE_DEBUG("failed to set vconf");
665 sub_desc = setting_file_basename(pa_ringtone);
667 ad->data_email_alert_tone =
668 setting_create_Gendial_field_def(genlist, &(ad->itc_2text_2),
669 setting_profile_sound_main_mouse_up_Gendial_list_cb,
670 ad, SWALLOW_Type_INVALID, NULL,
672 SETTING_SOUND_TEXT_EMAIL_ALERT,
674 if (ad->data_email_alert_tone) {
675 ad->data_email_alert_tone->userdata = ad;
677 SETTING_TRACE_ERROR("ad->data_email_alert_tone is NULL");
682 /* b-4. email alert repetition */
684 (VCONFKEY_SETAPPL_NOTI_EMAIL_ALERT_REP_TYPE_INT,
686 repeat_value = SETTING_DEFAULT_ALERT_REPEAT_TYPE_INT; /* default 0 : repeat once */
687 ad->data_email_alert_repeat =
688 setting_create_Gendial_exp_parent_field(genlist,
689 &(ad->itc_2text_3_parent),
690 setting_profile_sound_main_mouse_up_Gendial_list_cb,
691 ad, SWALLOW_Type_INVALID,
692 SETTING_SOUND_TEXT_EMAIL_RINGTONE_REPEAT,
693 repeat_type[repeat_value]);
694 if (ad->data_email_alert_repeat) {
695 ad->data_email_alert_repeat->int_slp_setting_binded =
696 INT_SLP_SETTING_EMAIL_ALERT_REPEAT;
698 SETTING_TRACE_ERROR("ad->data_email_alert_repeat is NULL");
701 Elm_Object_Item *item = NULL;
702 item = elm_genlist_item_append(genlist, &itc_bottom_seperator, NULL, NULL,
703 ELM_GENLIST_ITEM_NONE, NULL, NULL);
704 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
706 ad->sub_view[SETTING_PROF_VIEW_RTN] = genlist;
708 return ad->sub_view[SETTING_PROF_VIEW_RTN];
711 static void __view_change_cb(void *data, Evas_Object *obj, void *event_info)
713 //appcore_measure_start();
714 retm_if(event_info == NULL, "Invalid argmuent: event info is NULL");
715 retm_if(data == NULL, "Invalid argmuent: data is NULL");
717 SettingProfileUG *ad = (SettingProfileUG *) data;
719 if (device_haptic_stop_play(ad->hnd_hpt) != 0) {
720 SETTING_TRACE("ERROR device_haptic_stop_play");
723 setting_profile_close_all_mm_players(ad);
725 Evas_Object *sub_view = NULL;
726 Elm_Object_Item *sel_item = elm_toolbar_selected_item_get(obj);
727 const char *tab_lable = elm_object_item_text_get(sel_item);
729 //SETTING_TRACE("tab_lable:%s", tab_lable);
730 if (0 == safeStrCmp(tab_lable, VOLUME_STR)) {
732 device_haptic_stop_play(ad->hnd_hpt);
733 sub_view = __get_main_list(ad);
734 } else if (0 == safeStrCmp(tab_lable, RINGTONE_STR)) {
735 sub_view = __get_ringtone_list(ad);
738 Evas_Object *old_sub_view = elm_object_part_content_get(ad->view_layout, "elm.swallow.content");
739 ret_if(old_sub_view == sub_view);
744 elm_object_part_content_unset(ad->view_layout, "elm.swallow.content");
745 evas_object_hide(old_sub_view);
747 elm_object_part_content_set(ad->view_layout, "elm.swallow.content", sub_view);
748 evas_object_show(sub_view);
752 static int setting_profile_sound_main_create(void *cb)
754 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
756 SettingProfileUG *ad = (SettingProfileUG *) cb;
758 ad->ly_main = setting_create_win_layout(ad->win_main_layout, ad->win_get);
759 ad->navi_bar = setting_create_navi_bar(ad->ly_main);
762 Evas_Object *view_layout = elm_layout_add(ad->win_main_layout);
763 elm_layout_theme_set(view_layout, "layout", "tabbar", "default");
764 evas_object_show(view_layout);
765 ad->view_layout = view_layout;
767 Evas_Object *tabbar= elm_toolbar_add(ad->navi_bar);
769 return SETTING_RETURN_FAIL;
771 elm_object_part_content_set(view_layout, "elm.swallow.tabbar", tabbar);
772 ad->ctrl_bar = tabbar;
773 elm_toolbar_shrink_mode_set(tabbar, ELM_TOOLBAR_SHRINK_EXPAND);
774 elm_object_style_set(tabbar, "tabbar");
776 ad->ctrl_item[0] = elm_toolbar_item_append(tabbar,
778 VOLUME_STR, __view_change_cb, ad);
780 ad->ctrl_item[1] = elm_toolbar_item_append(tabbar,
782 RINGTONE_STR, __view_change_cb, ad);
784 elm_toolbar_select_mode_set(tabbar, ELM_OBJECT_SELECT_MODE_ALWAYS);
785 elm_toolbar_item_selected_set(ad->ctrl_item[0], EINA_TRUE);
787 Evas_Object *ug_back_btn = elm_button_add(ad->navi_bar);
788 elm_object_style_set(ug_back_btn, NAVI_BACK_BUTTON_STYLE);
789 evas_object_smart_callback_add(ug_back_btn, "clicked", setting_profile_sound_main_click_softkey_cancel_cb, ad);
791 Elm_Object_Item *navi_it = elm_naviframe_item_push(ad->navi_bar, NULL, ug_back_btn, NULL, ad->view_layout, "tabbar");
792 elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
794 setting_view_profile_sound_main.is_create = TRUE;
796 return SETTING_RETURN_SUCCESS;
799 static int setting_profile_sound_main_destroy(void *cb)
802 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
804 SettingProfileUG *ad = (SettingProfileUG *) cb;
806 if (ad->ly_main != NULL) {
807 //Fix the memory leak,
808 //Manage ad->sub_view[] separately, unset first, then delete in together
811 elm_object_part_content_unset(ad->view_layout, "elm.swallow.content");
813 int i = SETTING_PROF_VIEW_VOL;
814 for (; i < SETTING_PROF_VIEW_MAX; i++ )
816 evas_object_del(ad->sub_view[i]);
819 evas_object_del(ad->ly_main);
820 setting_view_profile_sound_main.is_create = FALSE;
822 return SETTING_RETURN_SUCCESS;
825 static int setting_profile_sound_main_update(void *cb)
828 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
830 SettingProfileUG *ad = (SettingProfileUG *) cb;
832 if (ad->ly_main != NULL) {
833 evas_object_show(ad->ly_main);
836 return SETTING_RETURN_SUCCESS;
839 static int setting_profile_sound_main_cleanup(void *cb)
842 retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
844 SettingProfileUG *ad = (SettingProfileUG *) cb;
846 if (ad->ly_main != NULL) {
847 evas_object_hide(ad->ly_main);
850 return SETTING_RETURN_SUCCESS;
853 /* ***************************************************
857 ***************************************************/
859 /* ***************************************************
863 ***************************************************/
866 setting_profile_sound_main_click_softkey_cancel_cb(void *data,
871 ret_if(data == NULL);
873 SettingProfileUG *ad = (SettingProfileUG *) data;
876 setting_profile_close_all_mm_players(ad);
877 /* close vibration */
878 if (device_haptic_stop_play(ad->hnd_hpt) != 0) {
879 SETTING_TRACE("ERROR device_haptic_stop_play");
883 /* Send destroy request */
884 ug_destroy_me(ad->ug);
889 static void setting_profile_sound_main_destroy_myfile_ug_cb(ui_gadget_h ug, void *priv)
891 ret_if(priv == NULL);
892 SettingProfileUG *ad = (SettingProfileUG *) priv;
896 ad->ug_loading = NULL;
901 setting_profile_sound_main_result_myfile_ug_cb(ui_gadget_h ug,
902 service_h result, void *priv)
904 ret_if(priv == NULL);
906 SettingProfileUG *ad = (SettingProfileUG *) priv;
907 char *ringtone_file = NULL;
908 char *ringtone_path = NULL;
910 service_get_extra_data(result, "result", &ringtone_path);
914 SETTING_TRACE("ringtone_path:%s", ringtone_path);
916 if (ringtone_path != NULL) {
917 ringtone_file = setting_file_basename(ringtone_path);
918 SETTING_TRACE("ringtone_file:%s", ringtone_file);
920 if (0 == safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_CALL_RINGTONE)) {
922 (VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR, ringtone_path) == 0) {
923 if (ad->data_call_alert_tone) {
924 ad->data_call_alert_tone->sub_desc = (char *)g_strdup(ringtone_file);
926 elm_object_item_data_set(ad->data_call_alert_tone->item, ad->data_call_alert_tone);
927 elm_genlist_item_update(ad->data_call_alert_tone->item);
931 safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_MSG_ALERT)) {
933 (VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR, ringtone_path) == 0) {
934 if (ad->data_msg_alert_tone) {
935 ad->data_msg_alert_tone->sub_desc = (char *)g_strdup(ringtone_file);
937 elm_object_item_data_set(ad->data_msg_alert_tone->item, ad->data_msg_alert_tone);
938 elm_genlist_item_update(ad->data_msg_alert_tone->item);
942 safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_EMAIL_ALERT)) {
944 (VCONFKEY_SETAPPL_NOTI_EMAIL_RINGTONE_PATH_STR, ringtone_path) == 0) {
945 if (ad->data_email_alert_tone) {
946 ad->data_email_alert_tone->sub_desc = (char *)g_strdup(ringtone_file);
948 elm_object_item_data_set(ad->data_email_alert_tone->item, ad->data_email_alert_tone);
949 elm_genlist_item_update(ad->data_email_alert_tone->item);
955 G_FREE(ringtone_file);
960 setting_profile_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode,
963 ret_if(priv == NULL);
965 SettingProfileUG *ad = (SettingProfileUG *) priv;
968 base = (Evas_Object *) ug_get_layout(ug);
973 case UG_MODE_FULLVIEW:
974 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
975 elm_win_resize_object_add(ad->win_get, base);
976 evas_object_show(base);
984 static void setting_profile_sound_main_create_myfile_ug(SettingProfileUG *ad)
990 SETTING_TRACE("Myfiles ug is already loaded.");
994 struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
998 cbs->layout_cb = setting_profile_layout_ug_cb;
999 cbs->result_cb = setting_profile_sound_main_result_myfile_ug_cb;
1000 cbs->destroy_cb = setting_profile_sound_main_destroy_myfile_ug_cb;
1001 cbs->priv = (void *)ad;
1004 if (service_create(&svc)) {
1009 const char *pa_cur_ringtone = NULL;
1010 const char *dir_path = NULL;
1011 if (0 == safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_CALL_RINGTONE)) {
1012 pa_cur_ringtone = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR);
1013 if (pa_cur_ringtone == NULL)
1015 pa_cur_ringtone = SETTING_DEFAULT_CALL_TONE;
1017 dir_path = SETTING_PROFILE_SOUND_RINGTONES_PATH;
1018 } else if (0 == safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_MSG_ALERT)) {
1019 pa_cur_ringtone = vconf_get_str(VCONFKEY_SETAPPL_NOTI_MSG_RINGTONE_PATH_STR);
1020 if (pa_cur_ringtone == NULL)
1021 pa_cur_ringtone = SETTING_DEFAULT_MSG_TONE;
1022 dir_path = SETTING_PROFILE_SOUND_ALERTS_PATH;
1023 } else if (0 == safeStrCmp(ad->ringtone_type, SETTING_SOUND_TEXT_EMAIL_ALERT)) {
1024 pa_cur_ringtone = vconf_get_str(VCONFKEY_SETAPPL_NOTI_EMAIL_RINGTONE_PATH_STR);
1025 if (pa_cur_ringtone == NULL)
1026 pa_cur_ringtone = SETTING_DEFAULT_EMAIL_TONE;
1027 dir_path = SETTING_PROFILE_SOUND_ALERTS_PATH;
1029 SETTING_TRACE("pa_cur_ringtone:\t%s", pa_cur_ringtone);
1030 SETTING_TRACE("dir_path:\t%s", dir_path);
1032 service_add_extra_data(svc, "marked_mode", pa_cur_ringtone);
1033 service_add_extra_data(svc, "path", dir_path);
1034 service_add_extra_data(svc, "select_type", "SINGLE_FILE");
1035 service_add_extra_data(svc, "file_type", "SOUND");
1036 service_add_extra_data(svc, "drm_type", "DRM_ALL");
1038 SETTING_TRACE("ad->ug->layout:%p", (void *)ug_get_layout(ad->ug));
1039 ad->ug_loading = ug_create(ad->ug, "myfile-efl", UG_MODE_FULLVIEW, svc, cbs);
1040 if (NULL == ad->ug_loading) { /* error handling */
1041 SETTING_TRACE_ERROR("NULL == ad->ug_loading");
1044 service_destroy(svc);
1047 /** @todo verify it's valid */
1049 FREE(pa_cur_ringtone);
1055 setting_profile_sound_main_Gendial_chk_cb(void *data, Evas_Object *obj,
1059 ret_if(data == NULL);
1061 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1062 SettingProfileUG *ad = list_item->userdata;
1064 int state = list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */
1066 /* restore the selected check status */
1067 list_item->chk_status = state;
1068 elm_check_state_set(list_item->eo_check, state);
1070 if (!safeStrCmp(SETTING_SOUND_TEXT_SOUND, list_item->keyStr)) {
1071 if (vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, list_item->chk_status) < 0) {
1072 list_item->chk_status = !state;
1073 elm_check_state_set(list_item->eo_check, list_item->chk_status);
1076 if (list_item->chk_status) {
1077 setting_enable_genlist_item(ad->data_call_volume->item);
1078 setting_enable_genlist_item(ad->data_noti_volume->item);
1079 setting_enable_genlist_item(ad->data_media_volume->item);
1080 setting_enable_genlist_item(ad->data_touch_volume->item);
1082 setting_profile_close_all_mm_players(ad);
1083 setting_disable_genlist_item(ad->data_call_volume->item);
1084 setting_disable_genlist_item(ad->data_noti_volume->item);
1085 setting_disable_genlist_item(ad->data_media_volume->item);
1086 setting_disable_genlist_item(ad->data_touch_volume->item);
1088 } else if (!safeStrCmp(SETTING_SOUND_TEXT_VIBRATION, list_item->keyStr)) {
1089 if (vconf_set_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, list_item->chk_status) < 0) {
1090 list_item->chk_status = !state;
1091 elm_check_state_set(list_item->eo_check, list_item->chk_status);
1093 if (list_item->chk_status) {
1094 setting_enable_genlist_item(ad->data_vib_volume->item);
1095 setting_enable_genlist_item(ad->data_touch_vib->item);
1097 /* Play vib if vib turns on */
1099 char pattern_file[MAX_COMMON_BUFFER_LEN] = {0,};
1100 svi_get_path(SVI_TYPE_VIB, SVI_VIB_NOTIFICATION_GENERAL, pattern_file, sizeof(pattern_file));
1101 device_haptic_stop_play(ad->hnd_hpt);
1102 err = device_haptic_play_file(ad->hnd_hpt, pattern_file, 1, (int)(elm_slider_value_get(ad->data_vib_volume->eo_check)+0.5));
1105 SETTING_TRACE("Failed to play haptic monotone");
1107 if (device_haptic_stop_play(ad->hnd_hpt) != 0) {
1108 SETTING_TRACE("ERROR device_haptic_stop_play");
1110 setting_disable_genlist_item(ad->data_vib_volume->item);
1111 setting_disable_genlist_item(ad->data_touch_vib->item);
1114 /* additional items */
1115 else if (!safeStrCmp(SETTING_SOUND_TEXT_LOCK_SOUND, list_item->keyStr)) {
1116 if (vconf_set_bool(VCONFKEY_SETAPPL_SOUND_LOCK_BOOL, list_item->chk_status) < 0) {
1117 list_item->chk_status = !state;
1118 elm_check_state_set(list_item->eo_check, !state);
1127 setting_profile_sound_main_mouse_up_Gendial_list_cb(void *data,
1132 ret_if(data == NULL);
1133 retm_if(event_info == NULL, "Invalid argument: event info is NULL");
1135 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
1136 elm_genlist_item_selected_set(item, 0);
1137 Setting_GenGroupItem_Data *list_item =
1138 (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
1140 SettingProfileUG *ad = data;
1143 device_haptic_stop_play(ad->hnd_hpt);
1145 SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
1146 if (!safeStrCmp(SETTING_SOUND_TEXT_CALL_RINGTONE, list_item->keyStr)
1147 || !safeStrCmp(SETTING_SOUND_TEXT_MSG_ALERT, list_item->keyStr)
1148 || !safeStrCmp(SETTING_SOUND_TEXT_EMAIL_ALERT, list_item->keyStr)) {
1149 ad->ringtone_type = list_item->keyStr;
1150 setting_profile_sound_main_create_myfile_ug(ad);
1151 } else if (!safeStrCmp(SETTING_SOUND_TEXT_SOUND, list_item->keyStr)) {
1152 int old_status = elm_check_state_get(list_item->eo_check);
1153 if (vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, !old_status) == 0) {
1155 list_item->chk_status = !old_status;
1156 elm_check_state_set(list_item->eo_check, list_item->chk_status);
1157 if (list_item->chk_status) {
1158 setting_enable_genlist_item(ad->data_call_volume->item);
1159 setting_enable_genlist_item(ad->data_noti_volume->item);
1160 setting_enable_genlist_item(ad->data_media_volume->item);
1161 setting_enable_genlist_item(ad->data_touch_volume->item);
1163 setting_profile_close_all_mm_players(ad);
1164 setting_disable_genlist_item(ad->data_call_volume->item);
1165 setting_disable_genlist_item(ad->data_noti_volume->item);
1166 setting_disable_genlist_item(ad->data_media_volume->item);
1167 setting_disable_genlist_item(ad->data_touch_volume->item);
1172 else if (!safeStrCmp("IDS_ST_BODY_TOUCH_SOUNDS", list_item->keyStr)) {
1173 int old_status = elm_check_state_get(list_item->eo_check);
1174 /* To do : set vconfkey for touch sounds */
1176 list_item->chk_status = !old_status;
1177 elm_check_state_set(list_item->eo_check, list_item->chk_status);
1180 else if (ad->data_msg_alert_repeat == list_item
1181 || ad->data_email_alert_repeat == list_item) {
1182 bool status = !elm_genlist_item_expanded_get(item);
1183 elm_genlist_item_expanded_set(item, status);
1188 setting_profile_sound_main_call_ringtone_sound_slider_value_change_cb(void *data,
1193 ret_if(data == NULL);
1195 double val = elm_slider_value_get(obj);
1197 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1198 SettingProfileUG *ad = list_item->userdata;
1200 if(ad->mp_ringtone == NULL)
1203 if(list_item->chk_status != (int)(val+0.5))
1205 list_item->chk_status = (int)(val+0.5);
1206 sound_manager_set_volume(SOUND_TYPE_RINGTONE, (unsigned int)list_item->chk_status);
1207 SETTING_TRACE_DEBUG("ringtone volume is %d, %f", list_item->chk_status, val);
1212 setting_profile_sound_main_noti_sound_slider_value_change_cb(void *data,
1217 ret_if(data == NULL);
1219 double val = elm_slider_value_get(obj);
1221 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1222 SettingProfileUG *ad = list_item->userdata;
1224 if(ad->mp_noti == NULL)
1227 if(list_item->chk_status != (int)(val+0.5))
1229 list_item->chk_status = val;
1230 sound_manager_set_volume(SOUND_TYPE_NOTIFICATION, (unsigned int)list_item->chk_status);
1231 SETTING_TRACE_DEBUG("notification volume is %d, %f", list_item->chk_status, val);
1236 setting_profile_sound_main_media_sound_slider_value_change_cb(void *data,
1241 ret_if(data == NULL);
1243 double val = elm_slider_value_get(obj);
1245 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1246 SettingProfileUG *ad = list_item->userdata;
1248 if(ad->mp_media == NULL)
1250 if(list_item->chk_status != (int)(val+0.5))
1252 list_item->chk_status = val;
1253 sound_manager_set_volume(SOUND_TYPE_MEDIA, (unsigned int)list_item->chk_status);
1254 SETTING_TRACE_DEBUG("media volume is %d, %f", list_item->chk_status, val);
1259 settings_profile_sound_main_sys_sound_slider_value_change_cb(void *data,
1264 ret_if(data == NULL);
1266 double val = elm_slider_value_get(obj);
1268 Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1269 SettingProfileUG *ad = list_item->userdata;
1271 if(ad->mp_sys == NULL)
1274 if(list_item->chk_status != (int)(val+0.5))
1276 list_item->chk_status = val;
1277 sound_manager_set_volume(SOUND_TYPE_SYSTEM, (unsigned int)list_item->chk_status);
1278 SETTING_TRACE_DEBUG("system volume is %d, %f", list_item->chk_status, val);