aboutsummaryrefslogtreecommitdiff
path: root/music_sampler/actions/wait.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-08-12 14:51:32 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-08-12 14:51:32 +0200
commit21ffec315b8fa8a6b46351021da915236148a7b1 (patch)
tree52951646c8f9d1ea453c58aa37c92e64ff0dd9a1 /music_sampler/actions/wait.py
parent4094ae4ebff7997e8c5e0fd84a1434b1b86632b1 (diff)
downloadMusicSampler-21ffec315b8fa8a6b46351021da915236148a7b1.tar.gz
MusicSampler-21ffec315b8fa8a6b46351021da915236148a7b1.tar.zst
MusicSampler-21ffec315b8fa8a6b46351021da915236148a7b1.zip
Make 'interrupt_wait' able to interrupt all waits
If 'wait_id' is not specified, interrupt_wait will now stop all wait events. This fixes https://git.immae.eu/mantisbt/view.php?id=4
Diffstat (limited to 'music_sampler/actions/wait.py')
-rw-r--r--music_sampler/actions/wait.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/music_sampler/actions/wait.py b/music_sampler/actions/wait.py
index e6d07f2..bcee649 100644
--- a/music_sampler/actions/wait.py
+++ b/music_sampler/actions/wait.py
@@ -1,8 +1,7 @@
1import threading 1import threading
2 2
3def run(action, duration=0, music=None, set_wait_id=None, **kwargs): 3def run(action, duration=0, music=None, set_wait_id=None, **kwargs):
4 if set_wait_id is not None: 4 action.mapping.add_wait(action, wait_id=set_wait_id)
5 action.mapping.add_wait_id(set_wait_id, action)
6 5
7 action.sleep_event = threading.Event() 6 action.sleep_event = threading.Event()
8 action.sleep_event_timer = threading.Timer( 7 action.sleep_event_timer = threading.Timer(