[SCM] calf/master: Re-arrange the FFT windows.

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:41:12 UTC 2013


The following commit has been merged in the master branch:
commit 1e012bcf523133e009d8f7a064d29fde7b66ab32
Author: Markus Schmidt <schmidt at boomshop.net>
Date:   Sat Sep 15 18:41:08 2012 +0100

    Re-arrange the FFT windows.

diff --git a/src/calf/gui_controls.h b/src/calf/gui_controls.h
index bddbd70..0b8bc64 100644
--- a/src/calf/gui_controls.h
+++ b/src/calf/gui_controls.h
@@ -187,6 +187,7 @@ struct button_param_control: public param_control
     virtual void get();
     virtual void set();
     static void button_clicked(GtkButton *widget, gpointer value);
+    static void button_press_event(GtkButton *widget, GdkEvent *event, gpointer value);
 };
 
 /// Combo list box
diff --git a/src/gui_controls.cpp b/src/gui_controls.cpp
index 8e704f6..f78afa3 100644
--- a/src/gui_controls.cpp
+++ b/src/gui_controls.cpp
@@ -632,6 +632,7 @@ GtkWidget *button_param_control::create(plugin_gui *_gui, int _param_no)
     
     widget  = gtk_button_new_with_label (get_props().name);
     gtk_signal_connect (GTK_OBJECT (widget), "clicked", G_CALLBACK (button_clicked), (gpointer)this);
+    gtk_signal_connect (GTK_OBJECT (widget), "button-press-event", G_CALLBACK (button_press_event), (gpointer)this);
     gtk_widget_set_name(GTK_WIDGET(widget), "Calf-Button");
     return widget;
 }
@@ -643,6 +644,21 @@ void button_param_control::button_clicked(GtkButton *widget, gpointer value)
     jhp->get();
 }
 
+void button_param_control::button_press_event(GtkButton *widget, GdkEvent *event, gpointer value)
+{
+    param_control *jhp = (param_control *)value;
+    
+    static int last_time = 0;
+    
+    if (event->button.type == GDK_BUTTON_PRESS)
+    {
+        printf("time=%f\n", 60000.0 / (event->button.time - last_time));
+        last_time = event->button.time;
+    }
+    
+    jhp->get();
+}
+
 void button_param_control::get()
 {
     const parameter_properties &props = get_props();
diff --git a/src/metadata.cpp b/src/metadata.cpp
index 6814637..b407929 100644
--- a/src/metadata.cpp
+++ b/src/metadata.cpp
@@ -988,7 +988,7 @@ const char *analyzer_smooth_names[] = { "Off", "Falling", "Transition" };
 const char *analyzer_post_names[] = { "Normalized", "Average", "Additive", "Denoised Peaks" };
 const char *analyzer_view_names[] = { "Bars", "Lines", "Cubic Splines" };
 const char *analyzer_scale_names[] = { "Logarithmic", "Linear" };
-const char *analyzer_windowing_names[] = { "Linear", "Hamming", "von Hann", "Blackman", "Blackman-Harris", "Blackman-Nuttall", "Bartlett", "Triangular", "Bartlett-Hann", "Sine", "Lanczos", "Gauß" };
+const char *analyzer_windowing_names[] = { "Linear", "Hamming", "von Hann", "Blackman", "Blackman-Harris", "Blackman-Nuttall", "Sine", "Lanczos", "Gauß", "Bartlett", "Triangular", "Bartlett-Hann" };
 CALF_PORT_PROPS(analyzer) = {
     { 0,           0,           1,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_L", "Level L" },
     { 0,           0,           1,     0,  PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_R", "Level R" },
@@ -1001,7 +1001,7 @@ CALF_PORT_PROPS(analyzer) = {
     { 2,           0,           3,     0,  PF_ENUM | PF_CTL_COMBO, analyzer_post_names, "analyzer_post", "Analyzer Post FFT" },
     { 1,           0,           1,     2,  PF_ENUM | PF_CTL_COMBO , analyzer_view_names, "analyzer_view", "Analyzer View" },
     { 1,           0,           2,     0,  PF_ENUM | PF_CTL_COMBO, analyzer_smooth_names, "analyzer_smoothing", "Analyzer Smoothing" },
-    { 8,           0,           11,    2,  PF_ENUM | PF_CTL_COMBO, analyzer_windowing_names, "analyzer_windowing", "Analyzer Windowing" },
+    { 0,           0,           11,    2,  PF_ENUM | PF_CTL_COMBO, analyzer_windowing_names, "analyzer_windowing", "Analyzer Windowing" },
     { 6,           2,           8,     0,  PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "analyzer_accuracy", "Analyzer Accuracy" },
     { 13,          1,           15,    0,  PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "analyzer_speed", "Analyzer Speed" },
     { 1,           0,           1,     0,  PF_BOOL | PF_CTL_TOGGLE, NULL, "analyzer_display", "Analyzer Display" },
diff --git a/src/modules.cpp b/src/modules.cpp
index 91c3c7f..d7093fe 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -1168,15 +1168,28 @@ bool analyzer_audio_module::get_graph(int index, int subindex, float *data, int
                             a3 * cos((6.f * M_PI * i) / points - 1);
                         break;
                     case 6:
+                        // Sine
+                        _f = sin((M_PI * i) / (points - 1));
+                        break;
+                    case 7:
+                        // Lanczos
+                        _f = sinc((2.f * i) / (points - 1) - 1);
+                        break;
+                    case 8:
+                        // Gauß
+                        _a = 2.718281828459045;
+                        _f = pow(_a, -0.5f * pow((i - (points - 1) / 2) / (0.4 * (points - 1) / 2.f), 2));
+                        break;
+                    case 9:
                         // Bartlett
                         _f = (2.f / (points - 1)) * (((points - 1) / 2.f) - \
                             fabs(i - ((points - 1) / 2.f)));
                         break;
-                    case 7:
+                    case 10:
                         // Triangular
                         _f = (2.f / points) * ((2.f / points) - fabs(i - ((points - 1) / 2.f)));
                         break;
-                    case 8:
+                    case 11:
                         // Bartlett-Hann
                         a0 = 0.62;
                         a1 = 0.48;
@@ -1184,19 +1197,6 @@ bool analyzer_audio_module::get_graph(int index, int subindex, float *data, int
                         _f = a0 - a1 * fabs((i / (points - 1)) - 0.5) - \
                             a2 * cos((2 * M_PI * i) / (points - 1));
                         break;
-                    case 9:
-                        // Sine
-                        _f = sin((M_PI * i) / (points - 1));
-                        break;
-                    case 10:
-                        // Lanczos
-                        _f = sinc((2.f * i) / (points - 1) - 1);
-                        break;
-                    case 11:
-                        // Gauß
-                        _a = 2.718281828459045;
-                        _f = pow(_a, -0.5f * pow((i - (points - 1) / 2) / (0.4 * (points - 1) / 2.f), 2));
-                        break;
                 }
                 L *= _f;
                 if(_param_mode > _m)

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list