Just did a git pull this morning and just came up with this error (Mac, xcode). #Error:: Invalid cast from juce::ScopedPointer to type AudioUnitPluginWindowCarbon* (or Cocoa, as below …)
Tried a dynamic_cast<> on the pointer instead, but no good. Wasn’t sure why that would be invalid, so I thought I would kick it up.
[code]
AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
{
ScopedPointer w (new AudioUnitPluginWindowCocoa (*this, false));
if (! ((AudioUnitPluginWindowCocoa*) w)->isValid())
w = 0;
#if JUCE_SUPPORT_CARBON
if (w == 0)
w = new AudioUnitPluginWindowCarbon (*this);
if (! ((AudioUnitPluginWindowCarbon*) w)->isValid())
w = 0;
}
looks like you’ve been making changes here. The pointer error is gone anyhow. And though loading the plugin and using it in my main audioCallback method seems fine (it processes audio) … I get this error when I try to view the plugin UI:
Closing AU GUI: FM8
Closing AU GUI: FM8
Program received signal: “EXC_BAD_ACCESS”.
It doesn’t seem to always happen though. Certain plugins have issues more often that others. Perhaps something in the pluginInstance isn’t being allocated ?
Here is one that “worked”, it has issues as well … but I always figured that was the fault of the plugin
(I think I remember seeing those previously):
Closing AU GUI: 4Front Bass
Closing AU GUI: 4Front Bass
Closing AU GUI: 4Front Bass
Opening AU GUI: 4Front Bass
Closing AU GUI: 4Front Bass
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 489
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 489
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: CGSOrderWindowList
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 489
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: CGSRemoveWindowFromWindowOrderingGroup: Invalid window
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 489
Sat Mar 20 10:59:06 Aaron-Leeses-MacBook.local jucedemo[1496] <Error>: kCGErrorIllegalArgument: CGSRemoveWindowFromWindowMovementGroup: Invalid window
done removing a virtual instrument
So you did, sorry. I should have backed up and sent you more.
No worries though, seems I got it … just a silly typo in juce_AudioPluginFormat.mm
[code]AudioProcessorEditor* AudioUnitPluginInstance::createEditor()
{
ScopedPointer w (new AudioUnitPluginWindowCocoa (*this, false));
if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor*> (w))->isValid())
w = 0;
#if JUCE_SUPPORT_CARBON
if (w == 0)
{
w = new AudioUnitPluginWindowCarbon (*this);
if (! static_cast <AudioUnitPluginWindowCocoa*> (static_cast <AudioProcessorEditor*> (w))->isValid())
w = 0;
}
#endif
if (w == 0)
w = new AudioUnitPluginWindowCocoa (*this, true); // use AUGenericView as a fallback
return w.release();
} [/code]
the static cast within #if JUCE_SUPPORT_CARBON should be AudioUnitPluginWindowCarbon instead of Cocoa I believe. Which explains why some plugs worked out ok and others crashed.