aboutsummaryrefslogtreecommitdiff
path: root/helpers/__init__.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-19 22:57:03 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-19 22:57:03 +0200
commitd479af33afa54fee7c22701c6012a1579ead395f (patch)
tree4b2c97662866051a22f8f14f0de2297d04d3b746 /helpers/__init__.py
parent23b7e0e5daf024e87d967ede3dfe6777a07e7469 (diff)
downloadMusicSampler-d479af33afa54fee7c22701c6012a1579ead395f.tar.gz
MusicSampler-d479af33afa54fee7c22701c6012a1579ead395f.tar.zst
MusicSampler-d479af33afa54fee7c22701c6012a1579ead395f.zip
Fix channels and description with blank lines
Diffstat (limited to 'helpers/__init__.py')
-rw-r--r--helpers/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/helpers/__init__.py b/helpers/__init__.py
index b7acbf5..d0d3f46 100644
--- a/helpers/__init__.py
+++ b/helpers/__init__.py
@@ -14,6 +14,8 @@ def parse_config(mapping):
14 14
15 file_lock = Lock("file") 15 file_lock = Lock("file")
16 16
17 channel_id = 0
18
17 for mapped_key in config['keys']: 19 for mapped_key in config['keys']:
18 key = mapping.find_by_unicode(mapped_key) 20 key = mapping.find_by_unicode(mapped_key)
19 if key is None: 21 if key is None:
@@ -39,7 +41,8 @@ def parse_config(mapping):
39 if argument == 'file': 41 if argument == 'file':
40 filename = action[action_name]['file'] 42 filename = action[action_name]['file']
41 if filename not in seen_files: 43 if filename not in seen_files:
42 seen_files[filename] = MusicFile(filename, file_lock) 44 seen_files[filename] = MusicFile(filename, file_lock, channel_id)
45 channel_id = channel_id + 1
43 46
44 action_args['music'] = seen_files[filename] 47 action_args['music'] = seen_files[filename]
45 48
@@ -57,3 +60,6 @@ def parse_config(mapping):
57 key.set_description(config['key_properties'][key_property]['description']) 60 key.set_description(config['key_properties'][key_property]['description'])
58 if 'color' in config['key_properties'][key_property]: 61 if 'color' in config['key_properties'][key_property]:
59 key.set_color(config['key_properties'][key_property]['color']) 62 key.set_color(config['key_properties'][key_property]['color'])
63
64 # Return the number of channels reserved
65 return channel_id + 1