remove environment parameter and pass it via initialisation

This commit is contained in:
chrys
2016-09-21 23:17:54 +02:00
parent 9c571ba032
commit e9b97945a3
84 changed files with 1080 additions and 1057 deletions

View File

@@ -11,22 +11,22 @@ class command():
def __init__(self):
pass
def initialize(self, environment):
pass
def shutdown(self, environment):
pass
def getDescription(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'decrease sound volume'
def run(self, environment):
def run(self):
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume')
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.1:
value = 0.1
environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
self.env['runtime']['outputManager'].presentText(str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
def setCallback(self, callback):
pass