From 09e6c6494ecf47661dc321296dc16844a96c213b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 24 Aug 2022 14:55:57 +0200 Subject: [PATCH] Add a CLAP plugin type These aren't handled anywhere yet --- src/common/plugins.cpp | 8 ++++++-- src/common/plugins.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/plugins.cpp b/src/common/plugins.cpp index 35435ab0..b7ea513e 100644 --- a/src/common/plugins.cpp +++ b/src/common/plugins.cpp @@ -69,7 +69,9 @@ LibArchitecture find_dll_architecture(const fs::path& plugin_path) { } PluginType plugin_type_from_string(const std::string& plugin_type) noexcept { - if (plugin_type == "VST2") { + if (plugin_type == "CLAP") { + return PluginType::clap; + } else if (plugin_type == "VST2") { return PluginType::vst2; } else if (plugin_type == "VST3") { return PluginType::vst3; @@ -81,7 +83,9 @@ PluginType plugin_type_from_string(const std::string& plugin_type) noexcept { std::string plugin_type_to_string(const PluginType& plugin_type) { // We'll capitalize the acronyms because this is also our human readable // format - if (plugin_type == PluginType::vst2) { + if (plugin_type == PluginType::clap) { + return "CLAP"; + } else if (plugin_type == PluginType::vst2) { return "VST2"; } else if (plugin_type == PluginType::vst3) { return "VST3"; diff --git a/src/common/plugins.h b/src/common/plugins.h index 08fbb5e4..97b3d407 100644 --- a/src/common/plugins.h +++ b/src/common/plugins.h @@ -37,7 +37,7 @@ enum class LibArchitecture { dll_32, dll_64 }; * `plugin_type_from_string()` with some invalid value we can use it to * gracefully show an error message without resorting to exceptions. */ -enum class PluginType { vst2, vst3, unknown }; +enum class PluginType { clap, vst2, vst3, unknown }; template void serialize(S& s, PluginType& plugin_type) {