41 #ifndef __CAComponentDescription_h__
42 #define __CAComponentDescription_h__
44 #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
45 #include <AudioUnit/AudioUnit.h>
47 #include <ConditionalMacros.h>
48 #include <AudioUnit.h>
51 #include "CACFDictionary.h"
55 void CAShowComponentDescription(
const AudioComponentDescription *desc);
60 class CAComponentDescription :
public AudioComponentDescription {
62 CAComponentDescription() { memset (
this, 0,
sizeof (AudioComponentDescription)); }
64 CAComponentDescription (OSType inType, OSType inSubtype = 0, OSType inManu = 0);
66 CAComponentDescription(
const AudioComponentDescription& desc) { memcpy (
this, &desc,
sizeof (AudioComponentDescription)); }
74 bool IsAUFX()
const {
return componentType == kAudioUnitType_Effect; }
75 bool IsAUFM()
const {
return componentType == kAudioUnitType_MusicEffect; }
77 bool IsEffect ()
const {
return IsAUFX() || IsAUFM() || IsPanner(); }
79 bool IsOffline ()
const {
return componentType ==
'auol'; }
81 bool IsFConv ()
const {
return componentType == kAudioUnitType_FormatConverter; }
83 bool IsPanner ()
const {
return componentType == kAudioUnitType_Panner; }
85 bool IsMusicDevice ()
const {
return componentType == kAudioUnitType_MusicDevice; }
87 #ifndef MAC_OS_X_VERSION_10_4
88 bool IsGenerator ()
const {
return componentType ==
'augn'; }
90 bool IsGenerator ()
const {
return componentType ==kAudioUnitType_Generator; }
93 bool IsOutput ()
const {
return componentType == kAudioUnitType_Output; }
95 bool IsSource ()
const {
return IsMusicDevice() || IsGenerator(); }
97 OSType Type ()
const {
return componentType; }
98 OSType SubType ()
const {
return componentSubType; }
99 OSType Manu ()
const {
return componentManufacturer; }
101 int Count()
const {
return AudioComponentCount(const_cast<CAComponentDescription*>(
this)); }
104 bool Matches (
const AudioComponentDescription &desc)
const;
110 void Print(FILE* file = stdout)
const { _CAShowComponentDescription (
this, file); }
112 OSStatus Save (CFPropertyListRef *outData)
const;
113 OSStatus Restore (CFPropertyListRef &inData);
116 static void _CAShowComponentDescription (
const AudioComponentDescription *desc, FILE* file);
117 friend void CAShowComponentDescription (
const AudioComponentDescription *desc);
120 inline bool operator< (
const AudioComponentDescription& x,
const AudioComponentDescription& y)
122 return memcmp (&x, &y, offsetof (AudioComponentDescription, componentFlags)) < 0;
125 inline bool operator== (
const AudioComponentDescription& x,
const AudioComponentDescription& y)
127 return !memcmp (&x, &y, offsetof (AudioComponentDescription, componentFlags));
130 inline bool operator!= (
const AudioComponentDescription& x,
const AudioComponentDescription& y)
bool TTFOUNDATION_EXPORT operator!=(const TTObject &anObject, const TTObject &anotherObject)
Compare two objects for inequality.
bool TTFOUNDATION_EXPORT operator==(const TTObject &anObject, const TTObject &anotherObject)
Compare two objects for equality.