Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::old_dsp::plugins::CachedPluginDescriptors Class Referencefinal

Descriptors to be cached. More...

#include <src/gui/backend/cached_plugin_descriptors.h>

Public Member Functions

void serialize_to_file ()
 Serializes the cached descriptors to the standard file.
 
void serialize_to_file_no_throw ()
 Wrapper over serialize_to_file that ignores exceptions.
 
bool is_blacklisted (std::string_view sha1)
 Returns if the plugin with the given sha1 is blacklisted or not.
 
std::vector< std::unique_ptr< PluginDescriptor > > get_valid_descriptors_for_sha1 (std::string_view sha1)
 Returns found non-blacklisted descriptors.
 
bool contains_sha1 (std::string_view sha1, bool check_valid, bool check_blacklisted)
 Returns whether the given sha1 is in the cache.
 
bool contains_valid_sha1 (auto sha1)
 
bool contains_blacklisted_sha1 (auto sha1)
 
void blacklist (std::string_view sha1, bool serialize)
 Appends a descriptor to the cache.
 
void add (const PluginDescriptor &descr, bool serialize)
 Appends a descriptor to the cache.
 
void clear ()
 Clears the descriptors and removes the cache file.
 

Static Public Member Functions

static std::unique_ptr< CachedPluginDescriptorsread_or_new ()
 Returns a new instance with the cache pre-filled from the cache file, or an empty instance if there is no file or an error occurred.
 
static constexpr int get_format_major_version ()
 
static constexpr int get_format_minor_version ()
 
static constexpr auto get_document_type ()
 

Data Fields

std::vector< std::unique_ptr< PluginDescriptor > > descriptors_
 Valid descriptors.
 
std::vector< std::string > blacklisted_sha1s_
 Blacklisted hashes, to skip when scanning.
 

Static Public Attributes

static constexpr auto kDescriptorsKey = "descriptors"sv
 
static constexpr auto kBlacklistedSha1sKey = "blacklistedSha1s"sv
 

Friends

void to_json (nlohmann::json &j, const CachedPluginDescriptors &p)
 
void from_json (const nlohmann::json &j, CachedPluginDescriptors &p)
 

Detailed Description

Descriptors to be cached.

Definition at line 20 of file cached_plugin_descriptors.h.

Member Function Documentation

◆ add()

void zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::add ( const PluginDescriptor & descr,
bool serialize )

Appends a descriptor to the cache.

Parameters
serializeWhether to serialize the updated cache now.

◆ blacklist()

void zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::blacklist ( std::string_view sha1,
bool serialize )

Appends a descriptor to the cache.

Parameters
serializeWhether serialize the updated cache now.

◆ contains_blacklisted_sha1()

bool zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::contains_blacklisted_sha1 ( auto sha1)
inline

Definition at line 85 of file cached_plugin_descriptors.h.

◆ contains_sha1()

bool zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::contains_sha1 ( std::string_view sha1,
bool check_valid,
bool check_blacklisted )

Returns whether the given sha1 is in the cache.

Parameters
sha1

◆ contains_valid_sha1()

bool zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::contains_valid_sha1 ( auto sha1)
inline

Definition at line 80 of file cached_plugin_descriptors.h.

◆ get_document_type()

static constexpr auto zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::get_document_type ( )
inlinestaticconstexpr

Definition at line 56 of file cached_plugin_descriptors.h.

◆ get_format_major_version()

static constexpr int zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::get_format_major_version ( )
inlinestaticconstexpr

Definition at line 54 of file cached_plugin_descriptors.h.

◆ get_format_minor_version()

static constexpr int zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::get_format_minor_version ( )
inlinestaticconstexpr

Definition at line 55 of file cached_plugin_descriptors.h.

◆ read_or_new()

static std::unique_ptr< CachedPluginDescriptors > zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::read_or_new ( )
static

Returns a new instance with the cache pre-filled from the cache file, or an empty instance if there is no file or an error occurred.

Returns
std::unique_ptr<CachedPluginDescriptors>

◆ serialize_to_file()

void zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::serialize_to_file ( )

Serializes the cached descriptors to the standard file.

Exceptions
ZrythmExceptionif an error occurred while serializing.

◆ serialize_to_file_no_throw()

void zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::serialize_to_file_no_throw ( )
inline

Wrapper over serialize_to_file that ignores exceptions.

Definition at line 42 of file cached_plugin_descriptors.h.

Friends And Related Symbol Documentation

◆ to_json

void to_json ( nlohmann::json & j,
const CachedPluginDescriptors & p )
friend

Definition at line 114 of file cached_plugin_descriptors.h.

Field Documentation

◆ blacklisted_sha1s_

std::vector<std::string> zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::blacklisted_sha1s_

Blacklisted hashes, to skip when scanning.

Definition at line 140 of file cached_plugin_descriptors.h.

◆ descriptors_

std::vector<std::unique_ptr<PluginDescriptor> > zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::descriptors_

Valid descriptors.

Definition at line 137 of file cached_plugin_descriptors.h.

◆ kBlacklistedSha1sKey

auto zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::kBlacklistedSha1sKey = "blacklistedSha1s"sv
staticconstexpr

Definition at line 111 of file cached_plugin_descriptors.h.

◆ kDescriptorsKey

auto zrythm::gui::old_dsp::plugins::CachedPluginDescriptors::kDescriptorsKey = "descriptors"sv
staticconstexpr

Definition at line 110 of file cached_plugin_descriptors.h.


The documentation for this class was generated from the following file: