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 = QueueMonitor()
|
||||||
manager.start()
|
manager.start()
|
||||||
|
|
||||||
|
def clearQueueExternal():
|
||||||
|
global queue
|
||||||
|
queue = []
|
||||||
|
|
||||||
# Mac audio support
|
# Mac audio support
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
@ -98,6 +102,10 @@ try:
|
||||||
# new handle
|
# new handle
|
||||||
play_(path)
|
play_(path)
|
||||||
|
|
||||||
|
def clearQueueOSX():
|
||||||
|
global queue
|
||||||
|
queue = []
|
||||||
|
|
||||||
def play_(path):
|
def play_(path):
|
||||||
global current
|
global current
|
||||||
current = NSSound.alloc()
|
current = NSSound.alloc()
|
||||||
|
@ -115,5 +123,7 @@ except ImportError:
|
||||||
|
|
||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
play = playOSX
|
play = playOSX
|
||||||
|
clearAudioQueue = clearQueueOSX
|
||||||
else:
|
else:
|
||||||
play = playExternal
|
play = playExternal
|
||||||
|
clearAudioQueue = clearQueueExternal
|
||||||
|
|
Loading…
Reference in a new issue