Sync private git to RSA git.
authorhhh.kwon <hhh.kwon@samsung.com>
Fri, 9 Nov 2012 02:52:06 +0000 (11:52 +0900)
committerhhh.kwon <hhh.kwon@samsung.com>
Fri, 9 Nov 2012 02:52:06 +0000 (11:52 +0900)
21 files changed:
CMakeLists.txt
data/images/public/00_volume_icon.png [deleted file]
data/images/public/00_volume_icon_Call.png [deleted file]
data/images/public/00_volume_icon_Mute.png [deleted file]
data/images/public/00_volume_icon_Vibrat.png [deleted file]
data/images/public/00_volume_icon_headphone.png [deleted file]
data/images/public/00_volume_icon_media.png [deleted file]
data/images/public/00_winset_divider_line.png [deleted file]
data/volume_app.edc
packaging/org.tizen.volume.spec
src/_button.c
src/_button.h
src/_logic.c
src/_logic.h
src/_sound.c
src/_sound.h
src/_util_efl.c
src/_util_efl.h
src/_util_log.h
src/volume.c
src/volume.h

index f916549..6ea1b59 100644 (file)
@@ -44,6 +44,7 @@ pkg_check_modules(pkgs REQUIRED
        svi
        glib-2.0
        ui-gadget-1
+       notification
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
diff --git a/data/images/public/00_volume_icon.png b/data/images/public/00_volume_icon.png
deleted file mode 100755 (executable)
index d9bdd9b..0000000
Binary files a/data/images/public/00_volume_icon.png and /dev/null differ
diff --git a/data/images/public/00_volume_icon_Call.png b/data/images/public/00_volume_icon_Call.png
deleted file mode 100755 (executable)
index 922b246..0000000
Binary files a/data/images/public/00_volume_icon_Call.png and /dev/null differ
diff --git a/data/images/public/00_volume_icon_Mute.png b/data/images/public/00_volume_icon_Mute.png
deleted file mode 100755 (executable)
index bb970b9..0000000
Binary files a/data/images/public/00_volume_icon_Mute.png and /dev/null differ
diff --git a/data/images/public/00_volume_icon_Vibrat.png b/data/images/public/00_volume_icon_Vibrat.png
deleted file mode 100755 (executable)
index 2528fff..0000000
Binary files a/data/images/public/00_volume_icon_Vibrat.png and /dev/null differ
diff --git a/data/images/public/00_volume_icon_headphone.png b/data/images/public/00_volume_icon_headphone.png
deleted file mode 100755 (executable)
index 0819ca0..0000000
Binary files a/data/images/public/00_volume_icon_headphone.png and /dev/null differ
diff --git a/data/images/public/00_volume_icon_media.png b/data/images/public/00_volume_icon_media.png
deleted file mode 100755 (executable)
index 39b0abe..0000000
Binary files a/data/images/public/00_volume_icon_media.png and /dev/null differ
diff --git a/data/images/public/00_winset_divider_line.png b/data/images/public/00_winset_divider_line.png
deleted file mode 100755 (executable)
index e287978..0000000
Binary files a/data/images/public/00_winset_divider_line.png and /dev/null differ
index 85a19bc..78d4f06 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+#define RESOURCE_IMAGE( FILE_NAME ) \
+        group { \
+                name : FILE_NAME; \
+                images.image: FILE_NAME COMP; \
+                parts { \
+                        part { name: "image"; \
+                                description { \
+                                        state : "default" 0.0; \
+                                        image.normal : FILE_NAME; \
+                                        aspect : 1 1; \
+                                        aspect_preference : BOTH; \
+                                } \
+                        } \
+                } \
+        }
+
+
 collections {
 
+RESOURCE_IMAGE("00_volume_icon.png");
+RESOURCE_IMAGE("00_volume_icon_Call.png");
+RESOURCE_IMAGE("00_volume_icon_Mute.png");
+RESOURCE_IMAGE("00_volume_icon_Vibrat.png");
+RESOURCE_IMAGE("00_volume_icon_headphone.png");
+RESOURCE_IMAGE("00_volume_icon_media.png");
+
        #define SLIDER_INDICATOR_TEXT_COLOR_INC      42 109 140 255
        #define SLIDER_UNITS_TEXT_COLOR_INC          100 100 100 255
        #define SLIDER_UNITS_TEXT_SIZE_INC  30
index 7298249..2682e7d 100755 (executable)
@@ -13,6 +13,7 @@ BuildRequires:  pkgconfig(syspopup)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(svi)
 BuildRequires:  pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(notification)
 
 BuildRequires:  cmake
 BuildRequires:  edje-bin
index 05513dd..11a8c27 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,12 +52,15 @@ static void button_ug_destroy_cb(ui_gadget_h ug, void *priv)
        struct appdata *ad = (struct appdata *)priv;
        retm_if(ug == NULL, "Invalid argument: ug is NULL\n");
 
-       ug_destroy(ug);
+       /* ug_destroy 0 : success, -1 : fail */
+       _D("%d\n", ug_destroy(ug));
        ad->ug = NULL;
 
        ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
        utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
+
        _close_volume(ad);
+       elm_exit();
 }
 
 ui_gadget_h create_button_ug(void *data)
@@ -86,9 +89,9 @@ int _open_ug(void *data)
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
        retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
 
-       UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
-       elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
+       UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_PORTRAIT_ONLY);
        ug = create_button_ug(ad);
