add music player controller buttons 44/43844/1
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 14 Jul 2015 12:23:23 +0000 (21:23 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 14 Jul 2015 12:23:23 +0000 (21:23 +0900)
Change-Id: Ie708bc04fc6c5fe69933ed3a4009d350ebafb11e
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
res/edc/widgets/button.edc

index f203cd3..f44bb68 100644 (file)
@@ -625,6 +625,246 @@ group {
 }
 
 group {
+       name: "elm/button/base/music_btn_prev";
+       inherit: "elm/button/base/viewer_btn_prev";
+       images {
+               image: IMAGE_MUSIC_PREV_NORMAL COMP;
+               image: IMAGE_MUSIC_PREV_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               min: 164 142;
+                               image {
+                                       normal: IMAGE_MUSIC_PREV_NORMAL;
+                               }
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_PREV_FOCUS;
+                               }
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_MUSIC_PREV;
+               }
+       }
+}
+
+group {
+       name: "elm/button/base/music_btn_next";
+       inherit: "elm/button/base/music_btn_prev";
+       images {
+               image: IMAGE_MUSIC_NEXT_NORMAL COMP;
+               image: IMAGE_MUSIC_NEXT_FOCUS COMP;
+       }
+       parts {
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_NEXT_NORMAL;
+                               }
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_NEXT_FOCUS;
+                               }
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_MUSIC_NEXT;
+               }
+       }
+}
+
+group {
+       name: "elm/button/base/music_btn_play";
+       inherit: "elm/button/base/music_btn_prev";
+       images {
+               image: IMAGE_MUSIC_PLAY_NORMAL COMP;
+               image: IMAGE_MUSIC_PLAY_FOCUS COMP;
+               image: IMAGE_MUSIC_PAUSE_NORMAL COMP;
+               image: IMAGE_MUSIC_PAUSE_FOCUS COMP;
+       }
+       script {
+               public cur_state;
+       }
+       parts {
+               part {
+                       name: "color";
+                       description {
+                               state: "default_pause" 0.0;
+                       }
+                       description {
+                               state: "selected_pause" 0.0;
+                               color: COLOR_ITEM_FOCUS;
+                       }
+               }
+               part {
+                       name: "bg";
+                       scale: 1;
+                       description {
+                               state: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_PLAY_NORMAL;
+                               }
+                       }
+                       description {
+                               state: "selected" 0.0;
+                               inherit: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_PLAY_FOCUS;
+                               }
+                       }
+                       description {
+                               state: "default_pause" 0.0;
+                               inherit: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_PAUSE_NORMAL;
+                               }
+                       }
+                       description {
+                               state: "selected_pause" 0.0;
+                               inherit: "default" 0.0;
+                               image {
+                                       normal: IMAGE_MUSIC_PAUSE_FOCUS;
+                               }
+                       }
+               }
+       }
+       programs {
+               program {
+                       name: "load";
+                       signal: "load";
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PLAY);
+                       }
+               }
+               program {
+                       name: SIG_SET_PLAY;
+                       signal: SIG_SET_PLAY;
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PLAY);
+                               set_state(PART:"bg", "default", 0.0);
+                               set_state(PART:"color", "default", 0.0);
+                       }
+               }
+               program {
+                       name: SIG_SET_PAUSE;
+                       signal: SIG_SET_PAUSE;
+                       source: "";
+                       script {
+                               set_int(cur_state, STATE_PAUSE);
+                               set_state(PART:"bg", "default_pause", 0.0);
+                               set_state(PART:"color", "default_pause", 0.0);
+                       }
+               }
+               program {
+                       name: "button_clicked";
+                       signal: "mouse,clicked,1";
+                       source: "bg";
+                       action: SIGNAL_EMIT "elm,action,click" "";
+               }
+               program {
+                       name: SIG_BTN_CLICKED;
+                       signal: SIG_BTN_CLICKED;
+                       source: "";
+                       after: "emit,signal";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PLAY) {
+                                       set_int(cur_state, STATE_PAUSE);
+                                       set_state(PART:"bg", "selected_pause", 0.0);
+                               } else {
+                                       set_int(cur_state, STATE_PLAY);
+                                       set_state(PART:"bg", "selected", 0.0);
+                               }
+                       }
+               }
+               program {
+                       name: "emit,signal";
+                       action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_MUSIC_PLAY;
+               }
+               program {
+                       name: "focused";
+                       signal: "elm,action,focus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PLAY)
+                                       run_program(PROGRAM:"focused,play");
+                               else
+                                       run_program(PROGRAM:"focused,pause");
+                       }
+               }
+               program {
+                       name: "unfocused";
+                       signal: "elm,action,unfocus";
+                       source: "elm";
+                       script {
+                               new state;
+                               state = get_int(cur_state);
+
+                               if (state == STATE_PLAY)
+                                       run_program(PROGRAM:"unfocused,play");
+                               else
+                                       run_program(PROGRAM:"unfocused,pause");
+                       }
+               }
+               program {
+                       name: "focused,play";
+                       action: STATE_SET "selected" 0.0;
+                       target: "bg";
+                       target: "color";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+               program {
+                       name: "focused,pause";
+                       action: STATE_SET "selected_pause" 0.0;
+                       target: "bg";
+                       target: "color";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+               program {
+                       name: "unfocused,play";
+                       action: STATE_SET "default" 0.0;
+                       target: "bg";
+                       target: "color";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+               program {
+                       name: "unfocused,pause";
+                       action: STATE_SET "default_pause" 0.0;
+                       target: "bg";
+                       target: "color";
+                       transition: LINEAR TRANSITION_TIME;
+               }
+       }
+}
+
+group {
        name: "elm/button/base/base_btn_recent";
        data.item, "focus_highlight" "on";
        images {