Skip to content

Commit 93722ed

Browse files
committed
wait() waits for all actions
1 parent 3be1655 commit 93722ed

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/rtmixer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,21 @@ def fetch_and_reset_stats(self, time=0, allow_belated=True):
9191
self._enqueue(action)
9292
return action
9393

94-
def wait(self, action, sleeptime=10):
94+
def wait(self, action=None, sleeptime=10):
9595
"""Wait for *action* to be finished.
9696
9797
Between repeatedly checking if the action is finished, this
9898
waits for *sleeptime* milliseconds.
9999
100+
If no *action* is given, this waits for all actions.
101+
100102
"""
101-
while action in self.actions:
102-
_sd.sleep(sleeptime)
103+
if action is None:
104+
while self.actions:
105+
_sd.sleep(sleeptime)
106+
else:
107+
while action in self.actions:
108+
_sd.sleep(sleeptime)
103109

104110
def _check_channels(self, channels, kind):
105111
"""Check if number of channels or mapping was given."""

0 commit comments

Comments
 (0)