]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - music_sampler.py
Show last used keys
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler.py
index 81b96c4c29d32ea45498109e28548e2d40e19602..5e61466257fdb631ad8467e6c7bedcb16901ab0c 100644 (file)
@@ -11,6 +11,23 @@ from helpers.key import Key
 from helpers.mapping import Mapping
 import helpers
 
+class KeyList(RelativeLayout):
+    keylist = ListProperty([])
+    first_key = StringProperty("")
+    second_key = StringProperty("")
+    third_key = StringProperty("")
+
+    def append(self, value):
+        self.keylist = [value] + self.keylist
+
+    def on_keylist(self, instance, new_key_list):
+        if len(self.keylist) > 0:
+            self.first_key  = self.keylist[0]
+        if len(self.keylist) > 1:
+            self.second_key = self.keylist[1]
+        if len(self.keylist) > 2:
+            self.third_key  = self.keylist[2]
+
 class PlayList(RelativeLayout):
     playlist = ListProperty([])