]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/actions/play.py
Rename helpers to music_sampler
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / actions / play.py
diff --git a/helpers/actions/play.py b/helpers/actions/play.py
deleted file mode 100644 (file)
index fdba95b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-def run(action, music=None, fade_in=0, start_at=0,
-        restart_if_running=False, volume=100,
-        loop=0, **kwargs):
-    for music in action.music_list(music):
-        if restart_if_running:
-            if music.is_in_use():
-                music.stop()
-            music.play(
-                    volume=volume,
-                    fade_in=fade_in,
-                    start_at=start_at,
-                    loop=loop)
-        elif not music.is_in_use():
-            music.play(
-                    volume=volume,
-                    fade_in=fade_in,
-                    start_at=start_at,
-                    loop=loop)
-
-def description(action, music=None, fade_in=0, start_at=0,
-        restart_if_running=False, volume=100, loop=0, **kwargs):
-    message = "starting "
-    if music is not None:
-        message += "« {} »".format(music.name)
-    else:
-        message += "all musics"
-
-    if start_at != 0:
-        message += " at {}s".format(start_at)
-
-    if fade_in != 0:
-        message += " with {}s fade_in".format(fade_in)
-
-    message += " at volume {}%".format(volume)
-
-    if loop > 0:
-        message += " {} times".format(loop + 1)
-    elif loop < 0:
-        message += " in loop"
-
-    if restart_if_running:
-        message += " (restarting if already running)"
-
-    return message