aboutsummaryrefslogtreecommitdiff
path: root/helpers/actions/seek.py
blob: 467af7d4656d261cc36a8f0d91890dd748d9d404 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def run(action, music=None, value=0, delta=False, **kwargs):
    for music in action.music_list(music):
        music.seek(value=value, delta=delta)

def description(action, music=None, value=0, delta=False, **kwargs):
    if delta:
        if music is not None:
            return "moving music « {} » by {:+d}s" \
                    .format(music.name, value)
        else:
            return "moving all musics by {:+d}s" \
                    .format(value)
    else:
        if music is not None:
            return "moving music « {} » to position {}s" \
                    .format(music.name, value)
        else:
            return "moving all musics to position {}s" \
                    .format(value)