]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - musicsampler.kv
Add exit key
[perso/Immae/Projets/Python/MusicSampler.git] / musicsampler.kv
CommitLineData
8612c5f8 1#:import math math
bb69f62e 2#:import h helpers
8612c5f8
IB
3
4<Key>:
5 pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x
6 pad_cols: False
7
8 y: (self.parent.top-self.parent.y) - (self.row) * self.parent.key_size - (self.row - 1) * self.parent.key_sep
9 x: (self.col - 1) * self.parent.key_size + int(self.col - 1) * self.parent.key_sep + self.pad_col_sep
10 size_hint: None, None
11 line_color: 120/255, 120/255, 120/255, 1
12 enabled: True
13 line_width: 2
14 row: 1
15 col: 0
16 key_code: 0
17 key_sym: ""
18 key_width: 1
19 key_height: 1
20 width: self.key_width * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep
21 height: self.key_height * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep
22 canvas.before:
23 Color:
24 rgba: self.color
25 RoundedRectangle:
26 pos: self.x, self.y
27 size: self.size
28 canvas:
29 Color:
30 rgba: self.line_color
31 Line:
32 rounded_rectangle: self.x + self.line_width, self.y + self.line_width, self.width - 2 * self.line_width, self.height - 2 * self.line_width, 10
33 width: self.line_width
34 Label:
35 id: key_label
bb69f62e 36 font_name: h.path() + "fonts/Ubuntu-B.ttf"
8612c5f8
IB
37 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size))
38 color: 0, 0, 0, 1
39 text: self.parent.key_sym
40 text_size: self.parent.width,self.font_size
41 shorten: True
42 shorten_from: "right"
43 split_str: ""
44 center_x: self.parent.x + self.texture_size[0] /2 + 5
45 center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
46 Label:
47 id: key_description_title
bb69f62e 48 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8
IB
49 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
50 color: 0, 0, 0, 1
51 text: self.parent.description_title
52 text_size: self.parent.width - 2*self.parent.line_width, self.font_size
53 halign: "right"
54 valign: "middle"
55 center_x: self.parent.x + self.texture_size[0] /2
56 center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
57 Label:
58 id: key_description
bb69f62e 59 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8
IB
60 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
61 color: 0, 0, 0, 1
62 text: "\n".join(self.parent.description)
63 text_size: 2 * self.parent.width,self.parent.height - key_label.font_size
64 halign: "left"
65 valign: "middle"
66 pos: self.parent.x + 2 * self.parent.line_width + 2, self.parent.y
67 size_hint: None, None
68 size: 2 * self.parent.width - 2 * self.parent.line_width, self.parent.height - key_label.font_size
69
70<Screen>:
4b2d79ca
IB
71 canvas:
72 Color:
73 rgba: 229/255, 228/255, 226/255, 1
74 Rectangle:
75 pos: 0, 0
76 size: self.width, self.height
77
8612c5f8
IB
78 key_size: int( (3 * self.width - 16) / 56)
79 key_sep: int( self.key_size / 24)
80 key_pad_sep: int( self.key_size / 7) + 1
81
82 border: (self.width - self.key_size * 18 - self.key_sep * 16 - self.key_pad_sep)/ 2
83
84 mapping_height: self.key_size * 6 + self.key_sep * 5
85 mapping_width: self.key_size * 18 + self.key_sep * 16 + self.key_pad_sep
86 mapping_x: self.border
87 mapping_y: self.top - self.mapping_height - self.border
88 action_list_height: self.height - self.mapping_height - 3 * self.border
89 action_list_width: 3 * self.width / 4
90 action_list_x: self.border
91 action_list_y: self.border
92 play_list_height: self.action_list_height
93 play_list_width: self.width - self.action_list_width - 3* self.border
94 play_list_y: self.border
95 play_list_x: self.action_list_width + 2 * self.border
96
97 Mapping:
98 id: Mapping
99 pos: self.parent.mapping_x, self.parent.mapping_y
100 size: self.parent.mapping_width, self.parent.mapping_height
101
102 key_size: self.parent.key_size
103 key_sep: self.parent.key_sep
104 key_pad_sep: self.parent.key_pad_sep
105 pad_x: self.key_size * 15 + 14 * self.key_sep + self.key_pad_sep
106 ActionList:
107 id: ActionList
108 pos: self.parent.action_list_x, self.parent.action_list_y
109 size: self.parent.action_list_width, self.parent.action_list_height
110 PlayList:
111 id: PlayList
112 pos: self.parent.play_list_x, self.parent.play_list_y
113 size: self.parent.play_list_width, self.parent.play_list_height
114
115<ActionList>:
116 size_hint: None, None
117 canvas:
118 Color:
119 rgba: 250./255, 250./255, 250./255, 1
120 Rectangle:
121 pos: 0, 0
122 size: self.width, self.height
123 Label:
124 id: action_list_title
bb69f62e 125 font_name: h.path() + "fonts/Ubuntu-B.ttf"
8612c5f8
IB
126 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
127 color: 0, 0, 0, 1
128 text: self.parent.action_title
129 text_size: None, self.parent.height
130 halign: "left"
131 valign: "top"
132 size_hint: None, None
133 size: self.texture_size[0], self.parent.height
134 Label:
135 id: action_list_icons
bb69f62e 136 font_name: h.path() + "fonts/Symbola.ttf"
8612c5f8
IB
137 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
138 line_height: 1.2 # FIXME: Donner la bonne taille de label
139 color: 0, 0, 0, 1
140 text: "\n".join(map(lambda x: x[0], self.parent.action_list))
141 text_size: None, self.parent.height
142 halign: "left"
143 valign: "top"
144 size_hint: None, None
145 size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
146 Label:
147 id: action_list_names
bb69f62e 148 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8
IB
149 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
150 color: 0, 0, 0, 1
151 text: "\n".join(map(lambda x: x[1], self.parent.action_list))
152 text_size: None, self.parent.height
153 halign: "left"
154 valign: "top"
155 size_hint: None, None
156 pos: 15, self.y
157 size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
158
159<PlayList>:
160 size_hint: None, None
161 canvas:
162 Color:
163 rgba: 250./255, 250./255, 250./255, 1
164 Rectangle:
165 pos: 0, 0
166 size: self.width, self.height
167 Label:
168 id: playlist_icons
bb69f62e 169 font_name: h.path() + "fonts/Symbola.ttf"
8612c5f8
IB
170 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
171 line_height: 1.2 # FIXME: Donner la bonne taille de label
172 color: 0, 0, 0, 1
173 text: "\n".join(map(lambda x: x[0], self.parent.playlist))
174 text_size: None, self.parent.height
175 halign: "left"
176 valign: "top"
177 size_hint: None, None
178 size: self.texture_size[0], self.parent.height
179 Label:
180 id: playlist_names
bb69f62e 181 font_name: h.path() + "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours
8612c5f8
IB
182 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
183 color: 0, 0, 0, 1
184 text: "\n".join(map(lambda x: x[1], self.parent.playlist))
185 text_size: None, self.parent.height
186 halign: "left"
187 valign: "top"
188 size_hint: None, None
189 pos: 15, self.y
190 size: self.texture_size[0], self.parent.height
191
192<Mapping>:
193 size_hint: None, None
194 key_size: 48
195 key_sep: 2
196 key_pad_sep: 7
197 pad_x: 755
198 canvas:
199 Color:
200 rgba: 250./255, 250./255, 250./255, 1
201 Rectangle:
202 pos: 0, 0
203 size: self.width, self.height
204 Key:
205 id: Key_27
206 key_code: 27
207 key_sym: "ESC"
208 row: 1
209 col: 1
210 Key:
211 id: Key_282
212 key_code: 282
213 key_sym: "F1"
214 row: 1
215 col: 3
216 Key:
217 id: Key_283
218 key_code: 283
219 key_sym: "F2"
220 row: 1
221 col: 4
222 Key:
223 id: Key_284
224 key_code: 284
225 key_sym: "F3"
226 row: 1
227 col: 5
228 Key:
229 id: Key_285
230 key_code: 285
231 key_sym: "F4"
232 row: 1
233 col: 6
234
235 Key:
236 id: Key_286
237 key_code: 286
238 key_sym: "F5"
239 row: 1
240 col: 7.5
241 Key:
242 id: Key_287
243 key_code: 287
244 key_sym: "F6"
245 row: 1
246 col: 8.5
247 Key:
248 id: Key_288
249 key_code: 288
250 key_sym: "F7"
251 row: 1
252 col: 9.5
253 Key:
254 id: Key_289
255 key_code: 289
256 key_sym: "F8"
257 row: 1
258 col: 10.5
259
260 Key:
261 id: Key_290
262 key_code: 290
263 key_sym: "F9"
264 row: 1
265 col: 12
266 Key:
267 id: Key_291
268 key_code: 291
269 key_sym: "F10"
270 row: 1
271 col: 13
272 Key:
273 id: Key_292
274 key_code: 292
275 key_sym: "F11"
276 row: 1
277 col: 14
278 Key:
279 id: Key_293
280 key_code: 293
281 key_sym: "F12"
282 row: 1
283 col: 15
284
285 Key:
286 id: Key_178
287 key_code: 178
288 key_sym: "²"
289 row: 2
290 col: 1
291 Key:
292 id: Key_38
293 key_code: 38
294 key_sym: "&"
295 row: 2
296 col: 2
297 Key:
298 id: Key_233
299 key_code: 233
300 key_sym: "é"
301 row: 2
302 col: 3
303 Key:
304 id: Key_34
305 key_code: 34
306 key_sym: '"'
307 row: 2
308 col: 4
309 Key:
310 id: Key_39
311 key_code: 39
312 key_sym: "'"
313 row: 2
314 col: 5
315 Key:
316 id: Key_40
317 key_code: 40
318 key_sym: "("
319 row: 2
320 col: 6
321 Key:
322 id: Key_45
323 key_code: 45
324 key_sym: "-"
325 row: 2
326 col: 7
327 Key:
328 id: Key_232
329 key_code: 232
330 key_sym: "è"
331 row: 2
332 col: 8
333 Key:
334 id: Key_95
335 key_code: 95
336 key_sym: "_"
337 row: 2
338 col: 9
339 Key:
340 id: Key_231
341 key_code: 231
342 key_sym: "ç"
343 row: 2
344 col: 10
345 Key:
346 id: Key_224
347 key_code: 224
348 key_sym: "à"
349 row: 2
350 col: 11
351 Key:
352 id: Key_41
353 key_code: 41
354 key_sym: ")"
355 row: 2
356 col: 12
357 Key:
358 id: Key_61
359 key_code: 61
360 key_sym: "="
361 row: 2
362 col: 13
363 Key:
364 id: Key_8
365 key_code: 8
366 key_sym: "<-"
367 row: 2
368 col: 14
369 key_width: 2
370 Key:
371 id: Key_9
372 key_code: 9
373 key_sym: "tab"
374 row: 3
375 col: 1
376 key_width: 1.48
377 Key:
378 id: Key_97
379 key_code: 97
380 key_sym: "a"
381 row: 3
382 col: 2.5
383 Key:
384 id: Key_122
385 key_code: 122
386 key_sym: "z"
387 row: 3
388 col: 3.5
389 Key:
390 id: Key_101
391 key_code: 101
392 key_sym: "e"
393 row: 3
394 col: 4.5
395 Key:
396 id: Key_114
397 key_code: 114
398 key_sym: "r"
399 row: 3
400 col: 5.5
401 Key:
402 id: Key_116
403 key_code: 116
404 key_sym: "t"
405 row: 3
406 col: 6.5
407 Key:
408 id: Key_121
409 key_code: 121
410 key_sym: "y"
411 row: 3
412 col: 7.5
413 Key:
414 id: Key_117
415 key_code: 117
416 key_sym: "u"
417 row: 3
418 col: 8.5
419 Key:
420 id: Key_105
421 key_code: 105
422 key_sym: "i"
423 row: 3
424 col: 9.5
425 Key:
426 id: Key_111
427 key_code: 111
428 key_sym: "o"
429 row: 3
430 col: 10.5
431 Key:
432 id: Key_112
433 key_code: 112
434 key_sym: "p"
435 row: 3
436 col: 11.5
437 Key:
438 id: Key_94
439 key_code: 94
440 key_sym: "^"
441 row: 3
442 col: 12.5
443 Key:
444 id: Key_36
445 key_code: 36
446 key_sym: "$"
447 row: 3
448 col: 13.5
449 Key:
450 id: Key_13
451 key_code: 13
452 key_sym: "Enter"
453 row: 4
454 col: 14.8
455 key_width: 1.23
456 key_height: 2
457 Key:
458 id: Key_301
459 key_code: 301
460 key_sym: "CAPS"
461 row: 4
462 col: 1
463 key_width: 1.75
464 line_width: 1
465 enabled: False
466
467 Key:
468 id: Key_113
469 key_code: 113
470 key_sym: "q"
471 row: 4
472 col: 2.8
473 Key:
474 id: Key_115
475 key_code: 115
476 key_sym: "s"
477 row: 4
478 col: 3.8
479 Key:
480 id: Key_100
481 key_code: 100
482 key_sym: "d"
483 row: 4
484 col: 4.8
485 Key:
486 id: Key_102
487 key_code: 102
488 key_sym: "f"
489 row: 4
490 col: 5.8
491 Key:
492 id: Key_103
493 key_code: 103
494 key_sym: "g"
495 row: 4
496 col: 6.8
497 Key:
498 id: Key_104
499 key_code: 104
500 key_sym: "h"
501 row: 4
502 col: 7.8
503 Key:
504 id: Key_106
505 key_code: 106
506 key_sym: "j"
507 row: 4
508 col: 8.8
509 Key:
510 id: Key_107
511 key_code: 107
512 key_sym: "k"
513 row: 4
514 col: 9.8
515 Key:
516 id: Key_108
517 key_code: 108
518 key_sym: "l"
519 row: 4
520 col: 10.8
521 Key:
522 id: Key_109
523 key_code: 109
524 key_sym: "m"
525 row: 4
526 col: 11.8
527 Key:
528 id: Key_249
529 key_code: 249
530 key_sym: "ù"
531 row: 4
532 col: 12.8
533 Key:
534 id: Key_42
535 key_code: 42
536 key_sym: "*"
537 row: 4
538 col: 13.8
539 Key:
540 id: Key_304
541 key_code: 304
542 key_sym: "LShift"
543 row: 5
544 col: 1
545 key_width: 1.3
546 line_width: 1
547 enabled: False
548 Key:
549 id: Key_60
550 key_code: 60
551 key_sym: "<"
552 row: 5
553 col: 2.3
554 Key:
555 id: Key_119
556 key_code: 119
557 key_sym: "w"
558 row: 5
559 col: 3.3
560 Key:
561 id: Key_120
562 key_code: 120
563 key_sym: "x"
564 row: 5
565 col: 4.3
566 Key:
567 id: Key_99
568 key_code: 99
569 key_sym: "c"
570 row: 5
571 col: 5.3
572 Key:
573 id: Key_118
574 key_code: 118
575 key_sym: "v"
576 row: 5
577 col: 6.3
578 Key:
579 id: Key_98
580 key_code: 98
581 key_sym: "b"
582 row: 5
583 col: 7.3
584 Key:
585 id: Key_110
586 key_code: 110
587 key_sym: "n"
588 row: 5
589 col: 8.3
590 Key:
591 id: Key_44
592 key_code: 44
593 key_sym: ","
594 row: 5
595 col: 9.3
596 Key:
597 id: Key_59
598 key_code: 59
599 key_sym: ";"
600 row: 5
601 col: 10.3
602 Key:
603 id: Key_58
604 key_code: 58
605 key_sym: ":"
606 row: 5
607 col: 11.3
608 Key:
609 id: Key_33
610 key_code: 33
611 key_sym: "!"
612 row: 5
613 col: 12.3
614 Key:
615 id: Key_303
616 key_code: 303
617 key_sym: "RShift"
618 row: 5
619 col: 13.3
620 key_width: 2.7
621 line_width: 1
622 enabled: False
623 Key:
624 id: Key_306
625 key_code: 306
626 key_sym: "LCtrl"
627 row: 6
628 col: 1
629 key_width: 1.3
630 line_width: 1
631 enabled: False
632 Key:
633 id: Key_311
634 key_code: 311
635 key_sym: "LSuper"
636 row: 6
637 col: 3.3
638 line_width: 1
639 enabled: False
640 Key:
641 id: Key_308
642 key_code: 308
643 key_sym: "LAlt"
644 row: 6
645 col: 4.3
646 line_width: 1
647 enabled: False
648 Key:
649 id: Key_32
650 key_code: 32
651 key_sym: "Espace"
652 row: 6
653 col: 5.3
654 key_width: 5
655 Key:
656 id: Key_313
657 key_code: 313
658 key_sym: "AltGr"
659 row: 6
660 col: 10.3
661 line_width: 1
662 enabled: False
663 Key:
664 id: Key_314
665 key_code: 314
666 key_sym: "Compose"
667 row: 6
668 col: 11.3
669 line_width: 1
670 enabled: False
671 Key:
672 id: Key_305
673 key_code: 305
674 key_sym: "RCtrl"
675 row: 6
676 col: 12.3
677 key_width: 1.3
678 line_width: 1
679 enabled: False
680
681
682 Key:
683 id: Key_277
684 key_code: 277
685 key_sym: "ins"
686 row: 2
687 col: 1
688 pad_cols: True
689 Key:
690 id: Key_278
691 key_code: 278
692 key_sym: "home"
693 row: 2
694 col: 2
695 pad_cols: True
696 Key:
697 id: Key_280
698 key_code: 280
699 key_sym: "pg_u"
700 row: 2
701 col: 3
702 pad_cols: True
703 Key:
704 id: Key_127
705 key_code: 127
706 key_sym: "del"
707 row: 3
708 col: 1
709 pad_cols: True
710 Key:
711 id: Key_279
712 key_code: 279
713 key_sym: "end"
714 row: 3
715 col: 2
716 pad_cols: True
717 Key:
718 id: Key_281
719 key_code: 281
720 key_sym: "pg_d"
721 row: 3
722 col: 3
723 pad_cols: True
724 Key:
725 id: Key_273
726 key_code: 273
727 key_sym: "up"
728 row: 5
729 col: 2
730 pad_cols: True
731 Key:
732 id: Key_274
733 key_code: 274
734 key_sym: "down"
735 row: 6
736 col: 2
737 pad_cols: True
738 Key:
739 id: Key_276
740 key_code: 276
741 key_sym: "left"
742 row: 6
743 col: 1
744 pad_cols: True
745 Key:
746 id: Key_275
747 key_code: 275
748 key_sym: "right"
749 row: 6
750 col: 3
751 pad_cols: True