Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
plugin_manager.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __PLUGINS_PLUGIN_MANAGER_H__
11#define __PLUGINS_PLUGIN_MANAGER_H__
12
13#include "plugins/lv2/lv2_urid.h"
15#include "utils/symap.h"
16
17#include "zix/sem.h"
18#include <lilv/lilv.h>
19
22
29#define PLUGIN_MANAGER (ZRYTHM->plugin_manager)
30#define LILV_WORLD (PLUGIN_MANAGER->lilv_world)
31#define LILV_PLUGINS (PLUGIN_MANAGER->lilv_plugins)
32#define LV2_GENERATOR_PLUGIN "Generator"
33#define LV2_CONSTANT_PLUGIN "Constant"
34#define LV2_INSTRUMENT_PLUGIN "Instrument"
35#define LV2_OSCILLATOR_PLUGIN "Oscillator"
36#define PM_URIDS (PLUGIN_MANAGER->urids)
37#define PM_SYMAP (PLUGIN_MANAGER->symap)
38#define PM_SYMAP_LOCK (PLUGIN_MANAGER->symap_lock)
39#define PM_GET_NODE(uri) plugin_manager_get_node (PLUGIN_MANAGER, uri)
40
42
47typedef struct PluginManager
48{
52 GPtrArray * plugin_descriptors;
53
55 char * plugin_categories[500];
56 int num_plugin_categories;
57
59 char * plugin_authors[6000];
60 int num_plugin_authors;
61
62 LilvWorld * lilv_world;
63 const LilvPlugins * lilv_plugins;
64
65 LilvNode ** nodes;
66 int num_nodes;
67 size_t nodes_size;
68
71
74
78 ZixSem symap_lock;
79
82
83 char * lv2_path;
84
86 bool setup;
87
90
92
94plugin_manager_new (void);
95
102const LilvNode *
103plugin_manager_get_node (PluginManager * self, const char * uri);
104
114void
116 PluginManager * self,
117 const double max_progress,
118 double * progress);
119
129
139 PluginManager * self,
140 const PluginDescriptor * src_descr);
141
146bool
148
154
155void
156plugin_manager_clear_plugins (PluginManager * self);
157
158void
159plugin_manager_free (PluginManager * self);
160
165#endif
bool plugin_manager_supports_protocol(PluginManager *self, ZPluginProtocol protocol)
Returns if the plugin manager supports the given plugin protocol.
void plugin_manager_scan_plugins(PluginManager *self, const double max_progress, double *progress)
Scans for plugins, optionally updating the progress.
PluginDescriptor * plugin_manager_find_plugin_from_uri(PluginManager *self, const char *uri)
Returns the PluginDescriptor instance for the given URI.
PluginDescriptor * plugin_manager_find_from_descriptor(PluginManager *self, const PluginDescriptor *src_descr)
Finds and returns the PluginDescriptor instance matching the given descriptor.
ZPluginProtocol
Plugin protocol.
PluginDescriptor * plugin_manager_pick_instrument(PluginManager *self)
Returns an instrument plugin, if any.
const LilvNode * plugin_manager_get_node(PluginManager *self, const char *uri)
Returns a cached LilvNode for the given URI.
Descriptors to be cached.
Cached URIDs for quick access (instead of having to use symap).
Definition lv2_urid.h:23
Serializable plugin collections.
Definition collections.h:28
The PluginManager is responsible for scanning and keeping track of available Plugin's.
CachedPluginDescriptors * cached_plugin_descriptors
Cached VST descriptors.
char * plugin_categories[500]
Plugin categories.
char * plugin_authors[6000]
Plugin authors.
ZixSem symap_lock
Lock for URI map.
PluginCollections * collections
Plugin collections.
Symap * symap
URI map for URID feature.
GPtrArray * plugin_descriptors
Scanned plugin descriptors.
int num_new_plugins
Number of newly scanned (newly cached) plugins.
bool setup
Whether the plugin manager has been set up already.
Lv2URIDs urids
URIDs.
Definition symap.h:36
API for Symap, a basic symbol map (string interner).