]> git.parisson.com Git - timeside.git/commitdiff
cleanup, remove blank lines for awdio
authoryomguy <yomguy@parisson.com>
Thu, 11 Nov 2010 22:14:55 +0000 (22:14 +0000)
committeryomguy <yomguy@parisson.com>
Thu, 11 Nov 2010 22:14:55 +0000 (22:14 +0000)
timeside/encoder/core.py
timeside/grapher/core.py
timeside/tools/waveform_batch_awdio.py

index 9786de146a062fb70cef39c8cec0a50473a25643..cfac24cde20b31426c538ef0ef2b20b5ce77aba1 100644 (file)
@@ -23,7 +23,7 @@
 from timeside.core import *
 import subprocess
 
-class SubProcessPipe:
+class SubProcessPipe(object):
     """Read media and stream data through a generator.
     Taken from Telemeta (see http://telemeta.org)"""
 
@@ -42,6 +42,7 @@ class SubProcessPipe:
         self.input = self.proc.stdin
         self.output = self.proc.stdout
 
+
 class EncoderSubProcessCore(Processor):
     """Defines the main parts of the encoding tools :
     paths, metadata parsing, data streaming thru system command"""
@@ -59,6 +60,3 @@ class EncoderSubProcessCore(Processor):
             if len(__chunk) == 0:
                 break
             yield __chunk
-
-
-
index 920b53b8ae94429332fd6c117f353a2a4120d336..0be28bfdb253ef63eab46710863c35016a43ee13 100644 (file)
@@ -366,10 +366,10 @@ class WaveformImageJoyContour(WaveformImage):
         self.image.save(filename)
         
         
-class WaveformImageSimple(WaveformImage):
+class WaveformImageSimple(object):
     """ Builds a PIL image representing a waveform of the audio stream.
     Adds pixels iteratively thanks to the adapter providing fixed size frame buffers.
-    Peaks are colored relative to the spectral centroids of each frame packet. """
+    """
 
     def __init__(self, image_width, image_height, nframes, samplerate, fft_size, bg_color, color_scheme):
         self.image_width = image_width
@@ -408,7 +408,7 @@ class WaveformImageSimple(WaveformImage):
         y1 = self.image_height * 0.5 - peaks[0] * (self.image_height - 4) * 0.5
         y2 = self.image_height * 0.5 - peaks[1] * (self.image_height - 4) * 0.5
         
-        if self.previous_y and x < self.image_width-1 and self.pixel_cursor % 2:
+        if self.previous_y and x < self.image_width-1:
             if y1 < y2:
                 self.draw.line((x, 0, x, y1), self.line_color)
                 self.draw.line((x, self.image_height , x, y2), self.line_color)
index ad4e79280f4ad2397907f75703a21f851061b793..d92a38f0d0513361cf562b989981838e45d5dda3 100644 (file)
@@ -57,7 +57,7 @@ class GrapherScheme:
         
         # Nb of threads
         # FIXME: memory leak for > 1 !
-        self.threads = 1
+        self.threads = 2
 
 
 class Media2Waveform(object):
@@ -112,8 +112,6 @@ class Media2Waveform(object):
             
         for media, image in self.path_dict.iteritems():
             q.put((media, image))
-            print media, image
-        
         q.join()
             
         
@@ -132,7 +130,6 @@ def Worker(width, height, bg_color, color_scheme, q, logger):
         logger.write_info(mess)
         grapher.release()
         q.task_done()
-        return
       
 if __name__ == '__main__':
     if len(sys.argv) <= 2: