From 8e50011c8d5e5f4ac48f0856c9737d62f3e67838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 14 Jul 2016 23:05:55 +0200 Subject: Rename 'add' to 'delta' --- helpers/action.py | 10 +++++----- helpers/mapping.py | 4 ++-- helpers/music_file.py | 4 ++-- 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: def stop_all_actions(self, **kwargs): self.mapping.stop_all_running() - def volume(self, music = None, value = 100, add = False, **kwargs): + def volume(self, music = None, value = 100, delta = False, **kwargs): if music is not None: - music.set_volume(value, add = add) + music.set_volume(value, delta = delta) else: - self.mapping.set_master_volume(value, add = add) + self.mapping.set_master_volume(value, delta = delta) def wait(self, duration = 0, music = None, **kwargs): self.sleep_event = threading.Event() @@ -156,8 +156,8 @@ class Action: def stop_all_actions_print(self, **kwargs): return "stopping all actions" - def volume_print(self, music = None, value = 100, add = False, **kwargs): - if add: + def volume_print(self, music = None, value = 100, delta = False, **kwargs): + if delta: if music is not None: return "{:+d}% to volume of « {} »".format(value, music.name) 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): def master_gain(self): return gain(self.master_volume) - def set_master_volume(self, value, add = False): - [db_gain, self.master_volume] = gain(value + int(add) * self.master_volume, self.master_volume) + def set_master_volume(self, value, delta = False): + [db_gain, self.master_volume] = gain(value + int(delta) * self.master_volume, self.master_volume) for music in self.open_files.values(): music.set_gain(db_gain) 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): with self.music_lock: self.current_audio_segment = new_audio_segment - def set_volume(self, value, add = False): - [db_gain, self.volume] = gain(value + int(add) * self.volume, self.volume) + def set_volume(self, value, delta = False): + [db_gain, self.volume] = gain(value + int(delta) * self.volume, self.volume) self.set_gain(db_gain) -- cgit v1.2.3