Re: Some AudioUnits crash WhackedTV sample code
Re: Some AudioUnits crash WhackedTV sample code
- Subject: Re: Some AudioUnits crash WhackedTV sample code
- From: john <email@hidden>
- Date: Mon, 20 Mar 2006 22:07:18 -0500
Hi Bill,
On the other hand, I have always used the correct code you have below
and I get a crash on the call the setShowsExpertParameters with the
F8 audiounit.
-- John
Robert,
I've reproduced the crash by making the following change in AULab:
Originally it is like this:
AUGenericView *viewToShow = [[[AUGenericView alloc]
initWithAudioUnit:mCurrentAU] autorelease];
Now, I change it to this:
AUGenericView *viewToShow = [[AUGenericView alloc] autorelease];
[viewToShow setShowsExpertParameters: YES];
[viewToShow initWithAudioUnit:mCurrentAU];
And I get a crash - with ANY AU - yours, Apple's, etc. The reason
being, that I am calling a method on the object BEFORE I have
called the init... method - so the setShows... method is expecting
state to be initialised that isn't until the init method is called.
I think the Cocoa convention is such that init methods should be
called before any other instance method. We can probably make the
generic view more robust here, but I don't think that is the
primary culprit.
If I change the code to do this:
AUGenericView *viewToShow = [[[AUGenericView alloc]
initWithAudioUnit:mCurrentAU] autorelease];
[viewToShow setShowsExpertParameters: YES];
Then everything is also fine...
If you make that change in the whacked TV code - then it should
also be fine. I'll send the bug over to the QT team.
Thanks
Bill
_______________________________________________
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