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
14#include "utils/symap.h"
15#include "utils/types.h"
16
17#include "zix/sem.h"
18
19TYPEDEF_STRUCT (CachedPluginDescriptors);
20TYPEDEF_STRUCT (PluginCollections);
21TYPEDEF_STRUCT (ZCarlaDiscovery);
22
29#define PLUGIN_MANAGER (ZRYTHM->plugin_manager)
30
32
37typedef struct PluginManager
38{
42 GPtrArray * plugin_descriptors;
43
45 char * plugin_categories[500];
46 int num_plugin_categories;
47
49 char * plugin_authors[6000];
50 int num_plugin_authors;
51
54
57
58 ZCarlaDiscovery * carla_discovery;
59
60 GenericCallback scan_done_cb;
61 void * scan_done_cb_data;
62
64 bool setup;
65
68
70
72plugin_manager_new (void);
73
74char **
75plugin_manager_get_paths_for_protocol (
76 const PluginManager * self,
77 const ZPluginProtocol protocol);
78
79char *
80plugin_manager_get_paths_for_protocol_separated (
81 const PluginManager * self,
82 const ZPluginProtocol protocol);
83
88char *
90 const PluginManager * self,
91 const ZPluginProtocol protocol,
92 const char * rel_path);
93
94void
95plugin_manager_begin_scan (
96 PluginManager * self,
97 const double max_progress,
98 double * progress,
100 void * user_data);
101
105void
107
111void
113 PluginManager * self,
114 const char * filename,
115 const char * sha1);
116
126
136 PluginManager * self,
137 const PluginDescriptor * src_descr);
138
143bool
145
151
152void
153plugin_manager_clear_plugins (PluginManager * self);
154
155void
156plugin_manager_free (PluginManager * self);
157
162#endif
bool plugin_manager_supports_protocol(PluginManager *self, ZPluginProtocol protocol)
Returns if the plugin manager supports the given plugin protocol.
void plugin_manager_add_descriptor(PluginManager *self, PluginDescriptor *descr)
Adds a new descriptor.
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.
void plugin_manager_set_currently_scanning_plugin(PluginManager *self, const char *filename, const char *sha1)
Updates the text in the greeter.
PluginDescriptor * plugin_manager_pick_instrument(PluginManager *self)
Returns an instrument plugin, if any.
char * plugin_manager_find_plugin_from_rel_path(const PluginManager *self, const ZPluginProtocol protocol, const char *rel_path)
Searches in the known paths for this plugin protocol for the given relative path of the plugin and re...
void(* GenericCallback)(void *object)
Generic callback.
Definition types.h:99
Descriptors to be cached.
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 descriptors.
char * plugin_categories[500]
Plugin categories.
char * plugin_authors[6000]
Plugin authors.
PluginCollections * collections
Plugin collections.
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.
API for Symap, a basic symbol map (string interner).
Custom types.