From 3a97797f35cffe43b3236d5f6388772d126c4fb4 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 28 Oct 2014 16:22:06 +0000 Subject: [PATCH 01/12] Added Fruityloop bridge recognition to PluginHostType --- modules/juce_audio_plugin_client/utility/juce_PluginHostType.h | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h b/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h index c321fc1162..e304c1ed17 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h +++ b/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h @@ -219,6 +219,7 @@ private: if (hostFilename.containsIgnoreCase ("TestHost")) return SteinbergTestHost; if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric; if (hostFilename.startsWith ("FL")) return FruityLoops; + if (hostFilename.contains ("ilbridge.")) return FruityLoops; if (hostPath.containsIgnoreCase ("Studio One")) return StudioOne; if (hostPath.containsIgnoreCase ("Digital Performer")) return DigitalPerformer; if (hostFilename.containsIgnoreCase ("VST_Scanner")) return VBVSTScanner; From 506ed2663f28ca7bca74b3f1b96e174e6361d463 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 29 Oct 2014 14:47:31 +0000 Subject: [PATCH 02/12] Workaround for old versions of Xcode. --- modules/juce_gui_basics/native/juce_mac_FileChooser.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 5a1e25e812..90004c1c0e 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -172,7 +172,7 @@ void FileChooser::showPlatformDialog (Array& results, [panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]]; [panel setNameFieldStringValue: juceStringToNS (filename)]; - if ([panel runModal] == NSModalResponseOK) + if ([panel runModal] == 1 /*NSModalResponseOK*/) #else if ([panel runModalForDirectory: juceStringToNS (directory) file: juceStringToNS (filename)] == NSModalResponseOK) From 783c5ed7f8ed44d3c6840ce2e04de1ae5482dc95 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 31 Oct 2014 11:52:53 +0000 Subject: [PATCH 03/12] Made SynthesiserVoice::isPlayingChannel virtual. --- .../synthesisers/juce_Synthesiser.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index 3c20a85302..19bb7a4f1c 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -191,17 +191,17 @@ public: */ virtual void setCurrentPlaybackSampleRate (double newRate); - /** Returns the current target sample rate at which rendering is being done. - Subclasses may need to know this so that they can pitch things correctly. - */ - double getSampleRate() const noexcept { return currentSampleRate; } - /** Returns true if the voice is currently playing a sound which is mapped to the given midi channel. If it's not currently playing, this will return false. */ - bool isPlayingChannel (int midiChannel) const; + virtual bool isPlayingChannel (int midiChannel) const; + + /** Returns the current target sample rate at which rendering is being done. + Subclasses may need to know this so that they can pitch things correctly. + */ + double getSampleRate() const noexcept { return currentSampleRate; } /** Returns true if the key that triggered this voice is still held down. Note that the voice may still be playing after the key was released (e.g because the From b51cc387183ea0def065bffc63861594de1e05c9 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 31 Oct 2014 13:02:41 +0000 Subject: [PATCH 04/12] Added a missing semicolon in ALSA --- modules/juce_audio_devices/native/juce_linux_ALSA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index 091ffbab54..fbb4010088 100644 --- a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -30,7 +30,7 @@ namespace #endif #if JUCE_ALSA_LOGGING - #define JUCE_ALSA_LOG(dbgtext) { juce::String tempDbgBuf ("ALSA: "); tempDbgBuf << dbgtext; Logger::writeToLog (tempDbgBuf); DBG (tempDbgBuf) } + #define JUCE_ALSA_LOG(dbgtext) { juce::String tempDbgBuf ("ALSA: "); tempDbgBuf << dbgtext; Logger::writeToLog (tempDbgBuf); DBG (tempDbgBuf); } #define JUCE_CHECKED_RESULT(x) (logErrorMessage (x, __LINE__)) static int logErrorMessage (int err, int lineNum) From 898080d1875ced22fcbb9bd8fe355c9afec6abef Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 31 Oct 2014 16:16:44 +0000 Subject: [PATCH 05/12] Fix for ListBox::getRowNumberOfComponent --- .../juce_gui_basics/widgets/juce_ListBox.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index 47f7f4c657..5364a0d098 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -174,7 +174,7 @@ public: int getRowNumberOfComponent (Component* const rowComponent) const noexcept { - const int index = getIndexOfChildComponent (rowComponent); + const int index = getViewedComponent()->getIndexOfChildComponent (rowComponent); const int num = rows.size(); for (int i = num; --i >= 0;) @@ -196,15 +196,16 @@ public: { hasUpdated = false; - const int newX = getViewedComponent()->getX(); - int newY = getViewedComponent()->getY(); + Component& content = *getViewedComponent(); + const int newX = content.getX(); + int newY = content.getY(); const int newW = jmax (owner.minimumRowWidth, getMaximumVisibleWidth()); const int newH = owner.totalItems * owner.getRowHeight(); if (newY + newH < getMaximumVisibleHeight() && newH > getMaximumVisibleHeight()) newY = getMaximumVisibleHeight() - newH; - getViewedComponent()->setBounds (newX, newY, newW, newH); + content.setBounds (newX, newY, newW, newH); if (makeSureItUpdatesContent && ! hasUpdated) updateContents(); @@ -214,11 +215,12 @@ public: { hasUpdated = true; const int rowH = owner.getRowHeight(); + Component& content = *getViewedComponent(); if (rowH > 0) { const int y = getViewPositionY(); - const int w = getViewedComponent()->getWidth(); + const int w = content.getWidth(); const int numNeeded = 2 + getMaximumVisibleHeight() / rowH; rows.removeRange (numNeeded, rows.size()); @@ -227,7 +229,7 @@ public: { RowComponent* newRow = new RowComponent (owner); rows.add (newRow); - getViewedComponent()->addAndMakeVisible (newRow); + content.addAndMakeVisible (newRow); } firstIndex = y / rowH; @@ -247,10 +249,10 @@ public: } if (owner.headerComponent != nullptr) - owner.headerComponent->setBounds (owner.outlineThickness + getViewedComponent()->getX(), + owner.headerComponent->setBounds (owner.outlineThickness + content.getX(), owner.outlineThickness, jmax (owner.getWidth() - owner.outlineThickness * 2, - getViewedComponent()->getWidth()), + content.getWidth()), owner.headerComponent->getHeight()); } From 581f6d26deac2dd2d1bdf631eac605dde56e2f36 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Nov 2014 10:06:33 +0000 Subject: [PATCH 06/12] Introjucer: Fixed escaping of scripts in Xcode exporter --- .../Source/Project Saving/jucer_ProjectExport_XCode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 9dd517d309..9c225d3fc1 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -910,7 +910,7 @@ private: const Identifier propertyName (o.getPropertyName(j)); String val (o.getProperty (propertyName).toString()); - if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,&+-_@~\r\n") + if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,&+-_@~\r\n\\") && ! (val.trimStart().startsWithChar ('(') || val.trimStart().startsWithChar ('{')))) val = "\"" + val + "\""; From 6d56d590dfc47c17f6eaf459d0b7a24b29954bca Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Nov 2014 10:12:39 +0000 Subject: [PATCH 07/12] Introjucer: handled a couple more escape characters in the Xcode exporter --- .../Source/Project Saving/jucer_ProjectExport_XCode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 9c225d3fc1..5531cd42b6 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -910,7 +910,7 @@ private: const Identifier propertyName (o.getPropertyName(j)); String val (o.getProperty (propertyName).toString()); - if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,&+-_@~\r\n\\") + if (val.isEmpty() || (val.containsAnyOf (" \t;<>()=,&+-_@~\r\n\\#%^`*") && ! (val.trimStart().startsWithChar ('(') || val.trimStart().startsWithChar ('{')))) val = "\"" + val + "\""; From 2fc0de42f2bb665bf191402914da26b98d2caa02 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Nov 2014 11:01:09 +0000 Subject: [PATCH 08/12] Made the AU wrapper send notifications about parameter name changes. --- .../AU/juce_AU_Wrapper.mm | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 051348d9e3..9e611be58c 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -647,7 +647,9 @@ public: void audioProcessorChanged (AudioProcessor*) { - PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0); + PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0); + PropertyChanged (kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0); + PropertyChanged (kAudioUnitProperty_ParameterInfo, kAudioUnitScope_Global, 0); } bool StreamFormatWritable (AudioUnitScope, AudioUnitElement) override @@ -664,9 +666,9 @@ public: ComponentResult Initialize() override { #if ! JucePlugin_IsSynth - const int numIns = GetInput(0) != 0 ? (int) GetInput(0)->GetStreamFormat().mChannelsPerFrame : 0; + const int numIns = findNumInputChannels(); #endif - const int numOuts = GetOutput(0) != 0 ? (int) GetOutput(0)->GetStreamFormat().mChannelsPerFrame : 0; + const int numOuts = findNumOutputChannels(); bool isValidChannelConfig = false; @@ -710,19 +712,32 @@ public: return JuceAUBaseClass::Reset (inScope, inElement); } + int findNumInputChannels() + { + #if JucePlugin_IsSynth + if (AUInputElement* e = GetInput(0)) + return (int) e->GetStreamFormat().mChannelsPerFrame; + #endif + + return 0; + } + + int findNumOutputChannels() + { + if (AUOutputElement* e = GetOutput(0)) + return (int) e->GetStreamFormat().mChannelsPerFrame; + + return 0; + } + void prepareToPlay() { if (juceFilter != nullptr) { - juceFilter->setPlayConfigDetails ( - #if ! JucePlugin_IsSynth - (int) GetInput(0)->GetStreamFormat().mChannelsPerFrame, - #else - 0, - #endif - (int) GetOutput(0)->GetStreamFormat().mChannelsPerFrame, - getSampleRate(), - (int) GetMaxFramesPerSlice()); + juceFilter->setPlayConfigDetails (findNumInputChannels(), + findNumOutputChannels(), + getSampleRate(), + (int) GetMaxFramesPerSlice()); bufferSpace.setSize (juceFilter->getNumInputChannels() + juceFilter->getNumOutputChannels(), (int) GetMaxFramesPerSlice() + 32); From 795d4fe4dd622e7a485823ad15f1249b63abf906 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Nov 2014 20:14:45 +0000 Subject: [PATCH 09/12] Introjucer: updated the Xcode plugin installer script to preserve symlinks for AAX. --- extras/Introjucer/JuceLibraryCode/BinaryData.cpp | 6 +++--- extras/Introjucer/JuceLibraryCode/BinaryData.h | 2 +- .../Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp index c4a5759ec6..ea35609c89 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp @@ -86,7 +86,7 @@ static const unsigned char temp_binary_data_0[] = " rm -r \"$AAX1\"\r\n" " fi\r\n" "\r\n" -" cp -r \"$original\" \"$AAX1\"\r\n" +" cp -R -H \"$original\" \"$AAX1\"\r\n" " fi\r\n" "\r\n" " if [ -d \"/Library/Application Support/Avid/Audio/Plug-Ins\" ]; then\r\n" @@ -96,7 +96,7 @@ static const unsigned char temp_binary_data_0[] = " rm -r \"$AAX2\"\r\n" " fi\r\n" "\r\n" -" cp -r \"$original\" \"$AAX2\"\r\n" +" cp -R -H \"$original\" \"$AAX2\"\r\n" " fi\r\n" "fi\r\n"; @@ -1244,7 +1244,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw switch (hash) { - case 0x44be9398: numBytes = 2916; return AudioPluginXCodeScript_txt; + case 0x44be9398: numBytes = 2922; return AudioPluginXCodeScript_txt; case 0x4a0cfd09: numBytes = 151; return background_tile_png; case 0x763d39dc: numBytes = 1050; return colourscheme_dark_xml; case 0xe8b08520: numBytes = 1050; return colourscheme_light_xml; diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.h b/extras/Introjucer/JuceLibraryCode/BinaryData.h index 0da7fcb4af..b8ed5abff9 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.h +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.h @@ -10,7 +10,7 @@ namespace BinaryData { extern const char* AudioPluginXCodeScript_txt; - const int AudioPluginXCodeScript_txtSize = 2916; + const int AudioPluginXCodeScript_txtSize = 2922; extern const char* background_tile_png; const int background_tile_pngSize = 151; diff --git a/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt b/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt index e4cf3dbdf8..bddaf22ab9 100644 --- a/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt +++ b/extras/Introjucer/Source/BinaryData/AudioPluginXCodeScript.txt @@ -75,7 +75,7 @@ if [ $copyAAX -gt 0 ]; then rm -r "$AAX1" fi - cp -r "$original" "$AAX1" + cp -R -H "$original" "$AAX1" fi if [ -d "/Library/Application Support/Avid/Audio/Plug-Ins" ]; then @@ -85,6 +85,6 @@ if [ $copyAAX -gt 0 ]; then rm -r "$AAX2" fi - cp -r "$original" "$AAX2" + cp -R -H "$original" "$AAX2" fi fi From 7e8cc2734d679d9e08c451b654b89df27f9df93b Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 2 Nov 2014 20:40:48 +0000 Subject: [PATCH 10/12] Some workarounds for people still using the 10.5 SDK --- modules/juce_gui_basics/native/juce_mac_FileChooser.mm | 2 +- modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 90004c1c0e..f256067ec6 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -175,7 +175,7 @@ void FileChooser::showPlatformDialog (Array& results, if ([panel runModal] == 1 /*NSModalResponseOK*/) #else if ([panel runModalForDirectory: juceStringToNS (directory) - file: juceStringToNS (filename)] == NSModalResponseOK) + file: juceStringToNS (filename)] == 1 /*NSModalResponseOK*/) #endif { if (isSaveDialogue) diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 6ec486460f..5061a6db01 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -1794,7 +1794,9 @@ private: static void windowDidExitFullScreen (id, SEL, NSNotification*) { + #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [NSApp setPresentationOptions: NSApplicationPresentationDefault]; + #endif } static void zoom (id self, SEL, id sender) From 6925b9626ce44180f38403e364c63d36db332b29 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 3 Nov 2014 14:25:17 +0000 Subject: [PATCH 11/12] Updated OSX file dragging functions to avoid some thigns that were deprecated in 10.10 --- .../native/juce_mac_Windowing.mm | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index 8f53304593..3d09529f12 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -164,37 +164,29 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi JUCE_AUTORELEASEPOOL { - NSView* view = (NSView*) sourceComp->getWindowHandle(); + if (NSView* view = (NSView*) sourceComp->getWindowHandle()) + { + if (NSEvent* event = [[view window] currentEvent]) + { + NSPoint eventPos = [event locationInWindow]; + NSRect dragRect = [view convertRect: NSMakeRect (eventPos.x - 16.0f, eventPos.y - 16.0f, 32.0f, 32.0f) + fromView: nil]; - if (view == nil) - return false; + for (int i = 0; i < files.size(); ++i) + { + if (! [view dragFile: juceStringToNS (files[i]) + fromRect: dragRect + slideBack: YES + event: event]) + return false; + } - NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; - [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] - owner: nil]; - - NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4]; - for (int i = 0; i < files.size(); ++i) - [filesArray addObject: juceStringToNS (files[i])]; - - [pboard setPropertyList: filesArray - forType: NSFilenamesPboardType]; - - NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow] - fromView: nil]; - dragPosition.x -= 16; - dragPosition.y -= 16; - - [view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])] - at: dragPosition - offset: NSMakeSize (0, 0) - event: [[view window] currentEvent] - pasteboard: pboard - source: view - slideBack: YES]; + return true; + } + } } - return true; + return false; } bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/) From 7c42fc102a8a003345c3fc1b3916dddef2f47c0b Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 3 Nov 2014 17:45:13 +0000 Subject: [PATCH 12/12] Fixed typo in AU wrapper. --- modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 9e611be58c..db732fbedd 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -714,7 +714,7 @@ public: int findNumInputChannels() { - #if JucePlugin_IsSynth + #if ! JucePlugin_IsSynth if (AUInputElement* e = GetInput(0)) return (int) e->GetStreamFormat().mChannelsPerFrame; #endif