]>
Commit | Line | Data |
---|---|---|
1 | from .helpers import parse_args, register_fonts, path | |
2 | ||
3 | parse_args() | |
4 | ||
5 | import kivy | |
6 | kivy.require("1.9.1") | |
7 | from kivy.app import App | |
8 | from kivy.uix.floatlayout import FloatLayout | |
9 | from kivy.uix.relativelayout import RelativeLayout | |
10 | from kivy.properties import ListProperty, StringProperty | |
11 | from kivy.core.window import Window | |
12 | from kivy.lang import Builder | |
13 | ||
14 | register_fonts() | |
15 | ||
16 | ||
17 | from .key import Key | |
18 | from .mapping import Mapping | |
19 | ||
20 | from .app_blocks.actionlist import * | |
21 | from .app_blocks.playlist import * | |
22 | ||
23 | class KeyList(RelativeLayout): | |
24 | keylist = ListProperty([]) | |
25 | first_key = StringProperty("") | |
26 | second_key = StringProperty("") | |
27 | third_key = StringProperty("") | |
28 | ||
29 | def append(self, value): | |
30 | self.keylist.insert(0, value) | |
31 | ||
32 | def on_keylist(self, instance, new_key_list): | |
33 | if len(self.keylist) > 0: | |
34 | self.first_key = self.keylist[0] | |
35 | if len(self.keylist) > 1: | |
36 | self.second_key = self.keylist[1] | |
37 | if len(self.keylist) > 2: | |
38 | self.third_key = self.keylist[2] | |
39 | ||
40 | class Screen(FloatLayout): | |
41 | pass | |
42 | ||
43 | class MusicSamplerApp(App): | |
44 | def build(self): | |
45 | Window.size = (913, 563) | |
46 | ||
47 | return Screen() | |
48 | ||
49 | def main(): | |
50 | Builder.load_file(path() + "/music_sampler.kv") | |
51 | MusicSamplerApp().run() |