aboutsummaryrefslogtreecommitdiff
path: root/helpers/actions/seek.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-26 16:27:51 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-26 16:27:51 +0200
commitc4f4f2a1d330d8e09021619bbb8dcaac4df0a602 (patch)
tree56f030600ad200632d0e9030c3b470dcb846215d /helpers/actions/seek.py
parenta1d7f30a1cafbfcf3a0a561fcab71ce6437a3d45 (diff)
downloadMusicSampler-c4f4f2a1d330d8e09021619bbb8dcaac4df0a602.tar.gz
MusicSampler-c4f4f2a1d330d8e09021619bbb8dcaac4df0a602.tar.zst
MusicSampler-c4f4f2a1d330d8e09021619bbb8dcaac4df0a602.zip
Move actions to separate files
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)