Re: ComponentInstanceRecord from AUBase
Re: ComponentInstanceRecord from AUBase
- Subject: Re: ComponentInstanceRecord from AUBase
- From: William Stewart <email@hidden>
- Date: Wed, 18 Nov 2009 16:57:50 -0800
Yes, except that:
You don't do it this way. From your AU code, you call the AUBase::PropertyChanged method and it issues a property changed notification. You don't use the event listener to do this from within an AU.
Bill
On Nov 18, 2009, at 7:03 AM, Andreas Tell wrote:
> Please ignore this query. I was missing the component argument at construction and mComponentInstance!
> Next time I will take a break before posting to the list ...
>
> sorry,
>
> Andreas
>
> Am 18.11.2009 um 14:55 schrieb Andreas Tell:
>
>> Dear Developers,
>>
>> I'm currently writing an Audio Unit that changes the latency property during processing. Following the the documentation I'd like to issue a Property Change Notification to the host from the audio unit. Here's what I do:
>>
>> AudioUnitEvent event;
>> event.mArgument.mProperty.mPropertyID = kAudioUnitProperty_Latency;
>> event.mArgument.mProperty.mAudioUnit = this; // <---- Bad assignment
>> event.mArgument.mProperty.mScope = kAudioUnitScope_Global;
>> event.mArgument.mProperty.mElement = 0;
>> event.mEventType = kAudioUnitEvent_PropertyChange;
>> AUEventListenerNotify (NULL, this, &event);
>>
>> Unfortunately it turns out that it's not so simple. The problem is that mAudioUnit is a ComponentInstanceRecord* and this is a pointer of a class derived from AUBase. The ComponentInstanceRecord is given to the GUI upon instantiation, but I have to issue the latency change from the AU itself. I've searched the headers, docs, archive, and found no way to retrieve the component instance from the class pointer.
>>
>> Is there any way to resolve this?
>>
>> Thanks,
>>
>> Andreas
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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
_______________________________________________
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