|
|
|
@@ -22,7 +22,7 @@ |
|
|
|
==============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)
|
|
|
|
#if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS)
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
#if JUCE_MAC && JUCE_SUPPORT_CARBON
|
|
|
|
@@ -165,7 +165,7 @@ namespace |
|
|
|
{
|
|
|
|
#if JUCE_WINDOWS
|
|
|
|
return timeGetTime() * 1000000.0;
|
|
|
|
#elif JUCE_LINUX
|
|
|
|
#elif JUCE_LINUX || JUCE_IOS
|
|
|
|
timeval micro;
|
|
|
|
gettimeofday (µ, 0);
|
|
|
|
return micro.tv_usec * 1000.0;
|
|
|
|
@@ -378,7 +378,7 @@ public: |
|
|
|
{
|
|
|
|
getActiveModules().add (this);
|
|
|
|
|
|
|
|
#if JUCE_WINDOWS || JUCE_LINUX
|
|
|
|
#if JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS
|
|
|
|
fullParentDirectoryPathName = f.getParentDirectory().getFullPathName();
|
|
|
|
#elif JUCE_MAC
|
|
|
|
FSRef ref;
|
|
|
|
@@ -394,9 +394,12 @@ public: |
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
#if JUCE_WINDOWS || JUCE_LINUX
|
|
|
|
DynamicLibrary module;
|
|
|
|
#if ! JUCE_MAC
|
|
|
|
String fullParentDirectoryPathName;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if JUCE_WINDOWS || JUCE_LINUX
|
|
|
|
DynamicLibrary module;
|
|
|
|
|
|
|
|
bool open()
|
|
|
|
{
|
|
|
|
@@ -460,11 +463,14 @@ public: |
|
|
|
return String();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
Handle resHandle;
|
|
|
|
CFBundleRef bundleRef;
|
|
|
|
|
|
|
|
#if JUCE_MAC
|
|
|
|
CFBundleRefNum resFileId;
|
|
|
|
FSSpec parentDirFSSpec;
|
|
|
|
ResFileRefNum resFileId;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
bool open()
|
|
|
|
{
|
|
|
|
@@ -510,13 +516,18 @@ public: |
|
|
|
if (pluginName.isEmpty())
|
|
|
|
pluginName = file.getFileNameWithoutExtension();
|
|
|
|
|
|
|
|
#if JUCE_MAC
|
|
|
|
resFileId = CFBundleOpenBundleResourceMap (bundleRef);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ok = true;
|
|
|
|
|
|
|
|
Array<File> vstXmlFiles;
|
|
|
|
file.getChildFile ("Contents")
|
|
|
|
file
|
|
|
|
#if JUCE_MAC
|
|
|
|
.getChildFile ("Contents")
|
|
|
|
.getChildFile ("Resources")
|
|
|
|
#endif
|
|
|
|
.findChildFiles (vstXmlFiles, File::findFiles, false, "*.vstxml");
|
|
|
|
|
|
|
|
if (vstXmlFiles.size() > 0)
|
|
|
|
@@ -541,7 +552,9 @@ public: |
|
|
|
{
|
|
|
|
if (bundleRef != 0)
|
|
|
|
{
|
|
|
|
#if JUCE_MAC
|
|
|
|
CFBundleCloseBundleResourceMap (bundleRef, resFileId);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (CFGetRetainCount (bundleRef) == 1)
|
|
|
|
CFBundleUnloadExecutable (bundleRef);
|
|
|
|
@@ -556,7 +569,7 @@ public: |
|
|
|
eff->dispatcher (eff, effClose, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModuleHandle)
|
|
|
|
@@ -875,7 +888,12 @@ public: |
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
#if JUCE_IOS
|
|
|
|
bool hasEditor() const override { return false; }
|
|
|
|
#else
|
|
|
|
bool hasEditor() const override { return effect != nullptr && (effect->flags & effFlagsHasEditor) != 0; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
AudioProcessorEditor* createEditor() override;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
@@ -1806,6 +1824,7 @@ private: |
|
|
|
};
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
#if ! JUCE_IOS
|
|
|
|
class VSTPluginWindow;
|
|
|
|
static Array<VSTPluginWindow*> activeVSTWindows;
|
|
|
|
|
|
|
|
@@ -2544,7 +2563,7 @@ private: |
|
|
|
|
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginWindow)
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#if JUCE_MSVC
|
|
|
|
#pragma warning (pop)
|
|
|
|
#endif
|
|
|
|
@@ -2552,8 +2571,12 @@ private: |
|
|
|
//==============================================================================
|
|
|
|
AudioProcessorEditor* VSTPluginInstance::createEditor()
|
|
|
|
{
|
|
|
|
#if JUCE_IOS
|
|
|
|
return nullptr;
|
|
|
|
#else
|
|
|
|
return hasEditor() ? new VSTPluginWindow (*this)
|
|
|
|
: nullptr;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
@@ -2690,7 +2713,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti |
|
|
|
{
|
|
|
|
const File f (File::createFileWithoutCheckingPath (fileOrIdentifier));
|
|
|
|
|
|
|
|
#if JUCE_MAC
|
|
|
|
#if JUCE_MAC || JUCE_IOS
|
|
|
|
return f.isDirectory() && f.hasFileExtension (".vst");
|
|
|
|
#elif JUCE_WINDOWS
|
|
|
|
return f.existsAsFile() && f.hasFileExtension (".dll");
|
|
|
|
@@ -2765,6 +2788,19 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() |
|
|
|
paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath",
|
|
|
|
programFiles + "\\VstPlugins"));
|
|
|
|
return paths;
|
|
|
|
#elif JUCE_IOS
|
|
|
|
// on iOS you can only load plug-ins inside the hosts bundle folder
|
|
|
|
CFURLRef relativePluginDir = CFBundleCopyBuiltInPlugInsURL (CFBundleGetMainBundle());
|
|
|
|
CFURLRef pluginDir = CFURLCopyAbsoluteURL (relativePluginDir);
|
|
|
|
CFRelease (relativePluginDir);
|
|
|
|
|
|
|
|
CFStringRef path = CFURLCopyFileSystemPath (pluginDir, kCFURLPOSIXPathStyle);
|
|
|
|
CFRelease (pluginDir);
|
|
|
|
|
|
|
|
FileSearchPath retval (String (CFStringGetCStringPtr (path, kCFStringEncodingUTF8)));
|
|
|
|
CFRelease (path);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|