aboutsummaryrefslogtreecommitdiff
path: root/helpers/mapping.py
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/mapping.py')
-rw-r--r--helpers/mapping.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/helpers/mapping.py b/helpers/mapping.py
index 60c7691..8e0265c 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -9,7 +9,7 @@ import sys
9 9
10from .music_file import * 10from .music_file import *
11from .mixer import Mixer 11from .mixer import Mixer
12from . import yml_file,gain 12from . import Config, gain
13 13
14class Mapping(RelativeLayout): 14class Mapping(RelativeLayout):
15 expected_keys = NumericProperty(0) 15 expected_keys = NumericProperty(0)
@@ -17,6 +17,7 @@ class Mapping(RelativeLayout):
17 ready_color = ListProperty([1, 165/255, 0, 1]) 17 ready_color = ListProperty([1, 165/255, 0, 1])
18 18
19 def __init__(self, **kwargs): 19 def __init__(self, **kwargs):
20 self.mixer = Mixer()
20 self.key_config, self.open_files = self.parse_config() 21 self.key_config, self.open_files = self.parse_config()
21 super(Mapping, self).__init__(**kwargs) 22 super(Mapping, self).__init__(**kwargs)
22 self._keyboard = Window.request_keyboard(self._keyboard_closed, self) 23 self._keyboard = Window.request_keyboard(self._keyboard_closed, self)
@@ -24,8 +25,6 @@ class Mapping(RelativeLayout):
24 self.running = [] 25 self.running = []
25 Clock.schedule_interval(self.not_all_keys_ready, 1) 26 Clock.schedule_interval(self.not_all_keys_ready, 1)
26 27
27 self.mixer = Mixer()
28
29 @property 28 @property
30 def master_gain(self): 29 def master_gain(self):
31 return gain(self.master_volume) 30 return gain(self.master_volume)
@@ -83,7 +82,7 @@ class Mapping(RelativeLayout):
83 self.running.remove((key, start_time)) 82 self.running.remove((key, start_time))
84 83
85 def parse_config(self): 84 def parse_config(self):
86 stream = open(yml_file(), "r") 85 stream = open(Config.yml_file, "r")
87 config = yaml.load(stream) 86 config = yaml.load(stream)
88 stream.close() 87 stream.close()
89 88