Commit Graph

42 Commits

Author SHA1 Message Date
797a24251f Don't clear history each time individual items are added or removed.
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.
2025-10-27 19:20:07 +01:00
b742bc0082 Add API header compile tests for C
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.
2025-03-24 10:00:24 +01:00
760a4c9c95 Add Milkdrop user sprites 2025-02-27 15:55:14 +01:00
fbdb18b355 Move FileParser to main directory.
Makes it easier to reuse for loading sprites.
2025-02-27 15:55:13 +01:00
ac77498318 nobody reads comments anyway 2024-04-18 23:49:31 +02:00
99259dc98a swaps misordered label values 2024-04-18 23:49:31 +02:00
a57885dc3a Add WaveformAligner test 2024-02-06 07:58:32 -06:00
7e45cbe1f9 Clean up minor warnings and code style
* Remove warnings for code in vendor folders
* Add pedantic and extra warnings in GCC only to projectM sources
* Rename ResetOpenGL to SetWindowSize
2024-02-01 11:27:10 -06:00
9762297909 Properly namespace all classes under "::libprojectM" 2023-12-30 14:56:35 +01:00
36fb09ce30 Implemented waveform alignment algorithm.
Also consolidated the waveform sample count constant to keep it aligned over all classes.
2023-11-24 21:00:40 +01:00
69d2134fa2 Rewrite of audio data processing/beat detection.
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.
2023-11-24 21:00:39 +01:00
045b05fa95 Replaced FFT implementation.
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.
2023-11-24 21:00:35 +01:00
b88f96b780 Fix CMake scripts, so they can be used via add_subdirectory(). 2023-09-19 18:38:43 +02:00
5c5bb0a147 PresetFileParser: Fix line reader and a compiler warning, re-add tests.
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.
2023-09-11 10:19:46 +02:00
29b3d4a463 Fix namespace issues in PCMTest.cpp 2023-09-11 10:19:46 +02:00
b9ef6a3974 Remove old expression parser and add the new projectm-eval lib.
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.
2023-09-11 10:19:45 +02:00
dfe08a14bb Fix some errors in FileParser 2023-09-11 10:19:45 +02:00
7b2b60d61f Added a new preset file parser class.
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.
2023-09-11 10:19:40 +02:00
c00d469081 Fix crash if playlist sort item count is out of bounds.
API docs say it's safe to pass out-of-bounds values, so it should behave in that way.
2023-03-23 10:48:07 +01:00
0940ec9532 Replace "-4.0" by "-4" 2023-02-22 16:34:46 +01:00
ede45f2e8c CMake: Replace "api/libprojectM/" by "api/projectM-4.0/" 2023-02-22 16:34:46 +01:00
139bd350fb Replace "#include <libprojectM/" by "#include <projectM-4.0/"
$ git grep -l 'include <libprojectM/' | xargs sed 's,include <libprojectM/,include <projectM-4.0/,' -i
2023-02-22 16:34:46 +01:00
1f33c810b3 Split up API headers into smaller, categorized files.
Also updated copyright and prefixed the render-related function with "opengl".
2023-01-18 12:57:57 +01:00
bac2a7ae12 Fix playlist tests on Windows.
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.
2023-01-17 18:55:29 +01:00
6e795ec632 Only build either shared or static projectM and playlist libraries.
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.
2023-01-13 11:16:27 +01:00
f2615a1745 Change projectm_playlist_items() method to return a given range of items. 2023-01-07 18:37:23 +01:00
4d54a511d1 Add projectm_playlist_get_shuffle() method to playlist API 2023-01-07 18:37:22 +01:00
62c4585cd7 Temporarily disable FFT low-frequency test.
Values don't match for some reason, need to investigate this later. Spectrum looks good, so it's probably the test implementation that's wrong here.
2022-12-30 14:44:06 +01:00
cddf1ec392 Temporarily disable FFT low-frequency test 2022-12-13 20:21:29 -06:00
710d228fcf Add libprojectM include path for tests, as it was removed in the library definition. 2022-12-06 15:02:40 +01:00
c4f24ba5e7 Fix tests on Windows, use correct filter syntax in projectMPlaylistPlaylist_ApplyFilter test. 2022-12-05 12:04:16 +01:00
42387a671b Add preset switched event formerly defined in projectM.h to playlist API 2022-12-04 21:54:29 +01:00
9ea98bf01e Add glob pattern filtering to playlist library.
Syntax is very similar to .gitignore glob syntax, with a few exceptions to simplify use.
2022-12-04 20:54:15 +01:00
a1ffd93e31 Add next/previous/last functions and playback history recording. 2022-11-26 23:47:04 +01:00
03f81ff36f Added more missing functions and tests to the playlist implementation. 2022-11-26 22:17:29 +01:00
7dcbe75db3 Added playback control methods and preset switching support. 2022-11-21 19:56:30 +01:00
7363afecc2 Add path scanning and sorting to the playlist implementation.
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.
2022-11-21 19:54:57 +01:00
4dfae6bf22 Add test project for playlist library, implemented tests for existing code and fixed a few issues found by testing. 2022-11-21 19:54:57 +01:00
ebce27fbfb Move libprojectM tests into subdirectory. 2022-11-21 19:54:57 +01:00
0fe87a2c04 Moved Pcm class tests to the unit test project.
Added a helper function to reset autoleveler, made it public as might come in handy if there's a gap (pause/resume, new track etc.) in the audio data.
2022-04-14 15:59:06 +02:00
1769039b08 Deleted old "unit tests" which did nothing useful.
Note: This change alone will not configure properly as the test target has no code files.
2022-04-14 15:59:06 +02:00
9e9f4ca1b2 Removed all outsourced code/files from the repo and updated README.md with new links.
New subproject/data locations:
- presets/presets-cream_of_the_crop: https://github.com/projectM-visualizer/presets-cream-of-the-crop
- presets/presets-En_D: https://github.com/projectM-visualizer/presets-en-d
- presets/textures: https://github.com/projectM-visualizer/presets-milkdrop-texture-pack
- src/EyeTune: https://github.com/projectM-visualizer/frontend-uwp
- src/museum: https://github.com/projectM-visualizer/museum
- src/projectm-android: https://github.com/projectM-visualizer/examples-android
- src/projectM-emscripten: https://github.com/projectM-visualizer/examples-emscripten
- src/projectM-jack: https://github.com/projectM-visualizer/frontend-qt
- src/projectM-libvisual: https://github.com/projectM-visualizer/frontend-libvisual-plug-in
- src/projectM-libvisual-alsa: Deleted.
- src/projectM-moviegen: https://github.com/projectM-visualizer/tools-moviegen
- src/projectM-MusicPlugin: https://github.com/projectM-visualizer/frontend-music-plug-in
- src/projectM-pulseaudio: https://github.com/projectM-visualizer/frontend-qt
- src/projectM-qt: https://github.com/projectM-visualizer/frontend-qt
- src/projectM-sdl: src/sdl-test-ui
- src/projectM-test: tests
2022-02-18 18:01:03 +01:00