From: yomguy <> Date: Thu, 27 Nov 2008 00:24:03 +0000 (+0000) Subject: Add width and height arguments to visualization api, fix analyzer skin X-Git-Tag: 1.1~784 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6699ec935f803ae6da5e87973e969033cf5b9b86;p=telemeta.git Add width and height arguments to visualization api, fix analyzer skin --- diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index 1bbcd46c..da05c610 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -137,7 +137,7 @@ h3 { .analyzer { background-color: #fff; - color: #555; + color: #000; border: 1px solid #adadad; width: 301px; padding: 2px; @@ -146,6 +146,18 @@ h3 { font-size: 1em; } +.analyzer_title { + background-color: #f2f2f2; + color: #000; + padding: 2px; +} + +.analyzer_line { + background-color: #fdfdfd; + color: #000; + padding: 4px; +} + /* Geographic navigator */ ul.continents, ul.continents ul { list-style: none; margin: 0; padding: 0;} ul.continents { margin: 1em 0; } diff --git a/telemeta/templates/mediaitem_detail.html b/telemeta/templates/mediaitem_detail.html index 849a1fff..cffa0175 100644 --- a/telemeta/templates/mediaitem_detail.html +++ b/telemeta/templates/mediaitem_detail.html @@ -49,13 +49,13 @@
- - + + {% for analyser in analysers %} - + diff --git a/telemeta/visualization/api.py b/telemeta/visualization/api.py index a15798a0..96727f2c 100644 --- a/telemeta/visualization/api.py +++ b/telemeta/visualization/api.py @@ -16,10 +16,9 @@ class IMediaItemVisualizer(Interface): """Return a short id alphanumeric, lower-case string.""" def get_name(): - """Return the visualization name, such as "Waveform", "Spectral view", - etc.. + """Return the visualization name, such as "Waveform", "Spectral view", + etc.. """ - - def render(media_item, options=None): - """Generator that streams the visualization output as a PNG image""" - + + def render(media_item, width=None, height=None, options=None): + """Generator that streams the visualization output as a PNG image""" \ No newline at end of file diff --git a/telemeta/visualization/waveform3.py b/telemeta/visualization/waveform3.py index 85b5133f..6454587d 100644 --- a/telemeta/visualization/waveform3.py +++ b/telemeta/visualization/waveform3.py @@ -23,15 +23,23 @@ class WaveFormVisualizer(Component): def get_name(self): return "Waveform (audiolab)" - - def render(self, media_item, options=None): + + def render(self, media_item, width=None, height=None, options=None): """Generator that streams the waveform as a PNG image with a python method""" wav_file = media_item.file.path pngFile_w = NamedTemporaryFile(suffix='.png') pngFile_s = NamedTemporaryFile(suffix='.png') - image_width = 305 - image_height = 150 + + if not width == None: + image_width = width + else: + image_width = 305 + if not height == None: + image_height = height + else: + image_height = 150 + fft_size = 2048 args = (wav_file, pngFile_w.name, pngFile_s.name, image_width, image_height, fft_size) create_png(*args) diff --git a/telemeta/visualization/waveform4.py b/telemeta/visualization/waveform4.py index 45865048..30fae22a 100644 --- a/telemeta/visualization/waveform4.py +++ b/telemeta/visualization/waveform4.py @@ -23,15 +23,23 @@ class WaveFormVisualizer(Component): def get_name(self): return "Waveform (audiolab large)" - - def render(self, media_item, options=None): + + def render(self, media_item, width=None, height=None, options=None): """Generator that streams the waveform as a PNG image with a python method""" wav_file = media_item.file.path pngFile_w = NamedTemporaryFile(suffix='.png') pngFile_s = NamedTemporaryFile(suffix='.png') - image_width = 1800 - image_height = 300 + + if not width == None: + image_width = width + else: + image_width = 1800 + if not height == None: + image_height = height + else: + image_height = 300 + fft_size = 2048 args = (wav_file, pngFile_w.name, pngFile_s.name, image_width, image_height, fft_size) create_png(*args)
Parameter
Property Value Unit
{{ analyser.name }}