diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2015-08-19 17:30:00 +0900 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2015-08-19 17:30:00 +0900 |
commit | 89c76559ba824ffd6933dc48407e5df7c72dd2c0 (patch) | |
tree | e830e2963b31931b2048c6f19dd0ffcd96b4da8b | |
parent | f5feab4ca78b017d329f0f8329acbe5387f40171 (diff) | |
download | air_mediahub-89c76559ba824ffd6933dc48407e5df7c72dd2c0.tar.gz air_mediahub-89c76559ba824ffd6933dc48407e5df7c72dd2c0.tar.bz2 air_mediahub-89c76559ba824ffd6933dc48407e5df7c72dd2c0.zip |
mplayer: add shuffle button
Change-Id: I0a1b480a9c992a21afd0a321aa303f9136b98c50
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | res/edc/images/btn_music_contr_shuffle_dis.png | bin | 991 -> 1888 bytes | |||
-rw-r--r-- | res/edc/images/btn_music_contr_shuffle_dis_foc.png | bin | 927 -> 3657 bytes | |||
-rw-r--r-- | res/edc/images/btn_music_contr_shuffle_nor.png | bin | 989 -> 3737 bytes | |||
-rw-r--r-- | res/edc/images/btn_music_contr_shuffle_nor_foc.png | bin | 894 -> 3679 bytes | |||
-rw-r--r-- | res/edc/widgets/button.edc | 240 | ||||
-rw-r--r-- | src/view/mplayer.c | 6 |
6 files changed, 245 insertions, 1 deletions
diff --git a/res/edc/images/btn_music_contr_shuffle_dis.png b/res/edc/images/btn_music_contr_shuffle_dis.png Binary files differindex 633184f..145d4b9 100644 --- a/res/edc/images/btn_music_contr_shuffle_dis.png +++ b/res/edc/images/btn_music_contr_shuffle_dis.png diff --git a/res/edc/images/btn_music_contr_shuffle_dis_foc.png b/res/edc/images/btn_music_contr_shuffle_dis_foc.png Binary files differindex ca262b7..cf1313b 100644 --- a/res/edc/images/btn_music_contr_shuffle_dis_foc.png +++ b/res/edc/images/btn_music_contr_shuffle_dis_foc.png diff --git a/res/edc/images/btn_music_contr_shuffle_nor.png b/res/edc/images/btn_music_contr_shuffle_nor.png Binary files differindex 0d32fd7..19d2544 100644 --- a/res/edc/images/btn_music_contr_shuffle_nor.png +++ b/res/edc/images/btn_music_contr_shuffle_nor.png diff --git a/res/edc/images/btn_music_contr_shuffle_nor_foc.png b/res/edc/images/btn_music_contr_shuffle_nor_foc.png Binary files differindex c7207b6..ff40461 100644 --- a/res/edc/images/btn_music_contr_shuffle_nor_foc.png +++ b/res/edc/images/btn_music_contr_shuffle_nor_foc.png diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc index f6cf990..d2b0140 100644 --- a/res/edc/widgets/button.edc +++ b/res/edc/widgets/button.edc @@ -25,6 +25,9 @@ #define STATE_PLAY 0 #define STATE_PAUSE 1 +#define STATE_EN 0 +#define STATE_DIS 1 + group { name: "elm/button/base/base_btn_menu"; data.item: "focus_highlight" "on"; @@ -1016,6 +1019,243 @@ group { } group { + name: "elm/button/base/music_btn_shuffle"; + data.item, "focus_highlight" "on"; + images { + image: IMAGE_MUSIC_SHUFFLE_NORMAL COMP; + image: IMAGE_MUSIC_SHUFFLE_FOCUS COMP; + image: IMAGE_MUSIC_SHUFFLE_DIS_NORMAL COMP; + image: IMAGE_MUSIC_SHUFFLE_DIS_FOCUS COMP; + } + script { + public cur_state; + } + parts { + part { + name: "color"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + } + description { + state: "selected" 0.0; + color: COLOR_ITEM_FOCUS; + } + description { + state: "default_dis" 0.0; + } + description { + state: "selected_dis" 0.0; + color: COLOR_ITEM_FOCUS; + } + } + part { + name: "bg"; + scale: 1; + description { + state: "default" 0.0; + min: 164 142; + image { + normal: IMAGE_MUSIC_SHUFFLE_NORMAL; + } + } + description { + state: "selected" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_MUSIC_SHUFFLE_FOCUS; + } + } + description { + state: "clicked" 0.0; + min: 82 71; + max: 82 71; + image { + normal: IMAGE_MUSIC_SHUFFLE_FOCUS; + } + } + description { + state: "default_dis" 0.0; + inherit: "default" 0.0; + image { + normal: IMAGE_MUSIC_SHUFFLE_DIS_NORMAL; + } + } + description { + state: "selected_dis" 0.0; + inherit: "selected" 0.0; + image { + normal: IMAGE_MUSIC_SHUFFLE_DIS_FOCUS; + } + } + description { + state: "clicked_dis" 0.0; + inherit: "clicked" 0.0; + image { + normal: IMAGE_MUSIC_SHUFFLE_DIS_FOCUS; + } + } + } + } + programs { + program { + name: "load"; + signal: "load"; + source: ""; + script { + set_int(cur_state, STATE_DIS); + set_state(PART:"bg", "default_dis", 0.0); + set_state(PART:"color", "default_dis", 0.0); + } + } + program { + name: SIG_SET_ENABLE; + signal: SIG_SET_ENABLE; + source: ""; + script { + set_int(cur_state, STATE_EN); + set_state(PART:"bg", "default", 0.0); + set_state(PART:"color", "default", 0.0); + } + } + program { + name: SIG_SET_DISABLE; + signal: SIG_SET_DISABLE; + source: ""; + script { + set_int(cur_state, STATE_DIS); + set_state(PART:"bg", "default_dis", 0.0); + set_state(PART:"color", "default_dis", 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: ""; + script { + new state; + state = get_int(cur_state); + + if (state == STATE_EN) { + set_int(cur_state, STATE_DIS); + run_program(PROGRAM:"anim,clicked,start,dis"); + } else { + set_int(cur_state, STATE_EN); + run_program(PROGRAM:"anim,clicked,start,en"); + } + } + } + program { + name: "anim,clicked,start,en"; + action: STATE_SET "clicked_dis" 0.0; + target: "bg"; + transition: TRANSITION_CLICK; + after: "anim,clicked,set,en"; + } + program { + name: "anim,clicked,set,en"; + action: STATE_SET "clicked" 0.0; + target: "bg"; + after: "anim,clicked,end,en"; + } + program { + name: "anim,clicked,end,en"; + action: STATE_SET "selected" 0.0; + target: "bg"; + transition: TRANSITION_CLICK; + after: "emit,signal"; + } + program { + name: "anim,clicked,start,dis"; + action: STATE_SET "clicked" 0.0; + target: "bg"; + transition: TRANSITION_CLICK; + after: "anim,clicked,set,dis"; + } + program { + name: "anim,clicked,set,dis"; + action: STATE_SET "clicked_dis" 0.0; + target: "bg"; + after: "anim,clicked,end,dis"; + } + program { + name: "anim,clicked,end,dis"; + action: STATE_SET "selected_dis" 0.0; + target: "bg"; + transition: TRANSITION_CLICK; + after: "emit,signal"; + } + program { + name: "emit,signal"; + action: SIGNAL_EMIT SIG_BTN_CALLBACK SRC_BTN_MUSIC_SHUFFLE; + } + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + script { + new state; + state = get_int(cur_state); + + if (state == STATE_EN) + run_program(PROGRAM:"focused,en"); + else + run_program(PROGRAM:"focused,dis"); + } + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + script { + new state; + state = get_int(cur_state); + + if (state == STATE_EN) + run_program(PROGRAM:"unfocused,en"); + else + run_program(PROGRAM:"unfocused,dis"); + } + } + program { + name: "focused,en"; + action: STATE_SET "selected" 0.0; + target: "bg"; + target: "color"; + transition: TRANSITION_FOCUS; + } + program { + name: "focused,dis"; + action: STATE_SET "selected_dis" 0.0; + target: "bg"; + target: "color"; + transition: TRANSITION_FOCUS; + } + program { + name: "unfocused,en"; + action: STATE_SET "default" 0.0; + target: "bg"; + target: "color"; + transition: TRANSITION_FOCUS; + } + program { + name: "unfocused,dis"; + action: STATE_SET "default_dis" 0.0; + target: "bg"; + target: "color"; + transition: TRANSITION_FOCUS; + } + } +} + +group { name: "elm/button/base/music_btn_play"; data.item, "focus_highlight" "on"; images { diff --git a/src/view/mplayer.c b/src/view/mplayer.c index 4157b32..324cda0 100644 --- a/src/view/mplayer.c +++ b/src/view/mplayer.c @@ -36,7 +36,7 @@ #define STYLE_MUSIC_BTN "music_btn" #define PART_MUSIC_BTN "control_btn" -#define PLAY_BTN_LOC 1 +#define PLAY_BTN_LOC 2 struct _list_data { app_media *am; @@ -69,6 +69,10 @@ struct _btn_info { static struct _btn_info btn_player[] = { { + .name = SRC_BTN_MUSIC_SHUFFLE, + .loc = 0, + }, + { .name = SRC_BTN_MUSIC_PREV, .loc = 1, }, |