]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/action.py
Small fixes
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / action.py
index 792b123cd2676c37bca6c72f2c7905aaf06b6578..1b8fc5ff53381f60fcf6bb0d0e590af3777819d0 100644 (file)
@@ -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)