+       _ungrab_key(ad);
 
        retvm_if(ug == NULL, -1, "Failed to Create ug!\n");
 
@@ -96,4 +99,3 @@ int _open_ug(void *data)
 
        return 0;
 }
-
index ae3fd14..61fb368 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index bf33499..e526d1d 100755 (executable)
@@ -1,4 +1,4 @@
-/*
+/* test
  * Copyright 2012  Samsung Electronics Co., Ltd
  *
  * Licensed under the Flora License, Version 1.0 (the License);
@@ -25,6 +25,7 @@
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
 
+#include"_logic.h"
 #include "volume.h"
 #include "_util_log.h"
 #include "_util_efl.h"
@@ -40,8 +41,6 @@ enum {
        IDLELOCK_MAX,
 };
 
-void _ungrab_key(struct appdata *ad);
-
 int _close_volume(void *data)
 {
        struct appdata *ad = (struct appdata *)data;
@@ -129,7 +128,7 @@ Eina_Bool _sd_timer_cb(void *data)
 static Eina_Bool _key_press_cb(void *data, int type, void *event)
 {
        _D("%s\n", __func__);
-       int val=0, snd=0;
+       int val=0, snd=0, vib=0;
        Ecore_Event_Key *ev = event;
        struct appdata *ad = (struct appdata *)data;
 
@@ -141,42 +140,40 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event)
                return ECORE_CALLBACK_CANCEL;
        }
 
-       vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &snd);
-
        ad->flag_pressing = EINA_TRUE;
 
        DEL_TIMER(ad->ptimer)
+       vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &snd);
+       vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &vib);
+
+       /* If sound is set off, only RINGTONE, MEDIA types are able to change. */
+       if(!snd && ad->type != VOLUME_TYPE_MEDIA && ad->type != VOLUME_TYPE_RINGTONE){
+               if(vib)_play_vib(ad->sh);
+               return ECORE_CALLBACK_CANCEL;
+       }
 
        if (!strcmp(ev->keyname, KEY_VOLUMEUP)) {
                _get_sound_level(ad->type, &val);
                if (val == ad->step) {
                        _set_sound_level(ad->type, ad->step);
-                       _play_sound(ad->type, ad->sh);
+                       if(snd)_play_sound(ad->type, ad->sh);
                        return ECORE_CALLBACK_CANCEL;
                }
-               if(!snd){
-                       _D("mute and volume up key pressed\n");
-                       vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, EINA_TRUE);
-               }
                _set_sound_level(ad->type, val + 1);
