41 #include "CAComponentDescription.h"
42 #include "CAStreamBasicDescription.h"
45 void CAShowComponentDescription(
const AudioComponentDescription *desc)
47 CAComponentDescription::_CAShowComponentDescription (desc, stdout);
50 void CAComponentDescription::_CAShowComponentDescription(
const AudioComponentDescription *desc, FILE* file)
55 fprintf (file,
"AudioComponentDescription: %s - ", CAStringForOSType(desc->componentType, str));
56 fprintf (file,
"%s - ", CAStringForOSType(desc->componentSubType, str));
57 fprintf (file,
"%s", CAStringForOSType(desc->componentManufacturer, str));
58 fprintf (file,
", 0x%X, 0x%X\n", (
int)desc->componentFlags, (
int)desc->componentFlagsMask);
62 CAComponentDescription::CAComponentDescription (OSType inType, OSType inSubtype, OSType inManu)
64 componentType = inType;
65 componentSubType = inSubtype;
66 componentManufacturer = inManu;
68 componentFlagsMask = 0;
71 bool CAComponentDescription::IsAU ()
const
73 bool flag = IsEffect() || IsMusicDevice() || IsOffline();
74 if (flag)
return true;
76 switch (componentType) {
77 case kAudioUnitType_Output:
78 case kAudioUnitType_FormatConverter:
79 case kAudioUnitType_Mixer:
85 inline bool _MatchTest (
const OSType &inTypeA,
const OSType &inTypeB)
87 return ((inTypeA == inTypeB) || (!inTypeA && !inTypeB) || (inTypeA && !inTypeB) || (!inTypeA && inTypeB));
90 bool CAComponentDescription::Matches (
const AudioComponentDescription &desc)
const
95 matches = _MatchTest (componentType, desc.componentType);
98 matches = _MatchTest (componentSubType, desc.componentSubType);
101 matches = _MatchTest (componentManufacturer, desc.componentManufacturer);