Re: Closing Carbon View Components
Re: Closing Carbon View Components
- Subject: Re: Closing Carbon View Components
- From: Bill Stewart <email@hidden>
- Date: Mon, 11 Nov 2002 01:12:54 -0800
I would strongly advise you against this approach.
The API for the Carbon View is providing you a window where the host is
expecting you to display your UI - your code is disregarding that
directive and putting up its own window instead - not a very polite or
well-mannered behaviour on your part.
We have yet to address formally the Cocoa View side of things for Audio
Units and will definately do so in a future release.
So, any discussion past that central point is in my view mute.
Bill
On Sunday, November 10, 2002, at 04:21 PM, Andy wrote:
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.
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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.