| @@ -124,7 +124,7 @@ public: | |||||
| bool isOSX() const override { return ! iOS; } | bool isOSX() const override { return ! iOS; } | ||||
| bool isiOS() const override { return iOS; } | bool isiOS() const override { return iOS; } | ||||
| bool supportsVST() const override { return true; } | |||||
| bool supportsVST() const override { return ! iOS; } | |||||
| bool supportsVST3() const override { return ! iOS; } | bool supportsVST3() const override { return ! iOS; } | ||||
| bool supportsAAX() const override { return ! iOS; } | bool supportsAAX() const override { return ! iOS; } | ||||
| bool supportsRTAS() const override { return ! iOS; } | bool supportsRTAS() const override { return ! iOS; } | ||||
| @@ -270,13 +270,11 @@ public: | |||||
| firstProcessCallback (true), | firstProcessCallback (true), | ||||
| shouldDeleteEditor (false), | shouldDeleteEditor (false), | ||||
| #if JUCE_64BIT | #if JUCE_64BIT | ||||
| useNSView (true) | |||||
| useNSView (true), | |||||
| #else | #else | ||||
| useNSView (false) | |||||
| #endif | |||||
| #if ! JUCE_IOS | |||||
| , hostWindow (0) | |||||
| useNSView (false), | |||||
| #endif | #endif | ||||
| hostWindow (0) | |||||
| { | { | ||||
| busUtils.init(); | busUtils.init(); | ||||
| @@ -343,9 +341,7 @@ public: | |||||
| delete filter; | delete filter; | ||||
| filter = nullptr; | filter = nullptr; | ||||
| #if ! JUCE_IOS | |||||
| jassert (editorComp == 0); | jassert (editorComp == 0); | ||||
| #endif | |||||
| deleteTempChannels(); | deleteTempChannels(); | ||||
| @@ -1347,7 +1343,6 @@ public: | |||||
| void createEditorComp() | void createEditorComp() | ||||
| { | { | ||||
| #if ! JUCE_IOS | |||||
| if (hasShutdown || filter == nullptr) | if (hasShutdown || filter == nullptr) | ||||
| return; | return; | ||||
| @@ -1366,16 +1361,12 @@ public: | |||||
| cEffect.flags &= ~effFlagsHasEditor; | cEffect.flags &= ~effFlagsHasEditor; | ||||
| } | } | ||||
| } | } | ||||
| #endif | |||||
| shouldDeleteEditor = false; | shouldDeleteEditor = false; | ||||
| } | } | ||||
| void deleteEditor (bool canDeleteLaterIfModal) | void deleteEditor (bool canDeleteLaterIfModal) | ||||
| { | { | ||||
| #if JUCE_IOS | |||||
| ignoreUnused (canDeleteLaterIfModal); | |||||
| #else | |||||
| JUCE_AUTORELEASEPOOL | JUCE_AUTORELEASEPOOL | ||||
| { | { | ||||
| PopupMenu::dismissAllActiveMenus(); | PopupMenu::dismissAllActiveMenus(); | ||||
| @@ -1417,7 +1408,6 @@ public: | |||||
| hostWindow = 0; | hostWindow = 0; | ||||
| #endif | #endif | ||||
| } | } | ||||
| #endif | |||||
| } | } | ||||
| VstIntPtr dispatcher (VstInt32 opCode, VstInt32 index, VstIntPtr value, void* ptr, float opt) override | VstIntPtr dispatcher (VstInt32 opCode, VstInt32 index, VstIntPtr value, void* ptr, float opt) override | ||||
| @@ -1425,7 +1415,6 @@ public: | |||||
| if (hasShutdown) | if (hasShutdown) | ||||
| return 0; | return 0; | ||||
| #if ! JUCE_IOS | |||||
| if (opCode == effEditIdle) | if (opCode == effEditIdle) | ||||
| { | { | ||||
| doIdleCallback(); | doIdleCallback(); | ||||
| @@ -1455,7 +1444,7 @@ public: | |||||
| hostWindow = (Window) ptr; | hostWindow = (Window) ptr; | ||||
| Window editorWnd = (Window) editorComp->getWindowHandle(); | Window editorWnd = (Window) editorComp->getWindowHandle(); | ||||
| XReparentWindow (display, editorWnd, hostWindow, 0, 0); | XReparentWindow (display, editorWnd, hostWindow, 0, 0); | ||||
| #elif JUCE_MAC | |||||
| #else | |||||
| hostWindow = attachComponentToWindowRefVST (editorComp, ptr, useNSView); | hostWindow = attachComponentToWindowRefVST (editorComp, ptr, useNSView); | ||||
| #endif | #endif | ||||
| editorComp->setVisible (true); | editorComp->setVisible (true); | ||||
| @@ -1490,11 +1479,10 @@ public: | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| #endif | |||||
| return AudioEffectX::dispatcher (opCode, index, value, ptr, opt); | return AudioEffectX::dispatcher (opCode, index, value, ptr, opt); | ||||
| } | } | ||||
| #if ! JUCE_IOS | |||||
| void resizeHostWindow (int newWidth, int newHeight) | void resizeHostWindow (int newWidth, int newHeight) | ||||
| { | { | ||||
| if (editorComp != nullptr) | if (editorComp != nullptr) | ||||
| @@ -1683,7 +1671,6 @@ public: | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EditorCompWrapper) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EditorCompWrapper) | ||||
| }; | }; | ||||
| #endif | |||||
| //============================================================================== | //============================================================================== | ||||
| private: | private: | ||||
| @@ -1691,10 +1678,8 @@ private: | |||||
| PluginBusUtilities busUtils; | PluginBusUtilities busUtils; | ||||
| juce::MemoryBlock chunkMemory; | juce::MemoryBlock chunkMemory; | ||||
| juce::uint32 chunkMemoryTime; | juce::uint32 chunkMemoryTime; | ||||
| #if ! JUCE_IOS | |||||
| ScopedPointer<EditorCompWrapper> editorComp; | ScopedPointer<EditorCompWrapper> editorComp; | ||||
| ERect editorSize; | ERect editorSize; | ||||
| #endif | |||||
| MidiBuffer midiEvents; | MidiBuffer midiEvents; | ||||
| VSTMidiEventList outgoingEvents; | VSTMidiEventList outgoingEvents; | ||||
| bool isProcessing, isBypassed, hasShutdown, isInSizeWindow, firstProcessCallback; | bool isProcessing, isBypassed, hasShutdown, isInSizeWindow, firstProcessCallback; | ||||
| @@ -1707,7 +1692,7 @@ private: | |||||
| void* hostWindow; | void* hostWindow; | ||||
| #elif JUCE_LINUX | #elif JUCE_LINUX | ||||
| Window hostWindow; | Window hostWindow; | ||||
| #elif JUCE_WINDOWS | |||||
| #else | |||||
| HWND hostWindow; | HWND hostWindow; | ||||
| #endif | #endif | ||||
| @@ -2001,17 +1986,14 @@ namespace | |||||
| //============================================================================== | //============================================================================== | ||||
| // Mac startup code.. | // Mac startup code.. | ||||
| #if JUCE_MAC || JUCE_IOS | |||||
| #if JUCE_MAC | |||||
| JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster); | JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster); | ||||
| JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster) | JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster) | ||||
| { | { | ||||
| PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_VST; | PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_VST; | ||||
| #if JUCE_MAC | |||||
| initialiseMacVST(); | initialiseMacVST(); | ||||
| #endif | |||||
| return pluginEntryPoint (audioMaster); | return pluginEntryPoint (audioMaster); | ||||
| } | } | ||||
| @@ -2020,10 +2002,7 @@ namespace | |||||
| { | { | ||||
| PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_VST; | PluginHostType::jucePlugInClientCurrentWrapperType = AudioProcessor::wrapperType_VST; | ||||
| #if JUCE_MAC | |||||
| initialiseMacVST(); | initialiseMacVST(); | ||||
| #endif | |||||
| return pluginEntryPoint (audioMaster); | return pluginEntryPoint (audioMaster); | ||||
| } | } | ||||
| @@ -65,7 +65,7 @@ void AudioPluginFormatManager::addDefaultFormats() | |||||
| // you should only call this method once! | // you should only call this method once! | ||||
| for (int i = formats.size(); --i >= 0;) | for (int i = formats.size(); --i >= 0;) | ||||
| { | { | ||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS) | |||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) | |||||
| jassert (dynamic_cast<VSTPluginFormat*> (formats[i]) == nullptr); | jassert (dynamic_cast<VSTPluginFormat*> (formats[i]) == nullptr); | ||||
| #endif | #endif | ||||
| @@ -87,7 +87,7 @@ void AudioPluginFormatManager::addDefaultFormats() | |||||
| formats.add (new AudioUnitPluginFormat()); | formats.add (new AudioUnitPluginFormat()); | ||||
| #endif | #endif | ||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS) | |||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) | |||||
| formats.add (new VSTPluginFormat()); | formats.add (new VSTPluginFormat()); | ||||
| #endif | #endif | ||||
| @@ -22,7 +22,7 @@ | |||||
| ============================================================================== | ============================================================================== | ||||
| */ | */ | ||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS) | |||||
| #if JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) | |||||
| //============================================================================== | //============================================================================== | ||||
| #if JUCE_MAC && JUCE_SUPPORT_CARBON | #if JUCE_MAC && JUCE_SUPPORT_CARBON | ||||
| @@ -165,7 +165,7 @@ namespace | |||||
| { | { | ||||
| #if JUCE_WINDOWS | #if JUCE_WINDOWS | ||||
| return timeGetTime() * 1000000.0; | return timeGetTime() * 1000000.0; | ||||
| #elif JUCE_LINUX || JUCE_IOS | |||||
| #elif JUCE_LINUX | |||||
| timeval micro; | timeval micro; | ||||
| gettimeofday (µ, 0); | gettimeofday (µ, 0); | ||||
| return micro.tv_usec * 1000.0; | return micro.tv_usec * 1000.0; | ||||
| @@ -378,7 +378,7 @@ public: | |||||
| { | { | ||||
| getActiveModules().add (this); | getActiveModules().add (this); | ||||
| #if JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS | |||||
| #if JUCE_WINDOWS || JUCE_LINUX | |||||
| fullParentDirectoryPathName = f.getParentDirectory().getFullPathName(); | fullParentDirectoryPathName = f.getParentDirectory().getFullPathName(); | ||||
| #elif JUCE_MAC | #elif JUCE_MAC | ||||
| FSRef ref; | FSRef ref; | ||||
| @@ -394,12 +394,9 @@ public: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| #if ! JUCE_MAC | |||||
| String fullParentDirectoryPathName; | |||||
| #endif | |||||
| #if JUCE_WINDOWS || JUCE_LINUX | |||||
| #if JUCE_WINDOWS || JUCE_LINUX | |||||
| DynamicLibrary module; | DynamicLibrary module; | ||||
| String fullParentDirectoryPathName; | |||||
| bool open() | bool open() | ||||
| { | { | ||||
| @@ -463,14 +460,11 @@ public: | |||||
| return String(); | return String(); | ||||
| } | } | ||||
| #endif | #endif | ||||
| #else | |||||
| #else | |||||
| Handle resHandle; | Handle resHandle; | ||||
| CFBundleRef bundleRef; | CFBundleRef bundleRef; | ||||
| #if JUCE_MAC | |||||
| CFBundleRefNum resFileId; | |||||
| FSSpec parentDirFSSpec; | FSSpec parentDirFSSpec; | ||||
| #endif | |||||
| ResFileRefNum resFileId; | |||||
| bool open() | bool open() | ||||
| { | { | ||||
| @@ -516,18 +510,13 @@ public: | |||||
| if (pluginName.isEmpty()) | if (pluginName.isEmpty()) | ||||
| pluginName = file.getFileNameWithoutExtension(); | pluginName = file.getFileNameWithoutExtension(); | ||||
| #if JUCE_MAC | |||||
| resFileId = CFBundleOpenBundleResourceMap (bundleRef); | resFileId = CFBundleOpenBundleResourceMap (bundleRef); | ||||
| #endif | |||||
| ok = true; | ok = true; | ||||
| Array<File> vstXmlFiles; | Array<File> vstXmlFiles; | ||||
| file | |||||
| #if JUCE_MAC | |||||
| .getChildFile ("Contents") | |||||
| file.getChildFile ("Contents") | |||||
| .getChildFile ("Resources") | .getChildFile ("Resources") | ||||
| #endif | |||||
| .findChildFiles (vstXmlFiles, File::findFiles, false, "*.vstxml"); | .findChildFiles (vstXmlFiles, File::findFiles, false, "*.vstxml"); | ||||
| if (vstXmlFiles.size() > 0) | if (vstXmlFiles.size() > 0) | ||||
| @@ -552,9 +541,7 @@ public: | |||||
| { | { | ||||
| if (bundleRef != 0) | if (bundleRef != 0) | ||||
| { | { | ||||
| #if JUCE_MAC | |||||
| CFBundleCloseBundleResourceMap (bundleRef, resFileId); | CFBundleCloseBundleResourceMap (bundleRef, resFileId); | ||||
| #endif | |||||
| if (CFGetRetainCount (bundleRef) == 1) | if (CFGetRetainCount (bundleRef) == 1) | ||||
| CFBundleUnloadExecutable (bundleRef); | CFBundleUnloadExecutable (bundleRef); | ||||
| @@ -569,7 +556,7 @@ public: | |||||
| eff->dispatcher (eff, effClose, 0, 0, 0, 0); | eff->dispatcher (eff, effClose, 0, 0, 0, 0); | ||||
| } | } | ||||
| #endif | |||||
| #endif | |||||
| private: | private: | ||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModuleHandle) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModuleHandle) | ||||
| @@ -888,12 +875,7 @@ public: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| #if JUCE_IOS | |||||
| bool hasEditor() const override { return false; } | |||||
| #else | |||||
| bool hasEditor() const override { return effect != nullptr && (effect->flags & effFlagsHasEditor) != 0; } | bool hasEditor() const override { return effect != nullptr && (effect->flags & effFlagsHasEditor) != 0; } | ||||
| #endif | |||||
| AudioProcessorEditor* createEditor() override; | AudioProcessorEditor* createEditor() override; | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -1824,7 +1806,6 @@ private: | |||||
| }; | }; | ||||
| //============================================================================== | //============================================================================== | ||||
| #if ! JUCE_IOS | |||||
| class VSTPluginWindow; | class VSTPluginWindow; | ||||
| static Array<VSTPluginWindow*> activeVSTWindows; | static Array<VSTPluginWindow*> activeVSTWindows; | ||||
| @@ -2563,7 +2544,7 @@ private: | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginWindow) | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginWindow) | ||||
| }; | }; | ||||
| #endif | |||||
| #if JUCE_MSVC | #if JUCE_MSVC | ||||
| #pragma warning (pop) | #pragma warning (pop) | ||||
| #endif | #endif | ||||
| @@ -2571,12 +2552,8 @@ private: | |||||
| //============================================================================== | //============================================================================== | ||||
| AudioProcessorEditor* VSTPluginInstance::createEditor() | AudioProcessorEditor* VSTPluginInstance::createEditor() | ||||
| { | { | ||||
| #if JUCE_IOS | |||||
| return nullptr; | |||||
| #else | |||||
| return hasEditor() ? new VSTPluginWindow (*this) | return hasEditor() ? new VSTPluginWindow (*this) | ||||
| : nullptr; | : nullptr; | ||||
| #endif | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -2713,7 +2690,7 @@ bool VSTPluginFormat::fileMightContainThisPluginType (const String& fileOrIdenti | |||||
| { | { | ||||
| const File f (File::createFileWithoutCheckingPath (fileOrIdentifier)); | const File f (File::createFileWithoutCheckingPath (fileOrIdentifier)); | ||||
| #if JUCE_MAC || JUCE_IOS | |||||
| #if JUCE_MAC | |||||
| return f.isDirectory() && f.hasFileExtension (".vst"); | return f.isDirectory() && f.hasFileExtension (".vst"); | ||||
| #elif JUCE_WINDOWS | #elif JUCE_WINDOWS | ||||
| return f.existsAsFile() && f.hasFileExtension (".dll"); | return f.existsAsFile() && f.hasFileExtension (".dll"); | ||||
| @@ -2788,19 +2765,6 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() | |||||
| paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath", | paths.add (WindowsRegistry::getValue ("HKEY_LOCAL_MACHINE\\Software\\VST\\VSTPluginsPath", | ||||
| programFiles + "\\VstPlugins")); | programFiles + "\\VstPlugins")); | ||||
| return paths; | 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 | #endif | ||||
| } | } | ||||
| @@ -22,7 +22,7 @@ | |||||
| ============================================================================== | ============================================================================== | ||||
| */ | */ | ||||
| #if (JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_IOS)) || DOXYGEN | |||||
| #if (JUCE_PLUGINHOST_VST && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) || DOXYGEN | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| @@ -348,10 +348,8 @@ public: | |||||
| if (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format. | if (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format. | ||||
| { | { | ||||
| #if ! JUCE_IOS | |||||
| if (propertiesToUse != nullptr) | if (propertiesToUse != nullptr) | ||||
| path = getLastSearchPath (*propertiesToUse, formatToScan); | path = getLastSearchPath (*propertiesToUse, formatToScan); | ||||
| #endif | |||||
| pathList.setSize (500, 300); | pathList.setSize (500, 300); | ||||
| pathList.setPath (path); | pathList.setPath (path); | ||||