projectM-visualizer / frontend-sdl-cpp

Standalone application based on libSDL that turns your desktop audio into awesome visuals. Available on most platforms supported by both libprojectM and libSDL.
GNU General Public License v3.0
66 stars 35 forks source link

Doesn't build against projectM HEAD due to missing text-related helpers #43

Closed nzoschke closed 1 year ago

nzoschke commented 2 years ago

https://github.com/projectM-visualizer/projectm/pull/652 removed parts of projectM this frontend uses.

The errors I get when building the frontend are

% make
Consolidate compiler generated dependencies of target projectMSDL
[ 11%] Building CXX object src/CMakeFiles/projectMSDL.dir/AudioCapture.cpp.o
[ 22%] Building CXX object src/CMakeFiles/projectMSDL.dir/ProjectMSDLApplication.cpp.o
[ 33%] Building CXX object src/CMakeFiles/projectMSDL.dir/ProjectMWrapper.cpp.o
[ 44%] Building CXX object src/CMakeFiles/projectMSDL.dir/RenderLoop.cpp.o
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:59:21: error: use of undeclared identifier 'projectm_is_text_input_active'
                if (projectm_is_text_input_active(_projectMHandle, true))
                    ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:70:22: error: use of undeclared identifier 'projectm_is_text_input_active'
                if (!projectm_is_text_input_active(_projectMHandle, true))
                     ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:85:21: error: use of undeclared identifier 'projectm_is_text_input_active'
                if (projectm_is_text_input_active(_projectMHandle, true))
                    ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:87:21: error: use of undeclared identifier 'projectm_set_search_text'; did you mean 'projectm_get_search_index'?
                    projectm_set_search_text(_projectMHandle, event.text.text);
                    ^~~~~~~~~~~~~~~~~~~~~~~~
                    projectm_get_search_index
/usr/local/include/libprojectM/projectM.h:822:30: note: 'projectm_get_search_index' declared here
PROJECTM_EXPORT unsigned int projectm_get_search_index(projectm_handle instance, const char* name);
                             ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:88:21: error: use of undeclared identifier 'projectm_populate_preset_menu'
                    projectm_populate_preset_menu(_projectMHandle);
                    ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:167:13: error: use of undeclared identifier 'projectm_set_toast_message'
            projectm_set_toast_message(_projectMHandle, aspectCorrectionEnabled ? "Aspect Correction Enabled"
            ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:196:17: error: use of undeclared identifier 'projectm_set_toast_message'
                projectm_set_toast_message(_projectMHandle, _audioCapture.AudioDeviceName().c_str());
                ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:234:13: error: use of undeclared identifier 'projectm_set_toast_message'
            projectm_set_toast_message(_projectMHandle, shuffleEnabled ? "Shuffle Enabled" : "Shuffle Disabled");
            ^
/Users/noah/src/frontend-sdl2/src/RenderLoop.cpp:340:13: error: use of undeclared identifier 'projectm_delete_search_text'
            projectm_delete_search_text(_projectMHandle);
            ^
9 errors generated.
make[2]: *** [src/CMakeFiles/projectMSDL.dir/RenderLoop.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/projectMSDL.dir/all] Error 2
make: *** [all] Error 2

Workaround is to build projectM from and older version:

cd projectm
git reset --hard 62cecb36d6c796771f84511347a5772b48162960
cmake && make && make install
nzoschke commented 2 years ago

I assume any frontends should do their own text overlays going forward.

kblaschke commented 2 years ago

Lots of API changes going on now, e.g. splitting out playlist management and removing the built-in key handler, so this breakage is intentional. The frontend will be adapted to the changes when the API changes are finished, so the work has to be done only once instead of every push in the main repo.

For the future, I'll probably add a libprojectm Git submodule to this project, pointing to a known working commit in the upstream repo. This would make things easier for other devs to determine which commit of libprojectM still works.

kblaschke commented 1 year ago

It is now building against 4.0.0-rc1 in current master, plus a few additional fixes.