From 37cc8ed1be82569982626f757be6eaaca83c8cf6 Mon Sep 17 00:00:00 2001 From: flavio Date: Tue, 31 Jul 2012 14:53:37 +0000 Subject: Modularización y correcciones en gstreamer --- (limited to 'mouth.py') diff --git a/mouth.py b/mouth.py index 136ec7b..47a021b 100644 --- a/mouth.py +++ b/mouth.py @@ -48,6 +48,7 @@ class Mouth(Gtk.DrawingArea): self.fill_color = fill_color self.show_all() + self.connect('draw', self.draw_mouth) audioSource.connect("new-buffer", self._new_buffer) @@ -72,8 +73,8 @@ class Mouth(Gtk.DrawingArea): self.volume = numpy.core.max(self.main_buffers) # -\ # numpy.core.min(self.main_buffers) - def do_draw(self, context): - rect = self.get_allocation() + def draw_mouth(self, widget, context): + rect = widget.get_allocation() self.processBuffer() @@ -114,8 +115,10 @@ class WaveformMouth(Mouth): self.y_mag_bias_multiplier = 1 self.y_mag = 0.7 + + self.show_all() - def do_draw(self, context): + def draw_wave(self, context): rect = self.get_allocation() self.param1 = rect.height / 65536.0 self.param2 = rect.height / 2.0 @@ -167,8 +170,11 @@ class FFTMouth(Mouth): self.scaleX = "10" self.scaleY = "10" + + self.show_all() + self.connect('draw', self.draw_fftmouth) - def processBuffer(self, rect): + def newprocessBuffer(self, rect): self.param1 = rect.height / 65536.0 self.param2 = rect.height / 2.0 @@ -205,10 +211,10 @@ class FFTMouth(Mouth): self.peaks = val - def do_draw(self, context): - rect = self.get_allocation() + def draw_fftmouth(self, widget, context): + rect = widget.get_allocation() - self.processBuffer(rect) + self.newprocessBuffer(rect) # background context.set_source_rgba(*self.fill_color.get_rgba()) -- cgit v0.9.1