aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-14 23:05:55 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-14 23:05:55 +0200
commit8e50011c8d5e5f4ac48f0856c9737d62f3e67838 (patch)
treeeb4810a920284ea8a830be164ce7bd185d589dee
parent1b4b78f5b6df7182ac066fcc26a7b4f0e8586a47 (diff)
downloadMusicSampler-8e50011c8d5e5f4ac48f0856c9737d62f3e67838.tar.gz
MusicSampler-8e50011c8d5e5f4ac48f0856c9737d62f3e67838.tar.zst
MusicSampler-8e50011c8d5e5f4ac48f0856c9737d62f3e67838.zip
Rename 'add' to 'delta'
-rw-r--r--helpers/action.py10
-rw-r--r--helpers/mapping.py4
-rw-r--r--helpers/music_file.py4
3 files changed, 9 insertions, 9 deletions
diff --git a/helpers/action.py b/helpers/action.py
index 28afcee..2f294a0 100644
--- a/helpers/action.py
+++ b/helpers/action.py
@@ -87,11 +87,11 @@ class Action:
87 def stop_all_actions(self, **kwargs): 87 def stop_all_actions(self, **kwargs):
88 self.mapping.stop_all_running() 88 self.mapping.stop_all_running()
89 89
90 def volume(self, music = None, value = 100, add = False, **kwargs): 90 def volume(self, music = None, value = 100, delta = False, **kwargs):
91 if music is not None: 91 if music is not None:
92 music.set_volume(value, add = add) 92 music.set_volume(value, delta = delta)
93 else: 93 else:
94 self.mapping.set_master_volume(value, add = add) 94 self.mapping.set_master_volume(value, delta = delta)
95 95
96 def wait(self, duration = 0, music = None, **kwargs): 96 def wait(self, duration = 0, music = None, **kwargs):
97 self.sleep_event = threading.Event() 97 self.sleep_event = threading.Event()
@@ -156,8 +156,8 @@ class Action:
156 def stop_all_actions_print(self, **kwargs): 156 def stop_all_actions_print(self, **kwargs):
157 return "stopping all actions" 157 return "stopping all actions"
158 158
159 def volume_print(self, music = None, value = 100, add = False, **kwargs): 159 def volume_print(self, music = None, value = 100, delta = False, **kwargs):
160 if add: 160 if delta:
161 if music is not None: 161 if music is not None:
162 return "{:+d}% to volume of « {} »".format(value, music.name) 162 return "{:+d}% to volume of « {} »".format(value, music.name)
163 else: 163 else:
diff --git a/helpers/mapping.py b/helpers/mapping.py
index d9b7ba0..84845fc 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -28,8 +28,8 @@ class Mapping(RelativeLayout):
28 def master_gain(self): 28 def master_gain(self):
29 return gain(self.master_volume) 29 return gain(self.master_volume)
30 30
31 def set_master_volume(self, value, add = False): 31 def set_master_volume(self, value, delta = False):
32 [db_gain, self.master_volume] = gain(value + int(add) * self.master_volume, self.master_volume) 32 [db_gain, self.master_volume] = gain(value + int(delta) * self.master_volume, self.master_volume)
33 for music in self.open_files.values(): 33 for music in self.open_files.values():
34 music.set_gain(db_gain) 34 music.set_gain(db_gain)
35 35
diff --git a/helpers/music_file.py b/helpers/music_file.py
index 6a28d62..b926c64 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -152,8 +152,8 @@ class MusicFile(Machine):
152 with self.music_lock: 152 with self.music_lock:
153 self.current_audio_segment = new_audio_segment 153 self.current_audio_segment = new_audio_segment
154 154
155 def set_volume(self, value, add = False): 155 def set_volume(self, value, delta = False):
156 [db_gain, self.volume] = gain(value + int(add) * self.volume, self.volume) 156 [db_gain, self.volume] = gain(value + int(delta) * self.volume, self.volume)
157 157
158 self.set_gain(db_gain) 158 self.set_gain(db_gain)
159 159