]> git.parisson.com Git - telemeta.git/commitdiff
Add width and height arguments to visualization api, fix analyzer skin
authoryomguy <>
Thu, 27 Nov 2008 00:24:03 +0000 (00:24 +0000)
committeryomguy <>
Thu, 27 Nov 2008 00:24:03 +0000 (00:24 +0000)
telemeta/htdocs/css/telemeta.css
telemeta/templates/mediaitem_detail.html
telemeta/visualization/api.py
telemeta/visualization/waveform3.py
telemeta/visualization/waveform4.py

index 1bbcd46c0a95598a554b0cd9beaf5822b8127f56..da05c6108bb0ca6ee81efd86f2bb4b7fd897e7a4 100644 (file)
@@ -137,7 +137,7 @@ h3 {
 \r
 .analyzer {\r
     background-color: #fff;\r
-    color: #555;\r
+    color: #000;\r
     border: 1px solid #adadad;\r
     width: 301px;\r
     padding: 2px;\r
@@ -146,6 +146,18 @@ h3 {
     font-size: 1em;\r
 }\r
 \r
+.analyzer_title {\r
+    background-color: #f2f2f2;\r
+    color: #000;\r
+    padding: 2px;\r
+}\r
+\r
+.analyzer_line {\r
+    background-color: #fdfdfd;\r
+    color: #000;\r
+    padding: 4px;\r
+}\r
+\r
 /* Geographic navigator */\r
 ul.continents, ul.continents ul { list-style: none; margin: 0; padding: 0;}\r
 ul.continents { margin: 1em 0; }\r
index 849a1fffefe5774bb9a230df8501898789f77f9a..cffa0175cbc892ea30e8a79a3508995ee74285b4 100644 (file)
 \r
       <div class="analyzer">\r
         <table width="100%">\r
-         <tr>\r
-          <td>Parameter</td>\r
+         <tr class="analyzer_title">\r
+          <td>Property</td>\r
           <td>Value</td>\r
           <td>Unit</td>\r
          <tr>\r
         {% for analyser in analysers %}\r
-         <tr>\r
+         <tr class="analyzer_line">\r
           <td>\r
             {{ analyser.name }}\r
           </td>\r
index a15798a0ecca27030b8c930c68ca1657680578a6..96727f2c9d979da5058bfff3534d300b7624950d 100644 (file)
@@ -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
index 85b5133f2ea7b31fa3cfde50d592470a14c86810..6454587d4b7a5bf1bff40e5aef56372efc003e6a 100644 (file)
@@ -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)
index 4586504829b2cfa8e64cfc6bbc9649c16b82b000..30fae22a5faf93e127c071bcd988a80b05988536 100644 (file)
@@ -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)