Skip to content

Commit

Permalink
Expose plt_autosort API to plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed Nov 2, 2024
1 parent 5b118e7 commit dd4d711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/deadbeef/deadbeef.h
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,13 @@ typedef struct {
/// The deinit func will be called before unloading a plugin,
/// and the caller will wait until completion block is performed.
void (*plug_register_for_async_deinit) (DB_plugin_t *plugin, void (*deinit_func)(void (*completion_callback)(DB_plugin_t *plugin)));

/// Apply autosort to specified playlist, if it's enabled.
/// Every time a playlist is sorted via plt_sort or similar,
/// the chosen sort settings are saved in the playlist's metadata.
/// When plt_autosort is called, the playlist is re-sorted with those saved settings.
/// Usually it should be called by UI code, when appropriate.
void (*plt_autosort)(ddb_playlist_t *plt);
#endif
} DB_functions_t;

Expand Down
1 change: 1 addition & 0 deletions src/plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ static DB_functions_t deadbeef_api = {
.plt_load_from_buffer = (int (*) (ddb_playlist_t *plt, const uint8_t *buffer, size_t size))plt_load_from_buffer,
.plt_save_to_buffer = (ssize_t (*) (ddb_playlist_t *plt, uint8_t **out_buffer))plt_save_to_buffer,
.plug_register_for_async_deinit = _plug_register_for_async_deinit,
.plt_autosort = (void (*)(ddb_playlist_t *plt))plt_autosort,
};

DB_functions_t *deadbeef = &deadbeef_api;
Expand Down

0 comments on commit dd4d711

Please sign in to comment.