diff options
author | Jon Bergli Heier <jonheier@start.no> | 2007-09-30 00:18:01 +0200 |
---|---|---|
committer | Jon Bergli Heier <jonheier@start.no> | 2007-09-30 00:18:01 +0200 |
commit | 52bbda1d41708a955abe3a691abac2c8b457714a (patch) | |
tree | a71e0413d087716f58b7117cd88bc6de3c512aa5 | |
parent | d5616e3970b5fe3a32f565e26ff776f93a62ac54 (diff) |
Copied over lead-in and lead-out functions from old code.
-rw-r--r-- | pykfx.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -141,6 +141,20 @@ class Event: self.karaoke.append(Syllable(tot - ms, tot, part)) + def add_lead_in(self, s): + t = self.start.split(':') + ts = float(t[-1]) + 60 * int(t[-2]) + 3600 * int(t[-3]) - s + th, ts = int(ts / 3600), ts % 3600 + tm, ts = int(ts / 60), ts % 60 + self.start = '%01d:%02d:%05.2f' % (th, tm, ts) + + def add_lead_out(self, s): + t = self.snd.split(':') + ts = float(t[-1]) + 60 * int(t[-2]) + 3600 * int(t[-3]) + s + th, ts = int(ts / 3600), ts % 3600 + tm, ts = int(ts / 60), ts % 60 + self.end = '%01d:%02d:%05.2f' % (th, tm, ts) + class Events: def __init__(self, f = None): self.format, self.events = [], [] |