-               _play_sound(ad->type, ad->sh);
+               if(snd)_play_sound(ad->type, ad->sh);
                DEL_TIMER(ad->sutimer)
                ADD_TIMER(ad->sutimer, 0.5, _su_timer_cb, ad)
 
                _D("set volume %d -> [%d]\n", val, val+1);
 
        } else if (!strcmp(ev->keyname, KEY_VOLUMEDOWN)) {
-               if(!snd){
-                       /* Do nothing */
-                       return ECORE_CALLBACK_CANCEL;
-               }
                _get_sound_level(ad->type, &val);
                if (val == 0) {
-                       _play_vib(ad->sh);
+                       if(vib)_play_vib(ad->sh);
                        return ECORE_CALLBACK_CANCEL;
                }
                _set_sound_level(ad->type, val - 1);
-               _play_sound(ad->type, ad->sh);
+               if(snd)_play_sound(ad->type, ad->sh);
                DEL_TIMER(ad->sdtimer)
                ADD_TIMER(ad->sdtimer, 0.5, _sd_timer_cb, ad)
 
@@ -293,10 +290,10 @@ volume_type_t _get_volume_type(void)
                        break;
                case MM_ERROR_SOUND_VOLUME_NO_INSTANCE:
                case MM_ERROR_SOUND_VOLUME_CAPTURE_ONLY:
-                       type = VOLUME_TYPE_SYSTEM;
+                       type = VOLUME_TYPE_RINGTONE;
                        break;
                default:
-                       fprintf(stderr, "Failed to get sound type(errno:%x)\n", ret);
+                       _D("Failed to get sound type(errno:%x)\n", ret);
                        return -1;
        }
        return type;
@@ -496,7 +493,6 @@ void _set_level(int type)
 
 static void _block_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source)
 {
-       _D("%s\n", __func__);
        _close_volume(data);
 }
 
@@ -608,7 +604,7 @@ Eina_Bool _ld_warmup_timer_cb(void *data)
 void _init_press_timers(void *data)
 {
        struct appdata *ad = (struct appdata *)data;
-       retvm_if(ad == NULL, ECORE_CALLBACK_CANCEL, "Invalid argument: appdata is NULL\n");
+       retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
        DEL_TIMER(ad->sdtimer)
        DEL_TIMER(ad->ldtimer)
        DEL_TIMER(ad->ldwarmtimer)
@@ -625,7 +621,6 @@ int _handle_bundle(bundle *b, struct appdata *ad)
        bval = bundle_get_val(b, "LONG_PRESS");
        if (bval) {
                _D("val(%s)\n", bval);
-               Ecore_X_Display* disp = ecore_x_display_get();
 
                if (!strncmp(bval, "VOLUME_UP", strlen("LONG_PRESS"))) {
                        _D("volume up long press\n");
@@ -645,14 +640,14 @@ int _handle_bundle(bundle *b, struct appdata *ad)
        return 0;
 }
 
-static void _button_mouse_down_cb(void *data, Evas_Object *obj, void *event_info)
+static void _button_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        _D("%s\n", __func__);
        struct appdata *ad = (struct appdata *)data;
        retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
        char buf[PATHBUF_SIZE] = {0, };
-       snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS_PRESSED);
-       elm_icon_file_set(ad->ic_settings, buf, NULL);
+       snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS_PRESSED);
+       elm_icon_file_set(obj, buf, NULL);
 }
 
 static void _button_cb(void *data, Evas_Object *obj, void *event_info)
@@ -661,41 +656,13 @@ static void _button_cb(void *data, Evas_Object *obj, void *event_info)
        struct appdata *ad = (struct appdata *)data;
        retm_if(ad == NULL, "Invalid argument: appdata is NULL\n");
        char buf[PATHBUF_SIZE] = {0, };
-       snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
-       elm_icon_file_set(ad->ic_settings, buf, NULL);
+       snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
+       elm_icon_file_set(obj, buf, NULL);
        if(evas_object_visible_get(ad->win)){
                DEL_TIMER(ad->ptimer)
                _open_ug(ad);
        }
 }
