From: yomguy Date: Fri, 18 Jun 2010 19:58:01 +0000 (+0000) Subject: rename color_scheme X-Git-Tag: 0.3.2~138 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d5bed07a9159996a388a39f19d0d26c9aef74e3d;p=timeside.git rename color_scheme --- diff --git a/INSTALL b/INSTALL index 22aa818..9b57714 100644 --- a/INSTALL +++ b/INSTALL @@ -22,7 +22,7 @@ Write your root password. Add backports repository to the apt sources.list:: - $ echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" | tee -a /etc/apt/sources.list + $ echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" | tee -a /etc/apt/sources.list Note : you can paste the full command but without the shell character '$'. Then : @@ -33,8 +33,8 @@ Then : Say 'YES' to all questions. Then:: $ apt-get install -t lenny-backports vim subversion python python-setuptools python-xml python-mutagen \ - python-imaging python-numpy python-gst0.10, gstreamer0.10-plugins-base \ - gstreamer0.10-plugins-fluendo-mp3 gstreamer0.10-plugins-good + python-imaging python-numpy python-gst0.10 gstreamer0.10-plugins-base \ + gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-good Install TimeSide @@ -104,11 +104,8 @@ For example, a normalization and a waveform, from a python shell:: >>> decoder = timeside.decoder.FileDecoder('source.wav') >>> grapher = timeside.grapher.Waveform('image.png') ->>> max = timeside.analyzer.MaxLevel() >>> encoder = timeside.encoder.WavEncoder('normalized.wav') ->>> (decoder | max).run() ->>> gain = max.result() > 0 and (1 / max.result()) or 1 ->>> (decoder | Gain(gain) | grapher | encoder).run() +>>> (decoder | grapher | encoder).run() See the website for more examples and information about the TimeSide API: diff --git a/timeside/grapher/core.py b/timeside/grapher/core.py index 36bc0bd..b42e29f 100644 --- a/timeside/grapher/core.py +++ b/timeside/grapher/core.py @@ -29,7 +29,7 @@ import numpy from timeside.core import FixedSizeInputAdapter -color_schemes = { +default_color_schemes = { 'default': { 'waveform': [(50,0,200), (0,220,80), (255,224,0), (255,0,0)], 'spectrogram': [(0, 0, 0), (58/4,68/4,65/4), (80/2,100/2,153/2), (90,180,100), @@ -145,7 +145,7 @@ class WaveformImage(object): if isinstance(color_scheme, dict): colors = color_scheme['waveform'] else: - colors = color_schemes[self.color_scheme]['waveform'] + colors = default_color_schemes[self.color_scheme]['waveform'] self.color_lookup = interpolate_colors(colors)