2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_AUDIOPLUGINFORMATMANAGER_JUCEHEADER__
27 #define __JUCE_AUDIOPLUGINFORMATMANAGER_JUCEHEADER__
29 #include "juce_AudioPluginFormat.h"
30 #include "../../utilities/juce_DeletedAtShutdown.h"
31 #include "../../core/juce_Singleton.h"
34 //==============================================================================
36 This maintains a list of known AudioPluginFormats.
38 @see AudioPluginFormat
40 class JUCE_API AudioPluginFormatManager
: public DeletedAtShutdown
43 //==============================================================================
44 AudioPluginFormatManager();
47 ~AudioPluginFormatManager();
49 juce_DeclareSingleton_SingleThreaded (AudioPluginFormatManager
, false);
51 //==============================================================================
52 /** Adds any formats that it knows about, e.g. VST.
54 void addDefaultFormats();
56 //==============================================================================
57 /** Returns the number of types of format that are available.
59 Use getFormat() to get one of them.
63 /** Returns one of the available formats.
67 AudioPluginFormat
* getFormat (int index
);
69 //==============================================================================
70 /** Adds a format to the list.
72 The object passed in will be owned and deleted by the manager.
74 void addFormat (AudioPluginFormat
* format
);
77 //==============================================================================
78 /** Tries to load the type for this description, by trying all the formats
79 that this manager knows about.
81 The caller is responsible for deleting the object that is returned.
83 If it can't load the plugin, it returns 0 and leaves a message in the
86 AudioPluginInstance
* createPluginInstance (const PluginDescription
& description
,
87 String
& errorMessage
) const;
89 /** Checks that the file or component for this plugin actually still exists.
91 (This won't try to load the plugin)
93 bool doesPluginStillExist (const PluginDescription
& description
) const;
96 //==============================================================================
97 OwnedArray
<AudioPluginFormat
> formats
;
99 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormatManager
);
104 #endif // __JUCE_AUDIOPLUGINFORMATMANAGER_JUCEHEADER__