41 #if !defined(__CAHALAudioDevice_h__)
42 #define __CAHALAudioDevice_h__
49 #include "CAHALAudioObject.h"
55 class CAHALAudioDevice
57 public CAHALAudioObject
62 CAHALAudioDevice(AudioObjectID inAudioDevice);
63 CAHALAudioDevice(CFStringRef inUID);
64 virtual ~CAHALAudioDevice();
68 CFStringRef CopyDeviceUID()
const;
69 bool HasModelUID()
const;
70 CFStringRef CopyModelUID()
const;
71 CFStringRef CopyConfigurationApplicationBundleID()
const;
72 CFURLRef CopyIconLocation()
const;
73 UInt32 GetTransportType()
const;
74 bool CanBeDefaultDevice(
bool inIsInput,
bool inIsSystem)
const;
75 bool HasDevicePlugInStatus()
const;
76 OSStatus GetDevicePlugInStatus()
const;
78 bool IsHidden()
const;
79 pid_t GetHogModeOwner()
const;
80 bool IsHogModeSettable()
const;
82 void ReleaseHogMode();
83 bool HasPreferredStereoChannels(
bool inIsInput)
const;
84 void GetPreferredStereoChannels(
bool inIsInput, UInt32& outLeft, UInt32& outRight)
const;
85 void SetPreferredStereoChannels(
bool inIsInput, UInt32 inLeft, UInt32 inRight);
86 bool HasPreferredChannelLayout(
bool inIsInput)
const;
87 void GetPreferredChannelLayout(
bool inIsInput, AudioChannelLayout& outChannelLayout)
const;
88 void SetPreferredStereoChannels(
bool inIsInput, AudioChannelLayout& inChannelLayout);
89 UInt32 GetNumberRelatedAudioDevices()
const;
90 void GetRelatedAudioDevices(UInt32& ioNumberRelatedDevices, AudioObjectID* outRelatedDevices)
const;
91 AudioObjectID GetRelatedAudioDeviceByIndex(UInt32 inIndex)
const;
95 UInt32 GetNumberStreams(
bool inIsInput)
const;
96 void GetStreams(
bool inIsInput, UInt32& ioNumberStreams, AudioObjectID* outStreamList)
const;
97 AudioObjectID GetStreamByIndex(
bool inIsInput, UInt32 inIndex)
const;
98 UInt32 GetTotalNumberChannels(
bool inIsInput)
const;
99 void GetCurrentVirtualFormats(
bool inIsInput, UInt32& ioNumberStreams, AudioStreamBasicDescription* outFormats)
const;
100 void GetCurrentPhysicalFormats(
bool inIsInput, UInt32& ioNumberStreams, AudioStreamBasicDescription* outFormats)
const;
104 bool IsRunning()
const;
105 bool IsRunningSomewhere()
const;
106 UInt32 GetLatency(
bool inIsInput)
const;
107 UInt32 GetSafetyOffset(
bool inIsInput)
const;
108 bool HasClockDomain()
const;
109 UInt32 GetClockDomain()
const;
110 Float64 GetActualSampleRate()
const;
111 Float64 GetNominalSampleRate()
const;
112 void SetNominalSampleRate(Float64 inSampleRate);
113 UInt32 GetNumberAvailableNominalSampleRateRanges()
const;
114 void GetAvailableNominalSampleRateRanges(UInt32& ioNumberRanges, AudioValueRange* outRanges)
const;
115 void GetAvailableNominalSampleRateRangeByIndex(UInt32 inIndex, Float64& outMinimum, Float64& outMaximum)
const;
116 bool IsValidNominalSampleRate(Float64 inSampleRate)
const;
117 bool IsIOBufferSizeSettable()
const;
118 UInt32 GetIOBufferSize()
const;
119 void SetIOBufferSize(UInt32 inBufferSize);
120 bool UsesVariableIOBufferSizes()
const;
121 UInt32 GetMaximumVariableIOBufferSize()
const;
122 bool HasIOBufferSizeRange()
const;
123 void GetIOBufferSizeRange(UInt32& outMinimum, UInt32& outMaximum)
const;
124 AudioDeviceIOProcID CreateIOProcID(AudioDeviceIOProc inIOProc,
void* inClientData);
125 void DestroyIOProcID(AudioDeviceIOProcID inIOProcID);
126 void StartIOProc(AudioDeviceIOProcID inIOProcID);
127 void StartIOProcAtTime(AudioDeviceIOProcID inIOProcID, AudioTimeStamp& ioStartTime,
bool inIsInput,
bool inIgnoreHardware);
128 void StopIOProc(AudioDeviceIOProcID inIOProcID);
129 void GetIOProcStreamUsage(AudioDeviceIOProcID inIOProcID,
bool inIsInput,
bool* outStreamUsage)
const;
130 void SetIOProcStreamUsage(AudioDeviceIOProcID inIOProcID,
bool inIsInput,
const bool* inStreamUsage);
131 Float32 GetIOCycleUsage()
const;
132 void SetIOCycleUsage(Float32 inValue);
136 void GetCurrentTime(AudioTimeStamp& outTime);
137 void TranslateTime(
const AudioTimeStamp& inTime, AudioTimeStamp& outTime);
138 void GetNearestStartTime(AudioTimeStamp& ioTime,
bool inIsInput,
bool inIgnoreHardware);
142 bool HasVolumeControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
143 bool VolumeControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
144 Float32 GetVolumeControlScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
145 Float32 GetVolumeControlDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
146 void SetVolumeControlScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue);
147 void SetVolumeControlDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue);
148 Float32 GetVolumeControlScalarForDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue)
const;
149 Float32 GetVolumeControlDecibelForScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue)
const;
151 bool HasSubVolumeControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
152 bool SubVolumeControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
153 Float32 GetSubVolumeControlScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
154 Float32 GetSubVolumeControlDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
155 void SetSubVolumeControlScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue);
156 void SetSubVolumeControlDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue);
157 Float32 GetSubVolumeControlScalarForDecibelValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue)
const;
158 Float32 GetSubVolumeControlDecibelForScalarValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue)
const;
160 bool HasMuteControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
161 bool MuteControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
162 bool GetMuteControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
163 void SetMuteControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel,
bool inValue);
165 bool HasSoloControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
166 bool SoloControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
167 bool GetSoloControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
168 void SetSoloControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel,
bool inValue);
170 bool HasStereoPanControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
171 bool StereoPanControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
172 Float32 GetStereoPanControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
173 void SetStereoPanControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel, Float32 inValue);
174 void GetStereoPanControlChannels(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32& outLeftChannel, UInt32& outRightChannel)
const;
176 bool HasJackControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
177 bool GetJackControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
179 bool HasSubMuteControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
180 bool SubMuteControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
181 bool GetSubMuteControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
182 void SetSubMuteControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel,
bool inValue);
184 bool HasiSubOwnerControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
185 bool iSubOwnerControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
186 bool GetiSubOwnerControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
187 void SetiSubOwnerControlValue(AudioObjectPropertyScope inScope, UInt32 inChannel,
bool inValue);
189 bool HasDataSourceControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
190 bool DataSourceControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
191 UInt32 GetCurrentDataSourceID(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
192 void SetCurrentDataSourceByID(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inID);
193 UInt32 GetNumberAvailableDataSources(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
194 void GetAvailableDataSources(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32& ioNumberSources, UInt32* outSources)
const;
195 UInt32 GetAvailableDataSourceByIndex(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inIndex)
const;
196 CFStringRef CopyDataSourceNameForID(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inID)
const;
198 bool HasDataDestinationControl(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
199 bool DataDestinationControlIsSettable(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
200 UInt32 GetCurrentDataDestinationID(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
201 void SetCurrentDataDestinationByID(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inID);
202 UInt32 GetNumberAvailableDataDestinations(AudioObjectPropertyScope inScope, UInt32 inChannel)
const;
203 void GetAvailableDataDestinations(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32& ioNumberDestinations, UInt32* outDestinations)
const;
204 UInt32 GetAvailableDataDestinationByIndex(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inIndex)
const;
205 CFStringRef CopyDataDestinationNameForID(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inID)
const;
207 bool HasClockSourceControl()
const;
208 bool ClockSourceControlIsSettable()
const;
209 UInt32 GetCurrentClockSourceID()
const;
210 void SetCurrentClockSourceByID(UInt32 inID);
211 UInt32 GetNumberAvailableClockSources()
const;
212 void GetAvailableClockSources(UInt32& ioNumberSources, UInt32* outSources)
const;
213 UInt32 GetAvailableClockSourceByIndex(UInt32 inIndex)
const;
214 CFStringRef CopyClockSourceNameForID(UInt32 inID)
const;
215 UInt32 GetClockSourceKindForID(UInt32 inID)
const;