openshot-audio  0.1.6
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) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_KNOWNPLUGINLIST_H_INCLUDED
26 #define JUCE_KNOWNPLUGINLIST_H_INCLUDED
27 
28 
29 //==============================================================================
39 {
40 public:
41  //==============================================================================
44 
46  ~KnownPluginList();
47 
48  //==============================================================================
50  void clear();
51 
55  int getNumTypes() const noexcept { return types.size(); }
56 
60  PluginDescription* getType (int index) const noexcept { return types [index]; }
61 
63  PluginDescription** begin() const noexcept { return types.begin(); }
65  PluginDescription** end() const noexcept { return types.end(); }
66 
68  PluginDescription* getTypeForFile (const String& fileOrIdentifier) const;
69 
75  PluginDescription* getTypeForIdentifierString (const String& identifierString) const;
76 
78  bool addType (const PluginDescription& type);
79 
81  void removeType (int index);
82 
95  bool scanAndAddFile (const String& possiblePluginFileOrIdentifier,
96  bool dontRescanIfAlreadyInList,
98  AudioPluginFormat& formatToUse);
99 
101  void scanFinished();
102 
106  bool isListingUpToDate (const String& possiblePluginFileOrIdentifier,
107  AudioPluginFormat& formatToUse) const;
108 
112  void scanAndAddDragAndDroppedFiles (AudioPluginFormatManager& formatManager,
113  const StringArray& filenames,
114  OwnedArray <PluginDescription>& typesFound);
115 
116  //==============================================================================
118  const StringArray& getBlacklistedFiles() const;
119 
121  void addToBlacklist (const String& pluginID);
122 
124  void removeFromBlacklist (const String& pluginID);
125 
127  void clearBlacklistedFiles();
128 
129  //==============================================================================
133  {
134  defaultOrder = 0,
139  sortByFileSystemLocation
140  };
141 
142  //==============================================================================
150  void addToMenu (PopupMenu& menu, SortMethod sortMethod) const;
151 
156  int getIndexChosenByMenu (int menuResultCode) const;
157 
158  //==============================================================================
160  void sort (SortMethod method, bool forwards);
161 
162  //==============================================================================
164  XmlElement* createXml() const;
165 
167  void recreateFromXml (const XmlElement& xml);
168 
169  //==============================================================================
173  struct PluginTree
174  {
178  };
179 
181  PluginTree* createTree (const SortMethod sortMethod) const;
182 
183  //==============================================================================
185  {
186  public:
187  CustomScanner();
188  virtual ~CustomScanner();
189 
193  virtual bool findPluginTypesFor (AudioPluginFormat& format,
195  const String& fileOrIdentifier) = 0;
196 
198  virtual void scanFinished();
199 
204  bool shouldExit() const noexcept;
205  };
206 
210  void setCustomScanner (CustomScanner*);
211 
212 private:
213  //==============================================================================
215  StringArray blacklist;
217  CriticalSection scanLock;
218 
220 };
221 
222 
223 #endif // JUCE_KNOWNPLUGINLIST_H_INCLUDED
Definition: juce_KnownPluginList.h:137
Definition: juce_KnownPluginList.h:38
Definition: juce_PopupMenu.h:77
Definition: juce_AudioPluginFormat.h:35
#define noexcept
Definition: juce_CompilerSupport.h:141
PluginDescription * getType(int index) const noexcept
Definition: juce_KnownPluginList.h:60
Definition: juce_KnownPluginList.h:135
Definition: juce_KnownPluginList.h:184
Definition: juce_String.h:43
Definition: juce_KnownPluginList.h:136
Definition: juce_AudioPluginFormatManager.h:35
Definition: juce_ChangeBroadcaster.h:35
Array< const PluginDescription * > plugins
Definition: juce_KnownPluginList.h:177
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
Definition: juce_CriticalSection.h:47
Definition: juce_XmlElement.h:142
PluginDescription ** end() const noexcept
Definition: juce_KnownPluginList.h:65
int getNumTypes() const noexcept
Definition: juce_KnownPluginList.h:55
Definition: juce_PluginDescription.h:40
Definition: juce_ScopedPointer.h:70
OwnedArray< PluginTree > subFolders
Definition: juce_KnownPluginList.h:176
Definition: juce_StringArray.h:39
Definition: juce_Array.h:60
Definition: juce_KnownPluginList.h:138
Definition: juce_KnownPluginList.h:173
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
PluginDescription ** begin() const noexcept
Definition: juce_KnownPluginList.h:63
String folder
Definition: juce_KnownPluginList.h:175
SortMethod
Definition: juce_KnownPluginList.h:132