From 52bbda1d41708a955abe3a691abac2c8b457714a Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 30 Sep 2007 00:18:01 +0200 Subject: Copied over lead-in and lead-out functions from old code. --- pykfx.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pykfx.py b/pykfx.py index ded5269..ea4e0d3 100644 --- a/pykfx.py +++ b/pykfx.py @@ -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 = [], [] -- cgit v1.2.3