Update outputManager.py

This commit is contained in:
chrys87 2016-07-26 15:59:27 +02:00 committed by GitHub
parent 05b69ddd94
commit f486d2beb0

View File

@ -3,9 +3,10 @@
class outputManager(): class outputManager():
def __init__(self): def __init__(self):
pass pass
def presentText(self, environment, Text, Interrupt=True): def presentText(self, environment, Text, Interrupt=True, soundIconName = ''):
self.speakText(environment, Text, Interrupt) self.speakText(environment, Text, Interrupt)
self.brailleText(environment, Text) self.brailleText(environment, Text)
self.playSoundIcon(environment, soundIconName):
def speakText(self, environment, Text, Interrupt=True): def speakText(self, environment, Text, Interrupt=True):
if environment['runtime']['speechDriver'] == None: if environment['runtime']['speechDriver'] == None:
@ -23,14 +24,20 @@ class outputManager():
environment['runtime']['speechDriver'].speak(Text) environment['runtime']['speechDriver'].speak(Text)
def brailleText(self, environment, Text): def brailleText(self, environment, Text, Interrupt=True):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'): if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'braille', 'enabled'):
return return
print('braille') print('braille')
def interruptOutput(self, environment): def interruptOutput(self, environment):
environment['runtime']['speechDriver'].cancel() environment['runtime']['speechDriver'].cancel()
def playSoundIcon(self, environment, IconName): def playSoundIcon(self, environment, IconName, Interrupt=True):
if soundIconName == '':
return
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'): if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
return return
print(IconName) print(IconName)
try:
print(environment['soundIcons'][IconName])
except:
print('no icon there for' + IconName)