Still much to do here, especially in regards to key handling and config file parsing. For now, the app only load presets from the "presets" subdir of the current working directory.
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.
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.
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.
The native presets did not build anymore due to refactorings, cause other build issues on Windows (e.g. require linking to psapi.lib) and would need a complete makeover anyway.
In this case, the weighted random chooser would divide by zero, which will cause a crash. In the case this happens, we'll simply use a uniform random distribution as all ratings are equally zero.
The external gltext.h is C, thus forward declare GLTtext as a struct
instead of a class.
In file included from /projectm/src/libprojectM/Renderer/MenuText.cpp:7:
/projectm/src/libprojectM/Renderer/../gltext.h:108:9: warning: struct 'GLTtext' was previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
typedef struct GLTtext GLTtext;
^
/projectm/src/libprojectM/Renderer/MenuText.h:9:7: note: previous use is here
class GLTtext;
^
In file included from /projectm/src/libprojectM/Renderer/MenuText.cpp:7:
/projectm/src/libprojectM/Renderer/../gltext.h:211:1: warning: 'GLTtext' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct GLTtext {
^
/projectm/src/libprojectM/Renderer/MenuText.h:9:1: note: did you mean struct here?
class GLTtext;
^~~~~
struct