]>
git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - music_sampler/actions/stop.py
1 def run(action
, music
=None, fade_out
=0, wait
=False,
2 set_wait_id
=None, **kwargs
):
4 for music
in action
.music_list(music
):
5 if music
.is_loaded_paused() or music
.is_loaded_playing():
6 if previous
is not None:
7 previous
.stop(fade_out
=fade_out
)
10 music
.stop(fade_out
=fade_out
)
12 if previous
is not None:
13 action
.waiting_music
= previous
17 set_wait_id
=set_wait_id
)
19 def description(action
, music
=None, fade_out
=0, wait
=False,
20 set_wait_id
=None, **kwargs
):
24 message
+= "music « {} »".format(music
.name
)
26 message
+= "all musics"
29 message
+= " with {}s fadeout".format(fade_out
)
31 if set_wait_id
is not None:
32 message
+= " (waiting the end of fadeout, with id {})"\
35 message
+= " (waiting the end of fadeout)"
39 def interrupt(action
, music
=None, fade_out
=0, wait
=False,
40 set_wait_id
=None, **kwargs
):
41 if action
.waiting_music
is not None:
42 action
.waiting_music
.wait_event
.set()