• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SDK Available
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SDK Available


  • Subject: Re: SDK Available
  • From: Bill Stewart <email@hidden>
  • Date: Thu, 1 May 2003 17:14:58 -0700

OK

Marc , Urs, thanks for the feedback...

Any other glaring or otherwise comments or concerns?

Bill

On Monday, April 28, 2003, at 01:44 PM, Marc Poirier wrote:

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?

These are already by virtue of their base classes.




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);

Yes indeed - the compiler has no idea what count is equal to... surprised this works at all actually - fixed.


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;

OK - good point.

I added Urs suggestion for control kind of popup arrow as well.. seemed reasonable to me.

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.


Found and changed all of the remaining SetControl calls to use the 32Bit versions


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; }

Zero is typically NOT the real tail value - so yes, you can overide the GetTail and return a non-zero value, but you also need to say that you do support the property. That's the way it stays.

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.

Found and changed all of the remaining SetControl calls to use the 32Bit versions (Including the XControl class in XFramework




The AUMIDIEffectBase constructor should have the same stub as the
AUEffectBase constructor (so that the inPlaceProcess argument is
available).

Yes - missed that one, so that's fixed

Speaking of which, does that constructor option now essentially replace
the function AUInlineEffectBase? If so, then that is a very nice thing...

Yes - we just left that class there for those that might be using it, but we'd rather see people move over to the AUEffectBase (as that is the one we will maintain)

We also believe it is very important the units support the inplace property ID - it doesn't necessarily have to be settable (though that shouldn't be an issue) - but some hosts will want to know if they can buffer manage your unit or not. Even if you don't support in place processing, its a good idea to report this as a read only property so a host can tell..


In SDKDiffs.rtf it says: "(7) SetMaxFramesPerSlice is no longer private
(sub class can overide)"

Yes it's public, but it's not virtual.

Code merge problem... sorry about that.

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;


-- mailto:email@hidden
tel: +1 408 974 4056

________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __
_______________________________________________
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.
  • Follow-Ups:
    • Parameters - Re: SDK Available
      • From: Urs Heckmann <email@hidden>
    • Re: SDK Available
      • From: Marc Poirier <email@hidden>
    • Re: SDK Available
      • From: Urs Heckmann <email@hidden>
  • Prev by Date: Re: CoreAudio HAL Limits?
  • Next by Date: Re: setNumSampleFramesPerBuffer()
  • Previous by thread: Re: setNumSampleFramesPerBuffer()
  • Next by thread: Re: SDK Available
  • Index(es):
    • Date
    • Thread