]>
git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - music_sampler/app.py
1 from .helpers
import parse_args
, register_fonts
, path
7 from kivy
.app
import App
8 from kivy
.uix
.floatlayout
import FloatLayout
9 from kivy
.uix
.stacklayout
import StackLayout
10 from kivy
.uix
.relativelayout
import RelativeLayout
11 from kivy
.properties
import ListProperty
, StringProperty
12 from kivy
.core
.window
import Window
13 from kivy
.lang
import Builder
15 from .mapping
import Mapping
19 from .app_blocks
.playlist
import *
21 class KeyList(RelativeLayout
):
22 keylist
= ListProperty([])
23 first_key
= StringProperty("")
24 second_key
= StringProperty("")
25 third_key
= StringProperty("")
27 def append(self
, value
):
28 self
.keylist
.insert(0, value
)
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]
38 class ActionList(RelativeLayout
):
39 action_title
= StringProperty("")
40 action_list
= ListProperty([])
42 def update_list(self
, key
, action_descriptions
):
43 self
.action_title
= "actions linked to key {}:".format(key
.key_sym
)
46 for [action
, status
] in action_descriptions
:
49 elif status
== "current":
53 self
.action_list
.append([icon
, action
])
55 class Screen(FloatLayout
):
58 class MusicSamplerApp(App
):
60 Window
.size
= (913, 563)
65 Builder
.load_file(path() + "/music_sampler.kv")
66 MusicSamplerApp().run()