[SCM] calf/master: mergeconflict
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:40:58 UTC 2013
line-graph modes done
Merge branch 'analyzer' into line-graph
show phase by freq in analyzer
show phase by freq in analyzer
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 8d546aa3bec7f2094c6e1974fe63791e268fe3c1
Merge: 36dea348ad3d40ac944591af28edab9b142bffbd 90d0da02a4d04569501a663ce3a14241cae3a784
Author: Christian Holschuh <chrisch.holli at gmx.de>
Date: Tue Mar 6 05:13:51 2012 +0100
mergeconflict
diff --combined src/modules.cpp
index 6d4b3d8,6d29aa3..74c2ead
--- 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;
@@@ -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_correction] == 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,6 -1097,7 +1105,6 @@@
if(fftdone and i) {
int n = 0;
float var1 = 0.f;
- float var2 = 0.f;
switch((int)*params[param_analyzer_correction]) {
case 0:
@@@ -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,24 -1175,28 +1183,27 @@@
// 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(i) {
++ data[i] = fft_out[iter];
++ }
else data[i] = 0.f;
- // if(fabs(data[i])>1.f) printf("mehr als 1 bei %5d bei %4d : %.4f\n",i,iter,data[i]);
- 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_correction] == 2) {
- // data[i] = dB_grid(fabs(1e-20) / _accuracy * 2.f);
- // }
+ }
else {
data[i] = INFINITY;
}
- printf("data: %.5f\n", data[i]);
}
____analyzer_smooth_dirty = 0;
if(subindex == 1) {
// subtle hold line
context->set_source_rgba(0.35, 0.4, 0.2, 0.2);
}
- if(*params[param_analyzer_bars]) {
+ if (*params[param_analyzer_correction] == 3) {
+ // draw centered bars
+ *mode = 3;
+ } else if(*params[param_analyzer_bars]) {
if(subindex == 0) {
// draw bars
*mode = 1;
@@@ -1208,14 -1204,10 +1211,11 @@@
// draw boxes
*mode = 2;
}
- } else if (*params[param_analyzer_correction] == 3) {
- // draw centered bars
- *mode = 3;
} else {
// draw lines
*mode = 0;
}
+ ____analyzer_sanitize = 0;
return true;
}
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list