Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plugin-factory.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "plugin.h"
  3. static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[] = "clap.plugin-factory";
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. // Every method must be thread-safe.
  8. // It is very important to be able to scan the plugin as quickly as possible.
  9. //
  10. // If the content of the factory may change due to external events, like the user installed
  11. typedef struct clap_plugin_factory {
  12. // Get the number of plugins available.
  13. // [thread-safe]
  14. uint32_t (CLAP_ABI *get_plugin_count)(const struct clap_plugin_factory *factory);
  15. // Retrieves a plugin descriptor by its index.
  16. // Returns null in case of error.
  17. // The descriptor must not be freed.
  18. // [thread-safe]
  19. const clap_plugin_descriptor_t *(CLAP_ABI *get_plugin_descriptor)(
  20. const struct clap_plugin_factory *factory, uint32_t index);
  21. // Create a clap_plugin by its plugin_id.
  22. // The returned pointer must be freed by calling plugin->destroy(plugin);
  23. // The plugin is not allowed to use the host callbacks in the create method.
  24. // Returns null in case of error.
  25. // [thread-safe]
  26. const clap_plugin_t *(CLAP_ABI *create_plugin)(const struct clap_plugin_factory *factory,
  27. const clap_host_t *host,
  28. const char *plugin_id);
  29. } clap_plugin_factory_t;
  30. #ifdef __cplusplus
  31. }
  32. #endif