diff --git a/cava.c b/cava.c index 18dfeca..89c02d1 100644 --- a/cava.c +++ b/cava.c @@ -317,6 +317,13 @@ Options:\n\ gravity = 0; } + // validate: integral + if (integral < 0) { + integral = 0; + } else if (integral > 1) { + integral = 0.99; + } + // read & validate: eq smcount = iniparser_getsecnkeys(ini, "eq"); if (smcount > 0) { diff --git a/example_files/config b/example_files/config index 0d6e100..16f8d4f 100644 --- a/example_files/config +++ b/example_files/config @@ -19,9 +19,9 @@ ; foreground = cyan [smoothing] -; integral = 0.7 # multiplier for the integral smoothing calculations. Higher values means smoother, but less precise. 0 to disable. +; integral = 0.7 # multiplier for the integral smoothing calculations. Takes values from 0 - 0.99. Higher values means smoother, but less precise. 0 to disable. ; monstercat = 1 # disables or enables the so-called "Monstercat smoothing". Default: 1. Set to 0 to disable. -; gravity = 1 # Set gravity multiplier for "drop off". Higher values means bars will drop faster. Accepts only non-negative values. Set to 0 to disable "drop off". +; gravity = 1 # Set gravity multiplier for "drop off". Higher values means bars will drop faster. Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off". [eq] # This one is tricky. You can have as much keys as you want. More keys = more precision. Look at readme.md on github for further explanations and examples.