[SCM] calf/master: move triangular window functions to the end choose linear window as default

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


The following commit has been merged in the master branch:
commit 3c10a8e7726691430b4fd0b7821d93b04d1046ea
Author: Markus Schmidt <schmidt at boomshop.net>
Date:   Sat Sep 15 16:13:46 2012 +0200

    move triangular window functions to the end
    choose linear window as default

diff --git a/src/metadata.cpp b/src/metadata.cpp
index c28a12b..3126f12 100644
--- a/src/metadata.cpp
+++ b/src/metadata.cpp
@@ -990,7 +990,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" },
@@ -1003,7 +1003,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 8254b52..485c9d2 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -1197,15 +1197,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;
@@ -1213,19 +1226,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