fix for no sound enabled

This commit is contained in:
David Rose 2002-09-17 02:37:32 +00:00
parent 083ae49ef0
commit 93d73a2b4e

View File

@ -52,28 +52,32 @@ class SoundInterval(Interval.Interval):
t1 = t + self.startTime t1 = t + self.startTime
if (t1 < 0.1): if (t1 < 0.1):
t1 = 0.0 t1 = 0.0
self.sound.setVolume(self.volume) if self.sound != None:
self.sound.setTime(t1) self.sound.setVolume(self.volume)
self.sound.setLoop(self.loop) self.sound.setTime(t1)
self.sound.play() self.sound.setLoop(self.loop)
self.sound.play()
self.state = CInterval.SStarted self.state = CInterval.SStarted
self.currT = t1 self.currT = t1
def privStep(self, t): def privStep(self, t):
if self.state == CInterval.SPaused: if self.state == CInterval.SPaused:
# Restarting from a pause. # Restarting from a pause.
self.sound.setVolume(self.volume) if self.sound != None:
self.sound.setTime(t) self.sound.setVolume(self.volume)
self.sound.setLoop(self.loop) self.sound.setTime(t)
self.sound.play() self.sound.setLoop(self.loop)
self.sound.play()
self.state = CInterval.SStarted self.state = CInterval.SStarted
self.currT = t self.currT = t
def privFinalize(self): def privFinalize(self):
self.sound.stop() if self.sound != None:
self.sound.stop()
self.currT = self.getDuration() self.currT = self.getDuration()
self.state = CInterval.SFinal self.state = CInterval.SFinal
def privInterrupt(self): def privInterrupt(self):
self.sound.stop() if self.sound != None:
self.sound.stop()
self.state = CInterval.SPaused self.state = CInterval.SPaused