X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=helpers%2Faction.py;h=1b8fc5ff53381f60fcf6bb0d0e590af3777819d0;hb=c80ff6dc4579ab28c4064576db5a4859e639c504;hp=792b123cd2676c37bca6c72f2c7905aaf06b6578;hpb=176642649ad18f056675f7d89ea84482084234bc;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git 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)