*** empty log message ***

This commit is contained in:
Mike Goslin 2001-03-06 01:47:13 +00:00
parent 1511097112
commit 2e37c13254
3 changed files with 25 additions and 3 deletions

View File

@ -42,10 +42,12 @@ class Interval(DirectObject):
"""
self.setT(self.getDuration(), entry=1)
def play(self, t0=0.0, duration=0.0):
def play(self, t0=0.0, duration=0.0, scale=1.0):
""" play(t0, duration)
"""
self.startT = self.clock.getFrameTime() - t0
assert(scale > 0.0)
self.scale = scale
if (duration == 0.0):
self.playDuration = self.duration
else:
@ -61,7 +63,7 @@ class Interval(DirectObject):
""" __playTask(task)
"""
t = self.clock.getFrameTime()
te = t - self.startT
te = (t - self.startT) * self.scale
if (te <= self.playDuration):
self.setT(te)
return Task.cont

View File

@ -39,6 +39,6 @@ class SoundInterval(Interval):
assert(t >= 0)
if (entry == 1):
self.isPlaying = 1
AudioManager.play(self.sound)
AudioManager.play(self.sound, t)
if (self.loop):
AudioManager.setLoop(self.sound, 1)

View File

@ -0,0 +1,20 @@
"""WaitInterval module: contains the WaitInterval class"""
from PandaModules import *
from Interval import *
class WaitInterval(Interval):
waitNum = 1
# special methods
def __init__(self, duration, name=None):
"""__init__(duration, name)
"""
if (name == None):
n = 'Wait-%d' % self.waitNum
self.waitNum = self.waitNum + 1
else:
n = name
Interval.__init__(self, n, duration)