]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - music_sampler/actions/stop_all_actions.py
Rename helpers to music_sampler
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler / actions / stop_all_actions.py
diff --git a/music_sampler/actions/stop_all_actions.py b/music_sampler/actions/stop_all_actions.py
new file mode 100644 (file)
index 0000000..4ea875a
--- /dev/null
@@ -0,0 +1,14 @@
+def run(action, key_start_time=0, other_only=False, **kwargs):
+    if other_only:
+        action.mapping.stop_all_running(
+                except_key=action.key,
+                key_start_time=key_start_time)
+    else:
+        action.mapping.stop_all_running()
+
+def description(action, other_only=False, **kwargs):
+    message = "stopping all actions"
+    if other_only:
+        message += " except this key"
+
+    return message