fix settings stuff

This commit is contained in:
chrys
2016-07-26 23:39:22 +02:00
parent d90ebb8932
commit f00621832e
3 changed files with 37 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ class outputManager():
def presentText(self, environment, text, interrupt=True, soundIconName = ''):
self.speakText(environment, text, interrupt)
self.brailleText(environment, text)
self.playSoundIcon(environment, soundIconName):
self.playSoundIcon(environment, soundIconName)
def speakText(self, environment, text, interrupt=True):
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'):
@@ -32,17 +32,17 @@ class outputManager():
def interruptOutput(self, environment):
environment['runtime']['speechDriver'].cancel()
environment['runtime']['soundDriver'].cancel()
def playSoundIcon(self, environment, iconName, interrupt=True):
def playSoundIcon(self, environment, soundIconName, interrupt=True):
if soundIconName == '':
return
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
return
if environment['runtime']['soundDriver'] == None:
return
print(IconName)
print(soundIconName)
try:
print(environment['soundIcons'][iconName])
environment['runtime']['soundDriver'].playSoundFile(environment, environment['soundIcons'][iconName], interrupt)
print(environment['soundIcons'][soundIconName])
environment['runtime']['soundDriver'].playSoundFile(environment, environment['soundIcons'][soundIconName], interrupt)
except:
print('no icon there for' + IconName)