mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-26 01:05:13 +00:00
Address Copilot review feedback
This commit is contained in:
committed by
Mischa Spiegelmock
parent
aa24265fd1
commit
e718f99e6f
@ -131,12 +131,9 @@ void PlaylistCWrapper::PlayPresetIndex(uint32_t index, bool hardCut, bool resetF
|
||||
{
|
||||
if (m_presetLoadEventCallback(index, filename.c_str(), hardCut, m_presetLoadEventUserData))
|
||||
{
|
||||
// Application handled the load, don't try to load from filesystem.
|
||||
// Only fire switched event if the app's load succeeded.
|
||||
if (!m_lastPresetSwitchFailed && m_presetSwitchedEventCallback != nullptr)
|
||||
{
|
||||
m_presetSwitchedEventCallback(hardCut, index, m_presetSwitchedEventUserData);
|
||||
}
|
||||
// Application handled the load - return without further action.
|
||||
// The app is responsible for calling projectm_load_preset_file/data,
|
||||
// handling errors, and firing the switched event when ready.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,20 +80,24 @@ typedef void (*projectm_playlist_preset_switch_failed_event)(const char* preset_
|
||||
* - Custom preset storage solutions
|
||||
*
|
||||
* When this callback is set and returns true, the playlist library will NOT attempt
|
||||
* to load the preset file itself. The application is responsible for calling
|
||||
* projectm_load_preset_file() or projectm_load_preset_data() with the preset content.
|
||||
* to load the preset file itself and will return immediately without firing any events.
|
||||
* The application takes full responsibility for:
|
||||
* - Calling projectm_load_preset_file() or projectm_load_preset_data() with the preset content
|
||||
* - Handling any loading errors
|
||||
* - Firing the preset_switched_event callback when the preset is ready (if desired)
|
||||
*
|
||||
* If the callback returns false or is not set, the playlist library will use the
|
||||
* default behavior of loading the preset from the filesystem.
|
||||
*
|
||||
* @note The filename pointer is only valid inside the callback. Make a copy if it needs
|
||||
* to be retained for later use.
|
||||
* @note Do not call any playlist preset-switching functions from within this callback.
|
||||
* @param index The playlist index of the preset to be loaded.
|
||||
* @param filename The preset filename/URL at this index. Can be used as a key or path.
|
||||
* @param hard_cut True if this should be a hard cut, false for a smooth transition.
|
||||
* @param user_data A user-defined data pointer that was provided when registering the callback,
|
||||
* e.g. context information.
|
||||
* @return True if the application handled the preset loading, false to use default behavior.
|
||||
* @return True if the application handles preset loading, false to use default behavior.
|
||||
* @since 4.2.0
|
||||
*/
|
||||
typedef bool (*projectm_playlist_preset_load_event)(unsigned int index, const char* filename,
|
||||
|
||||
Reference in New Issue
Block a user