Re: Displaying an AudioUnitCarbonView in a Cocoa application? [solved]
Re: Displaying an AudioUnitCarbonView in a Cocoa application? [solved]
- Subject: Re: Displaying an AudioUnitCarbonView in a Cocoa application? [solved]
- From: Per Bull Holmen <email@hidden>
- Date: Fri, 11 Jun 2010 07:25:51 -0700 (PDT)
Hi all
The problem is solved. I wanted to display a window with a Carbon UI for an AudioUnit, within a Cocoa application. Now that it seems Apple has removed most Carbon documentation from their website, that can be quite a challenge for one who has never learned Carbon. At the same time, it seems most AudioUnits are Carbon only... my error was that after copying example code found on the web (not Apple's site), I tried to show the window using SelectWindow... after replacing SelectWindow with ShowWindow it worked.
For those who might be interested, I have pasted a working code here, though it is not thoroughly tested. Everyone who use it, must make sure only one window is opened per AudioUnit. Otherwise I believe there could be trouble. Error handling is not tested at all.
http://www.pastebin.org/324578
I have two questions for those more familiar with Carbon, though. In Apple's technote...
http://developer.apple.com/mac/library/technotes/tn2007/tn2213.html
...they say we must keep an EventHandlerRef mCarbonEventHandlerRef, after calling InstallWindowEventHandler. That is to call RemoveEventHandler(mCarbonWindowHandlerRef); when the parent window gets closed. But in the technote they create a Cocoa window with a Carbon window as a child. I just create a Carbon window from ground up. Do I still need to call RemoveEventHandler in my window closing event handling procedure? I assume not.
The second question is whether I need to explicitly call DisposeWindow when it gets closed.
Per
_______________________________________________
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