Re: Useful Fix for those Porting VSTGUI based plug-ins to AU
Re: Useful Fix for those Porting VSTGUI based plug-ins to AU
- Subject: Re: Useful Fix for those Porting VSTGUI based plug-ins to AU
- From: Marc Poirier <email@hidden>
- Date: Fri, 26 Sep 2003 14:20:31 -0500 (CDT)
Ahhh, there is a reason for that working in VST and not AU, a difference
in the specifications. With VST on Mac, the host is responsible for
dispatching the mouse down event to the plugin. In AU, that's not the
case, the plugin is responsible for catching the mouse down. And in the
VST docs, it is specified that the host is required to set the current
resource and current port for the plugin before dispatching certain
opcodes, mouse and draw and editOpen being a few of those (that is
actually one of the only bits of host documentation in the VST docs!).
So my point is just that VST plugs can safely assume that their port and
resource will be current during these times, but for AU that assumption is
not safe. It's a bit out-moded anyway since Resource Manager stuff and
QuickTime drawing are both legacy in OS X now, but VST is older, ya
know...
Anyway, I'm not writing this just to listen to myself type, but in case it
might be useful. If you're relying on VSTGUI in an AU, it might be
worthwhile to look at some other areas of the code with this in mind,
there might be other problem spots lurking in there.
Marc
On Fri, 26 Sep 2003, Art Gillespie wrote:
>
Fellow intrepid porters:
>
>
The problem of controls in VSTGUI-based plugins 'running away' in some
>
hosts (In my case this behavior was manifesting itself in DP 4.1 when
>
another window with animation (e.g. the performance meter) was open) is
>
caused by the following code in vstgui.cpp:1946:
>
>
void CDrawContext::getMouseLocation (CPoint &point)
>
{
>
... other platform switches omitted
>
#elif MAC
>
Point where;
>
GetMouse (&where);
>
point (where.h, where.v);
>
#elif MOTIF
>
>
...
>
>
}
>
>
Which should be
>
>
Point where;
>
CGrafPtr save;
>
GetPort(&save);
>
SetPort(getPort());
>
GetMouse (&where);
>
point (where.h, where.v);
>
SetPort(save);
>
>
Hope that saves someone else an hour or so of debugging :) Also, I no
>
longer subscribe to vst-development, so if anyone has the inclination
>
to post this there...
>
>
Best,
>
>
Art
>
>>0xBA
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.