2024-11-04 10:15:32 +00:00
|
|
|
#include <QAudioDevice>
|
|
|
|
#include <QAudioFormat>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include <qaudiodevice.h>
|
|
|
|
#include "gen_qaudiodevice.h"
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QAudioDevice_new(QAudioDevice** outptr_QAudioDevice) {
|
|
|
|
QAudioDevice* ret = new QAudioDevice();
|
|
|
|
*outptr_QAudioDevice = ret;
|
2024-11-04 10:15:32 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QAudioDevice_new2(QAudioDevice* other, QAudioDevice** outptr_QAudioDevice) {
|
|
|
|
QAudioDevice* ret = new QAudioDevice(*other);
|
|
|
|
*outptr_QAudioDevice = ret;
|
2024-11-04 10:15:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QAudioDevice_Swap(QAudioDevice* self, QAudioDevice* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QAudioDevice_OperatorAssign(QAudioDevice* self, QAudioDevice* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAudioDevice_OperatorEqual(const QAudioDevice* self, QAudioDevice* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *other);
|
2024-11-04 10:15:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAudioDevice_OperatorNotEqual(const QAudioDevice* self, QAudioDevice* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *other);
|
2024-11-04 10:15:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QAudioDevice_IsNull(const QAudioDevice* self) {
|
|
|
|
return self->isNull();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QAudioDevice_Id(const QAudioDevice* self) {
|
|
|
|
QByteArray _qb = self->id();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QAudioDevice_Description(const QAudioDevice* self) {
|
|
|
|
QString _ret = self->description();
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAudioDevice_IsDefault(const QAudioDevice* self) {
|
|
|
|
return self->isDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QAudioDevice_Mode(const QAudioDevice* self) {
|
|
|
|
QAudioDevice::Mode _ret = self->mode();
|
|
|
|
return static_cast<int>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QAudioDevice_IsFormatSupported(const QAudioDevice* self, QAudioFormat* format) {
|
|
|
|
return self->isFormatSupported(*format);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAudioFormat* QAudioDevice_PreferredFormat(const QAudioDevice* self) {
|
|
|
|
return new QAudioFormat(self->preferredFormat());
|
|
|
|
}
|
|
|
|
|
|
|
|
int QAudioDevice_MinimumSampleRate(const QAudioDevice* self) {
|
|
|
|
return self->minimumSampleRate();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QAudioDevice_MaximumSampleRate(const QAudioDevice* self) {
|
|
|
|
return self->maximumSampleRate();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QAudioDevice_MinimumChannelCount(const QAudioDevice* self) {
|
|
|
|
return self->minimumChannelCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QAudioDevice_MaximumChannelCount(const QAudioDevice* self) {
|
|
|
|
return self->maximumChannelCount();
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of uint16_t */ QAudioDevice_SupportedSampleFormats(const QAudioDevice* self) {
|
2024-11-04 10:15:32 +00:00
|
|
|
QList<QAudioFormat::SampleFormat> _ret = self->supportedSampleFormats();
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
uint16_t* _arr = static_cast<uint16_t*>(malloc(sizeof(uint16_t) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QAudioFormat::SampleFormat _lv_ret = _ret[i];
|
|
|
|
_arr[i] = static_cast<uint16_t>(_lv_ret);
|
|
|
|
}
|
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t QAudioDevice_ChannelConfiguration(const QAudioDevice* self) {
|
|
|
|
QAudioFormat::ChannelConfig _ret = self->channelConfiguration();
|
|
|
|
return static_cast<uint32_t>(_ret);
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QAudioDevice_Delete(QAudioDevice* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QAudioDevice*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-11-04 10:15:32 +00:00
|
|
|
}
|
|
|
|
|