Standalone application based on SDL2 that turns your desktop audio into awesome visuals. Available on most platforms supported by both libprojectM and libSDL2.
There are multiple issues with projectM's internal configuration file that could be fixed:
Empty boolean values are interpreted as true, should ideally use a default value instead which might as well be false.
Other empty numerical values (but existing keys, e.g. Mesh X = will return zero and strings will be empty.
Floating-point numbers lose their decimals when written back into the file, e.g. a 1.5 is written as 1.
The original contents of an existing file are wiped out/replaced completely, e.g. blank lines, ordering of lines and all comments.
To make the file behave a bit better and not confuse users, I'd suggest the following changes:
Do not interpret empty values in a random way. Instead use the default value that is already provided to the read function.
When writing values back, make sure the value format is maintained, e.g. decimal numbers keep their decimals.
If the configuration file exists, do not simply overwrite it with new content, but go through it line by line. For each line:
Keep the line untouched if it's empty or just a comment.
If it contains a known setting, replace the value with the new/changed data and mark it "saved"
If it contains an unknown setting or any invalid syntax, keep the line untouched.
If any setting line contains a comment after the value, also write it to the changed file.
If a known setting is encountered more than once, comment out each additional occurance, but keep it unchanged otherwise.
If a setting is missing, append it to the file and possibly add a comment # Added by projectM to the end of each new line.
This should fix the aforementioned issues and also add the possibility to have other applications add more settings to the file which aren't interpreted or touched by projectM.
The SDL frontend no longer uses the legacy config file anymore. I'll later add another user configuration that stores any UI setting changes and other things like last window position etc.
There are multiple issues with projectM's internal configuration file that could be fixed:
true
, should ideally use a default value instead which might as well befalse
.Mesh X =
will return zero and strings will be empty.1.5
is written as1
.To make the file behave a bit better and not confuse users, I'd suggest the following changes:
# Added by projectM
to the end of each new line.This should fix the aforementioned issues and also add the possibility to have other applications add more settings to the file which aren't interpreted or touched by projectM.