From c80ff6dc4579ab28c4064576db5a4859e639c504 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 17 Jul 2016 16:32:03 +0200 Subject: [PATCH] Small fixes --- helpers/action.py | 14 +++++++------- helpers/music_file.py | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/helpers/action.py b/helpers/action.py index 792b123..1b8fc5f 100644 --- a/helpers/action.py +++ b/helpers/action.py @@ -42,17 +42,17 @@ class Action: if getattr(self, self.action + "_interrupt", None): return getattr(self, self.action + "_interrupt")(**self.arguments) - # Actions - def command(self, command = "", **kwargs): - # FIXME: todo - pass - def music_list(self, music): if music is not None: return [music] else: return self.mapping.open_files.values() + # Actions + def command(self, command = "", **kwargs): + # FIXME: todo + pass + def pause(self, music = None, **kwargs): for music in self.music_list(music): if music.is_loaded_playing(): @@ -67,7 +67,7 @@ class Action: restart_if_running = False, volume = 100, loop = 0, **kwargs): - if music is not None: + for music in self.music_list(music): if restart_if_running: if music.is_not_stopped(): music.stop() @@ -131,7 +131,7 @@ class Action: if music is not None: message += "« {} »".format(music.name) else: - message += "music" + message += "all musics" if start_at != 0: message += " at {}s".format(start_at) diff --git a/helpers/music_file.py b/helpers/music_file.py index 5baab7e..7e5f978 100644 --- a/helpers/music_file.py +++ b/helpers/music_file.py @@ -177,8 +177,6 @@ class MusicFile(Machine): ms = int(self.sound_position * 1000) ms_fo = max(1, int(fade_out * 1000)) - # FIXME: stop fade_out puis seek -5 -> on abandonne le fade ? (cf - # commentaire dans fonction seek new_audio_segment = self.current_audio_segment[:ms + ms_fo].fade_out(ms_fo) with self.music_lock: self.current_audio_segment = new_audio_segment -- 2.41.0