]> git.parisson.com Git - promaster.git/commitdiff
fir counters
authoryomguy <yomguy@parisson.com>
Thu, 13 Dec 2012 17:23:34 +0000 (18:23 +0100)
committeryomguy <yomguy@parisson.com>
Thu, 13 Dec 2012 17:23:34 +0000 (18:23 +0100)
kdenlive/fade.py

index ab53fcea75d069580a718d030389310369e8852d..82165efa1a45ea3d9e511e5f4e0dea5f18f89e5e 100644 (file)
@@ -27,8 +27,6 @@ class KdenliveAutoFade(object):
 
     def __init__(self):
         self.n_frames = 2
-        self.audio_count = 0
-        self.video_count = 0
 
     def audio_fade_in(self, frame_out):
         child = {'attributes': {u'id': u'fadeout',
@@ -157,6 +155,9 @@ class KdenliveAutoFade(object):
         return child
 
     def run(self, path_in, path_out):
+        audio_count = 0
+        video_count = 0
+
         d = xmltodict(path_in)
         for attr in d['children']:
             if 'playlist' in attr['name'] and 'children' in attr:
@@ -168,18 +169,19 @@ class KdenliveAutoFade(object):
                             frame_out = att['attributes']['out']
 
                             if 'audio' in producer:
-                                if not self.audio_count % 2:
+                                if not audio_count % 2:
                                     att['children'] = [self.audio_fade_in(frame_out)]
                                 else:
                                     att['children'] = [self.audio_fade_out(frame_in)]
-                                self.audio_count =+ 1
+                                audio_count += 1
+
 
                             if 'video' in producer:
-                                if not self.video_count % 2:
+                                if not video_count % 2:
                                     att['children'] = [self.video_fade_in(frame_out)]
                                 else:
                                     att['children'] = [self.video_fade_out(frame_in)]
-                                self.video_count =+ 1
+                                video_count += 1
 
         data = dicttoxml(d)
         f = open(path_out, 'w')