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