Re: AU Host Window Compositing flags
Re: AU Host Window Compositing flags
- Subject: Re: AU Host Window Compositing flags
- From: Michael Hopkins <email@hidden>
- Date: Tue, 05 Nov 2002 13:38:22 -0800
Franck,
There was a good reason that AudioUnitHosting does not use window
compositing. The generic view does not work correctly with this flag. We
have recently tracked down and fixed the problems that prevented these view
items from working correctly and plan on shipping an updated
AudioUnitHosting app that supports compositing in the future.
Here is a summary of the things that we discovered while fixing these issues
that we would like to share in order to help others going down the same
path:
Compositing tips
----------------
If you use HIView, the host application needs to have compositing turned on
for the window you are embedded in. Your component cannot and should not try
to set this attribute for the hosting window. This attribute can only be set
at creation time of the window. To check to see if compositing is on for
your window, do the following:
WindowAttributes attributes;
err = GetWindowAttributes(carbonWindowRef, &attributes);
Bool hasCompositing = attributes & kWindowCompositingAttribute;
Please do not assume that compositing is on for your host. You should
probably check and bail if necessary if it is not on, or even better,
provide a non HIView dependent interface in that case.
Using carbon controls in a composited window
--------------------------------------------
You may mix carbon controls and HIViews. You need to do some specific things
for your carbon controls in order to make sure they behave correctly.
1) Do not use EmbedControl() to add controls to the carbon root pane.
Instead use HIViewAddSubview. Since a ControlRef and HIViewRef are the same
type, you can use these interchangeably. We will probably add an accessor to
the mCarbonPane for subview management. Keep in mind that this is a
protected method, so if you derive from AUCarbonViewBase, you may access
this data member directly.
2) Make sure that all of your panes and controls are being added in a
parent-relative matter and not in a window relative manner. HIView.h adds
many routines for coordinate mapping between views. Your view coordinate
system should be relative to the root pane and not the window.
3) Do not use Draw1Control, DrawControls, or UpdateControls to update your
custom carbon controls. HIViewSetNeedsDisplay (view, true) should be
sufficient for all of your updating needs.
4) Certain types of standard carbon controls do not support compositing:
editable text control, the list box control, the scrolling text field
control, and the data browser. The Data browser is being updated to support
compositing, and the Unicode text control replaces the standard edit text
control
There are many more issues that people have brought up on the list. We are
still working to resolve these problems, and will post additional
information related to this topic as these problems are resolved. If anyone
else has additional comments or related tips, please post them and share
with the list.
Thanks,
Michael Hopkins
CoreAudio Carbonite
>
From: Franck Stauffer <email@hidden>
>
Date: Tue Nov 5, 2002 5:31:45 AM US/Pacific
>
To: email@hidden
>
Subject: AU Host Window Compositing flags
>
>
Hello,
>
>
I found out what the problem is with HIView and audio units...Hosts (i
>
only tested AUHosting and Logic) don't create windows for the audio
>
>
units with compositing enabled. I enabled it in AudioUnitHosting and
>
now all my problems are gone!!! So what's the point? is there a reason
>
hosts shouldn't create windows with compositing enabled?
>
>
Franck
_______________________________________________
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.