clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit 5db020b10d7de98e68d7fe3b3bbefca5d2db9b65
parent 89c57c569c0ac9020cc7ca530f1524ee22288afc
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Mon, 24 Oct 2022 14:26:30 +0200

Change to a listing approach

Diffstat:
Minclude/clap/ext/draft/resource-directory.h | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/include/clap/ext/draft/resource-directory.h b/include/clap/ext/draft/resource-directory.h @@ -35,6 +35,10 @@ extern "C" { /// Note for the host /// - try to use the filesytem's copy-on-write feature when possible for reducing exclusive folder /// space usage on duplication +/// - host can "garbage collect" the files in the shared folder using: +/// clap_plugin_resource_directory.get_files_count() +/// clap_plugin_resource_directory.get_file_path() +/// but be **very** careful before deleting any resources typedef struct clap_plugin_resource_directory { // Returns true if the plugin wants a resource directory with the specified sharing. @@ -54,13 +58,16 @@ typedef struct clap_plugin_resource_directory { // [main-thread] void(CLAP_ABI *collect)(const clap_plugin_t *plugin, bool all); - // Returns true if the plugin is using the file pointed by path or any file under the path - // directory. - // - // path must be absolute. + // Returns the number of files used by the plugin in the shared resource folder. // // [main-thread] - bool(CLAP_ABI *is_using_file)(const clap_plugin *plugin, const char *path); + uint32_t(CLAP_ABI *get_files_count)(const clap_plugin_t *plugin); + + // Retrieves file path. + // @param path writable memory to store the path + // @param path_size number of available bytes in path + // Returns the number of bytes in the path, or -1 on error + int32_t(CLAP_ABI* get_file_path)(const clap_plugin_t *plugin, uint32_t index, char *path, uint32_t path_size); } clap_plugin_resource_directory_t; typedef struct clap_host_resource_directory {