[SCM] calf/master: + Filter: added line graph

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:24 UTC 2013


The following commit has been merged in the master branch:
commit ca08f43edee26ae9e8bfbfe65aad2d0c621d2d6b
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Fri Nov 7 18:29:07 2008 +0000

    + Filter: added line graph

diff --git a/src/calf/modules.h b/src/calf/modules.h
index efea3e2..67ff820 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -234,7 +234,7 @@ public:
     }
 };
 
-class filter_audio_module: public audio_module<filter_metadata>
+class filter_audio_module: public audio_module<filter_metadata>, public line_graph_iface
 {
 public:    
     float *ins[in_count]; 
@@ -377,6 +377,22 @@ public:
         }
         return ostate;
     }
+    bool get_graph(int index, int subindex, float *data, int points, cairo_t *context)
+    {
+        if (index == par_cutoff && !subindex) {
+            for (int i = 0; i < points; i++)
+            {
+                typedef std::complex<double> cfloat;
+                double freq = 20.0 * pow (20000.0 / 20.0, i * 1.0 / points);
+                float level = 1.0;
+                for (int j = 0; j < order; j++)
+                    level *= left[j].freq_gain(freq, srate);                
+                data[i] = log(level) / log(1024.0) + 0.5;
+            }
+            return true;
+        }
+        return false;
+    }
 };
 
 class vintage_delay_audio_module: public audio_module<vintage_delay_metadata>

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list