6#include "plugins/plugin_protocol.h"
7#include "utils/icloneable.h"
8#include "utils/utf8_string.h"
12#include <boost/describe.hpp>
13#include <nlohmann/json_fwd.hpp>
21namespace zrythm::plugins
27enum class PluginCategory : std::uint8_t
75enum class PluginArchitecture : std::uint8_t
84enum class BridgeMode : std::uint8_t
114 Q_PROPERTY (QString name READ name CONSTANT FINAL)
115 Q_PROPERTY (QString vendor READ vendor CONSTANT FINAL)
116 Q_PROPERTY (QString format READ format CONSTANT FINAL)
117 Q_PROPERTY (QString category READ category CONSTANT FINAL)
121 static std::unique_ptr<PluginDescriptor>
122 from_juce_description (
const juce::PluginDescription &juce_desc);
124 std::unique_ptr<juce::PluginDescription> to_juce_description ()
const;
133 [[nodiscard]] QString name ()
const {
return name_.to_qstring (); }
134 QString format ()
const;
135 QString vendor ()
const;
136 QString category ()
const;
145 Q_INVOKABLE
bool isInstrument ()
const;
146 Q_INVOKABLE
bool isEffect ()
const;
147 Q_INVOKABLE
bool isModulator ()
const;
148 Q_INVOKABLE
bool isMidiModifier ()
const;
175 friend void init_from (
181 static constexpr auto kAuthorKey =
"author"sv;
182 static constexpr auto kNameKey =
"name"sv;
183 static constexpr auto kWebsiteKey =
"website"sv;
184 static constexpr auto kCategoryKey =
"category"sv;
185 static constexpr auto kCategoryStringKey =
"categoryString"sv;
186 static constexpr auto kNumAudioInsKey =
"numAudioIns"sv;
187 static constexpr auto kNumAudioOutsKey =
"numAudioOuts"sv;
188 static constexpr auto kNumMidiInsKey =
"numMidiIns"sv;
189 static constexpr auto kNumMidiOutsKey =
"numMidiOuts"sv;
190 static constexpr auto kNumCtrlInsKey =
"numCtrlIns"sv;
191 static constexpr auto kNumCtrlOutsKey =
"numCtrlOuts"sv;
192 static constexpr auto kNumCvInsKey =
"numCvIns"sv;
193 static constexpr auto kNumCvOutsKey =
"numCvOuts"sv;
194 static constexpr auto kUniqueIdKey =
"uniqueId"sv;
195 static constexpr auto kDeprecatedUniqueIdKey =
"deprecatedUniqueId"sv;
196 static constexpr auto kArchitectureKey =
"architecture"sv;
197 static constexpr auto kProtocolKey =
"protocol"sv;
198 static constexpr auto kPathOrIdKey =
"pathOrId"sv;
199 static constexpr auto kMinBridgeModeKey =
"minBridgeMode"sv;
200 static constexpr auto kHasCustomUIKey =
"hasCustomUI"sv;
206 constexpr auto tie = [] (
const auto &p) {
208 p.arch_, p.protocol_, p.path_or_id_, p.unique_id_,
209 p.juce_compat_deprecated_unique_id_, p.min_bridge_mode_,
212 return tie (a) == tie (b);
219 PluginCategory category_ = PluginCategory::None;
239 PluginArchitecture
arch_ = PluginArchitecture::ARCH_64_BIT;
258 bool has_custom_ui_{};
260 BOOST_DESCRIBE_CLASS (
285template <>
struct hash<zrythm::plugins::PluginDescriptor>
291 h = h ^ qHash (d.
arch_);
292 if (std::holds_alternative<fs::path> (d.
path_or_id_))
294 h = h ^ qHash (std::get<fs::path> (d.
path_or_id_).string ());
299 h ^ qHash (std::get<zrythm::utils::Utf8String> (d.
path_or_id_).str ());
The PluginDescriptor class provides a set of static utility functions and member functions to work wi...
int num_midi_ins_
Number of MIDI input ports.
int num_ctrl_outs_
Number of output control (plugin param) ports.
int juce_compat_deprecated_unique_id_
This is additionally needed by JUCE for some plugin formats.
Protocol::ProtocolType protocol_
Plugin protocol (Lv2/DSSI/LADSPA/VST/etc.).
int64_t unique_id_
Used by some plugin formats to uniquely identify the plugin.
bool has_custom_ui() const
Returns if the Plugin has a supported custom UI.
PluginArchitecture arch_
Architecture (32/64bit).
bool is_same_plugin(const PluginDescriptor &other) const
Returns whether the two descriptors describe the same plugin, ignoring irrelevant fields.
BridgeMode min_bridge_mode_
Minimum required bridge mode.
BridgeMode get_min_bridge_mode() const
Returns the minimum bridge mode required for this plugin.
int num_midi_outs_
Number of MIDI output ports.
int num_audio_ins_
Number of audio input ports.
int num_ctrl_ins_
Number of input control (plugin param) ports.
int num_cv_outs_
Number of output CV ports.
Q_INVOKABLE QString serializeToString() const
Serializes the descriptor to a string.
int num_audio_outs_
Number of audio output ports.
int num_cv_ins_
Number of input CV ports.
utils::Utf8String category_str_
Lv2 plugin subcategory.
utils::Utf8String get_icon_name() const
Gets an appropriate icon name.
std::variant< fs::path, utils::Utf8String > path_or_id_
Identifier, for plugin formats that use unique identifiers, or path otherwise.
ProtocolType
Plugin protocol.
@ Internal
Dummy protocol for tests.
Lightweight UTF-8 string wrapper with safe conversions.