From 91e2759000958ee0880cb019f347af5f085152f5 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Thu, 14 Oct 2010 14:17:10 +0100 Subject: [PATCH] Fix for some broken Apple AudioUnit editors. Fix for amalgamated mac builds. Changed some mac debugging settings which didn't work. Updated the Jucer-generated audio plugins to match the current codebase. --- Builds/MacOSX/Juce.xcodeproj/project.pbxproj | 4 +- Builds/iPhone/Juce.xcodeproj/project.pbxproj | 4 +- amalgamation/juce_amalgamated_template.cpp | 7 ++ .../The Jucer.xcodeproj/project.pbxproj | 4 +- .../JuceLibraryCode/BinaryData.cpp | 6 ++ .../JuceLibraryCode/BinaryData.h | 4 +- .../jucer_AudioPluginFilterTemplate.cpp | 5 ++ .../jucer_AudioPluginFilterTemplate.h | 1 + .../Amalgamator.xcodeproj/project.pbxproj | 4 +- .../Plugin Host.xcodeproj/project.pbxproj | 4 +- .../JuceDemoPlugin.xcodeproj/project.pbxproj | 4 +- .../BinaryBuilder.xcodeproj/project.pbxproj | 4 +- .../HelloWorld.xcodeproj/project.pbxproj | 4 +- .../HelloWorld.xcodeproj/project.pbxproj | 4 +- .../Juce Demo.xcodeproj/project.pbxproj | 4 +- .../Juce Demo.xcodeproj/project.pbxproj | 4 +- juce_amalgamated.cpp | 77 ++++++++++++++----- juce_amalgamated.h | 5 +- .../formats/juce_AudioUnitPluginFormat.mm | 26 +++++-- src/core/juce_StandardHeader.h | 2 +- .../components/special/juce_NSViewComponent.h | 4 + src/native/mac/juce_mac_NSViewComponent.mm | 17 +++- 22 files changed, 144 insertions(+), 54 deletions(-) diff --git a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj index 000e6ad90a..10383fe724 100644 --- a/Builds/MacOSX/Juce.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Juce.xcodeproj/project.pbxproj @@ -1895,7 +1895,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "jucedebug"; }; name = Debug; }; 71190EFA58D0942581B5F1AD = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -1910,7 +1910,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "juce"; }; name = Release; }; 3A1CB6B5ECF4A79CDE35CC66 = { isa = XCConfigurationList; buildConfigurations = ( 8E935B9E7F2982A06CD7EF99, diff --git a/Builds/iPhone/Juce.xcodeproj/project.pbxproj b/Builds/iPhone/Juce.xcodeproj/project.pbxproj index 7ad29552f9..9be17be6d9 100644 --- a/Builds/iPhone/Juce.xcodeproj/project.pbxproj +++ b/Builds/iPhone/Juce.xcodeproj/project.pbxproj @@ -1895,7 +1895,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "jucedebug"; }; name = Debug; }; 71190EFA58D0942581B5F1AD = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -1910,7 +1910,7 @@ GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_SYMBOLS_PRIVATE_EXTERN = NO; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "juce"; }; name = Release; }; 3A1CB6B5ECF4A79CDE35CC66 = { isa = XCConfigurationList; buildConfigurations = ( 8E935B9E7F2982A06CD7EF99, diff --git a/amalgamation/juce_amalgamated_template.cpp b/amalgamation/juce_amalgamated_template.cpp index 629258a633..9544a15c0e 100644 --- a/amalgamation/juce_amalgamated_template.cpp +++ b/amalgamation/juce_amalgamated_template.cpp @@ -387,6 +387,13 @@ //============================================================================== #if JUCE_BUILD_NATIVE + + // Non-public headers that are needed by more than one platform must be included + // before the platform-specific sections.. + BEGIN_JUCE_NAMESPACE + #include "../src/native/common/juce_MidiDataConcatenator.h" + END_JUCE_NAMESPACE + #if JUCE_WINDOWS #include "../src/native/juce_win32_NativeCode.cpp" #endif diff --git a/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj b/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj index f530ef56d3..129120d478 100644 --- a/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj +++ b/extras/Jucer (experimental)/Builds/MacOSX/The Jucer.xcodeproj/project.pbxproj @@ -283,7 +283,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "Jucer"; }; name = Debug; }; 4C681DED23FC5056A83C964C = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -297,7 +297,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "Jucer"; }; name = Release; }; 045AC698C60073CCF5CC6116 = { isa = XCConfigurationList; buildConfigurations = ( 69D26A715A354ED1735D8438, diff --git a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp index 5687b33fac..68176e6e0b 100644 --- a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp +++ b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.cpp @@ -525,6 +525,11 @@ static const unsigned char temp_891b85da[] = "}\r\n" "\r\n" "//==============================================================================\r\n" +"bool FILTERCLASSNAME::hasEditor() const\r\n" +"{\r\n" +" return true; // (change this to false if you choose to not supply an editor)\r\n" +"}\r\n" +"\r\n" "AudioProcessorEditor* FILTERCLASSNAME::createEditor()\r\n" "{\r\n" " return new EDITORCLASSNAME (this);\r\n" @@ -589,6 +594,7 @@ static const unsigned char temp_356ba65f[] = "\r\n" " //==============================================================================\r\n" " AudioProcessorEditor* createEditor();\r\n" +" bool hasEditor() const;\r\n" "\r\n" " //==============================================================================\r\n" " const String getName() const;\r\n" diff --git a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h index 96250974e7..4e4ba1fa97 100644 --- a/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h +++ b/extras/Jucer (experimental)/JuceLibraryCode/BinaryData.h @@ -20,10 +20,10 @@ namespace BinaryData const int jucer_AudioPluginEditorTemplate_hSize = 794; extern const char* jucer_AudioPluginFilterTemplate_cpp; - const int jucer_AudioPluginFilterTemplate_cppSize = 4349; + const int jucer_AudioPluginFilterTemplate_cppSize = 4480; extern const char* jucer_AudioPluginFilterTemplate_h; - const int jucer_AudioPluginFilterTemplate_hSize = 2353; + const int jucer_AudioPluginFilterTemplate_hSize = 2382; extern const char* jucer_MainConsoleAppTemplate_cpp; const int jucer_MainConsoleAppTemplate_cppSize = 749; diff --git a/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.cpp b/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.cpp index ccb4f091aa..480d5af492 100644 --- a/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.cpp +++ b/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.cpp @@ -145,6 +145,11 @@ void FILTERCLASSNAME::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiM } //============================================================================== +bool FILTERCLASSNAME::hasEditor() const +{ + return true; // (change this to false if you choose to not supply an editor) +} + AudioProcessorEditor* FILTERCLASSNAME::createEditor() { return new EDITORCLASSNAME (this); diff --git a/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.h b/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.h index 0b0647f975..54dbc8aade 100644 --- a/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.h +++ b/extras/Jucer (experimental)/Source/BinaryData/jucer_AudioPluginFilterTemplate.h @@ -32,6 +32,7 @@ public: //============================================================================== AudioProcessorEditor* createEditor(); + bool hasEditor() const; //============================================================================== const String getName() const; diff --git a/extras/amalgamator/Builds/MacOSX/Amalgamator.xcodeproj/project.pbxproj b/extras/amalgamator/Builds/MacOSX/Amalgamator.xcodeproj/project.pbxproj index bca3e583bb..1828222f2a 100644 --- a/extras/amalgamator/Builds/MacOSX/Amalgamator.xcodeproj/project.pbxproj +++ b/extras/amalgamator/Builds/MacOSX/Amalgamator.xcodeproj/project.pbxproj @@ -102,7 +102,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "amalgamator"; }; name = Debug; }; 322333C2238617224CAE5D89 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -116,7 +116,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "amalgamator"; }; name = Release; }; FA25EC7DB69A3A88993F2853 = { isa = XCConfigurationList; buildConfigurations = ( 4EAD81574ACF05AC27D04B76, diff --git a/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj b/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj index a54de8f4a6..43a5b60017 100644 --- a/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj +++ b/extras/audio plugin host/Builds/MacOSX/Plugin Host.xcodeproj/project.pbxproj @@ -141,7 +141,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "Plugin Host"; }; name = Debug; }; 74C9869781487FF560C4590D = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -155,7 +155,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "Plugin Host"; }; name = Release; }; 3DBB3F42145D936BBD5425D7 = { isa = XCConfigurationList; buildConfigurations = ( 8133D32BA8816D704BF648FA, diff --git a/extras/audio plugins/demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj b/extras/audio plugins/demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj index d18fcda687..d7e996301a 100644 --- a/extras/audio plugins/demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj +++ b/extras/audio plugins/demo/Builds/MacOSX/JuceDemoPlugin.xcodeproj/project.pbxproj @@ -285,7 +285,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemoPlugin"; }; name = Debug; }; D9F9CC7EC1952477F7915D84 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -299,7 +299,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemoPlugin"; }; name = Release; }; 91EB753864A948DE4421285E = { isa = XCConfigurationList; buildConfigurations = ( F6631902F8DE12E2C2C34B71, diff --git a/extras/binarybuilder/Builds/MacOSX/BinaryBuilder.xcodeproj/project.pbxproj b/extras/binarybuilder/Builds/MacOSX/BinaryBuilder.xcodeproj/project.pbxproj index ce2e4e892f..a027d5c9c3 100644 --- a/extras/binarybuilder/Builds/MacOSX/BinaryBuilder.xcodeproj/project.pbxproj +++ b/extras/binarybuilder/Builds/MacOSX/BinaryBuilder.xcodeproj/project.pbxproj @@ -102,7 +102,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "BinaryBuilder"; }; name = Debug; }; B911917EBAEE875AC65A0C2B = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -116,7 +116,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "BinaryBuilder"; }; name = Release; }; 71143A294DF2ABC013DAD8F4 = { isa = XCConfigurationList; buildConfigurations = ( C69BDE02D12775D4A17BFA17, diff --git a/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj b/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj index 8c0b2b8c07..c4a4c8eff6 100644 --- a/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj +++ b/extras/example projects/Builds/MacOSX/HelloWorld.xcodeproj/project.pbxproj @@ -120,7 +120,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "HelloWorld"; }; name = Debug; }; 0F295119837F2D1BC9387794 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -134,7 +134,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "HelloWorld"; }; name = Release; }; C71BF9C42683418116C8426E = { isa = XCConfigurationList; buildConfigurations = ( 1C939EADBAB81B95A46A6581, diff --git a/extras/example projects/Builds/iPhone/HelloWorld.xcodeproj/project.pbxproj b/extras/example projects/Builds/iPhone/HelloWorld.xcodeproj/project.pbxproj index f8aca1e67d..2842afce79 100644 --- a/extras/example projects/Builds/iPhone/HelloWorld.xcodeproj/project.pbxproj +++ b/extras/example projects/Builds/iPhone/HelloWorld.xcodeproj/project.pbxproj @@ -105,7 +105,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "HelloWorld"; }; name = Debug; }; 0F295119837F2D1BC9387794 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -119,7 +119,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "HelloWorld"; }; name = Release; }; C71BF9C42683418116C8426E = { isa = XCConfigurationList; buildConfigurations = ( 1C939EADBAB81B95A46A6581, diff --git a/extras/juce demo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj b/extras/juce demo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj index 8bbfcd9c5c..9e3f6909b0 100644 --- a/extras/juce demo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj +++ b/extras/juce demo/Builds/MacOSX/Juce Demo.xcodeproj/project.pbxproj @@ -219,7 +219,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemo"; }; name = Debug; }; 623F392572A48BDD48CE1CC4 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -233,7 +233,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemo"; }; name = Release; }; 2B22E1D006C8AF43954EE79D = { isa = XCConfigurationList; buildConfigurations = ( 7FA986B99AFC795723E00AB0, diff --git a/extras/juce demo/Builds/iPhone/Juce Demo.xcodeproj/project.pbxproj b/extras/juce demo/Builds/iPhone/Juce Demo.xcodeproj/project.pbxproj index 2cba2e41db..624715b332 100644 --- a/extras/juce demo/Builds/iPhone/Juce Demo.xcodeproj/project.pbxproj +++ b/extras/juce demo/Builds/iPhone/Juce Demo.xcodeproj/project.pbxproj @@ -204,7 +204,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemo"; }; name = Debug; }; 623F392572A48BDD48CE1CC4 = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -218,7 +218,7 @@ GCC_MODEL_TUNING = G5; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; ZERO_LINK = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = "dwarf"; PRODUCT_NAME = "JuceDemo"; }; name = Release; }; 2B22E1D006C8AF43954EE79D = { isa = XCConfigurationList; buildConfigurations = ( 7FA986B99AFC795723E00AB0, diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index c01f121b88..2ad811f3d2 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -620,7 +620,6 @@ */ #import #import - #endif #if JUCE_MSVC @@ -32010,7 +32009,8 @@ OSStatus AudioUnitPluginInstance::getTransportState (Boolean* outIsPlaying, return noErr; } -class AudioUnitPluginWindowCocoa : public AudioProcessorEditor +class AudioUnitPluginWindowCocoa : public AudioProcessorEditor, + public Timer { public: AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& plugin_, const bool createGenericViewIfNeeded) @@ -32048,6 +32048,18 @@ public: wrapper.setSize (getWidth(), getHeight()); } + void timerCallback() + { + wrapper.resizeToFitView(); + startTimer (jmin (713, getTimerInterval() + 51)); + } + + void childBoundsChanged (Component* child) + { + setSize (wrapper.getWidth(), wrapper.getHeight()); + startTimer (70); + } + private: AudioUnitPluginInstance& plugin; NSViewComponent wrapper; @@ -32088,10 +32100,9 @@ private: } for (int i = (dataSize - sizeof (CFURLRef)) / sizeof (CFStringRef); --i >= 0;) - { CFRelease (info->mCocoaAUViewClass[i]); - CFRelease (info->mCocoaAUViewBundleLocation); - } + + CFRelease (info->mCocoaAUViewBundleLocation); } } @@ -32101,8 +32112,10 @@ private: wrapper.setView (pluginView); if (pluginView != 0) - setSize ([pluginView frame].size.width, - [pluginView frame].size.height); + { + timerCallback(); + startTimer (70); + } return pluginView != 0; } @@ -237563,20 +237576,10 @@ END_JUCE_NAMESPACE //============================================================================== #if JUCE_BUILD_NATIVE - #if JUCE_WINDOWS - -/*** Start of inlined file: juce_win32_NativeCode.cpp ***/ -/* - This file wraps together all the win32-specific code, so that - we can include all the native headers just once, and compile all our - platform-specific stuff in one big lump, keeping it out of the way of - the rest of the codebase. -*/ - -#if JUCE_WINDOWS - -BEGIN_JUCE_NAMESPACE + // Non-public headers that are needed by more than one platform must be included + // before the platform-specific sections.. + BEGIN_JUCE_NAMESPACE /*** Start of inlined file: juce_MidiDataConcatenator.h ***/ #ifndef __JUCE_MIDIDATACONCATENATOR_JUCEHEADER__ @@ -237698,6 +237701,23 @@ private: #endif // __JUCE_MIDIDATACONCATENATOR_JUCEHEADER__ /*** End of inlined file: juce_MidiDataConcatenator.h ***/ + + END_JUCE_NAMESPACE + + #if JUCE_WINDOWS + +/*** Start of inlined file: juce_win32_NativeCode.cpp ***/ +/* + This file wraps together all the win32-specific code, so that + we can include all the native headers just once, and compile all our + platform-specific stuff in one big lump, keeping it out of the way of + the rest of the codebase. +*/ + +#if JUCE_WINDOWS + +BEGIN_JUCE_NAMESPACE + #define JUCE_INCLUDED_FILE 1 // Now include the actual code files.. @@ -273916,7 +273936,10 @@ public: if (currentPeer != peer) { - [view removeFromSuperview]; + if ([view superview] != nil) + [view removeFromSuperview]; // Must be careful not to call this unless it's required - e.g. some Apple AU views + // override the call and use it as a sign that they're being deleted, which breaks everything.. + currentPeer = peer; if (peer != 0) @@ -273934,6 +273957,12 @@ public: componentPeerChanged(); } + const Rectangle getViewBounds() const + { + NSRect r = [view frame]; + return Rectangle (0, 0, (int) r.size.width, (int) r.size.height); + } + juce_UseDebuggingNewOperator private: @@ -273965,6 +273994,12 @@ void* NSViewComponent::getView() const return info == 0 ? 0 : info->view; } +void NSViewComponent::resizeToFitView() +{ + if (info != 0) + setBounds (info->getViewBounds()); +} + void NSViewComponent::paint (Graphics&) { } diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 6eabb36a01..63978e8f04 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -64,7 +64,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 76 +#define JUCE_BUILDNUMBER 77 /** Current Juce version number. @@ -57941,6 +57941,9 @@ public: */ void* getView() const; + /** Resizes this component to fit the view that it contains. */ + void resizeToFitView(); + /** @internal */ void paint (Graphics& g); diff --git a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm index 0c273e4206..16dc00fb23 100644 --- a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm +++ b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm @@ -886,7 +886,8 @@ OSStatus AudioUnitPluginInstance::getTransportState (Boolean* outIsPlaying, //============================================================================== -class AudioUnitPluginWindowCocoa : public AudioProcessorEditor +class AudioUnitPluginWindowCocoa : public AudioProcessorEditor, + public Timer { public: AudioUnitPluginWindowCocoa (AudioUnitPluginInstance& plugin_, const bool createGenericViewIfNeeded) @@ -924,6 +925,18 @@ public: wrapper.setSize (getWidth(), getHeight()); } + void timerCallback() + { + wrapper.resizeToFitView(); + startTimer (jmin (713, getTimerInterval() + 51)); + } + + void childBoundsChanged (Component* child) + { + setSize (wrapper.getWidth(), wrapper.getHeight()); + startTimer (70); + } + private: AudioUnitPluginInstance& plugin; NSViewComponent wrapper; @@ -964,10 +977,9 @@ private: } for (int i = (dataSize - sizeof (CFURLRef)) / sizeof (CFStringRef); --i >= 0;) - { CFRelease (info->mCocoaAUViewClass[i]); - CFRelease (info->mCocoaAUViewBundleLocation); - } + + CFRelease (info->mCocoaAUViewBundleLocation); } } @@ -977,8 +989,10 @@ private: wrapper.setView (pluginView); if (pluginView != 0) - setSize ([pluginView frame].size.width, - [pluginView frame].size.height); + { + timerCallback(); + startTimer (70); + } return pluginView != 0; } diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 710e1f4959..b8942f2dd7 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 52 -#define JUCE_BUILDNUMBER 76 +#define JUCE_BUILDNUMBER 77 /** Current Juce version number. diff --git a/src/gui/components/special/juce_NSViewComponent.h b/src/gui/components/special/juce_NSViewComponent.h index 2da03c6cab..346c94db45 100644 --- a/src/gui/components/special/juce_NSViewComponent.h +++ b/src/gui/components/special/juce_NSViewComponent.h @@ -71,6 +71,10 @@ public: */ void* getView() const; + + /** Resizes this component to fit the view that it contains. */ + void resizeToFitView(); + //============================================================================== /** @internal */ void paint (Graphics& g); diff --git a/src/native/mac/juce_mac_NSViewComponent.mm b/src/native/mac/juce_mac_NSViewComponent.mm index c0e974dafc..52f09f245e 100644 --- a/src/native/mac/juce_mac_NSViewComponent.mm +++ b/src/native/mac/juce_mac_NSViewComponent.mm @@ -91,7 +91,10 @@ public: if (currentPeer != peer) { - [view removeFromSuperview]; + if ([view superview] != nil) + [view removeFromSuperview]; // Must be careful not to call this unless it's required - e.g. some Apple AU views + // override the call and use it as a sign that they're being deleted, which breaks everything.. + currentPeer = peer; if (peer != 0) @@ -109,6 +112,12 @@ public: componentPeerChanged(); } + const Rectangle getViewBounds() const + { + NSRect r = [view frame]; + return Rectangle (0, 0, (int) r.size.width, (int) r.size.height); + } + juce_UseDebuggingNewOperator private: @@ -141,6 +150,12 @@ void* NSViewComponent::getView() const return info == 0 ? 0 : info->view; } +void NSViewComponent::resizeToFitView() +{ + if (info != 0) + setBounds (info->getViewBounds()); +} + void NSViewComponent::paint (Graphics&) { }