Browse Source

Minor updates to some plugin classes.

tags/2021-05-28
Julian Storer 15 years ago
parent
commit
80472c3448
6 changed files with 62 additions and 21 deletions
  1. +10
    -5
      extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h
  2. +2
    -0
      extras/audio plugins/wrapper/RTAS/juce_RTAS_MacUtilities.mm
  3. +19
    -12
      extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm
  4. +6
    -1
      extras/audio plugins/wrapper/juce_IncludeCharacteristics.h
  5. +12
    -1
      extras/audio plugins/wrapper/juce_PluginHostType.h
  6. +13
    -2
      src/native/mac/juce_mac_CarbonViewWrapperComponent.h

+ 10
- 5
extras/Jucer (experimental)/Source/model/Project/jucer_ProjectExport_MSVC.h 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)"


+ 2
- 0
extras/audio plugins/wrapper/RTAS/juce_RTAS_MacUtilities.mm 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);


+ 19
- 12
extras/audio plugins/wrapper/VST/juce_VST_Wrapper.mm 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 }
};
InstallWindowEventHandler ((WindowRef) windowRef,
NewEventHandlerUPP (windowVisibilityBodge),
GetEventTypeCount (eventsToCatch), eventsToCatch,
(void*) hostWindow, &ref);
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
{
// 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));
}
#endif
return hostWindow;


+ 6
- 1
extras/audio plugins/wrapper/juce_IncludeCharacteristics.h 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


+ 12
- 1
extras/audio plugins/wrapper/juce_PluginHostType.h 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!


+ 13
- 2
src/native/mac/juce_mac_CarbonViewWrapperComponent.h 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,


Loading…
Cancel
Save