#338 fix default eq

master
karlstav 6 years ago
parent cb4ac7a1b8
commit 42581bea4f
  1. 5
      cava.c
  2. 2
      config.c

@ -626,7 +626,7 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
if (p.stereo)
bars = bars / 2; // in stereo onle half number of bars per channel
if ((p.smcount > 0) && (bars > 0)) {
if (p.customEQ && (bars > 0)) {
smh = (double)(((double)p.smcount) / ((double)bars));
}
@ -651,7 +651,8 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
k[n] = pow(fc[n], 1);
k[n] *= (float)height / pow(2, 28);
k[n] *= p.smooth[(int)floor(((double)n) * smh)];
if(p.customEQ)
k[n] *= p.smooth[(int)floor(((double)n) * smh)];
k[n] /= log2(audio.FFTbassbufferSize);
// lfc stores the lower cut frequency foo each bar in the fft out buffer
if (fc[n] < bass_cut_off) {

@ -456,7 +456,6 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors
p->bit_format = iniparser_getint(ini, "output:bit_format", 16);
// read & validate: eq
p->smooth = smoothDef;
p->smcount = iniparser_getsecnkeys(ini, "eq");
if (p->smcount > 0) {
p->customEQ = 1;
@ -473,7 +472,6 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors
}
} else {
p->customEQ = 0;
p->smcount = sizeof(smoothDef) / sizeof(smoothDef[0]); // back to the default one
}
free(p->audio_source);

Loading…
Cancel
Save