miqt/qt/multimedia/gen_qaudiodecoder.cpp

309 lines
10 KiB
C++
Raw Normal View History

2024-11-04 10:15:32 +00:00
#include <QAudioBuffer>
#include <QAudioDecoder>
#include <QAudioFormat>
#include <QIODevice>
#include <QList>
#include <QMetaObject>
#include <QObject>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qaudiodecoder.h>
#include "gen_qaudiodecoder.h"
#include "_cgo_export.h"
QAudioDecoder* QAudioDecoder_new() {
return new QAudioDecoder();
}
QAudioDecoder* QAudioDecoder_new2(QObject* parent) {
return new QAudioDecoder(parent);
}
QMetaObject* QAudioDecoder_MetaObject(const QAudioDecoder* self) {
return (QMetaObject*) self->metaObject();
}
void* QAudioDecoder_Metacast(QAudioDecoder* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QAudioDecoder_Tr(const char* s) {
QString _ret = QAudioDecoder::tr(s);
// 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;
}
struct miqt_string QAudioDecoder_TrUtf8(const char* s) {
QString _ret = QAudioDecoder::trUtf8(s);
// 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;
}
int QAudioDecoder_HasSupport(struct miqt_string mimeType) {
QString mimeType_QString = QString::fromUtf8(mimeType.data, mimeType.len);
QMultimedia::SupportEstimate _ret = QAudioDecoder::hasSupport(mimeType_QString);
return static_cast<int>(_ret);
}
int QAudioDecoder_State(const QAudioDecoder* self) {
QAudioDecoder::State _ret = self->state();
return static_cast<int>(_ret);
}
struct miqt_string QAudioDecoder_SourceFilename(const QAudioDecoder* self) {
QString _ret = self->sourceFilename();
// 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;
}
void QAudioDecoder_SetSourceFilename(QAudioDecoder* self, struct miqt_string fileName) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
self->setSourceFilename(fileName_QString);
}
QIODevice* QAudioDecoder_SourceDevice(const QAudioDecoder* self) {
return self->sourceDevice();
}
void QAudioDecoder_SetSourceDevice(QAudioDecoder* self, QIODevice* device) {
self->setSourceDevice(device);
}
QAudioFormat* QAudioDecoder_AudioFormat(const QAudioDecoder* self) {
return new QAudioFormat(self->audioFormat());
}
void QAudioDecoder_SetAudioFormat(QAudioDecoder* self, QAudioFormat* format) {
self->setAudioFormat(*format);
}
int QAudioDecoder_Error(const QAudioDecoder* self) {
QAudioDecoder::Error _ret = self->error();
return static_cast<int>(_ret);
}
struct miqt_string QAudioDecoder_ErrorString(const QAudioDecoder* self) {
QString _ret = self->errorString();
// 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;
}
QAudioBuffer* QAudioDecoder_Read(const QAudioDecoder* self) {
return new QAudioBuffer(self->read());
}
bool QAudioDecoder_BufferAvailable(const QAudioDecoder* self) {
return self->bufferAvailable();
}
long long QAudioDecoder_Position(const QAudioDecoder* self) {
qint64 _ret = self->position();
return static_cast<long long>(_ret);
}
long long QAudioDecoder_Duration(const QAudioDecoder* self) {
qint64 _ret = self->duration();
return static_cast<long long>(_ret);
}
void QAudioDecoder_Start(QAudioDecoder* self) {
self->start();
}
void QAudioDecoder_Stop(QAudioDecoder* self) {
self->stop();
}
void QAudioDecoder_BufferAvailableChanged(QAudioDecoder* self, bool param1) {
self->bufferAvailableChanged(param1);
}
void QAudioDecoder_connect_BufferAvailableChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(bool)>(&QAudioDecoder::bufferAvailableChanged), self, [=](bool param1) {
bool sigval1 = param1;
miqt_exec_callback_QAudioDecoder_BufferAvailableChanged(slot, sigval1);
});
}
void QAudioDecoder_BufferReady(QAudioDecoder* self) {
self->bufferReady();
}
void QAudioDecoder_connect_BufferReady(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)()>(&QAudioDecoder::bufferReady), self, [=]() {
miqt_exec_callback_QAudioDecoder_BufferReady(slot);
});
}
void QAudioDecoder_Finished(QAudioDecoder* self) {
self->finished();
}
void QAudioDecoder_connect_Finished(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)()>(&QAudioDecoder::finished), self, [=]() {
miqt_exec_callback_QAudioDecoder_Finished(slot);
});
}
void QAudioDecoder_StateChanged(QAudioDecoder* self, int newState) {
self->stateChanged(static_cast<QAudioDecoder::State>(newState));
}
void QAudioDecoder_connect_StateChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(QAudioDecoder::State)>(&QAudioDecoder::stateChanged), self, [=](QAudioDecoder::State newState) {
QAudioDecoder::State newState_ret = newState;
int sigval1 = static_cast<int>(newState_ret);
miqt_exec_callback_QAudioDecoder_StateChanged(slot, sigval1);
});
}
void QAudioDecoder_FormatChanged(QAudioDecoder* self, QAudioFormat* format) {
self->formatChanged(*format);
}
void QAudioDecoder_connect_FormatChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(const QAudioFormat&)>(&QAudioDecoder::formatChanged), self, [=](const QAudioFormat& format) {
const QAudioFormat& format_ret = format;
// Cast returned reference into pointer
QAudioFormat* sigval1 = const_cast<QAudioFormat*>(&format_ret);
miqt_exec_callback_QAudioDecoder_FormatChanged(slot, sigval1);
});
}
void QAudioDecoder_ErrorWithError(QAudioDecoder* self, int error) {
self->error(static_cast<QAudioDecoder::Error>(error));
}
void QAudioDecoder_connect_ErrorWithError(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(QAudioDecoder::Error)>(&QAudioDecoder::error), self, [=](QAudioDecoder::Error error) {
QAudioDecoder::Error error_ret = error;
int sigval1 = static_cast<int>(error_ret);
miqt_exec_callback_QAudioDecoder_ErrorWithError(slot, sigval1);
});
}
void QAudioDecoder_SourceChanged(QAudioDecoder* self) {
self->sourceChanged();
}
void QAudioDecoder_connect_SourceChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)()>(&QAudioDecoder::sourceChanged), self, [=]() {
miqt_exec_callback_QAudioDecoder_SourceChanged(slot);
});
}
void QAudioDecoder_PositionChanged(QAudioDecoder* self, long long position) {
self->positionChanged(static_cast<qint64>(position));
}
void QAudioDecoder_connect_PositionChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(qint64)>(&QAudioDecoder::positionChanged), self, [=](qint64 position) {
qint64 position_ret = position;
long long sigval1 = static_cast<long long>(position_ret);
miqt_exec_callback_QAudioDecoder_PositionChanged(slot, sigval1);
});
}
void QAudioDecoder_DurationChanged(QAudioDecoder* self, long long duration) {
self->durationChanged(static_cast<qint64>(duration));
}
void QAudioDecoder_connect_DurationChanged(QAudioDecoder* self, intptr_t slot) {
QAudioDecoder::connect(self, static_cast<void (QAudioDecoder::*)(qint64)>(&QAudioDecoder::durationChanged), self, [=](qint64 duration) {
qint64 duration_ret = duration;
long long sigval1 = static_cast<long long>(duration_ret);
miqt_exec_callback_QAudioDecoder_DurationChanged(slot, sigval1);
});
}
bool QAudioDecoder_Bind(QAudioDecoder* self, QObject* param1) {
return self->bind(param1);
}
void QAudioDecoder_Unbind(QAudioDecoder* self, QObject* param1) {
self->unbind(param1);
}
struct miqt_string QAudioDecoder_Tr2(const char* s, const char* c) {
QString _ret = QAudioDecoder::tr(s, c);
// 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;
}
struct miqt_string QAudioDecoder_Tr3(const char* s, const char* c, int n) {
QString _ret = QAudioDecoder::tr(s, c, static_cast<int>(n));
// 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;
}
struct miqt_string QAudioDecoder_TrUtf82(const char* s, const char* c) {
QString _ret = QAudioDecoder::trUtf8(s, c);
// 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;
}
struct miqt_string QAudioDecoder_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QAudioDecoder::trUtf8(s, c, static_cast<int>(n));
// 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;
}
int QAudioDecoder_HasSupport2(struct miqt_string mimeType, struct miqt_array /* of struct miqt_string */ codecs) {
QString mimeType_QString = QString::fromUtf8(mimeType.data, mimeType.len);
QStringList codecs_QList;
codecs_QList.reserve(codecs.len);
struct miqt_string* codecs_arr = static_cast<struct miqt_string*>(codecs.data);
for(size_t i = 0; i < codecs.len; ++i) {
QString codecs_arr_i_QString = QString::fromUtf8(codecs_arr[i].data, codecs_arr[i].len);
codecs_QList.push_back(codecs_arr_i_QString);
}
QMultimedia::SupportEstimate _ret = QAudioDecoder::hasSupport(mimeType_QString, codecs_QList);
return static_cast<int>(_ret);
}
void QAudioDecoder_Delete(QAudioDecoder* self) {
delete self;
}