Audacity 3.2.0
PluginDescriptor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 PluginDescriptor.h
6
7 Split from PluginManager.h
8
9**********************************************************************/
10
11#pragma once
12#include <wx/string.h>
13
14#include "EffectInterface.h"
15#include "PluginInterface.h"
16#include "XMLTagHandler.h"
17#include "wxArrayStringEx.h"
18
19class XMLWriter;
20
22//
23// PluginDescriptor
24//
26
27typedef enum : unsigned {
28 PluginTypeNone = 0, // 2.1.0 placeholder entries...not used by 2.1.1 or greater
29 PluginTypeStub =1, // Used for plugins that have not yet been registered
36
37class PluginDescriptorXMLTagHandler;
38
39// TODO: Convert this to multiple derived classes
42class MODULE_MANAGER_API PluginDescriptor final : public XMLTagHandler
43{
44public:
45
46 static constexpr auto XMLNodeName { "PluginDescriptor" };
47
48 PluginType GetPluginType() const;
49
50 // All plugins
51
52 // These return untranslated strings
53 const wxString & GetID() const;
54 const wxString & GetProviderID() const;
55 const PluginPath & GetPath() const;
56 const ComponentInterfaceSymbol & GetSymbol() const;
57
58 const wxString& GetUntranslatedVersion() const;
59 // There is no translated version
60
61 const wxString& GetVendor() const;
62
63 bool IsEnabled() const;
64 bool IsValid() const;
65
66 void SetEnabled(bool enable);
67 void SetValid(bool valid);
68
69 // Effect plugins only
70
71 // Internal string only, no translated counterpart!
72 // (Use Effect::GetFamilyName instead)
73 // This string persists in configuration files
74 // So config compatibility will break if it is changed across Audacity versions
75 wxString GetEffectFamily() const;
76
77 EffectType GetEffectType() const;
78 bool IsEffectDefault() const;
79 bool IsEffectInteractive() const;
80 bool IsEffectLegacy() const;
81 bool IsEffectRealtime() const;
82 bool IsEffectAutomatable() const;
83
84 // Importer plugins only
85
86 const wxString & GetImporterIdentifier() const;
88 const FileExtensions & GetImporterExtensions() const;
89
90 void WriteXML(XMLWriter& writer) const;
91
92 bool HandleXMLTag(const std::string_view& tag, const AttributesList& attrs) override;
93 XMLTagHandler* HandleXMLChild(const std::string_view& tag) override;
94 void HandleXMLEndTag(const std::string_view&) override;
95
96 void SetPluginType(PluginType type);
97
98 // These should be passed an untranslated value
99 void SetID(const PluginID & ID);
100 void SetProviderID(const PluginID & providerID);
101 void SetPath(const PluginPath & path);
102 void SetSymbol(const ComponentInterfaceSymbol & symbol);
103
104 // These should be passed an untranslated value wrapped in XO() so
105 // the value will still be extracted for translation
106 void SetVersion(const wxString & version);
107 void SetVendor(const wxString & vendor);
108
109 // "family" should be an untranslated string wrapped in wxT()
110 void SetEffectFamily(const wxString & family);
111 void SetEffectType(EffectType type);
112 void SetEffectDefault(bool dflt);
113 void SetEffectInteractive(bool interactive);
114 void SetEffectLegacy(bool legacy);
115 void SetRealtimeSupport(EffectDefinitionInterface::RealtimeSince realtime);
116
118 wxString SerializeRealtimeSupport() const;
120 void DeserializeRealtimeSupport(const wxString &value);
121
122 void SetEffectAutomatable(bool automatable);
123
124 void SetImporterIdentifier(const wxString & identifier);
126 void SetImporterExtensions(FileExtensions extensions);
127
128private:
129
130 // Common
131
132 PluginType mPluginType { PluginTypeNone };
133
134 wxString mID;
137 wxString mVersion;
138 wxString mVendor;
139 wxString mProviderID;
140 bool mEnabled {false};
141 bool mValid {false};
142
143 // Effects
144
147 bool mEffectInteractive {false};
148 bool mEffectDefault {false};
149 bool mEffectLegacy {false};
152 bool mEffectAutomatable {false};
153
154 // Importers
155
158};
wxString PluginID
EffectType
@ EffectTypeNone
static PluginID GetID(EffectPlugin &effect)
Definition: EffectUI.cpp:39
wxString PluginPath
type alias for identifying a Plugin supplied by a module, each module defining its own interpretation...
Definition: Identifier.h:214
PluginType
@ PluginTypeStub
@ PluginTypeModule
@ PluginTypeAudacityCommand
@ PluginTypeExporter
@ PluginTypeNone
@ PluginTypeEffect
@ PluginTypeImporter
std::vector< Attribute > AttributesList
Definition: XMLTagHandler.h:40
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
RealtimeSince
In which versions of Audacity was an effect realtime capable?
const TranslatableString & GetImporterFilterDescription() const
wxString mImporterIdentifier
void SetImporterFilterDescription(const TranslatableString &filterDesc)
FileExtensions mImporterExtensions
ComponentInterfaceSymbol mSymbol
Holds a msgid for the translation catalog; may also bind format arguments.
This class is an interface which should be implemented by classes which wish to be able to load and s...
Definition: XMLTagHandler.h:42
virtual XMLTagHandler * HandleXMLChild(const std::string_view &tag)=0
virtual void HandleXMLEndTag(const std::string_view &WXUNUSED(tag))
Definition: XMLTagHandler.h:59
virtual bool HandleXMLTag(const std::string_view &tag, const AttributesList &attrs)=0
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Definition: XMLWriter.h:25
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.