1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-20 01:14:20 +00:00
This commit is contained in:
jules 2008-07-15 13:40:27 +00:00
parent ef3f54928a
commit de37ff7979
5 changed files with 53 additions and 78 deletions

View file

@ -126,9 +126,9 @@ void FileChooser::showPlatformDialog (OwnedArray<File>& 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)
{

View file

@ -29,6 +29,9 @@
==============================================================================
*/
#ifndef __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__
#define __JUCE_MAC_NATIVEHEADERS_JUCEHEADER__
#include "../../../src/juce_core/basics/juce_StandardHeader.h"
#include <Cocoa/Cocoa.h>
@ -47,4 +50,7 @@ private:
NSAutoreleasePool* pool;
};
END_JUCE_NAMESPACE
#endif

View file

@ -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];

View file

@ -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 <Cocoa/Cocoa.h>
@ -253128,6 +253129,8 @@ private:
};
END_JUCE_NAMESPACE
#endif
/********* End of inlined file: juce_mac_NativeHeaders.h *********/
#include <IOKit/IOKitLib.h>
@ -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 <Cocoa/Cocoa.h>
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 <DiscRecording/DiscRecording.h>
@ -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 <Cocoa/Cocoa.h>
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 <fnmatch.h>
BEGIN_JUCE_NAMESPACE
@ -255966,9 +255929,9 @@ void FileChooser::showPlatformDialog (OwnedArray<File>& 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];

View file

@ -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: