aboutsummaryrefslogtreecommitdiff
path: root/helpers/actions/seek.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-26 16:35:05 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-26 16:35:05 +0200
commite4917bcc6c5355a82f05880a389d0a1fd868561d (patch)
tree56f030600ad200632d0e9030c3b470dcb846215d /helpers/actions/seek.py
parentdb905e0706ab9a1f92102e86f677c66371be4621 (diff)
parentc4f4f2a1d330d8e09021619bbb8dcaac4df0a602 (diff)
downloadMusicSampler-e4917bcc6c5355a82f05880a389d0a1fd868561d.tar.gz
MusicSampler-e4917bcc6c5355a82f05880a389d0a1fd868561d.tar.zst
MusicSampler-e4917bcc6c5355a82f05880a389d0a1fd868561d.zip
Merge branch 'actions_cleanup'
Diffstat (limited to 'helpers/actions/seek.py')
-rw-r--r--helpers/actions/seek.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/helpers/actions/seek.py b/helpers/actions/seek.py
new file mode 100644
index 0000000..467af7d
--- /dev/null
+++ b/helpers/actions/seek.py
@@ -0,0 +1,19 @@
1def run(action, music=None, value=0, delta=False, **kwargs):
2 for music in action.music_list(music):
3 music.seek(value=value, delta=delta)
4
5def description(action, music=None, value=0, delta=False, **kwargs):
6 if delta:
7 if music is not None:
8 return "moving music « {} » by {:+d}s" \
9 .format(music.name, value)
10 else:
11 return "moving all musics by {:+d}s" \
12 .format(value)
13 else:
14 if music is not None:
15 return "moving music « {} » to position {}s" \
16 .format(music.name, value)
17 else:
18 return "moving all musics to position {}s" \
19 .format(value)