diff --git a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm index f9b3d147e7..b93e6e0e84 100644 --- a/build/macosx/platform_specific_code/juce_mac_FileChooser.mm +++ b/build/macosx/platform_specific_code/juce_mac_FileChooser.mm @@ -126,9 +126,9 @@ void FileChooser::showPlatformDialog (OwnedArray& results, [panel setDelegate: delegate]; - NSInteger result = [panel runModalForDirectory: juceStringToNS (currentFileOrDirectory.getParentDirectory().getFullPathName()) - file: juceStringToNS (currentFileOrDirectory.getFileName())]; - if (result == NSOKButton) + if ([panel runModalForDirectory: juceStringToNS (currentFileOrDirectory.getParentDirectory().getFullPathName()) + file: juceStringToNS (currentFileOrDirectory.getFileName())] + == NSOKButton) { if (isSaveDialogue) { diff --git a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h index b9dc3652c0..dc5938fd00 100644 --- a/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h +++ b/build/macosx/platform_specific_code/juce_mac_NativeHeaders.h @@ -29,6 +29,9 @@ ============================================================================== */ +#ifndef __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ +#define __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ + #include "../../../src/juce_core/basics/juce_StandardHeader.h" #include @@ -47,4 +50,7 @@ private: NSAutoreleasePool* pool; }; + END_JUCE_NAMESPACE + +#endif diff --git a/build/macosx/platform_specific_code/juce_mac_Windowing.mm b/build/macosx/platform_specific_code/juce_mac_Windowing.mm index 5aec111379..1c7facc259 100644 --- a/build/macosx/platform_specific_code/juce_mac_Windowing.mm +++ b/build/macosx/platform_specific_code/juce_mac_Windowing.mm @@ -2497,7 +2497,7 @@ static NSImage* juceImageToNSImage (const Image& image) hasAlpha: image.hasAlphaChannel() isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace - bitmapFormat: 0 + bitmapFormat: (NSBitmapFormat) 0 bytesPerRow: lineStride bitsPerPixel: pixelStride * 8]; diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index be441200da..7aaac84e8c 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -29895,8 +29895,14 @@ static VstIntPtr handleGeneralCallback (VstInt32 opcode, VstInt32 index, VstInt3 return 0x0101; case audioMasterGetVendorString: case audioMasterGetProductString: - JUCEApplication::getInstance() - ->getApplicationName().copyToBuffer ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); + { + String hostName ("Juce VST Host"); + + if (JUCEApplication::getInstance() != 0) + hostName = JUCEApplication::getInstance()->getApplicationName(); + + hostName.copyToBuffer ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); + } break; case audioMasterGetSampleRate: @@ -65080,8 +65086,7 @@ public: outputChanLabel->attachToComponent (outputChanList, true); } - outputChanList->updateContent(); - outputChanList->repaint(); + outputChanList->refresh(); } else { @@ -65101,8 +65106,7 @@ public: inputChanLabel->attachToComponent (inputChanList, true); } - inputChanList->updateContent(); - inputChanList->repaint(); + inputChanList->refresh(); } else { @@ -65611,19 +65615,10 @@ void AudioDeviceSelectorComponent::resized() y += audioDeviceSettingsComp->getHeight() + space; } - VoidArray boxes; - if (midiInputsList != 0) - boxes.add (midiInputsList); - - const int boxSpace = getHeight() - y; - - for (int i = 0; i < boxes.size(); ++i) { - MidiInputSelectorComponentListBox* const box = (MidiInputSelectorComponentListBox*) boxes.getUnchecked (i); - - const int bh = box->getBestHeight (jmin (h * 8, boxSpace / boxes.size()) - space); - box->setBounds (lx, y, w, bh); + const int bh = midiInputsList->getBestHeight (jmin (h * 8, getHeight() - y - space)); + midiInputsList->setBounds (lx, y, w, bh); y += bh + space; } @@ -240391,7 +240386,7 @@ public: } ShowCaret (hwnd); - SetCaretPos (x, y); + SetCaretPos (-1, -1); } void repaint (int x, int y, int w, int h) @@ -243251,6 +243246,7 @@ class ActiveXControlData : public ComponentMovementWatcher bool wasShowing; public: + HWND controlHWND; IStorage* storage; IOleClientSite* clientSite; IOleObject* control; @@ -243260,6 +243256,7 @@ public: : ComponentMovementWatcher (owner_), owner (owner_), wasShowing (owner_ != 0 && owner_->isShowing()), + controlHWND (0), storage (new JuceIStorage()), clientSite (new JuceIOleClientSite (hwnd)), control (0) @@ -243307,6 +243304,11 @@ public: { componentPeerChanged(); } + + static bool doesWindowMatch (const ActiveXControlComponent* const ax, HWND hwnd) + { + return ((ActiveXControlData*) ax->control)->controlHWND == hwnd; + } }; static VoidArray activeXComps; @@ -243373,9 +243375,7 @@ static LRESULT CALLBACK activeXHookWndProc (HWND hwnd, UINT message, WPARAM wPar { const ActiveXControlComponent* const ax = (const ActiveXControlComponent*) activeXComps.getUnchecked(i); - HWND controlHWND = getHWND (ax); - - if (controlHWND == hwnd) + if (ActiveXControlData::doesWindowMatch (ax, hwnd)) { switch (message) { @@ -243471,12 +243471,12 @@ bool ActiveXControlComponent::createControl (const void* controlIID) control = info; setControlBounds (Rectangle (x, y, getWidth(), getHeight())); - HWND controlHWND = getHWND (this); + info->controlHWND = getHWND (this); - if (controlHWND != 0) + if (info->controlHWND != 0) { - originalWndProc = (void*) GetWindowLongPtr (controlHWND, GWLP_WNDPROC); - SetWindowLongPtr (controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); + originalWndProc = (void*) GetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC); + SetWindowLongPtr ((HWND) info->controlHWND, GWLP_WNDPROC, (LONG_PTR) activeXHookWndProc); } return true; @@ -243517,7 +243517,7 @@ void* ActiveXControlComponent::queryInterface (const void* iid) const void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const { - HWND hwnd = getHWND (this); + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; if (hwnd != 0) MoveWindow (hwnd, newBounds.getX(), newBounds.getY(), newBounds.getWidth(), newBounds.getHeight(), TRUE); @@ -243525,7 +243525,7 @@ void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) cons void ActiveXControlComponent::setControlVisible (const bool shouldBeVisible) const { - HWND hwnd = getHWND (this); + HWND hwnd = ((ActiveXControlData*) control)->controlHWND; if (hwnd != 0) ShowWindow (hwnd, shouldBeVisible ? SW_SHOWNA : SW_HIDE); @@ -253111,7 +253111,8 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_Network.mm *********/ /********* Start of inlined file: juce_mac_NativeHeaders.h *********/ -#include "../../../src/juce_core/basics/juce_StandardHeader. h" +#ifndef __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ +#define __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__ #include @@ -253128,6 +253129,8 @@ private: }; END_JUCE_NAMESPACE + +#endif /********* End of inlined file: juce_mac_NativeHeaders.h *********/ #include @@ -253641,26 +253644,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_AudioCDBurner.mm *********/ -/********* Start of inlined file: juce_mac_NativeHeaders.h *********/ -#include "../../../src/juce_core/basics/juce_StandardHeader. h" - -#include - -BEGIN_JUCE_NAMESPACE - -class AutoPool -{ -public: - AutoPool() { pool = [[NSAutoreleasePool alloc] init]; } - ~AutoPool() { [pool release]; } - -private: - NSAutoreleasePool* pool; -}; - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_NativeHeaders.h *********/ - #if JUCE_USE_CDBURNER #import @@ -255852,26 +255835,6 @@ END_JUCE_NAMESPACE /********* Start of inlined file: juce_mac_FileChooser.mm *********/ -/********* Start of inlined file: juce_mac_NativeHeaders.h *********/ -#include "../../../src/juce_core/basics/juce_StandardHeader. h" - -#include - -BEGIN_JUCE_NAMESPACE - -class AutoPool -{ -public: - AutoPool() { pool = [[NSAutoreleasePool alloc] init]; } - ~AutoPool() { [pool release]; } - -private: - NSAutoreleasePool* pool; -}; - -END_JUCE_NAMESPACE -/********* End of inlined file: juce_mac_NativeHeaders.h *********/ - #include BEGIN_JUCE_NAMESPACE @@ -255966,9 +255929,9 @@ void FileChooser::showPlatformDialog (OwnedArray& results, [panel setDelegate: delegate]; - NSInteger result = [panel runModalForDirectory: juceStringToNS (currentFileOrDirectory.getParentDirectory().getFullPathName()) - file: juceStringToNS (currentFileOrDirectory.getFileName())]; - if (result == NSOKButton) + if ([panel runModalForDirectory: juceStringToNS (currentFileOrDirectory.getParentDirectory().getFullPathName()) + file: juceStringToNS (currentFileOrDirectory.getFileName())] + == NSOKButton) { if (isSaveDialogue) { @@ -259613,7 +259576,7 @@ static NSImage* juceImageToNSImage (const Image& image) hasAlpha: image.hasAlphaChannel() isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace - bitmapFormat: 0 + bitmapFormat: (NSBitmapFormat) 0 bytesPerRow: lineStride bitsPerPixel: pixelStride * 8]; diff --git a/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp index d865710958..defa26f89c 100644 --- a/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp +++ b/src/juce_appframework/audio/plugins/formats/juce_VSTPluginFormat.cpp @@ -2309,8 +2309,14 @@ static VstIntPtr handleGeneralCallback (VstInt32 opcode, VstInt32 index, VstInt3 return 0x0101; case audioMasterGetVendorString: case audioMasterGetProductString: - JUCEApplication::getInstance() - ->getApplicationName().copyToBuffer ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); + { + String hostName ("Juce VST Host"); + + if (JUCEApplication::getInstance() != 0) + hostName = JUCEApplication::getInstance()->getApplicationName(); + + hostName.copyToBuffer ((char*) ptr, jmin (kVstMaxVendorStrLen, kVstMaxProductStrLen) - 1); + } break; case audioMasterGetSampleRate: