aboutsummaryrefslogtreecommitdiff
path: root/helpers/action.py
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/action.py')
-rw-r--r--helpers/action.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/helpers/action.py b/helpers/action.py
index 218c316..b8e44e6 100644
--- a/helpers/action.py
+++ b/helpers/action.py
@@ -102,9 +102,9 @@ class Action:
102 def stop_all_actions(self, **kwargs): 102 def stop_all_actions(self, **kwargs):
103 self.mapping.stop_all_running() 103 self.mapping.stop_all_running()
104 104
105 def volume(self, music=None, value=100, delta=False, **kwargs): 105 def volume(self, music=None, value=100, fade=0, delta=False, **kwargs):
106 if music is not None: 106 if music is not None:
107 music.set_volume(value, delta=delta) 107 music.set_volume(value, delta=delta, fade=fade)
108 else: 108 else:
109 self.mapping.set_master_volume(value, delta=delta) 109 self.mapping.set_master_volume(value, delta=delta)
110 110
@@ -192,22 +192,29 @@ class Action:
192 return "moving all musics to position {}s" \ 192 return "moving all musics to position {}s" \
193 .format(value) 193 .format(value)
194 194
195 def volume_print(self, music=None, value=100, delta=False, **kwargs): 195 def volume_print(self, music=None,
196 value=100, delta=False, fade=0, **kwargs):
197 message = ""
196 if delta: 198 if delta:
197 if music is not None: 199 if music is not None:
198 return "{:+d}% to volume of « {} »" \ 200 message += "{:+d}% to volume of « {} »" \
199 .format(value, music.name) 201 .format(value, music.name)
200 else: 202 else:
201 return "{:+d}% to volume" \ 203 message += "{:+d}% to volume" \
202 .format(value) 204 .format(value)
203 else: 205 else:
204 if music is not None: 206 if music is not None:
205 return "setting volume of « {} » to {}%" \ 207 message += "setting volume of « {} » to {}%" \
206 .format(music.name, value) 208 .format(music.name, value)
207 else: 209 else:
208 return "setting volume to {}%" \ 210 message += "setting volume to {}%" \
209 .format(value) 211 .format(value)
210 212
213 if music is not None and fade > 0:
214 message += " with {}s fade".format(fade)
215
216 return message
217
211 def wait_print(self, duration=0, music=None, **kwargs): 218 def wait_print(self, duration=0, music=None, **kwargs):
212 if music is None: 219 if music is None:
213 return "waiting {}s" \ 220 return "waiting {}s" \