-/*
-Eina_Bool _unset_layout(void *data)
-{
-       struct appdata *ad = (struct appdata *)data;
-       retvm_if(ad == NULL, EINA_FALSE,"Invalid argument: appdata is NULL\n");
-
-       DEL_TIMER(ad->warntimer);
-       if(elm_object_content_get(ad->pu)==ad->warn_ly){
-               elm_object_content_unset(ad->pu);
-               elm_object_content_set(ad->pu, ad->sl);
-               evas_object_hide(ad->warn_ly);
-       }
-       return ECORE_CALLBACK_CANCEL;
-}
-*/
-int _lang_changed(void *data){
-       _D("%s\n", __func__);
-       struct appdata *ad = (struct appdata *)data;
-       char buf[STRBUF_SIZE] = {0, };
-
-       retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
-       retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
-
-       snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
-                       T_("IDS_COM_BODY_HIGH_VOLUMES_MAY_HARM_YOUR_HEARING_IF_YOU_LISTEN_FOR_A_LONG_TIME"));
-       elm_object_text_set(ad->warn_lb, buf);
-       return 0;
-}
 
 int _app_reset(bundle *b, void *data)
 {
@@ -707,8 +674,6 @@ int _app_reset(bundle *b, void *data)
        /* volume-app layout */
        Elm_Theme *th;
        Evas_Object *outer, *inner, *block;
-       /* warn message layout */
-       //Evas_Object *label, *warn_ly;
        char buf[PATHBUF_SIZE] = {0, };
        struct appdata *ad = (struct appdata *)data;
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
@@ -741,6 +706,7 @@ int _app_reset(bundle *b, void *data)
                ad->win = win;
 
                _grab_key(ad);
+               mm_sound_route_get_playing_device(&(ad->device));
 
                th = elm_theme_new();
                elm_theme_ref_set(th, NULL);
@@ -770,7 +736,8 @@ int _app_reset(bundle *b, void *data)
                ic_settings = elm_icon_add(win);
                evas_object_size_hint_aspect_set(ic_settings, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
                elm_icon_resizable_set(ic_settings, EINA_FALSE, EINA_FALSE);
-               snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
+               snprintf(buf, sizeof(buf), "%s/%s", IMAGEDIR, IMG_VOLUME_ICON_SETTINGS);
+               _D("%s\n", buf);
                elm_icon_file_set(ic_settings, buf, NULL);
                elm_object_part_content_set(sl, "end", ic_settings);
                evas_object_event_callback_add(ic_settings, EVAS_CALLBACK_MOUSE_DOWN, _button_mouse_down_cb, ad);
@@ -788,22 +755,6 @@ int _app_reset(bundle *b, void *data)
                ad->ic = ic;
                _set_icon(ad, val);
 
-               /* Make a Layout for volume slider with warning text. */
-               /*
-               snprintf(buf, sizeof(buf), "<font_size=32><b>%s</b></font_size>",
-                       T_("IDS_COM_BODY_HIGH_VOLUMES_MAY_HARM_YOUR_HEARING_IF_YOU_LISTEN_FOR_A_LONG_TIME"));
-               label = _add_label(inner, "popup/default", buf);
-               //elm_object_part_content_set(inner, "elm.swallow.warn_label", label);
-               elm_object_part_content_set(outer, "elm.swallow.warn_label", label);
-               evas_object_show(label);
-               ad->warn_lb = label;
-               _D("%s\n", buf);*/
-
-               /*warn_ly = _add_layout(ad->pu, EDJ_THEME, GRP_VOLUME_SLIDER_WITH_WARNING);
-               elm_object_part_content_set(warn_ly, "elm.swallow.warn_label", ad->warn_lb);
-               ad->warn_ly = warn_ly;
-               evas_object_hide(ad->warn_ly);*/
-
                ret = syspopup_create(b, &handler, ad->win, ad);
                retvm_if(ret < 0, -1, "Failed to create syspopup\n");
 
@@ -811,13 +762,6 @@ int _app_reset(bundle *b, void *data)
 
                _rotate_func(ad);
                evas_object_show(ad->win);
-
-               if(evas_object_visible_get(ad->win))
-                       _D("window is visible\n");
-               else{
-                       _D("window is invisible, close volume\n");
-                       _close_volume(ad);
-               }
        }
        ad->flag_launching = EINA_FALSE;
        return 0;
index 4413e57..0d9051b 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,10 +27,8 @@ int _app_pause(struct appdata *ad);
 int _rotate_func(void *data);
 int _app_reset(bundle *b, void *data);
 Eina_Bool popup_timer_cb(void *data);
-Eina_Bool _unset_layout(void *data);
-int _lang_changed(void *data);
 void _init_press_timers(void *data);
+void _ungrab_key(struct appdata *ad);
 
 #endif
-
 /* __VOLUME_LOGIC_H__ */
index f450f1b..28cf820 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,6 +27,8 @@
 #define STRBUF_SIZE 64
 #define PATHBUF_SIZE 256
 
+int _set_sound_level(volume_type_t type, int val);
+
 void _play_vib(int handle)
 {
        svi_play_vib(handle, SVI_VIB_OPERATION_VIBRATION);
@@ -77,7 +79,6 @@ int _set_slider_value(void *data, int val)
 int _set_icon(void *data, int val)
 {
        int snd=0, vib=0;
-       char buf[PATHBUF_SIZE] = {0, };
        char *img = NULL;
        struct appdata *ad = (struct appdata *)data;
        retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
@@ -122,13 +123,58 @@ int _set_icon(void *data, int val)
                        }
                        break;
        }
-       snprintf(buf, sizeof(buf), "%s%s", IMAGEDIR, img);
        if (ad->ic ) {
-               elm_icon_file_set(ad->ic, buf, NULL);
+               elm_icon_file_set(ad->ic, EDJ_APP, img);
        }
        return 1;
 }
