@@ -54,12 +54,6 @@ | |||||
using juce::Component; | using juce::Component; | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it return a new instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
//============================================================================== | //============================================================================== | ||||
struct AAXClasses | struct AAXClasses | ||||
{ | { | ||||
@@ -362,10 +356,7 @@ struct AAXClasses | |||||
public: | public: | ||||
JuceAAX_Parameters() | JuceAAX_Parameters() | ||||
{ | { | ||||
pluginInstance = createPluginFilter(); | |||||
jassert (pluginInstance != nullptr); // your createPluginFilter() method must return an object! | |||||
pluginInstance->wrapperType = AudioProcessor::wrapperType_AAX; | |||||
pluginInstance = createPluginFilterOfType (AudioProcessor::wrapperType_AAX); | |||||
} | } | ||||
static AAX_CEffectParameters* AAX_CALLBACK Create() { return new JuceAAX_Parameters(); } | static AAX_CEffectParameters* AAX_CALLBACK Create() { return new JuceAAX_Parameters(); } | ||||
@@ -108,12 +108,6 @@ static const int numChannelConfigs = sizeof (channelConfigs) / sizeof (*channelC | |||||
#define JUCE_STATE_DICTIONARY_KEY CFSTR("jucePluginState") | #define JUCE_STATE_DICTIONARY_KEY CFSTR("jucePluginState") | ||||
#endif | #endif | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it create an instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
//============================================================================== | //============================================================================== | ||||
class JuceAU : public JuceAUBaseClass, | class JuceAU : public JuceAUBaseClass, | ||||
public AudioProcessorListener, | public AudioProcessorListener, | ||||
@@ -140,10 +134,7 @@ public: | |||||
initialiseJuce_GUI(); | initialiseJuce_GUI(); | ||||
} | } | ||||
juceFilter = createPluginFilter(); | |||||
jassert (juceFilter != nullptr); // your createPluginFilter() method must return an object! | |||||
juceFilter->wrapperType = AudioProcessor::wrapperType_AudioUnit; | |||||
juceFilter = createPluginFilterOfType (AudioProcessor::wrapperType_AudioUnit); | |||||
juceFilter->setPlayHead (this); | juceFilter->setPlayHead (this); | ||||
juceFilter->addListener (this); | juceFilter->addListener (this); | ||||
@@ -133,15 +133,8 @@ const int midiBufferSize = 1024; | |||||
const OSType juceChunkType = 'juce'; | const OSType juceChunkType = 'juce'; | ||||
static const int bypassControlIndex = 1; | static const int bypassControlIndex = 1; | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it return a new instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
static int numInstances = 0; | static int numInstances = 0; | ||||
//============================================================================== | //============================================================================== | ||||
class JucePlugInProcess : public CEffectProcessMIDI, | class JucePlugInProcess : public CEffectProcessMIDI, | ||||
public CEffectProcessRTAS, | public CEffectProcessRTAS, | ||||
@@ -155,10 +148,7 @@ public: | |||||
sampleRate (44100.0) | sampleRate (44100.0) | ||||
{ | { | ||||
asyncUpdater = new InternalAsyncUpdater (*this); | asyncUpdater = new InternalAsyncUpdater (*this); | ||||
juceFilter = createPluginFilter(); | |||||
jassert (juceFilter != nullptr); // your createPluginFilter() method must return an object! | |||||
juceFilter->wrapperType = AudioProcessor::wrapperType_RTAS; | |||||
juceFilter = createPluginFilterOfType (AudioProcessor::wrapperType_RTAS); | |||||
AddChunk (juceChunkType, "Juce Audio Plugin Data"); | AddChunk (juceChunkType, "Juce Audio Plugin Data"); | ||||
@@ -26,13 +26,7 @@ | |||||
#ifndef __JUCE_STANDALONEFILTERWINDOW_JUCEHEADER__ | #ifndef __JUCE_STANDALONEFILTERWINDOW_JUCEHEADER__ | ||||
#define __JUCE_STANDALONEFILTERWINDOW_JUCEHEADER__ | #define __JUCE_STANDALONEFILTERWINDOW_JUCEHEADER__ | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it create an instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType); | |||||
//============================================================================== | //============================================================================== | ||||
/** | /** | ||||
@@ -67,7 +61,7 @@ public: | |||||
JUCE_TRY | JUCE_TRY | ||||
{ | { | ||||
filter = createPluginFilter(); | |||||
filter = createPluginFilterOfType (AudioProcessor::wrapperType_Standalone); | |||||
} | } | ||||
JUCE_CATCH_ALL | JUCE_CATCH_ALL | ||||
@@ -77,8 +71,6 @@ public: | |||||
JUCEApplication::quit(); | JUCEApplication::quit(); | ||||
} | } | ||||
filter->wrapperType = AudioProcessor::wrapperType_Standalone; | |||||
filter->setPlayConfigDetails (JucePlugin_MaxNumInputChannels, | filter->setPlayConfigDetails (JucePlugin_MaxNumInputChannels, | ||||
JucePlugin_MaxNumOutputChannels, | JucePlugin_MaxNumOutputChannels, | ||||
44100, 512); | 44100, 512); | ||||
@@ -163,7 +155,7 @@ public: | |||||
{ | { | ||||
deleteFilter(); | deleteFilter(); | ||||
filter = createPluginFilter(); | |||||
filter = createPluginFilterOfType (AudioProcessor::wrapperType_Standalone); | |||||
if (filter != nullptr) | if (filter != nullptr) | ||||
{ | { | ||||
@@ -1450,13 +1450,6 @@ private: | |||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceVSTWrapper) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceVSTWrapper) | ||||
}; | }; | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it create an instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
//============================================================================== | //============================================================================== | ||||
namespace | namespace | ||||
{ | { | ||||
@@ -1473,17 +1466,9 @@ namespace | |||||
MessageManagerLock mmLock; | MessageManagerLock mmLock; | ||||
#endif | #endif | ||||
if (AudioProcessor* const filter = createPluginFilter()) | |||||
{ | |||||
filter->wrapperType = AudioProcessor::wrapperType_VST; | |||||
JuceVSTWrapper* const wrapper = new JuceVSTWrapper (audioMaster, filter); | |||||
return wrapper->getAeffect(); | |||||
} | |||||
else | |||||
{ | |||||
jassertfalse; // your createPluginFilter() method must return an object! | |||||
} | |||||
AudioProcessor* const filter = createPluginFilterOfType (AudioProcessor::wrapperType_VST); | |||||
JuceVSTWrapper* const wrapper = new JuceVSTWrapper (audioMaster, filter); | |||||
return wrapper->getAeffect(); | |||||
} | } | ||||
} | } | ||||
catch (...) | catch (...) | ||||
@@ -31,3 +31,5 @@ using namespace juce; | |||||
#define Point juce::Point | #define Point juce::Point | ||||
#define Component juce::Component | #define Component juce::Component | ||||
#endif | #endif | ||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType); |
@@ -24,7 +24,8 @@ | |||||
*/ | */ | ||||
#if _MSC_VER | #if _MSC_VER | ||||
#include <windows.h> | |||||
#include <windows.h> | |||||
#endif | |||||
// Your project must contain an AppConfig.h file with your project-specific settings in it, | // Your project must contain an AppConfig.h file with your project-specific settings in it, | ||||
// and your header search path must make it accessible to the module's files. | // and your header search path must make it accessible to the module's files. | ||||
@@ -33,6 +34,8 @@ | |||||
#include "../utility/juce_CheckSettingMacros.h" | #include "../utility/juce_CheckSettingMacros.h" | ||||
#include "juce_IncludeModuleHeaders.h" | #include "juce_IncludeModuleHeaders.h" | ||||
#if _MSC_VER | |||||
#if JucePlugin_Build_RTAS | #if JucePlugin_Build_RTAS | ||||
extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID); | extern "C" BOOL WINAPI DllMainRTAS (HINSTANCE, DWORD, LPVOID); | ||||
#endif | #endif | ||||
@@ -57,3 +60,21 @@ extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserve | |||||
} | } | ||||
#endif | #endif | ||||
//============================================================================== | |||||
/** Somewhere in the codebase of your plugin, you need to implement this function | |||||
and make it return a new instance of the filter subclass that you're building. | |||||
*/ | |||||
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||||
AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type) | |||||
{ | |||||
AudioProcessor::setTypeOfNextNewPlugin (type); | |||||
AudioProcessor* const pluginInstance = createPluginFilter(); | |||||
AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined); | |||||
// your createPluginFilter() method must return an object! | |||||
jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type); | |||||
return pluginInstance; | |||||
} |
@@ -1573,7 +1573,7 @@ bool AudioUnitPluginFormat::fileMightContainThisPluginType (const String& fileOr | |||||
if (AudioUnitFormatHelpers::getComponentDescFromIdentifier (fileOrIdentifier, desc, name, version, manufacturer)) | if (AudioUnitFormatHelpers::getComponentDescFromIdentifier (fileOrIdentifier, desc, name, version, manufacturer)) | ||||
return FindNextComponent (0, &desc) != 0; | return FindNextComponent (0, &desc) != 0; | ||||
const File f (fileOrIdentifier); | |||||
const File f (File::createFileWithoutCheckingPath (fileOrIdentifier)); | |||||
return f.hasFileExtension (".component") | return f.hasFileExtension (".component") | ||||
&& f.isDirectory(); | && f.isDirectory(); | ||||
@@ -23,8 +23,15 @@ | |||||
============================================================================== | ============================================================================== | ||||
*/ | */ | ||||
static ThreadLocalValue<AudioProcessor::WrapperType> wrapperTypeBeingCreated; | |||||
void AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::WrapperType type) | |||||
{ | |||||
wrapperTypeBeingCreated = type; | |||||
} | |||||
AudioProcessor::AudioProcessor() | AudioProcessor::AudioProcessor() | ||||
: wrapperType (wrapperType_Undefined), | |||||
: wrapperType (wrapperTypeBeingCreated.get()), | |||||
playHead (nullptr), | playHead (nullptr), | ||||
sampleRate (0), | sampleRate (0), | ||||
blockSize (0), | blockSize (0), | ||||
@@ -592,6 +592,9 @@ public: | |||||
*/ | */ | ||||
WrapperType wrapperType; | WrapperType wrapperType; | ||||
/** @internal */ | |||||
static void setTypeOfNextNewPlugin (WrapperType); | |||||
protected: | protected: | ||||
//============================================================================== | //============================================================================== | ||||
/** Helper function that just converts an xml element into a binary blob. | /** Helper function that just converts an xml element into a binary blob. | ||||