41 #include "AUParamInfo.h"
42 #include "CAXException.h"
44 AUParamInfo::AUParamInfo (AudioUnit inAU,
46 bool inIncludeReadOnly,
47 AudioUnitScope inScope,
48 AudioUnitElement inElement)
56 OSStatus result = AudioUnitGetPropertyInfo(mAU, kAudioUnitProperty_ParameterList, inScope, mElement, &size, NULL);
57 if (size == 0 || result)
return;
59 int nparams = size /
sizeof(AudioUnitPropertyID);
60 mParamListID =
new AudioUnitParameterID[nparams];
62 memset (mParamListID, 0xFF, size);
64 AudioUnitParameterID *paramList =
new AudioUnitParameterID[nparams];
66 result = AudioUnitGetProperty(mAU, kAudioUnitProperty_ParameterList, mScope, mElement, paramList, &size);
68 delete [] mParamListID;
75 for (
int i = 0; i < nparams; ++i)
77 CAAUParameter auvp (mAU, paramList[i], mScope, mElement);
78 const AudioUnitParameterInfo ¶mInfo = auvp.ParamInfo();
81 if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
82 && !(paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
86 if (!inIncludeExpert && auvp.IsExpert())
90 if (!(paramInfo.flags & kAudioUnitParameterFlag_IsWritable)
91 && (paramInfo.flags & kAudioUnitParameterFlag_IsReadable))
93 if (!inIncludeReadOnly)
97 mParamListID[mNumParams] = paramList[i];
102 auvp.GetClumpID (clump);
103 mParams[clump].push_back (auvp);
109 AUParamInfo::~AUParamInfo()
111 delete [] mParamListID;
114 UInt32 AUParamInfo::NumParamsForClump (UInt32 inClump)
const
116 ParameterMap::const_iterator it = mParams.find(inClump);
117 if (it != mParams.end())
118 return (*it).second.size();
122 const CAAUParameter* AUParamInfo::GetParamInfo (AudioUnitParameterID inParamID)
const
124 for (ParameterMap::const_iterator it = mParams.begin(); it != mParams.end(); ++it) {
125 const ParameterList &list = (*it).second;
126 for (ParameterList::const_iterator iter = list.begin(); iter != list.end(); ++iter) {
127 if (inParamID == (*iter).mParameterID) {