File: plugin-factory.h

package info (click to toggle)
lsp-plugins 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 91,856 kB
  • sloc: cpp: 427,831; xml: 57,779; makefile: 9,961; php: 1,005; sh: 18
file content (40 lines) | stat: -rw-r--r-- 1,463 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include "plugin.h"

static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[] = "clap.plugin-factory";

#ifdef __cplusplus
extern "C" {
#endif

// Every method must be thread-safe.
// It is very important to be able to scan the plugin as quickly as possible.
//
// The host may use clap_plugin_invalidation_factory to detect filesystem changes
// which may change the factory's content.
typedef struct clap_plugin_factory {
   // Get the number of plugins available.
   // [thread-safe]
   uint32_t(CLAP_ABI *get_plugin_count)(const struct clap_plugin_factory *factory);

   // Retrieves a plugin descriptor by its index.
   // Returns null in case of error.
   // The descriptor must not be freed.
   // [thread-safe]
   const clap_plugin_descriptor_t *(CLAP_ABI *get_plugin_descriptor)(
      const struct clap_plugin_factory *factory, uint32_t index);

   // Create a clap_plugin by its plugin_id.
   // The returned pointer must be freed by calling plugin->destroy(plugin);
   // The plugin is not allowed to use the host callbacks in the create method.
   // Returns null in case of error.
   // [thread-safe]
   const clap_plugin_t *(CLAP_ABI *create_plugin)(const struct clap_plugin_factory *factory,
                                                  const clap_host_t                *host,
                                                  const char                       *plugin_id);
} clap_plugin_factory_t;

#ifdef __cplusplus
}
#endif