JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_KnownPluginList.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
40class JUCE_API KnownPluginList : public ChangeBroadcaster
41{
42public:
43 //==============================================================================
46
48 ~KnownPluginList() override;
49
50 //==============================================================================
52 void clear();
53
55 bool addType (const PluginDescription& type);
56
58 void removeType (const PluginDescription& type);
59
61 int getNumTypes() const noexcept;
62
64 Array<PluginDescription> getTypes() const;
65
67 Array<PluginDescription> getTypesForFormat (AudioPluginFormat&) const;
68
70 std::unique_ptr<PluginDescription> getTypeForFile (const String& fileOrIdentifier) const;
71
77 std::unique_ptr<PluginDescription> getTypeForIdentifierString (const String& identifierString) const;
78
91 bool scanAndAddFile (const String& possiblePluginFileOrIdentifier,
92 bool dontRescanIfAlreadyInList,
94 AudioPluginFormat& formatToUse);
95
97 void scanFinished();
98
102 bool isListingUpToDate (const String& possiblePluginFileOrIdentifier,
103 AudioPluginFormat& formatToUse) const;
104
108 void scanAndAddDragAndDroppedFiles (AudioPluginFormatManager& formatManager,
109 const StringArray& filenames,
111
112 //==============================================================================
114 const StringArray& getBlacklistedFiles() const;
115
117 void addToBlacklist (const String& pluginID);
118
120 void removeFromBlacklist (const String& pluginID);
121
123 void clearBlacklistedFiles();
124
125 //==============================================================================
129 {
130 defaultOrder = 0,
131 sortAlphabetically,
132 sortByCategory,
133 sortByManufacturer,
134 sortByFormat,
135 sortByFileSystemLocation,
136 sortByInfoUpdateTime
137 };
138
139 //==============================================================================
147 static void addToMenu (PopupMenu& menu, const Array<PluginDescription>& types,
148 SortMethod sortMethod, const String& currentlyTickedPluginID = {});
149
154 static int getIndexChosenByMenu (const Array<PluginDescription>& types, int menuResultCode);
155
156 //==============================================================================
158 void sort (SortMethod method, bool forwards);
159
160 //==============================================================================
162 std::unique_ptr<XmlElement> createXml() const;
163
165 void recreateFromXml (const XmlElement& xml);
166
167 //==============================================================================
172 {
174 OwnedArray<PluginTree> subFolders;
176 };
177
179 static std::unique_ptr<PluginTree> createTree (const Array<PluginDescription>& types, SortMethod sortMethod);
180
181 //==============================================================================
184 {
185 public:
187 virtual ~CustomScanner();
188
194 const String& fileOrIdentifier) = 0;
195
197 virtual void scanFinished();
198
203 bool shouldExit() const noexcept;
204 };
205
209 void setCustomScanner (std::unique_ptr<CustomScanner> newScanner);
210
211 //==============================================================================
212 #ifndef DOXYGEN
213 // These methods have been deprecated! When getting the list of plugin types you should instead use
214 // the getTypes() method which returns a copy of the internal PluginDescription array and can be accessed
215 // in a thread-safe way.
216 [[deprecated]] PluginDescription* getType (int index) noexcept { return &types.getReference (index); }
217 [[deprecated]] const PluginDescription* getType (int index) const noexcept { return &types.getReference (index); }
218 [[deprecated]] PluginDescription** begin() noexcept { jassertfalse; return nullptr; }
219 [[deprecated]] PluginDescription* const* begin() const noexcept { jassertfalse; return nullptr; }
220 [[deprecated]] PluginDescription** end() noexcept { jassertfalse; return nullptr; }
221 [[deprecated]] PluginDescription* const* end() const noexcept { jassertfalse; return nullptr; }
222
223 // These methods have been deprecated in favour of their static counterparts. You should call getTypes()
224 // to store the plug-in list at a point in time and use it when calling these methods.
225 [[deprecated]] void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const;
226 [[deprecated]] int getIndexChosenByMenu (int menuResultCode) const;
227 [[deprecated]] std::unique_ptr<PluginTree> createTree (SortMethod sortMethod) const;
228 #endif
229
230private:
231 //==============================================================================
232 Array<PluginDescription> types;
233 StringArray blacklist;
235 CriticalSection scanLock, typesArrayLock;
236
238};
239
240} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
ElementType & getReference(int index) noexcept
Returns a direct reference to one of the elements in the array, without checking the index passed in.
Definition juce_Array.h:267
This maintains a list of known AudioPluginFormats.
The base class for a type of plugin format, such as VST, AudioUnit, LADSPA, etc.
Holds a list of ChangeListeners, and sends messages to them when instructed.
Class to define a custom plugin scanner.
virtual bool findPluginTypesFor(AudioPluginFormat &format, OwnedArray< PluginDescription > &result, const String &fileOrIdentifier)=0
Attempts to load the given file and find a list of plugins in it.
Manages a list of plugin types.
SortMethod
Sort methods used to change the order of the plugins in the list.
String folder
The name of this folder in the tree.
A structure that recursively holds a tree of plugins.
An array designed for holding objects.
A small class to represent some facts about a particular type of plug-in.
Creates and displays a popup-menu.
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
T end(T... args)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
#define jassertfalse
This will always cause an assertion failure.
JUCE Namespace.