aboutsummaryrefslogtreecommitdiff
path: root/helpers/action.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-17 16:32:03 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-17 16:37:43 +0200
commitc80ff6dc4579ab28c4064576db5a4859e639c504 (patch)
tree50d9e2cf294dc12eb7c79f075d30ea96755e76f5 /helpers/action.py
parent176642649ad18f056675f7d89ea84482084234bc (diff)
downloadMusicSampler-c80ff6dc4579ab28c4064576db5a4859e639c504.tar.gz
MusicSampler-c80ff6dc4579ab28c4064576db5a4859e639c504.tar.zst
MusicSampler-c80ff6dc4579ab28c4064576db5a4859e639c504.zip
Small fixes
Diffstat (limited to 'helpers/action.py')
-rw-r--r--helpers/action.py14
1 files changed, 7 insertions, 7 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:
42 if getattr(self, self.action + "_interrupt", None): 42 if getattr(self, self.action + "_interrupt", None):
43 return getattr(self, self.action + "_interrupt")(**self.arguments) 43 return getattr(self, self.action + "_interrupt")(**self.arguments)
44 44
45 # Actions
46 def command(self, command = "", **kwargs):
47 # FIXME: todo
48 pass
49
50 def music_list(self, music): 45 def music_list(self, music):
51 if music is not None: 46 if music is not None:
52 return [music] 47 return [music]
53 else: 48 else:
54 return self.mapping.open_files.values() 49 return self.mapping.open_files.values()
55 50
51 # Actions
52 def command(self, command = "", **kwargs):
53 # FIXME: todo
54 pass
55
56 def pause(self, music = None, **kwargs): 56 def pause(self, music = None, **kwargs):
57 for music in self.music_list(music): 57 for music in self.music_list(music):
58 if music.is_loaded_playing(): 58 if music.is_loaded_playing():
@@ -67,7 +67,7 @@ class Action:
67 restart_if_running = False, volume = 100, 67 restart_if_running = False, volume = 100,
68 loop = 0, 68 loop = 0,
69 **kwargs): 69 **kwargs):
70 if music is not None: 70 for music in self.music_list(music):
71 if restart_if_running: 71 if restart_if_running:
72 if music.is_not_stopped(): 72 if music.is_not_stopped():
73 music.stop() 73 music.stop()
@@ -131,7 +131,7 @@ class Action:
131 if music is not None: 131 if music is not None:
132 message += "« {} »".format(music.name) 132 message += "« {} »".format(music.name)
133 else: 133 else:
134 message += "music" 134 message += "all musics"
135 135
136 if start_at != 0: 136 if start_at != 0:
137 message += " at {}s".format(start_at) 137 message += " at {}s".format(start_at)