mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
add support for clearing audio queue
This commit is contained in:
parent
2319cbcc71
commit
3e7d3bbf28
1 changed files with 10 additions and 0 deletions
|
@ -64,6 +64,10 @@ def playExternal(path):
|
|||
manager = QueueMonitor()
|
||||
manager.start()
|
||||
|
||||
def clearQueueExternal():
|
||||
global queue
|
||||
queue = []
|
||||
|
||||
# Mac audio support
|
||||
##########################################################################
|
||||
|
||||
|
@ -98,6 +102,10 @@ try:
|
|||
# new handle
|
||||
play_(path)
|
||||
|
||||
def clearQueueOSX():
|
||||
global queue
|
||||
queue = []
|
||||
|
||||
def play_(path):
|
||||
global current
|
||||
current = NSSound.alloc()
|
||||
|
@ -115,5 +123,7 @@ except ImportError:
|
|||
|
||||
if sys.platform.startswith("darwin"):
|
||||
play = playOSX
|
||||
clearAudioQueue = clearQueueOSX
|
||||
else:
|
||||
play = playExternal
|
||||
clearAudioQueue = clearQueueExternal
|
||||
|
|
Loading…
Reference in a new issue