1group { name: "e/modules/music-control/icon";
2   alias: "modules/music-control/icon";
3   max: 24 24;
4   images.image: "music_control_icon.png" COMP;
5   parts {
6      part { name: "image"; mouse_events: 0;
7         description { state: "default" 0.0;
8            aspect: 1.0 1.0; aspect_preference: BOTH;
9            image.normal: "music_control_icon.png";
10         }
11      }
12   }
13}
14
15group { name: "e/modules/music-control/main";
16   alias: "modules/music-control/main";
17   images.image: "music_control_icon.png" COMP;
18   parts {
19      part { name: "icon";
20         description { state: "default" 0.0;
21            aspect: 1.0 1.0; aspect_preference: BOTH;
22            image.normal: "music_control_icon.png";
23         }
24      }
25   }
26}
27
28group { name: "e/modules/music-control/popup";
29   alias: "modules/music-control/popup";
30#ifdef SKIP_NAMESPACE_VALIDATION
31   skip_namespace_validation: 1;
32#endif
33   min: 150 50;
34   images.image: "icon_prev.png" COMP;
35   images.image: "icon_next.png" COMP;
36   images.image: "icon_pause.png" COMP;
37   images.image: "icon_play.png" COMP;
38   styles {
39      style { name: "music_control_metadata_style";
40         base: "font="FN" font_size=10 align=left text_class=tb_plain color=#ffff style=shadow,bottom shadow_color=#00000080";
41         tag: "title" "+ font_size=12 font="FNBD" text_class=tb_big";
42         tag: "tag" "+ font_size=8 color=#888f";
43         tag: "br" "\n";
44      }
45   }
46   script {
47      public message(Msg_Type:type, id, ...) {
48         new txt[128];
49         getsarg(2, txt, 128);
50         set_text(PART:"player_name", txt);
51      }
52   }
53   parts {
54      alias: "cover_swallow" "e.cover_swallow";
55      part { name: "cover_bg";
56         description { state: "default" 0;
57            min: 90 90;
58            rel1.relative: 0.0 0.0;
59            rel2.relative: 0.35 1.0;
60            image.normal: "music_control_icon.png";
61         }
62      }
63      part { name: "e.cover_swallow"; type: SWALLOW;
64         description { state: "default" 0;
65            rel1.to: "cover_bg";
66            rel2.to: "cover_bg";
67         }
68      }
69      part { name: "player_name"; type: TEXT;
70         effect: GLOW;
71         description { state: "default" 0;
72            color: FN_COL_HIGHLIGHT;
73            text.size: 12;
74            text.text: "Music player";
75            text.font: FNBD;
76            rel1.to: "cover_bg";
77            rel1.relative: 1.0 0.0;
78            rel2.relative: 1.0 0.0;
79            rel2.offset: 0 12;
80         }
81      }
82      part { name: "metadata"; type: TEXTBLOCK;
83         description { state: "default" 0;
84            text {
85               style: "music_control_metadata_style";
86               text: "Song Title";
87               align: 0.0 0.0;
88            }
89            rel1.to: "player_name";
90            rel1.relative: 0.0 1.0;
91            rel1.offset: 3 0;
92         }
93      }
94      part { name: "previous_btn";
95         description { state: "default" 0;
96            max: 32 32;
97            aspect: 1.0 1.0; aspect_preference: BOTH;
98            align: 0.1 1.0;
99            rel1.relative: 0.35 0.0;
100            image.normal: "icon_prev.png";
101         }
102      }
103      part { name: "play_btn";
104         description { state: "default" 0;
105            max: 32 32;
106            aspect: 1.0 1.0; aspect_preference: BOTH;
107            align: 0.5 1.0;
108            rel1.relative: 0.35 0.0;
109            image.normal: "icon_pause.png";
110         }
111         description { state: "play" 0.0;
112            inherit: "default" 0.0;
113            image.normal: "icon_play.png";
114         }
115      }
116      part { name: "next_btn";
117         description { state: "default" 0;
118            max: 32 32;
119            aspect: 1.0 1.0; aspect_preference: BOTH;
120            align: 0.9 1.0;
121            rel1.relative: 0.35 0.0;
122            rel1.to: "player_name";
123            image.normal: "icon_next.png";
124         }
125      }
126   }
127   programs {
128      program {
129         signal: "mouse,clicked,*"; source: "previous_btn";
130         action: SIGNAL_EMIT "btn,clicked" "previous";
131      }
132      program {
133         signal: "mouse,clicked,*"; source: "play_btn";
134         action: SIGNAL_EMIT "btn,clicked" "play";
135      }
136      program {
137         signal: "mouse,clicked,*"; source: "next_btn";
138         action: SIGNAL_EMIT "btn,clicked" "next";
139      }
140      program {
141         signal: "btn,state,image,play"; source: "play";
142         action: STATE_SET "play" 0.0;
143         transition: LINEAR 0.1;
144         target: "play_btn";
145      }
146      program {
147         signal: "btn,state,image,play,no_delay"; source: "play";
148         action: STATE_SET "play" 0.0;
149         transition: LINEAR 0.0;
150         target: "play_btn";
151      }
152      program {
153         signal: "btn,state,image,pause"; source: "play";
154         action: STATE_SET "default" 0.0;
155         transition: LINEAR 0.1;
156         target: "play_btn";
157      }
158      program {
159         signal: "mouse,clicked,*"; source: "player_name";
160         action: SIGNAL_EMIT "label,clicked" "player_name";
161      }
162   }
163}
164