20 ENUM_CASE(kAudioObjectPropertyBaseClass );
24 ENUM_CASE(kAudioObjectPropertyModelName );
25 ENUM_CASE(kAudioObjectPropertyManufacturer );
26 ENUM_CASE(kAudioObjectPropertyElementName );
27 ENUM_CASE(kAudioObjectPropertyElementCategoryName);
28 ENUM_CASE(kAudioObjectPropertyElementNumberName );
29 ENUM_CASE(kAudioObjectPropertyOwnedObjects );
31 ENUM_CASE(kAudioObjectPropertySerialNumber );
32 ENUM_CASE(kAudioObjectPropertyFirmwareVersion );
33 ENUM_CASE(kAudioObjectPropertySelectorWildcard );
36 ENUM_CASE(kAudioDevicePropertyConfigurationApplication );
37 ENUM_CASE(kAudioDevicePropertyDeviceUID );
39 ENUM_CASE(kAudioDevicePropertyTransportType );
40 ENUM_CASE(kAudioDevicePropertyRelatedDevices );
41 ENUM_CASE(kAudioDevicePropertyClockDomain );
42 ENUM_CASE(kAudioDevicePropertyDeviceIsAlive );
43 ENUM_CASE(kAudioDevicePropertyDeviceIsRunning );
44 ENUM_CASE(kAudioDevicePropertyDeviceCanBeDefaultDevice );
45 ENUM_CASE(kAudioDevicePropertyDeviceCanBeDefaultSystemDevice);
48 ENUM_CASE(kAudioObjectPropertyControlList );
49 ENUM_CASE(kAudioDevicePropertySafetyOffset );
50 ENUM_CASE(kAudioDevicePropertyNominalSampleRate );
51 ENUM_CASE(kAudioDevicePropertyAvailableNominalSampleRates );
54 ENUM_CASE(kAudioDevicePropertyPreferredChannelsForStereo );
55 ENUM_CASE(kAudioDevicePropertyPreferredChannelLayout );
58 ENUM_CASE(kAudioClockDevicePropertyDeviceUID );
69 ENUM_CASE(kAudioEndPointDevicePropertyComposition );
70 ENUM_CASE(kAudioEndPointDevicePropertyEndPointList);
71 ENUM_CASE(kAudioEndPointDevicePropertyIsPrivate );
75 ENUM_CASE(kAudioStreamPropertyDirection );
76 ENUM_CASE(kAudioStreamPropertyTerminalType );
77 ENUM_CASE(kAudioStreamPropertyStartingChannel );
78 ENUM_CASE(kAudioStreamPropertyVirtualFormat );
79 ENUM_CASE(kAudioStreamPropertyAvailableVirtualFormats );
80 ENUM_CASE(kAudioStreamPropertyPhysicalFormat );
81 ENUM_CASE(kAudioStreamPropertyAvailablePhysicalFormats);
84 Q_UNREACHABLE_RETURN(u"");
129 QSpan<std::byte> destination,
bool warnIfMissing)
131 UInt32 readBytes = destination.size();
133 AudioObjectGetPropertyData(objectID, &address, 0,
nullptr, &readBytes, destination.data());
137 printUnableToReadWarning(objectID, address,
"Err:", res);
138 }
else if (readBytes != destination.size()) {
140 printUnableToReadWarning(objectID, address,
"Data size", readBytes,
"VS", destination.size(),
165 const QByteArray &id,
166 QAudioDevice::Mode mode)
168 if (id.isEmpty() || mode == QAudioDevice::Mode::Null)
171 const AudioObjectPropertyAddress audioDevicesPropertyAddress = {
172 kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal,
173 kAudioObjectPropertyElementMain
175 const std::optional<std::vector<AudioDeviceID>> audioDevicesOpt = getAudioPropertyList<AudioDeviceID>(
176 kAudioObjectSystemObject,
177 audioDevicesPropertyAddress);
178 if (audioDevicesOpt.has_value()) {
179 const std::vector<AudioDeviceID> &audioDevices = audioDevicesOpt.value();
180 const AudioObjectPropertyAddress audioDeviceStreamFormatPropertyAddress = makePropertyAddress(
181 kAudioDevicePropertyStreamFormat,
183 for (
const AudioDeviceID &device : audioDevices) {
185 const std::optional<AudioStreamBasicDescription> audioStreamOpt =
186 getAudioProperty<AudioStreamBasicDescription>(
188 audioDeviceStreamFormatPropertyAddress);
191 if (audioStreamOpt.has_value() && readPersistentDeviceId(device, mode) == id)