Re: AU Cocoa UI in Carbon window?
Re: AU Cocoa UI in Carbon window?
- Subject: Re: AU Cocoa UI in Carbon window?
- From: Michael Hopkins <email@hidden>
- Date: Fri, 12 Sep 2008 11:32:12 -0700
- Resent-date: Fri, 12 Sep 2008 11:33:29 -0700
- Resent-from: Michael Hopkins <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: CoreAudio API <email@hidden>
Tahome,
It looks like you are using the HICocoaView incorrectly.
HICocoaViewSetView takes a cocoa view which you already passed in the
create call. You need to add the HICocoaView to the mCarbon pane.
Please read the documentation at:
http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Articles/HICocoaView.html
Hope this helps!
-michael
On Sep 11, 2008, at 6:22 AM, tahome izwah wrote:
Hi all,
I have written a Cocoa AudioUnit plug in and am trying to enable its
UI in AudioUnit hosts that do not yet support Cocoa UIs by using
HICocoaView in Leopard. For this I have two UI classes, the usual
Cocoa ViewFactory with the Cocoa view as well as a Carbon custom UI
for older hosts that only support Carbon UIs, such as Ableton Live. in
the Carbon UI I intend to load the Cocoa UI and use the Carbon view as
a wrapper for it. In order to accomplish this I have transplanted the
Carbon UI code CreateUI() from the custom Carbon UI AudioUnit template
to my Cocoa AU and I have verified that the Carbon UI is getting
called. So far so good - I can see the custom Carbon UI in hosts that
do not support Cocoa.
Now where I am stuck is how do I actually add the Cocoa view to the
Carbon mCarbonPane? I can load the Cocoa ViewFactory from the NIB
without problem and I am getting a valid AUView by instantiating my
Cocoa UI, but if I try using
if (AUView != NULL) {
HIViewRef wrapper = NULL;
status = HICocoaViewCreate(AUView, 0, &wrapper);
NSLog(@"1-status = %d", status);
status = HIViewAddSubview(mCarbonPane, wrapper);
NSLog(@"2-status = %d", status);
}
I am getting no error and no UI (an empty window as a matter of fact),
or, alternatively
if (AUView != NULL) {
status = HICocoaViewSetView(mCarbonPane, AUView);
}
I am getting a -50 and no UI. I have verified that the Carbon window
is a compositing window.
I think I am missing something fundamentally here and would appreciate
any insights you can offer because I am really stuck and don't know
where to look for advice.
Thank you very much,
--th
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden