From: yomguy Date: Thu, 11 Nov 2010 22:14:55 +0000 (+0000) Subject: cleanup, remove blank lines for awdio X-Git-Tag: 0.3.2~90 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0a50860aa6b2e2dc9585977f1983bb18f34dc21b;p=timeside.git cleanup, remove blank lines for awdio --- diff --git a/timeside/encoder/core.py b/timeside/encoder/core.py index 9786de1..cfac24c 100644 --- a/timeside/encoder/core.py +++ b/timeside/encoder/core.py @@ -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 - - - diff --git a/timeside/grapher/core.py b/timeside/grapher/core.py index 920b53b..0be28bf 100644 --- a/timeside/grapher/core.py +++ b/timeside/grapher/core.py @@ -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) diff --git a/timeside/tools/waveform_batch_awdio.py b/timeside/tools/waveform_batch_awdio.py index ad4e792..d92a38f 100644 --- a/timeside/tools/waveform_batch_awdio.py +++ b/timeside/tools/waveform_batch_awdio.py @@ -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: