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-2020 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) \
40 plugin_manager_get_node (PLUGIN_MANAGER, uri)
41
43
48typedef struct PluginManager
49{
53 GPtrArray * plugin_descriptors;
54
56 char * plugin_categories[500];
57 int num_plugin_categories;
58
60 char * plugin_authors[6000];
61 int num_plugin_authors;
62
63 LilvWorld * lilv_world;
64 const LilvPlugins * lilv_plugins;
65
66 LilvNode ** nodes;
67 int num_nodes;
68 size_t nodes_size;
69
72
75
79 ZixSem symap_lock;
80
83
84 char * lv2_path;
85
88 bool setup;
89
91
93plugin_manager_new (void);
94
101const LilvNode *
103 PluginManager * self,
104 const char * uri);
105
115void
117 PluginManager * self,
118 const double max_progress,
119 double * progress);
120
130 PluginManager * self,
131 const char * uri);
132
142 PluginManager * self,
143 const PluginDescriptor * src_descr);
144
149bool
151 PluginManager * self,
152 PluginProtocol protocol);
153
159
160void
161plugin_manager_clear_plugins (PluginManager * self);
162
163void
164plugin_manager_free (PluginManager * self);
165
170#endif
void plugin_manager_scan_plugins(PluginManager *self, const double max_progress, double *progress)
Scans for plugins, optionally updating the progress.
PluginProtocol
Plugin protocol.
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.
PluginDescriptor * plugin_manager_pick_instrument(PluginManager *self)
Returns an instrument plugin, if any.
bool plugin_manager_supports_protocol(PluginManager *self, PluginProtocol protocol)
Returns if the plugin manager supports the given plugin protocol.
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:36
Serializable plugin collections.
Definition collections.h:44
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.
bool setup
Whether the plugin manager has been set up already.
Lv2URIDs urids
URIDs.
Definition symap.h:34
API for Symap, a basic symbol map (string interner).