Re: validate StreamFormat
Re: validate StreamFormat
- Subject: Re: validate StreamFormat
- From: William Stewart <email@hidden>
- Date: Thu, 17 Jun 2004 18:11:01 -0700
See AUEffectBase::Initialize
It does it all for you, matches the channels, etc...
You validate your formats in Initialization (not when they are set)...
So:
MyEffectClass::Initialize ()
{
res = AUEffectBase::Initialize();
if (res) return res;
// if you get here, then you do your initialization work
}
Bill
On 17/06/2004, at 3:59 PM, Mark's Studio wrote:
>
What is the right thing to do in ChangeStreamFormat, so it's only
>
supported formats that's allowed?
>
>
>
UInt32 SpectrumAU::SupportedNumChannels ( const AUChannelInfo**
>
outInfo)
>
{
>
static AUChannelInfo synthChannels[] = { {1, 1}, {2, 2} };
>
if (outInfo != NULL)
>
*outInfo = synthChannels;
>
return sizeof(synthChannels) / sizeof(AUChannelInfo);
>
>
>
}
>
>
ComponentResult SpectrumAU::ChangeStreamFormat(AudioUnitScope iScope,
>
AudioUnitElement iElem, const CAStreamBasicDescription& sOld, const
>
CAStreamBasicDescription& sNew)
>
{
>
ComponentResult result = AUBase::ChangeStreamFormat(iScope, iElem,
>
sOld, sNew);
>
if (result == noErr)
>
{
>
if (sOld.NumberChannels()!=sNew.NumberChannels())
>
{
>
const UInt32 iCha=sNew.NumberChannels();
>
if ((iCha>2) || (sNew.NumberInterleavedChannels()>1))
>
result = kAudioUnitErr_FormatNotSupported;
>
>
}
>
}
>
>
return result;
>
}
>
Input/Output Channel Handling:
>
1-1 1-2 1-4 1-5 2-2 2-4 2-5 4-4 4-5
>
5-5 5-2 6-6 8-8
>
X X
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
>
OutputChan:2
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
>
OutputChan:4
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
>
OutputChan:5
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:2,
>
OutputChan:4
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:2,
>
OutputChan:5
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:4,
>
OutputChan:4
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:4,
>
OutputChan:5
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:5,
>
OutputChan:5
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:5,
>
OutputChan:2
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:6,
>
OutputChan:6
>
WARNING: Can Initialize Unit to un-supported num channels:InputChan:8,
>
OutputChan:8
>
>
>
Peter Mark
>
>
Mark's Recording Studio A/S
>
Lundeskovsvej 3
>
2900 Hellerup
>
Denmark
>
Tel: +45 35366078 Fax: +45 35366038
>
www.marks-studio.dk
>
email@hidden
>
_______________________________________________
>
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.
>
>
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement [GSV]
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
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.