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

@ -15,14 +15,15 @@ class driver():
self.soundFileCommand = ''
self.frequenceCommand = ''
def initialize(self, environment):
self.soundFileCommand = environment['runtime']['settingsManager'].getSetting(environment,'sound', 'genericPlayFileCommand')
self.frequenceCommand = environment['runtime']['settingsManager'].getSetting(environment,'sound', 'genericFrequencyCommand')
self.env = environment
self.soundFileCommand = self.env['runtime']['settingsManager'].getSetting('sound', 'genericPlayFileCommand')
self.frequenceCommand = self.env['runtime']['settingsManager'].getSetting('sound', 'genericFrequencyCommand')
if self.soundFileCommand == '':
self.soundFileCommand = 'play -q -v fenrirVolume fenrirSoundFile'
if self.frequenceCommand == '':
self.frequenceCommand = '=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence'
return
def shutdown(self, environment):
def shutdown(self):
self.cancel()
return
def playFrequence(self, frequence, duration, adjustVolume):

View File

@ -30,7 +30,7 @@ class driver:
return
if not _gstreamerAvailable:
return
self.env = environment
self._player = Gst.ElementFactory.make('playbin', 'player')
bus = self._player.get_bus()
bus.add_signal_watch()
@ -49,7 +49,7 @@ class driver:
self._initialized = True
return
def shutdown(self, environment):
def shutdown(self):
global _gstreamerAvailable
if not _gstreamerAvailable:
return