Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
cached_plugin_descriptors.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2020-2021, 2024 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
12#ifndef __PLUGINS_CACHED_PLUGIN_DESCRIPTORS_H__
13#define __PLUGINS_CACHED_PLUGIN_DESCRIPTORS_H__
14
16#include "utils/yaml.h"
17
24#define CACHED_PLUGIN_DESCRIPTORS_SCHEMA_VERSION 4
25
30{
33
36 int num_descriptors;
37
41 int num_blacklisted;
43
44static const cyaml_schema_field_t cached_plugin_descriptors_fields_schema[] = {
45 YAML_FIELD_INT (CachedPluginDescriptors, schema_version),
48 descriptors,
49 plugin_descriptor_schema),
52 blacklisted,
53 plugin_descriptor_schema),
54
55 CYAML_FIELD_END
56};
57
58static const cyaml_schema_value_t cached_plugin_descriptors_schema = {
61 cached_plugin_descriptors_fields_schema),
62};
63
69
70void
71cached_plugin_descriptors_serialize_to_file (CachedPluginDescriptors * self);
72
76bool
79 const char * sha1);
80
97 GPtrArray * arr,
98 const PluginDescriptor * descr,
99 const char * sha1,
100 bool check_valid,
101 bool check_blacklisted);
102
116 const char * abs_path);
117
123void
126 const char * sha1,
127 bool _serialize);
128
138void
141 const PluginDescriptor * _new_descr,
142 bool _serialize);
143
150void
153 const PluginDescriptor * descr,
154 int _serialize);
155
159void
161
162void
163cached_plugin_descriptors_free (CachedPluginDescriptors * self);
164
169#endif
NONNULL_ARGS(1) int undo_manager_undo(UndoManager *self
Undo last action.
void cached_plugin_descriptors_blacklist(CachedPluginDescriptors *self, const char *sha1, bool _serialize)
Appends a descriptor to the cache.
PluginDescriptor ** cached_plugin_descriptors_get(CachedPluginDescriptors *self, const char *abs_path)
Returns the PluginDescriptor's corresponding to the .so/.dll file at the given path,...
void cached_plugin_descriptors_replace(CachedPluginDescriptors *self, const PluginDescriptor *_new_descr, bool _serialize)
Replaces a descriptor in the cache.
CachedPluginDescriptors * cached_plugin_descriptors_new(void)
Reads the file and fills up the object.
bool cached_plugin_descriptors_is_blacklisted(CachedPluginDescriptors *self, const char *sha1)
Returns if the plugin with the given sha1 is blacklisted or not.
void cached_plugin_descriptors_clear(CachedPluginDescriptors *self)
Clears the descriptors and removes the cache file.
unsigned int cached_plugin_descriptors_find(CachedPluginDescriptors *self, GPtrArray *arr, const PluginDescriptor *descr, const char *sha1, bool check_valid, bool check_blacklisted)
Finds descriptors matching the given one's unique identifiers and adds them to the array.
void cached_plugin_descriptors_add(CachedPluginDescriptors *self, const PluginDescriptor *descr, int _serialize)
Appends a descriptor to the cache.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Fixed-width array of pointers with variable count.
Definition yaml.h:55
Descriptors to be cached.
PluginDescriptor * descriptors[90000]
Valid descriptors.
PluginDescriptor * blacklisted[90000]
Blacklisted paths and hashes, to skip when scanning.
int schema_version
Version of the file.
YAML utils.