-/*
+
+Eina_Bool _delete_message_ticker_notification(void *data)
+{
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+       struct appdata *ad = (struct appdata *)data;
+       retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
+
+       if(ad->noti){
+               noti_err = notification_delete(ad->noti);
+               retvm_if(noti_err != NOTIFICATION_ERROR_NONE, ECORE_CALLBACK_RENEW, "Fail to notification_delete : %d\n", noti_err);
+       }
+       ad->noti = NULL;
+       return ECORE_CALLBACK_CANCEL;
+}
+
+notification_h _insert_message_ticker_notification(const char* pTickerMsg, const char* pLocaleTickerMsg)
+{
+       notification_h noti = NULL;
+       notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+       noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
+       retvm_if(noti == NULL, NULL, "notification_new is failed\n");
+
+       noti_err = notification_set_application(noti, PKGNAME);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_application : %d\n", noti_err);
+
+       noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, IMG_VOLUME_PACKAGE_ICON);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_image : %d\n", noti_err);
+
+       noti_err = notification_set_text_domain(noti, "volume-app", LOCALEDIR);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text_domain : %d\n", noti_err);
+
+       noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, pTickerMsg, T_(pLocaleTickerMsg), NOTIFICATION_VARIABLE_TYPE_NONE);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text : %d\n", noti_err);
+
+       noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF, pTickerMsg, T_(pLocaleTickerMsg), NOTIFICATION_VARIABLE_TYPE_NONE);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text : %d\n", noti_err);
+
+       noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_TICKER);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_display_applist : %d\n", noti_err);
+
+       noti_err = notification_insert(noti, NULL);
+       retvm_if(noti_err != NOTIFICATION_ERROR_NONE, NULL, "Fail to notification_set_text_domain : %d\n", noti_err);
+
+       return noti;
+}
+
 void _set_device_warning(void *data, int val, int device)
 {
        struct appdata *ad = (struct appdata *)data;
@@ -136,28 +182,23 @@ void _set_device_warning(void *data, int val, int device)
 
        switch (device) {
                case SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE:
-                       if (val >= 13) {
-                               if(ad->flag_warning) return;
-                               ad->flag_warning = true;
-                               elm_object_content_unset(ad->pu);
-                               elm_object_part_content_set(ad->warn_ly, "elm.swallow.slider1", ad->sl);
-                               elm_object_content_set(ad->pu, ad->warn_ly);
-                               evas_object_show(ad->warn_ly);
+                       if (val >= 10) {
+                               if(ad->noti == NULL){
+                                       ad->noti = _insert_message_ticker_notification(IDS_WARNING_MSG, STR_WARNING_MSG);
+                               }
                                DEL_TIMER(ad->warntimer);
-                               ADD_TIMER(ad->warntimer, 3.0, _unset_layout, data);
+                               ADD_TIMER(ad->warntimer, 2.0, _delete_message_ticker_notification, data);
                        }
                        else {
-                               ad->flag_warning = false;
-                               _unset_layout(data);
+                               _delete_message_ticker_notification(data);
                        }
                        break;
                default:
-                       ad->flag_warning = false;
-                       _unset_layout(data);
+                       _delete_message_ticker_notification(data);
                        break;
        }
 }
-*/
+
 int _get_title(volume_type_t type, char *label, int size)
 {
        char *text = NULL;
@@ -221,11 +262,26 @@ void _mm_func(void *data)
 
        /* function could be activated when window exists */
        ad->step = _get_step(ad->type);
-       mm_sound_volume_get_value(ad->type, (unsigned int*)(&val));
        mm_sound_route_get_playing_device(&device);
+       mm_sound_volume_get_value(ad->type, (unsigned int*)(&val));
+
+       /* apply earphone safety concept */
+       if(ad->device != device){
+               if(device == SYSTEM_AUDIO_ROUTE_PLAYBACK_DEVICE_EARPHONE && val > 9)
+                       val = 9;
+                       _set_sound_level(ad->type, val);
+               ad->device = device;
+       }
+       if(ad->type == VOLUME_TYPE_RINGTONE){
+               if(val == 0)
+                       vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, EINA_FALSE);
+               else
+                       vconf_set_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, EINA_TRUE);
+       }
 
        _set_slider_value(ad, val);
        _set_icon(ad, val);
