-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate new preset parser and rewrite/refactor preset rendering. #716
Merged
kblaschke
merged 51 commits into
projectM-visualizer:master
from
kblaschke:rewrite-preset-parser
Sep 15, 2023
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
7b2b60d
Added a new preset file parser class.
kblaschke 41a6342
Build and run unit tests from now on.
kblaschke caee555
Added missing <functional> include GCC automatically includes for som…
kblaschke 1c436c3
Format old parser code and fix a linker error.
kblaschke dfe08a1
Fix some errors in FileParser
kblaschke b9ef6a3
Remove old expression parser and add the new projectm-eval lib.
kblaschke 3a0dcff
Shader refactoring.
kblaschke 8823210
More rendering refactoring.
kblaschke 74ca378
More rendering refactoring.
kblaschke 922980f
Per-pixel mesh implementation.
kblaschke e7094aa
Remove "Pipeline" classes and temp fix all compilation issues.
kblaschke 7c4e0c8
Delete MilkdropPresetFactory dir, left over from a previous rebase.
kblaschke 95f3cb9
Move BlurTexture to MilkdropPreset.
kblaschke 29b3d4a
Fix namespace issues in PCMTest.cpp
kblaschke ecea456
Remove unnecessary functions in PresetFileParser.
kblaschke 5c5bb0a
PresetFileParser: Fix line reader and a compiler warning, re-add tests.
kblaschke a55fa07
Fix a few linker issues with the eval lib.
kblaschke e48e6f3
Remove call to deleted function.
kblaschke 6e49989
Fixed some typo, added missing call to RegisterBuiltinVariables().
kblaschke 7db50da
A few fixes for warnings etc.
kblaschke 62b84ef
Added a framebuffer class for drawing the presets into.
kblaschke e73b0f3
Working on getting stuff being rendered again, focus on default wavef…
kblaschke 102d4ba
Overhauled all primitives (waves, shapes and borders).
kblaschke 09607a2
Fix issues with the framebuffer implementation and reenable it.
kblaschke e603793
Finished per-pixel mesh, started rework of warp/comp shaders and text…
kblaschke ce0e585
More work on shader stuff, warp/comp shaders now compile properly.
kblaschke 904292e
Implemented motion vector grid.
kblaschke f88fe70
Fix wrong assignment in per-frame context.
kblaschke df7cd08
Fill both spectrum channels with data.
kblaschke 0ac9fe2
Finished final composite implementation, more fixes and cleanups.
kblaschke 2707a1d
Fix uv_orig coordinates in warp shader.
kblaschke 75fe0f0
Fixed more UV coordinate issues in the warp shader.
kblaschke 74bd99a
Fix idle preset and filters, load logo textures y-flipped.
kblaschke 4b3226a
Added projectM-Eval as submodule, flipped rendering stuff around a bi…
kblaschke feb7a33
A few Windows build fixes
kblaschke ef62ddf
Add omptl to Renderer linked library list.
kblaschke d2780c5
Check out submodules (for projectM-eval) in GitHub Actions workflows.
kblaschke 879c6c7
Split StaticGlShaders class into shader files and code templates, rem…
kblaschke e84acbc
Renamed simple textured/untextured shaders to be more readable.
kblaschke 486c86c
Filename fix in comment.
kblaschke e9438ee
Deleted lots of unused files and code.
kblaschke b07163d
Check active preset after the preset switch event, as this might have…
kblaschke a294b8a
Fix two Emscripten/GLES compile issues.
kblaschke 1c93302
Removed a few unused files.
kblaschke b7572ea
Use glDrawBuffers instead of glDrawBuffer with GLES.
kblaschke 494718d
Added missing float precision specifiers in vertex/fragment shaders.
kblaschke b05a8cc
GLES: Use GL_BACK instead of GL_COLOR_ATTACHMENT0 with default frameb…
kblaschke 561ea8c
Added methods to Framebuffer class to add externally created texture …
kblaschke c266599
Instead of color masking, attach/detach the motion vector u/v texture.
kblaschke 48b8d6a
Restore framebuffer bindings after modifying texture attachments.
kblaschke c08de98
Properly initialize u/v texture size for motion vectors.
kblaschke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
execute_process(COMMAND "${CMAKE_CTEST_COMMAND}" --build "$ENV{GITHUB_WORKSPACE}/cmake-build" | ||
--build-config $ENV{BUILD_TYPE} | ||
-V | ||
WORKING_DIRECTORY "$ENV{GITHUB_WORKSPACE}/cmake-build" | ||
|
||
RESULT_VARIABLE result | ||
) | ||
|
||
if(NOT result EQUAL 0) | ||
message(FATAL_ERROR "CTest returned bad exit status") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "vendor/projectm-eval"] | ||
path = vendor/projectm-eval | ||
url = https://github.com/projectM-visualizer/projectm-eval.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
namespace libprojectM { | ||
namespace Audio { | ||
|
||
static constexpr int WaveformSamples = 576; //!< Number of waveform data samples available for rendering a frame. | ||
static constexpr int SpectrumSamples = 512; //!< Number of spectrum analyzer samples. | ||
|
||
} // namespace Audio | ||
} // namespace libprojectM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "FrameAudioData.hpp" | ||
|
||
namespace libprojectM { | ||
namespace Audio { | ||
|
||
} // namespace Audio | ||
} // namespace libprojectM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* @file FrameAudioData.hpp | ||
* @brief Holds all audio data to be used to render a single frame. | ||
* | ||
* This includes the actual waveform data, spectrum and beat detection values. | ||
*/ | ||
#pragma once | ||
|
||
#include "projectM-4/projectM_export.h" | ||
#include "AudioConstants.hpp" | ||
|
||
#include <array> | ||
|
||
namespace libprojectM { | ||
namespace Audio { | ||
|
||
class PROJECTM_EXPORT FrameAudioData | ||
{ | ||
public: | ||
float bass{0.f}; | ||
float bassAtt{0.f}; | ||
float mid{0.f}; | ||
float midAtt{0.f}; | ||
float treb{0.f}; | ||
float trebAtt{0.f}; | ||
|
||
float vol{0.f}; | ||
float volAtt{0.f}; | ||
|
||
std::array<float, WaveformSamples> waveformLeft; | ||
std::array<float, WaveformSamples> waveformRight; | ||
|
||
std::array<float, SpectrumSamples> spectrumLeft; | ||
std::array<float, SpectrumSamples> spectrumRight; | ||
}; | ||
|
||
} // namespace Audio | ||
} // namespace libprojectM |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my knowledge of modern C++ is very poor. how does
data
get garbage-collected here? are we returning a struct copy? if so, since this is a hot path, can we return a pointer to a struct that frees itself when there are no more references or something? or is it not a big deal to copy 8 floats around?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's an object that's - in theory - copied. The compiler optimizes such return values as implicit moves, so when the code actually runs, no copy is created, but the object instance created in the function is moved to the caller's context without creating another object.
The audio data is only requested once per frame, and changes every frame, so using shared pointers here would just add overhead. The presets will get a const reference of this object, so ideally, only this single instance exists during a render call.