Re: Property Listener for parameter values?
Re: Property Listener for parameter values?
- Subject: Re: Property Listener for parameter values?
- From: Art Gillespie <email@hidden>
- Date: Thu, 21 Nov 2002 13:51:53 -0500
Yeah... I use a custom *Property* on the AudioUnit so I can get a reference
to my main DSP object and pass it to my GUI class. This approach makes it
easier to support multiple formats since the gui and main dsp object only
have knowledge of each other, with no format-specific code. Like so
(in my au view)
...
Phatmatik* phatmatik = NULL;
UInt32 size = sizeof(Phatmatik*);
/* get a pointer to our AudioUnit's phatmatik member */
AudioUnitGetProperty(mEditAudioUnit, kBAProperty_PhatmatikInstance,
kAudioUnitScope_Global, 1, &phatmatik, &size);
phatmatikgui = new PhatmatikGUI(phatmatik, this);
...
(and in my au)
ComponentResult PhatmatikAU::GetProperty(
AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void* outData
)
{
...
} else if (inID == kBAProperty_PhatmatikInstance) {
//the mui needs to know about phatmatik
*((Phatmatik**)outData) = phatmatik;
return noErr;
...
}
As marc points out, make sure that kBAProperty_MyAUInstance (or whatever) is
greater than 63999, as Apple reserves those 64000 properties for their own
use. Because I'm sure they'll need them. :P
Art
>
>0xBA
On 11/21/02 2:08 AM, "Urs Heckmann" <email@hidden> wrote:
>
Hi Art,
>
>
how do you pass non-parameter values by that method? I mean, you're
>
supposed to display a sample/loop editor :-)
>
>
Do you set up arbitrary ParameterIDs? Would that be allowed?
>
>
(I use a timer driven method checking GetProperty for VU meters just
>
like in VST...)
>
>
Cheers,
>
>
;) Urs
>
>
>
Am Mittwoch, 20.11.02, um 20:49 Uhr (Europe/Berlin) schrieb Art
>
Gillespie:
>
>
> That's what I use to communicate between gui & dsp, and it seems to
>
> work
>
> well. (Have no idea if it's the *right* way)
>
>
>
> Art
>
>>> 0xBA
>
>
>
>> AudioUnitParameter param;
>
>>
>
>> param.mAudioUnit = this;
>
>> param.mParameterID = theChangedParameterID;
>
>> param.mScope = kAudioUnitScope_Global;
>
>> param.mElement = 0;
>
>>
>
>> OSStatus result = AUParameterSet(NULL, NULL, ¶m,
>
>> theChangedParameterValue, 0);
>
>>
>
>>
>
>> Thanks for any advice,
>
>> Marc
>
_______________________________________________
>
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.
_______________________________________________
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.