[SCM] calf/master: new fixes
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:40:59 UTC 2013
Identifiers changed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d6a3c1a63a147948535a50da009275278ad5e6a3
X-Git-Newrev: 34569260c452f0fa4c543155ebba174a42a343dc
The following commit has been merged in the master branch:
commit 2c81cdae47a8e9f84a510d7f905003698037b882
Merge: 8d546aa3bec7f2094c6e1974fe63791e268fe3c1 5039f83892dd1a5cece41a3ad174485520c70aa6
Author: Christian Holschuh <chrisch.holli at gmx.de>
Date: Tue Mar 6 06:14:25 2012 +0100
new fixes
diff --combined src/modules.cpp
index 74c2ead,f8eaa1d..c8d1d4b
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@@ -882,11 -882,10 +882,11 @@@ analyzer_audio_module::analyzer_audio_m
memset(fft_hold, 0, max_fft_cache_size * sizeof(float)); // reset buffer to zero
fft_freeze = (float*) calloc(max_fft_cache_size, sizeof(float));
memset(fft_freeze, 0, max_fft_cache_size * sizeof(float)); // reset buffer to zero
-
+ fft_plan = false;
____analyzer_phase_was_drawn_here = 0;
____analyzer_smooth_dirty = 0;
____analyzer_hold_dirty = 0;
+ ____analyzer_sanitize = 0;
}
@@@ -900,7 -899,6 +900,7 @@@ void analyzer_audio_module::deactivate(
void analyzer_audio_module::params_changed() {
if(*params[param_analyzer_accuracy] != _acc_old) {
+ ____analyzer_sanitize = 1;
_accuracy = pow(2, 7 + *params[param_analyzer_accuracy]);
_acc_old = *params[param_analyzer_accuracy];
// recreate fftw plan
@@@ -985,18 -983,11 +985,18 @@@ bool analyzer_audio_module::get_phase_g
bool analyzer_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_iface *context, int *mode) const
{
+ if(____analyzer_sanitize) {
+ memset(fft_in, 1e-20, max_fft_cache_size * sizeof(float)); // reset buffer to zero
+ memset(fft_inL, 1e-20, max_fft_cache_size * sizeof(float));
+ memset(fft_inR, 1e-20, max_fft_cache_size * sizeof(float));
+ ____analyzer_sanitize = 0;
+ return false;
+ }
+
if (!active or subindex > 1 or !*params[param_analyzer_display]
or (subindex > 0 and !*params[param_analyzer_hold]))
// stop drawing
return false;
-
bool fftdone = false; // if fft was renewed, this one is true
double freq;
int iter = 0;
@@@ -1023,7 -1014,7 +1023,7 @@@
fftw_real valL;
fftw_real valR;
- switch((int)*params[param_analyzer_mode]) {
+ switch((int)*params[param_analyzer_source]) {
case 0:
default:
// average
@@@ -1040,7 -1031,7 +1040,7 @@@
}
// store value in analyzer buffer
fft_in[i] = (fftw_real)val;
- if(*params[param_analyzer_correction] == 3) {
+ if(*params[param_analyzer_mode] == 3) {
valL = L;
valR = R;
fft_inL[i] = valL;
@@@ -1071,7 -1062,7 +1071,7 @@@
// non-normalized
rfftw_one(fft_plan, fft_in, fft_out);
//run fft for left and right channel while in "phase by freq" mode
- if(*params[param_analyzer_correction] == 3 ) {
+ if(*params[param_analyzer_mode] == 3) {
rfftw_one(fft_plan, fft_inL, fft_outL);
rfftw_one(fft_plan, fft_inR, fft_outR);
}
@@@ -1089,7 -1080,8 +1089,7 @@@
}
for (int i = 0; i <= points; i++)
{
- float lastoutL = 0.f;
- float lastoutR = 0.f;
+ float lastout = 0.f;
// cycle through the points to draw
freq = 20.f * pow (1000.f, (float)i / points); //1000=20000/1000
if(*params[param_analyzer_linear]) {
@@@ -1105,8 -1097,9 +1105,8 @@@
if(fftdone and i) {
int n = 0;
float var1 = 0.f;
- float var2 = 0.f;
- switch((int)*params[param_analyzer_correction]) {
+ switch((int)*params[param_analyzer_mode]) {
case 0:
// nothing to do
break;
@@@ -1126,11 -1119,11 +1126,11 @@@
n++;
}
if(k != 0) var1 += fabs(fft_out[_iter + k]);
- else if(i) var1 += fabs(lastoutL);
+ else if(i) var1 += fabs(lastout);
else var1 += fabs(fft_out[_iter]);
n++;
}
- lastoutL = fft_out[_iter];
+ lastout = fft_out[_iter];
fft_out[_iter] = std::max(n * fabs(fft_out[_iter]) - var1 , 1e-20);
break;
case 3:
@@@ -1145,7 -1138,6 +1145,7 @@@
float diff_fft;
diff_fft = fabs(fft_outL[_iter]) - fabs(fft_outR[_iter]);
fft_out[_iter] = diff_fft / _accuracy;
+ //printf("fft_out[_iter]: %.4f\n",fft_out[_iter]);
break;
}
}
@@@ -1183,14 -1175,15 +1183,12 @@@
// fill freeze buffer
fft_freeze[iter] = val;
}
- data[i] = dB_grid(fabs(val) / _accuracy * 2.f);
+ data[i] = dB_grid(fabs(val) / _accuracy * 2.f + 1e-20);
- if(*params[param_analyzer_correction] == 3) {
- if(i) {
- data[i] = fft_out[iter];
- }
+ if(*params[param_analyzer_mode] == 3) {
+ if(i) data[i] = fft_out[iter];
else data[i] = 0.f;
- if(fabs(data[i])>1.f) printf("mehr als 1!!!!!!!!!! bei %5d bei iter %4d und _iter %4d\n",i,iter,_iter);
}
- } //else if(*params[param_analyzer_mode] == 2) {
- // data[i] = dB_grid(fabs(1e-20) / _accuracy * 2.f);
- // }
+ }
else {
data[i] = INFINITY;
}
@@@ -1200,7 -1193,7 +1198,7 @@@
// subtle hold line
context->set_source_rgba(0.35, 0.4, 0.2, 0.2);
}
- if (*params[param_analyzer_correction] == 3) {
+ if (*params[param_analyzer_mode] == 3) {
// draw centered bars
*mode = 3;
} else if(*params[param_analyzer_bars]) {
@@@ -1215,7 -1208,6 +1213,7 @@@
// draw lines
*mode = 0;
}
+ ____analyzer_sanitize = 0;
return true;
}
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list