Re: Starting Audio Unit programming in Xcode 6
Re: Starting Audio Unit programming in Xcode 6
- Subject: Re: Starting Audio Unit programming in Xcode 6
- From: Christian Rober <email@hidden>
- Date: Fri, 22 May 2015 23:04:04 -0400
Without testing it, your constructor seems to be throwing an exception (Open is a dispatched call to your constructor that catches any exceptions and returns them as normal OSStatus errors, see ComponentBase.cpp). The exception looks like it wraps an invalid parameter error (
10878, seen in AUComponent.h).
I think this exception is being thrown in your call to SetParameter. My first thought is that your kNumberOfParameters is set to 0. With no parameters reserved, trying to set one will throw that exact error/exception above.
The other part of this is that you are accidentally calling SetParameter on AUBase/YourClass and not the global scope. Though, from the code you shared, I don't even know how a 2 parameter SetParameter call to the base class would even compile.
I imagine the constructor body should look more like this:
Hardgainer::Hardgainer (AudioUnit component) : AUEffectBase (component) {
CreateElements ();
Globals () -> UseIndexedParameters (kNumberOfParameters); // <-- Should be non-zero
Globals () -> SetParameter (
kParameter_Gain,
kDefaultValue_Gain
); // <-- Need more arguments if calling AUBase::SetParameter.
….
Note: The indexed parameter gets created in global scope by setting it on the global element first. Only after this initial global setting can it be safely used by the AU.
--Christian
_______________________________________________
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