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