Re: SDK Available
Re: SDK Available
- Subject: Re: SDK Available
- From: Marc Poirier <email@hidden>
- Date: Mon, 28 Apr 2003 22:44:58 +0200 (CEST)
>
The April 2003 Core Audio SDK is now live in Member Site to all ADC
>
members. There should be a link from
>
>
http://developer.apple.com/audio
>
>
This SDK contains some revisions to the sample code as well as some
>
important fixes and improvements in the base classes for the AUs -
>
there is a file that describes the important differences from the
>
previous Dec Tools release
Ah, 'tis a nice update, thank you CoreAudio peoples! I have found a few
issues, though, after poking through the new SDK stuff...
old issues still unresolved:
I never noticed this before, but I was thinking, shouldn't the
~AUEffectBase and ~AUCarbonViewControl destructors be virtual?
The worst part of the ~CarbonEventHandler CFDictionaryGetKeysAndValues has
been fixed, but the current SDK code still will not compile in CW. CW
does not allow the declaration of an array variable using a non-constant
size, like this:
EventHandlerRef theHandlers[count];
so you need to explicitly allocate it like this:
EventHandlerRef *theHandlers = (EventHandlerRef*) malloc(count * sizeof(EventHandlerRef));
and then of course free it in at the end of the if (mHandlers != NULL)
statement:
free(theHandlers);
In AUCarbonViewControl::ParamToControl and
AUCarbonViewControl::ControlToParam, there is still the bad assumption
being made that a control for a parameter that supplies ValueStrings is a
pop-up menu control:
if (mParam.HasNamedParams())
do tweaks for pop-up menus;
I've brought this up before, but another reminder: This is a bad bad
assumption! There is a way to properly check if the control is a pop-up
menu and that proper method should be used instead:
ControlKind ctrlKind;
if ( (GetControlKind(mControl, &ctrlKind) == noErr) && (ctrlKind.kind == kControlKindPopupButton) )
do tweaks for pop-up menus;
I never mentioned this one before, but I'm wondering: What's the point of
the AUBase method SupportsTail() when the default return value of
GetTailTime() is 0 anyway? All I can see is that this makes it so that
you need to override 2 methods in order to supply tail size instead of
just overriding 1 method, and that just makes us dumb programmers all the
more likely to forget one and as a result mess things up (like I just did
in the release version of SFX Machine RT 1.0, for example). But maybe
there's a good reason for this that I'm not thinking of. If explicit
support or non-support is really critical, then maybe GetTailSize should
be more something like this:
virtual ComponentReset AUBase::GetTailSize(Float64 * outTailSize)
{ return kAudioUnitErr_InvalidProperty; }
new problems:
AUVPresets::AUVPresets() should use SetControl32BitMaximum, not
SetControlMaximum. Other than that, the SDK code has been fully migrated
to 32Bit control style, so far as I can see.
The AUMIDIEffectBase constructor should have the same stub as the
AUEffectBase constructor (so that the inPlaceProcess argument is
available).
Speaking of which, does that constructor option now essentially replace
the function AUInlineEffectBase? If so, then that is a very nice thing...
In SDKDiffs.rtf it says: "(7) SetMaxFramesPerSlice is no longer private
(sub class can overide)"
Yes it's public, but it's not virtual.
In AUBase::DispatchGetPropertyInfo the handling of FactoryPresets and
ParameterValueStrings has been tweaked, as described in SDKDiffs.rtf, to
handle NULL input to query whether or not the property is supported:
case kAudioUnitProperty_FactoryPresets:
require(inScope == kAudioUnitScope_Global, InvalidScope);
result = GetPresets(NULL);
if (!result) {
outDataSize = sizeof(CFArrayRef);
outWritable = false;
}
break;
case kAudioUnitProperty_ParameterValueStrings:
result = GetParameterValueStrings(inScope, inElement, NULL);
if (result == noErr) {
outDataSize = sizeof(CFArrayRef);
outWritable = false;
validateElement = false;
}
break;
But shouldn't there be handling of the case when the properties are not
supported, like I see for other properties, something like:
case kAudioUnitProperty_FactoryPresets:
require(inScope == kAudioUnitScope_Global, InvalidScope);
result = GetPresets(NULL);
if (!result) {
outDataSize = sizeof(CFArrayRef);
outWritable = false;
}
else
goto InvalidProperty;
break;
case kAudioUnitProperty_ParameterValueStrings:
result = GetParameterValueStrings(inScope, inElement, NULL);
if (result == noErr) {
outDataSize = sizeof(CFArrayRef);
outWritable = false;
validateElement = false;
}
else
goto InvalidProperty;
break;
_______________________________________________
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.