summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-11 00:17:05 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-14 22:26:02 -0300
commit1e61ab2a9689a70ddfc6220ebe821c8604974703 (patch)
tree9f482f5348a889fad0b53f490e79ba203b3a9a12 /data
parent25ab39d8830bfb9c60865f3c7f0b368b800c4f28 (diff)
Add volume meter functionality
Diffstat (limited to 'data')
-rw-r--r--data/themes/mixer.edc198
1 files changed, 99 insertions, 99 deletions
diff --git a/data/themes/mixer.edc b/data/themes/mixer.edc
index 75fd82b..b3c17c3 100644
--- a/data/themes/mixer.edc
+++ b/data/themes/mixer.edc
@@ -29,11 +29,10 @@ collections {
29 script { 29 script {
30 public message(Msg_Type:type, id, ...) { 30 public message(Msg_Type:type, id, ...) {
31 if ((type == MSG_INT_SET) && (id == 0)) { 31 if ((type == MSG_INT_SET) && (id == 0)) {
32 new m, l, r; 32 new m, v;
33 33
34 m = getarg(2); 34 m = getarg(2);
35 l = getarg(3); 35 v = getarg(3);
36 r = getarg(4);
37 36
38 if (m) { 37 if (m) {
39 run_program(PROGRAM:"mute"); 38 run_program(PROGRAM:"mute");
@@ -41,82 +40,84 @@ collections {
41 run_program(PROGRAM:"unmute"); 40 run_program(PROGRAM:"unmute");
42 } 41 }
43 42
44 if (l <= 0) { 43 if (v <= 0) {
45 run_program(PROGRAM:"l0-off"); 44 run_program(PROGRAM:"0-off");
46 run_program(PROGRAM:"l1-off"); 45 run_program(PROGRAM:"1-off");
47 run_program(PROGRAM:"l2-off"); 46 run_program(PROGRAM:"2-off");
48 run_program(PROGRAM:"l3-off"); 47 run_program(PROGRAM:"3-off");
49 run_program(PROGRAM:"l4-off"); 48 run_program(PROGRAM:"4-off");
50 } else if (l <= 20) { 49 } else if (v <= 20) {
51 run_program(PROGRAM:"l0-on"); 50 run_program(PROGRAM:"0-on");
52 run_program(PROGRAM:"l1-off"); 51 run_program(PROGRAM:"1-off");
53 run_program(PROGRAM:"l2-off"); 52 run_program(PROGRAM:"2-off");
54 run_program(PROGRAM:"l3-off"); 53 run_program(PROGRAM:"3-off");
55 run_program(PROGRAM:"l4-off"); 54 run_program(PROGRAM:"4-off");
56 } else if (l <= 40) { 55 } else if (v <= 40) {
57 run_program(PROGRAM:"l0-on"); 56 run_program(PROGRAM:"0-on");
58 run_program(PROGRAM:"l1-on"); 57 run_program(PROGRAM:"1-on");
59 run_program(PROGRAM:"l2-off"); 58 run_program(PROGRAM:"2-off");
60 run_program(PROGRAM:"l3-off"); 59 run_program(PROGRAM:"3-off");
61 run_program(PROGRAM:"l4-off"); 60 run_program(PROGRAM:"4-off");
62 } else if (l <= 60) { 61 } else if (v <= 60) {
63 run_program(PROGRAM:"l0-on"); 62 run_program(PROGRAM:"0-on");
64 run_program(PROGRAM:"l1-on"); 63 run_program(PROGRAM:"1-on");
65 run_program(PROGRAM:"l2-on"); 64 run_program(PROGRAM:"2-on");
66 run_program(PROGRAM:"l3-off"); 65 run_program(PROGRAM:"3-off");
67 run_program(PROGRAM:"l4-off"); 66 run_program(PROGRAM:"4-off");
68 } else if (l <= 80) { 67 } else if (v <= 80) {
69 run_program(PROGRAM:"l0-on"); 68 run_program(PROGRAM:"0-on");
70 run_program(PROGRAM:"l1-on"); 69 run_program(PROGRAM:"1-on");
71 run_program(PROGRAM:"l2-on"); 70 run_program(PROGRAM:"2-on");
72 run_program(PROGRAM:"l3-on"); 71 run_program(PROGRAM:"3-on");
73 run_program(PROGRAM:"l4-off"); 72 run_program(PROGRAM:"4-off");
74 } else { 73 } else {
75 run_program(PROGRAM:"l0-on"); 74 run_program(PROGRAM:"0-on");
76 run_program(PROGRAM:"l1-on"); 75 run_program(PROGRAM:"1-on");
77 run_program(PROGRAM:"l2-on"); 76 run_program(PROGRAM:"2-on");
78 run_program(PROGRAM:"l3-on"); 77 run_program(PROGRAM:"3-on");
79 run_program(PROGRAM:"l4-on"); 78 run_program(PROGRAM:"4-on");
80 } 79 }
81 80 } else if ((type == MSG_INT) && (id == 1)) {
82 if (r <= 0) { 81 new v;
83 run_program(PROGRAM:"r0-off"); 82 v = getarg(2);
84 run_program(PROGRAM:"r1-off"); 83 if (v <= 0) {
85 run_program(PROGRAM:"r2-off"); 84 run_program(PROGRAM:"0-off");
86 run_program(PROGRAM:"r3-off"); 85 run_program(PROGRAM:"1-off");
87 run_program(PROGRAM:"r4-off"); 86 run_program(PROGRAM:"2-off");
88 } else if (r <= 20) { 87 run_program(PROGRAM:"3-off");
89 run_program(PROGRAM:"r0-on"); 88 run_program(PROGRAM:"4-off");
90 run_program(PROGRAM:"r1-off"); 89 } else if (v <= 20) {
91 run_program(PROGRAM:"r2-off"); 90 run_program(PROGRAM:"0-on");
92 run_program(PROGRAM:"r3-off"); 91 run_program(PROGRAM:"1-off");
93 run_program(PROGRAM:"r4-off"); 92 run_program(PROGRAM:"2-off");
94 } else if (r <= 40) { 93 run_program(PROGRAM:"3-off");
95 run_program(PROGRAM:"r0-on"); 94 run_program(PROGRAM:"4-off");
96 run_program(PROGRAM:"r1-on"); 95 } else if (v <= 40) {
97 run_program(PROGRAM:"r2-off"); 96 run_program(PROGRAM:"0-on");
98 run_program(PROGRAM:"r3-off"); 97 run_program(PROGRAM:"1-on");
99 run_program(PROGRAM:"r4-off"); 98 run_program(PROGRAM:"2-off");
100 } else if (r <= 60) { 99 run_program(PROGRAM:"3-off");
101 run_program(PROGRAM:"r0-on"); 100 run_program(PROGRAM:"4-off");
102 run_program(PROGRAM:"r1-on"); 101 } else if (v <= 60) {
103 run_program(PROGRAM:"r2-on"); 102 run_program(PROGRAM:"0-on");
104 run_program(PROGRAM:"r3-off"); 103 run_program(PROGRAM:"1-on");
105 run_program(PROGRAM:"r4-off"); 104 run_program(PROGRAM:"2-on");
106 } else if (r <= 80) { 105 run_program(PROGRAM:"3-off");
107 run_program(PROGRAM:"r0-on"); 106 run_program(PROGRAM:"4-off");
108 run_program(PROGRAM:"r1-on"); 107 } else if (v <= 80) {
109 run_program(PROGRAM:"r2-on"); 108 run_program(PROGRAM:"0-on");
110 run_program(PROGRAM:"r3-on"); 109 run_program(PROGRAM:"1-on");
111 run_program(PROGRAM:"r4-off"); 110 run_program(PROGRAM:"2-on");
111 run_program(PROGRAM:"3-on");
112 run_program(PROGRAM:"4-off");
112 } else { 113 } else {
113 run_program(PROGRAM:"r0-on"); 114 run_program(PROGRAM:"0-on");
114 run_program(PROGRAM:"r1-on"); 115 run_program(PROGRAM:"1-on");
115 run_program(PROGRAM:"r2-on"); 116 run_program(PROGRAM:"2-on");
116 run_program(PROGRAM:"r3-on"); 117 run_program(PROGRAM:"3-on");
117 run_program(PROGRAM:"r4-on"); 118 run_program(PROGRAM:"4-on");
118 } 119 }
119 } 120 }
120 } 121 }
121 } 122 }
122 parts { 123 parts {
@@ -190,16 +191,16 @@ collections {
190 color: 255 255 255 255; \ 191 color: 255 255 255 255; \
191 } \ 192 } \
192 } 193 }
193 LED("r0", 99, 0, 1) 194 LED("r0", 99, 0, 1)
194 LED("r1", 99, 1, 9) 195 LED("r1", 99, 1, 9)
195 LED("r2", 99, 2, 15) 196 LED("r2", 99, 2, 15)
196 LED("r3", 99, 3, 21) 197 LED("r3", 99, 3, 21)
197 LED("r4", 99, 4, 27) 198 LED("r4", 99, 4, 27)
198 LED("l0", 61, 0, 1) 199 LED("l0", 61, 0, 1)
199 LED("l1", 61, -1, 9) 200 LED("l1", 61, -1, 9)
200 LED("l2", 61, -2, 15) 201 LED("l2", 61, -2, 15)
201 LED("l3", 61, -3, 21) 202 LED("l3", 61, -3, 21)
202 LED("l4", 61, -4, 27) 203 LED("l4", 61, -4, 27)
203#undef LED 204#undef LED
204 part { name: "over"; type: RECT; 205 part { name: "over"; type: RECT;
205 description { state: "default" 0.0; 206 description { state: "default" 0.0;
@@ -221,24 +222,23 @@ collections {
221#define PROG(_NAME) \ 222#define PROG(_NAME) \
222 program { name: _NAME"-on"; \ 223 program { name: _NAME"-on"; \
223 action: STATE_SET "active" 0.0; \ 224 action: STATE_SET "active" 0.0; \
224 target: _NAME; \ 225 target: "r"_NAME; \
225 target: _NAME"g"; \ 226 target: "l"_NAME; \
227 target: "r"_NAME"g"; \
228 target: "l"_NAME"g"; \
226 } \ 229 } \
227 program { name: _NAME"-off"; \ 230 program { name: _NAME"-off"; \
228 action: STATE_SET "default" 0.0; \ 231 action: STATE_SET "default" 0.0; \
229 target: _NAME; \ 232 target: "r"_NAME; \
230 target: _NAME"g"; \ 233 target: "l"_NAME; \
234 target: "r"_NAME"g"; \
235 target: "l"_NAME"g"; \
231 } 236 }
232 PROG("r0") 237 PROG("0")
233 PROG("r1") 238 PROG("1")
234 PROG("r2") 239 PROG("2")
235 PROG("r3") 240 PROG("3")
236 PROG("r4") 241 PROG("4")
237 PROG("l0")
238 PROG("l1")
239 PROG("l2")
240 PROG("l3")
241 PROG("l4")
242#undef PROG 242#undef PROG
243 } 243 }
244 } 244 }