-
-
Notifications
You must be signed in to change notification settings - Fork 436
Add preset load callback to playlist library #953
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
base: master
Are you sure you want to change the base?
Conversation
Adds projectm_playlist_set_preset_load_event_callback() to allow applications to handle preset loading themselves. This enables loading presets from: - Archives (ZIP files) - Network sources (HTTP) - Custom storage solutions - Asynchronous loading patterns When the callback is set and returns true, the playlist library skips its default filesystem-based loading. If the callback returns false or isn't set, the default behavior is used. Fixes #946
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.
Pull request overview
This PR adds a callback mechanism to the playlist library that allows applications to handle preset loading themselves instead of relying on the default filesystem loading. This enables loading presets from archives, network sources, or custom storage solutions as requested in issue #946.
Changes:
- Added
projectm_playlist_preset_load_eventcallback type that receives preset index, filename, hard_cut flag, and user data - Added
projectm_playlist_set_preset_load_event_callback()API function to register the callback - Modified
PlayPresetIndex()to invoke the callback before attempting filesystem loading - Callback return value controls whether default filesystem loading proceeds
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/playlist/api/projectM-4/playlist_callbacks.h | Defines the new preset load callback type and registration function with comprehensive documentation |
| src/playlist/PlaylistCWrapper.hpp | Adds callback storage members and setter method declaration |
| src/playlist/PlaylistCWrapper.cpp | Implements callback setter and invocation logic in the preset loading flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds a callback that's invoked before loading each preset from the playlist.
The callback receives the preset index, filename, and whether it's a hard cut.
Returning
falsefrom the callback prevents the preset from loading, allowingapplications to implement custom filtering or logging.
Fixes #946