1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00

Minor updates to some plugin classes.

This commit is contained in:
Julian Storer 2010-06-12 16:07:32 +01:00
parent e15dc9c198
commit 80472c3448
6 changed files with 61 additions and 20 deletions

View file

@ -996,6 +996,11 @@ protected:
return config.getName().toString() + "|Win32";
}
static void setConditionAttribute (XmlElement& xml, const Project::BuildConfiguration& config)
{
xml.setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
}
//==============================================================================
void fillInProjectXml (XmlElement& projectXml)
{
@ -1034,7 +1039,7 @@ protected:
Project::BuildConfiguration config (project.getConfiguration (i));
XmlElement* e = projectXml.createNewChildElement ("PropertyGroup");
e->setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
setConditionAttribute (*e, config);
e->setAttribute ("Label", "Configuration");
e->createNewChildElement ("ConfigurationType")->addTextElement (getProjectType());
e->createNewChildElement ("UseOfMfc")->addTextElement ("false");
@ -1077,15 +1082,15 @@ protected:
Project::BuildConfiguration config (project.getConfiguration (i));
XmlElement* outdir = props->createNewChildElement ("OutDir");
outdir->setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
setConditionAttribute (*outdir, config);
outdir->addTextElement (getConfigTargetPath (config) + "\\");
XmlElement* intdir = props->createNewChildElement ("IntDir");
intdir->setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
setConditionAttribute (*intdir, config);
intdir->addTextElement (getConfigTargetPath (config) + "\\");
XmlElement* name = props->createNewChildElement ("TargetName");
name->setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
setConditionAttribute (*name, config);
name->addTextElement (getBinaryFileForConfig (config).upToLastOccurrenceOf (".", false, false));
}
}
@ -1100,7 +1105,7 @@ protected:
const String outputFileName (getBinaryFileForConfig (config));
XmlElement* group = projectXml.createNewChildElement ("ItemDefinitionGroup");
group->setAttribute ("Condition", "'$(Configuration)|$(Platform)'=='" + createConfigName (config) + "'");
setConditionAttribute (*group, config);
XmlElement* midl = group->createNewChildElement ("Midl");
midl->createNewChildElement ("PreprocessorDefinitions")->addTextElement (isDebug ? "_DEBUG;%(PreprocessorDefinitions)"

View file

@ -56,6 +56,7 @@ void* attachSubWindow (void* hostWindowRef, Component* comp)
[hostWindow retain];
[hostWindow setCanHide: YES];
[hostWindow setReleasedWhenClosed: YES];
NSRect oldWindowFrame = [hostWindow frame];
NSView* content = [hostWindow contentView];
NSRect f = [content frame];
@ -77,6 +78,7 @@ void* attachSubWindow (void* hostWindowRef, Component* comp)
#endif
NSPoint windowPos = [hostWindow convertBaseToScreen: f.origin];
windowPos.x = windowPos.x + jmax (0.0f, (oldWindowFrame.size.width - f.size.width) / 2.0f);
windowPos.y = hostWindowScreenFrame.size.height + hostWindowScreenFrame.origin.y - (windowPos.y + f.size.height);
comp->setTopLeftPosition ((int) windowPos.x, (int) windowPos.y);

View file

@ -50,6 +50,9 @@ static pascal OSStatus windowVisibilityBodge (EventHandlerCallRef, EventRef e, v
switch (GetEventKind (e))
{
case kEventWindowInit:
[hostWindow display];
break;
case kEventWindowShown:
[hostWindow orderFront: nil];
break;
@ -157,18 +160,22 @@ void* attachComponentToWindowRef (Component* comp, void* windowRef)
[pluginWindow orderFront: nil];
#if ADD_CARBON_BODGE
// Adds a callback bodge to work around some problems with wrapped
// carbon windows..
const EventTypeSpec eventsToCatch[] = {
{ kEventClassWindow, kEventWindowShown },
{ kEventClassWindow, kEventWindowHidden }
};
{
// Adds a callback bodge to work around some problems with wrapped
// carbon windows..
const EventTypeSpec eventsToCatch[] = {
{ kEventClassWindow, kEventWindowInit },
{ kEventClassWindow, kEventWindowShown },
{ kEventClassWindow, kEventWindowHidden }
};
InstallWindowEventHandler ((WindowRef) windowRef,
NewEventHandlerUPP (windowVisibilityBodge),
GetEventTypeCount (eventsToCatch), eventsToCatch,
(void*) hostWindow, &ref);
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
}
InstallWindowEventHandler ((WindowRef) windowRef,
NewEventHandlerUPP (windowVisibilityBodge),
GetEventTypeCount (eventsToCatch), eventsToCatch,
(void*) hostWindow, &ref);
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
#endif
return hostWindow;

View file

@ -36,7 +36,7 @@
*/
#include "JucePluginCharacteristics.h"
#define SUPPORT_CARBON 1
#define JUCE_SUPPORT_CARBON 1
//==============================================================================
// The following stuff is just to cause a compile error if you've forgotten to
@ -90,6 +90,11 @@
#error "You need to define the JucePlugin_TailLengthSeconds value in your JucePluginCharacteristics.h file!"
#endif
#if __LP64__ // (disable VSTs and RTAS in a 64-bit build)
#undef JucePlugin_Build_VST
#undef JucePlugin_Build_RTAS
#endif
#if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_Standalone)
#error "You need to define at least one plugin format value in your JucePluginCharacteristics.h file!"
#endif

View file

@ -45,6 +45,7 @@ public:
AbletonLive8,
AbletonLiveGeneric,
AppleLogic,
EmagicLogic,
DigidesignProTools,
CakewalkSonar8,
CakewalkSonarGeneric,
@ -54,6 +55,8 @@ public:
SteinbergCubase4,
SteinbergCubase5,
SteinbergCubaseGeneric,
SteinbergWavelab5,
SteinbergWavelab6,
SteinbergWavelabGeneric
};
@ -80,9 +83,14 @@ public:
return type == CakewalkSonar8 || type == CakewalkSonarGeneric;
}
bool isLogic() const throw()
{
return type == AppleLogic || type == EmagicLogic;
}
bool isWavelab() const throw()
{
return type == SteinbergWavelabGeneric;
return type == SteinbergWavelabGeneric || type == SteinbergWavelab5 || type == SteinbergWavelab6;
}
//==============================================================================
@ -115,8 +123,11 @@ private:
if (hostFilename.containsIgnoreCase ("Cubase4")) return SteinbergCubase4;
if (hostFilename.containsIgnoreCase ("Cubase5")) return SteinbergCubase5;
if (hostFilename.containsIgnoreCase ("Cubase")) return SteinbergCubaseGeneric;
if (hostFilename.containsIgnoreCase ("Wavelab 5")) return SteinbergWavelab5;
if (hostFilename.containsIgnoreCase ("Wavelab 6" )) return SteinbergWavelab6;
if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
if (hostFilename.containsIgnoreCase ("reaper")) return Reaper;
if (hostFilename.containsIgnoreCase ("Logic")) return EmagicLogic;
#elif JUCE_LINUX
jassertfalse // not yet done!

View file

@ -96,8 +96,19 @@ public:
embeddedView = attachView (wrapperWindow, HIViewGetRoot (wrapperWindow));
EventTypeSpec windowEventTypes[] = { { kEventClassWindow, kEventWindowGetClickActivation },
{ kEventClassWindow, kEventWindowHandleDeactivate } };
EventTypeSpec windowEventTypes[] =
{
{ kEventClassWindow, kEventWindowGetClickActivation },
{ kEventClassWindow, kEventWindowHandleDeactivate },
{ kEventClassWindow, kEventWindowBoundsChanging },
{ kEventClassMouse, kEventMouseDown },
{ kEventClassMouse, kEventMouseMoved },
{ kEventClassMouse, kEventMouseDragged },
{ kEventClassMouse, kEventMouseUp},
{ kEventClassWindow, kEventWindowDrawContent },
{ kEventClassWindow, kEventWindowShown },
{ kEventClassWindow, kEventWindowHidden }
};
EventHandlerUPP upp = NewEventHandlerUPP (carbonEventCallback);
InstallWindowEventHandler (wrapperWindow, upp,