Re: Audio Unit Presets and undo
Re: Audio Unit Presets and undo
- Subject: Re: Audio Unit Presets and undo
- From: Bjorn Roche <email@hidden>
- Date: Thu, 7 Jun 2007 18:30:20 -0400
On Jun 7, 2007, at 11:27 AM, Bjorn Roche wrote:
Hey all,
I am restructuring my code a bit to support native Audio Unit GUIs
and running into trouble with Presets, parameter list changes and
undo. Previously, when a parameter list or preset changed event was
fired, I always knew it was in response to something I did, so I
did not have to create a new edit object. Now that I'm adding
support for native GUIs, those events may be fired in response to
something I did, or in response to something the user did, like
select a new preset or changed a parameter in the native UI. This
means I must have some way to distinguish my events from UI
triggered events so that I can create an edit for UI triggered
events (otherwise undo won't work). Here's what I've tried:
when I restore a preset:
set flag
restore preset
unset flag
when responding to an event:
if flag is set
return
else
create an edit
but this doesn't work because, as far as I can tell, an extra event
gets fired later, after the flag is unset, meaning I'm unable to
distinguish between events that I initiated programatically and
events that were initiated by the UI. So, am I doing something
wrong to cause the extra event to fire? Is there some other
strategy I can use? I'm aware that I can listen to gesture begin
and gesture end events for parameters, but this is for properties.
I *think* I have the situation straightened out with preset changes,
because I can compare the changes against what I have in my data-
structures. However, when the parameter list changes (for example, by
changing the number of bands in apple's graphic EQ), I seem to get
multiple parameter changed events and the parameter list is different
each time, so as far as my app can tell each is a separate event.
Since I can't find anything about this on the list it makes me think
something is wrong with my code to cause all those extra events....
but maybe someone else knows more?
bjorn
-----------------------------
Bjorn Roche
XO Wave
Digital Audio Production and Post-Production Software
http://www.xowave.com
http://blog.bjornroche.com
http://myspace.com/xowave
_______________________________________________
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