+       _set_device_warning(ad, val, device);
        _D("type(%d) val(%d)\n", ad->type, val);
 }
 
@@ -310,4 +366,3 @@ int _set_sound_level(volume_type_t type, int val)
        mm_sound_volume_set_value(type, val);
        return 0;
 }
-
index 2acde4e..fc71060 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -31,6 +31,7 @@ void _play_sound(int type, int handle);
 void _mm_func(void *data);
 int _set_icon(void * data, int val);
 int _set_sound_level(volume_type_t type, int val);
+int _delete_message_ticker_notification(void *data);
 
 #endif
 /* __VOLUME_SOUND_H__ */
index ea4e725..e685847 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 0275a0d..e89b3d8 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 3c9cacf..bd68b7e 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 324af38..7ef7dbc 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,11 +27,6 @@ struct text_part {
        char *msgid;
 };
 
-static int lang_changed(void *data)
-{
-       return _lang_changed(data);
-}
-
 static Eina_Bool rotate_cb(void *data, int type, void *event)
 {
        struct appdata *ad = data;
@@ -56,12 +51,6 @@ static int app_create(void *data)
 
        _app_create(ad);
 
-       lang_changed(ad);
-
-       /* add system event callback */
-       appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE,
-                       lang_changed, ad);
-
        /* add rotation event callback */
        ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
                                        rotate_cb, (void *)data);
@@ -132,8 +121,10 @@ int main(int argc, char *argv[])
                .reset = app_reset,
        };
 
-       /*elm_init(argc, argv);
-       elm_config_preferred_engine_set("opengl_x11");*/
+
+       /* appcore measure time example */
+       printf("from AUL to %s(): %d msec\n", __func__,
+                       appcore_measure_time_from("APP_START_TIME"));
 
        memset(&ad, 0x0, sizeof(struct appdata));
        ops.data = &ad;
@@ -141,4 +132,3 @@ int main(int argc, char *argv[])
        return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
 }
 
