Implement external preset switching control and add stream loading support.

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.
This commit is contained in:
Kai Blaschke
2022-11-06 18:47:59 +01:00
parent b23b5ce25c
commit 2b1099a653
24 changed files with 790 additions and 719 deletions

View File

@ -15,12 +15,12 @@ projectMWrapper::projectMWrapper(class ProjectM::Settings settings)
{
}
void projectMWrapper::PresetSwitchFailedEvent(bool isHardCut, const std::string& presetFilename,
void projectMWrapper::PresetSwitchFailedEvent(const std::string& presetFilename,
const std::string& failureMessage) const
{
if (_presetSwitchFailedEventCallback)
{
_presetSwitchFailedEventCallback(isHardCut, presetFilename.c_str(),
_presetSwitchFailedEventCallback(presetFilename.c_str(),
failureMessage.c_str(), _presetSwitchFailedEventUserData);
}
}
@ -417,12 +417,6 @@ void projectm_set_window_size(projectm_handle instance, size_t width, size_t hei
projectMInstance->ResetOpenGL(width, height);
}
bool projectm_get_error_loading_current_preset(projectm_handle instance)
{
auto projectMInstance = handle_to_instance(instance);
return projectMInstance->ErrorLoadingCurrentPreset();
}
unsigned int projectm_pcm_get_max_samples()
{
return Pcm::maxSamples;