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_VSTPluginFormat.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
26#if (JUCE_PLUGINHOST_VST || DOXYGEN)
27
28namespace juce
29{
30
31//==============================================================================
37class JUCE_API VSTPluginFormat : public AudioPluginFormat
38{
39public:
40 //==============================================================================
42 ~VSTPluginFormat() override;
43
44 //==============================================================================
48 static const XmlElement* getVSTXML (AudioPluginInstance* plugin);
49
51 static bool loadFromFXBFile (AudioPluginInstance* plugin, const void* data, size_t dataSize);
52
54 static bool saveToFXBFile (AudioPluginInstance* plugin, MemoryBlock& result, bool asFXB);
55
57 static bool getChunkData (AudioPluginInstance* plugin, MemoryBlock& result, bool isPreset);
58
60 static bool setChunkData (AudioPluginInstance* plugin, const void* data, int size, bool isPreset);
61
65 static AudioPluginInstance* createCustomVSTFromMainCall (void* entryPointFunction,
66 double initialSampleRate,
67 int initialBufferSize);
68
69 //==============================================================================
72 {
73 public:
74 virtual ~ExtraFunctions() {}
75
77 virtual int64 getTempoAt (int64 samplePos) = 0;
78
82 virtual int getAutomationState() = 0;
83 };
84
88 static void setExtraFunctions (AudioPluginInstance* plugin, ExtraFunctions* functions);
89
90 //==============================================================================
93
98
99 //==============================================================================
100 static String getFormatName() { return "VST"; }
101 String getName() const override { return getFormatName(); }
102 bool canScanForPlugins() const override { return true; }
103 bool isTrivialToScan() const override { return false; }
104
105 void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
106 bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
107 String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;
109 StringArray searchPathsForPlugins (const FileSearchPath&, bool recursive, bool) override;
112
119
120private:
121 //==============================================================================
122 void createPluginInstance (const PluginDescription&, double initialSampleRate,
123 int initialBufferSize, PluginCreationCallback) override;
124 bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const override;
125 void recursiveFileSearch (StringArray&, const File&, bool recursive);
126
128};
129
130} // namespace juce
131
132#endif
The base class for a type of plugin format, such as VST, AudioUnit, LADSPA, etc.
Base class for an active instance of a plugin.
Represents a set of folders that make up a search path.
Represents a local file or directory.
Definition juce_File.h:45
A class to hold a resizable block of raw data.
An array designed for holding objects.
A small class to represent some facts about a particular type of plug-in.
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
Base class for some extra functions that can be attached to a VST plugin instance.
virtual int64 getTempoAt(int64 samplePos)=0
This should return 10000 * the BPM at this position in the current edit.
virtual int getAutomationState()=0
This should return the host's automation state.
Implements a plugin format manager for VSTs.
static AudioPluginInstance * getPluginInstanceFromVstEffectInterface(void *aEffect)
Given a VstEffectInterface* (aka vst::AEffect*), this will return the juce AudioPluginInstance that i...
bool canScanForPlugins() const override
Returns true if this format needs to run a scan to find its list of plugins.
String getName() const override
Returns the format name.
bool fileMightContainThisPluginType(const String &fileOrIdentifier) override
Should do a quick check to see if this file or directory might be a plugin of this format.
bool doesPluginStillExist(const PluginDescription &) override
Checks whether this plugin could possibly be loaded.
static bool getChunkData(AudioPluginInstance *plugin, MemoryBlock &result, bool isPreset)
Attempts to get a VST's state as a chunk of memory.
static const XmlElement * getVSTXML(AudioPluginInstance *plugin)
Attempts to retrieve the VSTXML data from a plugin.
StringArray searchPathsForPlugins(const FileSearchPath &, bool recursive, bool) override
Searches a suggested set of directories for any plugins in this format.
static pointer_sized_int JUCE_CALLTYPE dispatcher(AudioPluginInstance *, int32, int32, pointer_sized_int, void *, float)
This simply calls directly to the VST's AEffect::dispatcher() function.
static bool setChunkData(AudioPluginInstance *plugin, const void *data, int size, bool isPreset)
Attempts to set a VST's state from a chunk of memory.
String getNameOfPluginFromIdentifier(const String &fileOrIdentifier) override
Returns a readable version of the name of the plugin that this identifier refers to.
static AudioPluginInstance * createCustomVSTFromMainCall(void *entryPointFunction, double initialSampleRate, int initialBufferSize)
Given a suitable function pointer to a VSTPluginMain function, this will attempt to instantiate and r...
void findAllTypesForFile(OwnedArray< PluginDescription > &, const String &fileOrIdentifier) override
This tries to create descriptions for all the plugin types available in a binary module file.
static void setExtraFunctions(AudioPluginInstance *plugin, ExtraFunctions *functions)
Provides an ExtraFunctions callback object for a plugin to use.
bool pluginNeedsRescanning(const PluginDescription &) override
Returns true if this plugin's version or date has changed and it should be re-checked.
static bool saveToFXBFile(AudioPluginInstance *plugin, MemoryBlock &result, bool asFXB)
Attempts to save a VST's state to some FXP or FXB data.
static bool loadFromFXBFile(AudioPluginInstance *plugin, const void *data, size_t dataSize)
Attempts to reload a VST plugin's state from some FXB or FXP data.
bool isTrivialToScan() const override
Should return true if this format is both safe and quick to scan - i.e.
virtual void aboutToScanVSTShellPlugin(const PluginDescription &)
Can be overridden to receive a callback when each member of a shell plugin is about to be tested duri...
FileSearchPath getDefaultLocationsToSearch() override
Returns the typical places to look for this kind of plugin.
Used to build a tree of elements representing an XML document.
#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 JUCE_CALLTYPE
This macro defines the C calling convention used as the standard for JUCE calls.
JUCE Namespace.
int pointer_sized_int
A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it.
signed int int32
A platform-independent 32-bit signed integer type.
long long int64
A platform-independent 64-bit integer type.