-
index 4f827b2..786284a 100755 (executable)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2012  Samsung Electronics Co., Ltd
- * 
+ *
  * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *     http://www.tizenopensource.org/license
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,6 +24,7 @@
 #include <syspopup.h>
 #include <appcore-efl.h>
 #include <Ecore_X.h>
+#include <notification.h>
 
 #if !defined(PACKAGE)
 #  define PACKAGE "volume"
 #  define EDJDIR RESDIR"/edje"
 #endif
 
-#define EDJ_THEME EDJDIR"/volume_popup.edj"
-#define GRP_VOLUME_SLIDER "popup_slider_style"
-#define GRP_VOLUME_SLIDER_WITH_WARNING "popup_slider_text_style_with_warn_label"
+#if !defined(PKGNAME)
+#  define PKGNAME "com.samsung.volume"
+#endif
+
 #define EDJ_APP EDJDIR"/volume_app.edj"
 #define GRP_VOLUME_BLOCKEVENTS "block_events"
 #define GRP_VOLUME_LAYOUT "volumeLayout"
 #define GRP_VOLUME_CONTENT "volumeLayoutContent"
 #define GRP_VOLUME_SLIDER_HORIZONTAL "volumeHorizontalSlider"
 
-#define IMG_VOLUME_ICON "/00_volume_icon.png"
-#define IMG_VOLUME_ICON_CALL "/00_volume_icon_Call.png"
-#define IMG_VOLUME_ICON_MUTE "/00_volume_icon_Mute.png"
-#define IMG_VOLUME_ICON_VIB "/00_volume_icon_Vibrat.png"
-#define IMG_VOLUME_ICON_HEADPHONE "/00_volume_icon_headphone.png"
-#define IMG_VOLUME_ICON_MEDIA "/00_volume_icon_media.png"
-#define IMG_VOLUME_ICON_SETTINGS "/00_volume_icon_settings.png"
-#define IMG_VOLUME_ICON_SETTINGS_PRESSED "/00_volume_icon_settings_pressed.png"
-#define IMG_VOLUME_WINSET_DIVIDER_LINE "/00_winset_divider_line.png"
+#define IMG_VOLUME_PACKAGE_ICON "/usr/share/icons/default/small/com.samsung.volume.png"
+#define IMG_VOLUME_ICON "00_volume_icon.png"
+#define IMG_VOLUME_ICON_CALL "00_volume_icon_Call.png"
+#define IMG_VOLUME_ICON_MUTE "00_volume_icon_Mute.png"
+#define IMG_VOLUME_ICON_VIB "00_volume_icon_Vibrat.png"
+#define IMG_VOLUME_ICON_HEADPHONE "00_volume_icon_headphone.png"
+#define IMG_VOLUME_ICON_MEDIA "00_volume_icon_media.png"
+#define IMG_VOLUME_ICON_SETTINGS "00_volume_icon_settings.png"
+#define IMG_VOLUME_ICON_SETTINGS_PRESSED "00_volume_icon_settings_pressed.png"
+
+#define IDS_WARNING_MSG "IDS_COM_BODY_HIGH_VOLUMES_MAY_HARM_YOUR_HEARING_IF_YOU_LISTEN_FOR_A_LONG_TIME"
+#define STR_WARNING_MSG "High volumes may harm your hearing if you listen for a long time"
 
 #define S_(str) dgettext("sys_string", str)
 #define T_(str) dgettext(PACKAGE, str)
@@ -82,9 +87,13 @@ struct appdata
        Ecore_Timer *warntimer; /* warning message timer */
        Ecore_Timer *luwarmtimer, *ldwarmtimer;
        volume_type_t type;
+       system_audio_route_device_t device;
        int step;
        int angle;
 
+       /* ticker notification handler */
+       notification_h noti;
+
        /* ug handler */
        ui_gadget_h ug;
 
@@ -94,7 +103,6 @@ struct appdata
        int flag_touching;
        int flag_launching;
        int flag_deleting;
-       int flag_warning;       /* set device warning flag */
 };
 
 #endif /* __VOLUME_H__ */