Update mute function 77/45277/1 accepted/tizen/tv/20150804.235443 submit/tizen/20150804.130957
authorjinwoo.shin <jw0227.shin@samsung.com>
Tue, 4 Aug 2015 10:15:17 +0000 (19:15 +0900)
committerjinwoo.shin <jw0227.shin@samsung.com>
Tue, 4 Aug 2015 10:15:17 +0000 (19:15 +0900)
Change-Id: I7f6097f1a9b4e50bcfe377062c1a56fefc290e7b
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
data/volume.edc
src/main.c
src/volume.c

index 95848dc..bb87aac 100644 (file)
@@ -73,6 +73,11 @@ collections {
                                                align, 0.5 0.0;
                                                fixed, 1 1;
                                        }
+                                       description {
+                                               state, "mute" 0.0;
+                                               inherit, "default" 0.0;
+                                               visible, 0;
+                                       }
                                }
                                part {
                                        name, "padding.progressbar";
@@ -111,6 +116,11 @@ collections {
                                                align, 0.5 0.0;
                                                fixed, 1 1;
                                        }
+                                       description {
+                                               state, "mute" 0.0;
+                                               inherit, "default" 0.0;
+                                               visible, 0;
+                                       }
                                }
                                part {
                                        name, "padding.icon";
@@ -153,6 +163,15 @@ collections {
                                        description {
                                                state, "mute" 0.0;
                                                inherit, "default" 0.0;
+                                               rel1 {
+                                                       to, "part.volume";
+                                                       relative, 0.5 0.5;
+                                               }
+                                               rel2 {
+                                                       to, "part.volume";
+                                                       relative, 0.5 0.5;
+                                               }
+                                               align, 0.5 0.5;
                                                image.normal, "ic_volume_mute.png";
                                        }
                                }
@@ -164,6 +183,8 @@ collections {
                                signal, SIGNAL_SHOW_MUTE;
                                source, SOURCE_PROGRAM;
                                action, STATE_SET "mute" 0.0;
+                               target, PART_VOLUME_TEXT;
+                               target, PART_VOLUME_PROGRESSBAR;
                                target, PART_VOLUME_ICON;
                        }
                        program {
@@ -171,6 +192,8 @@ collections {
                                signal, SIGNAL_HIDE_MUTE;
                                source, SOURCE_PROGRAM;
                                action, STATE_SET "default" 0.0;
+                               target, PART_VOLUME_TEXT;
+                               target, PART_VOLUME_PROGRESSBAR;
                                target, PART_VOLUME_ICON;
                        }
                }
index 0bc8f04..179ff35 100644 (file)
@@ -177,10 +177,11 @@ Eina_Bool _hide_timer(void *data)
 
        ad = data;
 
-       _hide(ad);
-
        ad->hide_timer = NULL;
 
+       if (!volume_is_mute())
+               _hide(ad);
+
        return ECORE_CALLBACK_CANCEL;
 }
 
@@ -200,6 +201,8 @@ static void _key_pressed(void *data, Evas *e, Evas_Object *obj, void *ei)
 
        if (ad->hide_timer)
                ecore_timer_reset(ad->hide_timer);
+       else
+               ad->hide_timer = ecore_timer_add(HIDE_DUR, _hide_timer, ad);
 
        if (!strcmp(ev->keyname, KEY_VOLUMEUP) ||
                        !strcmp(ev->keyname, KEY_VOLUMEUP_REMOTE)) {
index 17a282d..66f9ed2 100644 (file)
@@ -78,9 +78,13 @@ int volume_get_volume(void)
 {
        int vol, r;
 
-       r = sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol);
-       if (r < 0)
-               return -1;
-
-       return vol;
+       if (volume_is_mute())
+               return volume;
+       else {
+               r = sound_manager_get_volume(SOUND_TYPE_MEDIA, &vol);
+               if (r < 0)
+                       return -1;
+
+               return vol;
+       }
 }