4#ifndef QMACOSAUDIODATAUTILS_P_H
5#define QMACOSAUDIODATAUTILS_P_H
18#include <CoreAudio/AudioHardware.h>
29template<
typename... Args>
36 memcpy(&scope, &
address.mScope, 4);
37 std::reverse(scope, scope + 4);
40 warn <<
"Unable to read property" << logName <<
"for object" << objectID <<
", scope" << scope <<
";";
41 (warn << ... <<
args);
42 warn <<
"\n If the warning is unexpected use test_audio_config to get comprehensive audio info and report a bug";
45inline static AudioObjectPropertyAddress
47 AudioObjectPropertyElement element = kAudioObjectPropertyElementMaster)
51 : kAudioDevicePropertyScopeOutput,
56 void *
dst, UInt32 dstSize,
const char *logName)
58 UInt32 readBytes = dstSize;
59 const auto res = AudioObjectGetPropertyData(objectID, &
address, 0,
nullptr, &readBytes,
dst);
63 else if (readBytes != dstSize)
74 const AudioObjectPropertyAddress &
address,
75 const char *logName,
size_t minDataSize = 0)
77 static_assert(std::is_trivial_v<T>,
"A trivial type is expected");
80 const auto res = AudioObjectGetPropertyDataSize(objectID, &
address, 0,
nullptr, &
size);
84 "AudioObjectGetPropertyDataSize failed, Err:",
res);
85 }
else if (
size /
sizeof(T) < minDataSize) {
87 minDataSize *
sizeof(T),
"bytes");
89 std::vector<T>
data(
size /
sizeof(T));
91 return { std::move(
data) };
101 static_assert(std::is_trivial_v<T>,
"A trivial type is expected");
Mode
Describes the mode of this device.
Combined button and popup list for selecting options.
std::optional< T > getAudioObject(AudioObjectID objectID, const AudioObjectPropertyAddress &address, const char *logName)
static bool getAudioData(AudioObjectID objectID, const AudioObjectPropertyAddress &address, void *dst, UInt32 dstSize, const char *logName)
QT_BEGIN_NAMESPACE void printUnableToReadWarning(const char *logName, AudioObjectID objectID, const AudioObjectPropertyAddress &address, Args &&...args)
static AudioObjectPropertyAddress makePropertyAddress(AudioObjectPropertySelector selector, QAudioDevice::Mode mode, AudioObjectPropertyElement element=kAudioObjectPropertyElementMaster)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLuint64EXT address
QFileSelector selector
[1]