Closing Carbon View Components
Closing Carbon View Components
- Subject: Closing Carbon View Components
- From: Andy <email@hidden>
- Date: Mon, 11 Nov 2002 00:21:58 +0000
I've been playing around with making cocoa interfaces for AUs and had
some considerable success so far.
But I've got a couple of niggling worries that need discussion with any
AU host developers and the AUCarbonViewBase / AUView component
developers on this list ...
The technique I'm using is very similar to that presented in Apple's
"Cocoa in Carbon" example, although it required a bit more work to get
rid of static data. Basically when the view component is created by a
host app, I use a subclass of AUCarbonViewBase to load a cocoa bundle
containing a Window Controller. It seems to work perfectly, the cocoa
window controller is working just as well as it would in any cocoa app .
But once the cocoa window is created I no longer have any requirement
for the carbon window/view/component because my cocoa window is now
open, contains a reference to it's AU and is running in the Hosts GUI
thread.
So to put it another way: I only require the carbon view component as a
launch vehicle for my cocoa interface bundle, once launched I want to
be able to dump the carbon view component and it's window because it
appears to be no longer needed.
I prefer not to attempt embedding a cocoa view in the carbon window,
instead I am creating a separate cocoa window which gives me all the
benefits of cocoa window manipulation. In fact it seems possible to
even create multiple windows for an AU using this technique. (Although
I'm not sure how often that would be desirable [separate discussion
required!] ).
My questions are, in no particular order of preference ...
- Just how "required" is the AUView component and it's window ? How
much do AU hosts "rely" on the continued existence of the view
component ?
- Do I need to keep the carbon view and it's component around or can I
safely close the view component and dispose the window from inside my
cocoa controller ( ::CloseComponent() / ::DisposeWindow() or
::ReleaseWindow() ? )
Currently I'm hiding the carbon window when the cocoa window is
created. (It seemed the safest thing to do atm) Reasons: because once
the cocoa window is created the carbon view appears to be useless, I
now have a cocoa NSWindow to do the job instead.
- I'm a little concerned about receiving events from hosts, say
automation events, I don't have much to test this with atm but I hope
to receive a copy of Logic this week. At the moment it seems to me that
I might need to keep the view component open in order to get automation
view update events from the host. Is this correct ? I'm hoping I can
safely hook up my cocoa views with parameter change notifications from
the AudioUnit component and thus bybass any need for the carbon view
component altogether ?
- Who is ultimately responsible for the view component ? Who really
owns it at run-time ? I guess the Host does ?
This is my main worry. Closing the view component from the AU side
instead of the host side could upset a host ?
_______________________________________________
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.