]>
Commit | Line | Data |
---|---|---|
d734981b | 1 | from .helpers import parse_args, register_fonts, path |
cc008de4 | 2 | |
6ebe6247 | 3 | parse_args() |
cc008de4 | 4 | |
d8046b94 IB |
5 | import kivy |
6 | kivy.require("1.9.1") | |
4b2d79ca IB |
7 | from kivy.app import App |
8 | from kivy.uix.floatlayout import FloatLayout | |
d734981b | 9 | from kivy.uix.stacklayout import StackLayout |
4b2d79ca IB |
10 | from kivy.uix.relativelayout import RelativeLayout |
11 | from kivy.properties import ListProperty, StringProperty | |
4b2d79ca | 12 | from kivy.core.window import Window |
bb69f62e | 13 | from kivy.lang import Builder |
6ebe6247 IB |
14 | from .key import Key |
15 | from .mapping import Mapping | |
bb69f62e | 16 | |
6ebe6247 | 17 | register_fonts() |
35bde798 | 18 | |
d734981b IB |
19 | from .app_blocks.playlist import * |
20 | ||
65ec4d2a IB |
21 | class KeyList(RelativeLayout): |
22 | keylist = ListProperty([]) | |
23 | first_key = StringProperty("") | |
24 | second_key = StringProperty("") | |
25 | third_key = StringProperty("") | |
26 | ||
27 | def append(self, value): | |
98ff4305 | 28 | self.keylist.insert(0, value) |
65ec4d2a IB |
29 | |
30 | def on_keylist(self, instance, new_key_list): | |
31 | if len(self.keylist) > 0: | |
32 | self.first_key = self.keylist[0] | |
33 | if len(self.keylist) > 1: | |
34 | self.second_key = self.keylist[1] | |
35 | if len(self.keylist) > 2: | |
36 | self.third_key = self.keylist[2] | |
37 | ||
4b2d79ca IB |
38 | class ActionList(RelativeLayout): |
39 | action_title = StringProperty("") | |
40 | action_list = ListProperty([]) | |
189bf90c | 41 | |
b17aed6a | 42 | def update_list(self, key, action_descriptions): |
4b2d79ca IB |
43 | self.action_title = "actions linked to key {}:".format(key.key_sym) |
44 | self.action_list = [] | |
189bf90c | 45 | |
b17aed6a IB |
46 | for [action, status] in action_descriptions: |
47 | if status == "done": | |
4b2d79ca | 48 | icon = "✓" |
b17aed6a | 49 | elif status == "current": |
4b2d79ca IB |
50 | icon = "✅" |
51 | else: | |
52 | icon = " " | |
b17aed6a | 53 | self.action_list.append([icon, action]) |
189bf90c | 54 | |
4b2d79ca IB |
55 | class Screen(FloatLayout): |
56 | pass | |
189bf90c | 57 | |
4b2d79ca IB |
58 | class MusicSamplerApp(App): |
59 | def build(self): | |
60 | Window.size = (913, 563) | |
9de92b6d | 61 | |
4b2d79ca | 62 | return Screen() |
9de92b6d | 63 | |
6ebe6247 IB |
64 | def main(): |
65 | Builder.load_file(path() + "/music_sampler.kv") | |
4b2d79ca | 66 | MusicSamplerApp().run() |