Re: CocoaAUHost-like example for Carbon UIs
Re: CocoaAUHost-like example for Carbon UIs
- Subject: Re: CocoaAUHost-like example for Carbon UIs
- From: Paul Davis <email@hidden>
- Date: Wed, 22 Sep 2010 08:07:10 -0400
On Wed, Sep 22, 2010 at 7:32 AM, Geert Bevin <email@hidden> wrote:
> Hi,
>
> I'm totally new to MacOSX development and gradually learning. I'm debugging a problem with one of our applications where an Audio Unit with a Carbon GUI doesn't properly get keyboard focus when it's embedded in a Carbon view. We're using the Juce framework and I think that the problem might actually lie in the framework's focus handling itself. However, to be certain I'd like to write a simple self-contained example that merely creates an AU Carbon view embedded into a Cocoa application.
>
> The only example for hosting Audio Units I could find is the CocoaAUHost one, but it only show the generic UI for AUs that don't provide a Cocoa view. I'm starting to figure out now how to shoehorn "Technical Note TN2213: Audio Units: Embedding a Carbon View in a Cocoa Window" into the CocoaAUHost example, but given my novice status with all the frameworks, I'm afraid that it might take a while.
>
> Hence this simple question, is there a CocoaAUHost-like example available somewhere that also does Carbon UI embedding?
its not a simple example, but ardour/mixbus do this. they are based on
Cocoa, but they do not use Cocoa directly (they use a crossplatform
toolkit called GTK that in turn uses Cocoa). source code is all
available. 95% of the relevant stuff is in gtk2_ardour/au_pluginui.mm
which mixes C++, Cocoa, Objective-C and gtkmm (the C++ wrapper around
gtk) to get stuff done. the code is GPL'ed ... if you're working on
proprietary projects, then please be sure to respect the license.
ardour's code itself is derived from both the technote you mentioned,
and several other examples i found online (none of which was
"complete" by themselves). its likely still not quite 100%, since most
plugin developers seem to assume that "it works in Logic" is enough.
getting the focus stuff correct is VERY hard to do. in fact, its not
even entirely clear what "correct" even means - the user doesn't
necessarily want all keyboard input sent to the plugin ... or do
they?.
in ardour, i settled for a button that explicitly forces kbd focus
into the plugin window. it still doesn't work with some Carbon-based
GUIs that play games with the Carbon API (e.g. creating additional
overlay windows to collect licensing information).
_______________________________________________
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