diff options
-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 = [], [] |