This will prevent the playback history from vanishing unexpectedly in case a preset can't be loaded.
Also fixed a few typos in the Doxygen comments and clarified how the history is changed when changing the playlist.
This will enable any future changes to the header to be tested. These additional build checks are only executed if BUILD_TESTING is enabled (e.g. in our automated build checks) to speed up release builds.
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.
Removed the previous FFT algorithm, now using a modernized version of the original Milkdrop FFT transform which also has both an equalizer and frequency envelope, making it slightly more sophisticated.
Modernization mainly included replacing raw pointer arrays with std::vector and using STL types/functions for the calculation, specifically std::complex as the FFT heavily uses these numbers. This makes the code more compact and readable.
Manually tested both original and modernized versions of the class to test if the algorithm still returns the exact same results, which is the case.
Don't skip lines with no data after "=", as there are many presets with empty code lines. skipping it would create a gap in the line numbers, aborting the loop in GetCode() early.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.
Other changes:
- Renamed Parser to OldParser to make it clear this is going away.
- Removed all the useless "unit tests" which did not actually test anything.
- Added a new GTest-based test executable that can be run with CMake's CTest.
- Added unit tests for the new fileParser class, including test files.
Removed dependency on projectMtarget alltogether, as the playlist tests don't need the core library at all, only a few API functions which are mocked. Also made sure the mocked functions are declared as dllexport on Windows to match the dllimport declspec in the playlist library.
Target name is now just libprojectM::projectM for the main library instead of libprojectM::static or libprojectM::shared.
Now using CMake's default mechanism to select the resulting library type via the BUILD_SHARED_LIBS variable. Main use case will be working with the shared library, which is the default.
Playlist library now also builds as a shared library, including proper symbol exports.
Additionally, deleted the leftover TestRunner class and a few old and rather useless test cases.
Also added LLVM find_package call and as a link dependency if the build is configured for using (experimental) LLVM code.
Reorganized tests to link either one of the object libraries for unit testing.
Path scanning is using C++17's std::filesystem if available, but uses boost::filesystem as fallback. Using boost can be forced using the ENABLE_BOOST_FILESYSTEM CMake option.