summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-01-09 04:01:55 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-01-09 04:01:55 +0000
commitc22a6c5d5c5a96f757f608c22a064fd9029004bf (patch)
tree4bbeb1b36201fce6c2ac175b69d156142fae25f0 /data
parent36be5d7089ba5721504b7358e9c0cac82c059fe7 (diff)
support new song pos info in flat
display position in hh:mm:ss or whatever and a progress bar at the bottom as well as loop repeat or not icon. also add gradient in middle to darken a bit for detailed metadata to make it easier to read
Diffstat (limited to 'data')
-rw-r--r--data/elementary/themes/edc/music_control.edc162
-rw-r--r--data/elementary/themes/img/grad-v-bi.pngbin0 -> 2225 bytes
2 files changed, 141 insertions, 21 deletions
diff --git a/data/elementary/themes/edc/music_control.edc b/data/elementary/themes/edc/music_control.edc
index bb5c3832a9..849756d94c 100644
--- a/data/elementary/themes/edc/music_control.edc
+++ b/data/elementary/themes/edc/music_control.edc
@@ -38,6 +38,7 @@ group { name: "e/modules/music-control/popup";
38#ifdef SKIP_NAMESPACE_VALIDATION 38#ifdef SKIP_NAMESPACE_VALIDATION
39 skip_namespace_validation: 1; 39 skip_namespace_validation: 1;
40#endif 40#endif
41 images.image: "grad-v-bi.png" COMP;
41 min: 160 160; 42 min: 160 160;
42 styles { 43 styles {
43 style { name: "music_control_metadata_style"; 44 style { name: "music_control_metadata_style";
@@ -48,10 +49,52 @@ group { name: "e/modules/music-control/popup";
48 } 49 }
49 } 50 }
50 script { 51 script {
52 timeprint(dst[], dstn, Float:pos, Float:fmt) {
53 new h, m, s, fh, fm;
54 m = round(pos / 60.0, FLOOR);
55 h = round(float(m) / 60.0, FLOOR);
56 m = m - (h * 60);
57 s = round(pos - float((h * 3600) + (m * 60)), FLOOR);
58
59 fm = round(fmt / 60.0, FLOOR);
60 fh = round(float(fm) / 60.0, FLOOR);
61 if (fh > 0) {
62 if (m >= 10) {
63 if (s >= 10) snprintf(dst, dstn, "%i:%i:%i", h, m, s);
64 else snprintf(dst, dstn, "%i:%i:0%i", h, m, s);
65 } else {
66 if (s >= 10) snprintf(dst, dstn, "%i:0%i:%i", h, m, s);
67 else snprintf(dst, dstn, "%i:0%i:0%i", h, m, s);
68 }
69 }
70 else if (fm > 0) {
71 if (s >= 10) snprintf(dst, dstn, "%i:%i", m, s);
72 else snprintf(dst, dstn, "%i:0%i", m, s);
73 }
74 else {
75 if (s >= 10) snprintf(dst, dstn, "0%i", s);
76 else snprintf(dst, dstn, "%i", s);
77 }
78 }
51 public message(Msg_Type:type, id, ...) { 79 public message(Msg_Type:type, id, ...) {
52 new txt[128]; 80 if (id == 0) {
53 getsarg(2, txt, 128); 81 new txt[128];
54 set_text(PART:"player_name", txt); 82 getsarg(2, txt, 128);
83 set_text(PART:"player_name", txt);
84 } else if (id == 1) {
85 new Float:pos, Float:len, txt[128];
86 pos = getfarg(2);
87 len = getfarg(3);
88
89 timeprint(txt, 128, pos, len);
90 set_text(PART:"pos_txt", txt);
91 timeprint(txt, 128, len, len);
92 set_text(PART:"len_txt", txt);
93
94 custom_state(PART:"pos", "default", 0.0);
95 set_state_val(PART:"pos", STATE_REL2, (pos / len), 1.0);
96 set_state(PART:"pos", "custom", 0.0)
97 }
55 } 98 }
56 } 99 }
57 parts { 100 parts {
@@ -61,6 +104,7 @@ group { name: "e/modules/music-control/popup";
61 rel1.relative: 0.25 0.25; 104 rel1.relative: 0.25 0.25;
62 rel2.relative: 0.75 0.75; 105 rel2.relative: 0.75 0.75;
63 image.normal: "efm_drive_cd_icon"; 106 image.normal: "efm_drive_cd_icon";
107 color: 255 255 255 128;
64 } 108 }
65 } 109 }
66 part { name: "e.cover_swallow"; type: SWALLOW; 110 part { name: "e.cover_swallow"; type: SWALLOW;
@@ -81,6 +125,17 @@ group { name: "e/modules/music-control/popup";
81 offscale; 125 offscale;
82 } 126 }
83 } 127 }
128 part { name: "player_mid";
129 scale: 1;
130 description { state: "default" 0;
131 color: 0 0 0 128;
132 rel1.to: "player_name_back";
133 rel1.relative: 0.0 1.0;
134 rel2.to: "btn_back";
135 rel2.relative: 1.0 0.0;
136 image.normal: "grad-v-bi.png";
137 }
138 }
84 part { name: "player_name"; type: TEXT; 139 part { name: "player_name"; type: TEXT;
85 scale : 1; 140 scale : 1;
86 description { state: "default" 0; 141 description { state: "default" 0;
@@ -129,6 +184,40 @@ group { name: "e/modules/music-control/popup";
129 color: 0 0 0 220; 184 color: 0 0 0 220;
130 } 185 }
131 } 186 }
187 part { name: "pos_txt"; type: TEXT;
188 scale : 1;
189 description { state: "default" 0;
190 min: 64 15;
191 rel.to: "btn_back";
192 color: 255 255 255 255;
193 align: 0.5 1.0;
194 text.size: 10;
195 text.font: FN;
196 text.align: 0.0 1.0;
197 text.min: 0 1;
198 rel1.offset: 4 -5;
199 rel2.offset: -5 -5;
200 rel2.relative: 1.0 0.0;
201 offscale;
202 }
203 }
204 part { name: "len_txt"; type: TEXT;
205 scale : 1;
206 description { state: "default" 0;
207 min: 64 15;
208 rel.to: "btn_back";
209 color: 255 255 255 255;
210 align: 0.5 1.0;
211 text.size: 10;
212 text.font: FN;
213 text.align: 1.0 1.0;
214 text.min: 0 1;
215 rel1.offset: 4 -5;
216 rel2.offset: -5 -5;
217 rel2.relative: 1.0 0.0;
218 offscale;
219 }
220 }
132 part { name: "play_btn"; 221 part { name: "play_btn";
133 scale: 1; 222 scale: 1;
134 description { state: "default" 0; 223 description { state: "default" 0;
@@ -143,6 +232,25 @@ group { name: "e/modules/music-control/popup";
143 image.normal: "i-media-play"; 232 image.normal: "i-media-play";
144 } 233 }
145 } 234 }
235 part { name: "loop";
236 scale: 1;
237 description { state: "default" 0;
238 fixed: 1 1;
239 rel.to: "player_name_back";
240 min: 15 15;
241 max: 15 15;
242 align: 1.0 0.5;
243 rel1.offset: 4 4;
244 rel2.offset: -5 -5;
245 offscale;
246 image.normal: "i-reload";
247 visible: 0;
248 }
249 description { state: "loop" 0.0;
250 inherit: "default" 0.0;
251 visible: 1;
252 }
253 }
146 part { name: "previous_btn"; 254 part { name: "previous_btn";
147 scale: 1; 255 scale: 1;
148 description { state: "default" 0; 256 description { state: "default" 0;
@@ -167,52 +275,64 @@ group { name: "e/modules/music-control/popup";
167 image.normal: "i-media-next"; 275 image.normal: "i-media-next";
168 } 276 }
169 } 277 }
278 part { name: "pos"; type: RECT;
279 scale: 1;
280 mouse_events: 0;
281 description { state: "default" 0;
282 fixed: 1 1;
283 color: 51 153 255 255;
284 rel.to: "btn_back";
285 rel1.offset: 0 -1;
286 rel1.relative: 0.0 1.0;
287 min: 0 5;
288 align: 0.0 1.0;
289 }
290 }
170 } 291 }
171 programs { 292 programs {
172 program { 293 program { signal: "mouse,down,1"; source: "*_btn";
173 signal: "mouse,down,1"; source: "*_btn";
174 action: STATE_SET "pressed" 0.0; 294 action: STATE_SET "pressed" 0.0;
175 target: "btn_back"; 295 target: "btn_back";
176 } 296 }
177 program { 297 program { signal: "mouse,up,1"; source: "*_btn";
178 signal: "mouse,up,1"; source: "*_btn";
179 action: STATE_SET "default" 0.0; 298 action: STATE_SET "default" 0.0;
180 transition: DECELERATE 1.0; 299 transition: DECELERATE 1.0;
181 target: "btn_back"; 300 target: "btn_back";
182 } 301 }
183 program { 302 program { signal: "mouse,clicked,*"; source: "previous_btn";
184 signal: "mouse,clicked,*"; source: "previous_btn";
185 action: SIGNAL_EMIT "btn,clicked" "previous"; 303 action: SIGNAL_EMIT "btn,clicked" "previous";
186 } 304 }
187 program { 305 program { signal: "mouse,clicked,*"; source: "play_btn";
188 signal: "mouse,clicked,*"; source: "play_btn";
189 action: SIGNAL_EMIT "btn,clicked" "play"; 306 action: SIGNAL_EMIT "btn,clicked" "play";
190 } 307 }
191 program { 308 program { signal: "mouse,clicked,*"; source: "next_btn";
192 signal: "mouse,clicked,*"; source: "next_btn";
193 action: SIGNAL_EMIT "btn,clicked" "next"; 309 action: SIGNAL_EMIT "btn,clicked" "next";
194 } 310 }
195 program { 311 program { signal: "btn,state,image,play"; source: "play";
196 signal: "btn,state,image,play"; source: "play";
197 action: STATE_SET "play" 0.0; 312 action: STATE_SET "play" 0.0;
198 transition: LINEAR 0.1; 313 transition: LINEAR 0.1;
199 target: "play_btn"; 314 target: "play_btn";
200 } 315 }
201 program { 316 program { signal: "btn,state,image,play,no_delay"; source: "play";
202 signal: "btn,state,image,play,no_delay"; source: "play";
203 action: STATE_SET "play" 0.0; 317 action: STATE_SET "play" 0.0;
204 transition: LINEAR 0.0; 318 transition: LINEAR 0.0;
205 target: "play_btn"; 319 target: "play_btn";
206 } 320 }
207 program { 321 program { signal: "btn,state,image,pause"; source: "play";
208 signal: "btn,state,image,pause"; source: "play";
209 action: STATE_SET "default" 0.0; 322 action: STATE_SET "default" 0.0;
210 transition: LINEAR 0.1; 323 transition: LINEAR 0.1;
211 target: "play_btn"; 324 target: "play_btn";
212 } 325 }
213 program { 326 program { signal: "mouse,clicked,*"; source: "player_name";
214 signal: "mouse,clicked,*"; source: "player_name";
215 action: SIGNAL_EMIT "label,clicked" "player_name"; 327 action: SIGNAL_EMIT "label,clicked" "player_name";
216 } 328 }
329 program { signal: "loop,state,on"; source: "play";
330 action: STATE_SET "loop" 0.0;
331 target: "loop";
332 }
333 program { signal: "loop,state,off"; source: "play";
334 action: STATE_SET "default" 0.0;
335 target: "loop";
336 }
217 } 337 }
218} 338}
diff --git a/data/elementary/themes/img/grad-v-bi.png b/data/elementary/themes/img/grad-v-bi.png
new file mode 100644
index 0000000000..f9c3086453
--- /dev/null
+++ b/data/elementary/themes/img/grad-v-bi.png
Binary files differ