Consolidated audio processing code into the PCM class, removing the BeatDetect class in the process. Beat detection now uses the same algorithm as Milkdrop, passing the proper relative bass/mid/treb values to presets. Makes many presets look less jumpy/flickering, as the values are now (smoothly) alternating around 1.0.
Updating frame audio is now done in a function that must specifically be called. Any subsequent calls to GetFrameAudioData() will then return the exact same copy of the audio data. As of now with the exception that new waveform data may be passed in via a separate thread, which will then be returned and might not match the spectrum data. Will fix that in a later commit.
$ git grep -l 'include "libprojectM/' | xargs sed 's,include "libprojectM/,include "projectM-4.0/,' -i
And then revert for src/libprojectM/*.hpp includes:
$ for i in $( cd src/libprojectM && ls -1 *.hpp ) ; do grep -Rl "#include \"projectM-4.0/${i}\"" | xargs -r sed "s,\"projectM-4.0/${i},\"libprojectM/${i}," -i ; done
Mesh size is currently so deeply burrowed in the whole preset structure that changing it on the fly is basically impossible. For now, we'll reload the idle preset and reset the whole preset factory class tree to make sure all classes are properly reinitialized. If apps want to change the mesh size after startup, they need to reload the last played preset after changing the mesh size. This will be fixed in the future after the parser/equation compiler rewrite.
Was only possible on startup before, changing the paths required recreating the whole projectM instance. Now, the method will only reset the texture manager, but not the shaders and presets.
Lots of interconnected changes in this commit:
- Removed unnecessary name/author/filename members all over the place.
- Started using exceptions to deliver preset loading and rendering errors to the topmost ProjectM class.
- Added stream loading methods to factories and the base Preset class.
- Added new events for requesting preset switch and telling the user about loading errors.
- Consolidated preset switching logic in ProjectM class a bit.
Also make sure to propagate the changed value to the preset code via the PipelineContext class. Keeping it in the settings struct for now. Storing a dynamic value in settings makes no sense, so it will be removed later.
This removes:
- "Toast" messages
- The help text
- Statistics
- Preset name and (unimplemented) song title display
- Preset selection list and search menu
Some of the above functionality might later be added as an optional library, in a separate repository and with proper UTF-8 support.
Mostly replaced raw pointers with std::unique_ptr for easier memory management. Probably not needed for many of those classes, but was the least intrusive change for now.
Some members and functions were named in different ways, now the naming scheme is a bit more unified. Also changed some types to size_t where negative values don't make sense.
This will make it easier to integrate projectM into C applications and also removes potential issues of STL/C++ version differences between host and library.
Changed visibility of all symbols except the C API to "hidden". This effectively prevents the C++ API from being used in the shared library.
Added an option "ENABLE_CXX_INTERFACE" to re-enable the old export behaviour, displaying a prominent author warning after configuring the build if enabled.