From 1fda747e34a4583efffadb2d0cbd44d176b86789 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Tue, 03 Feb 2009 22:40:51 +0000 Subject: Add chat toolbar --- (limited to 'Speak.activity/waveform_mouth.py') diff --git a/Speak.activity/waveform_mouth.py b/Speak.activity/waveform_mouth.py index 05d7249..71a10ea 100644 --- a/Speak.activity/waveform_mouth.py +++ b/Speak.activity/waveform_mouth.py @@ -26,9 +26,9 @@ from mouth import * class WaveformMouth(Mouth): - def __init__(self, audioSource): + def __init__(self, audioSource, fill_color): - Mouth.__init__(self, audioSource) + Mouth.__init__(self, audioSource, fill_color) self.buffer_size = 100 self.peaks = [] @@ -54,12 +54,12 @@ class WaveformMouth(Mouth): self.context.clip() # background - self.context.set_source_rgb(.5,.5,.5) + self.context.set_source_rgba(*self.fill_color.get_rgba()) self.context.rectangle(0,0, bounds.width,bounds.height) self.context.fill() # Draw the waveform - self.context.set_line_width(10.0) + self.context.set_line_width(min(bounds.height/10.0, 10)) count = 0 buflen = float(len(self.main_buffers)) for value in self.main_buffers: -- cgit v0.9.1