miqt/qt6/multimedia/gen_qaudiosource.cpp

431 lines
13 KiB
C++
Raw Normal View History

2024-11-04 10:15:32 +00:00
#include <QAudioDevice>
#include <QAudioFormat>
#include <QAudioSource>
2024-11-19 06:29:06 +00:00
#include <QChildEvent>
#include <QEvent>
2024-11-04 10:15:32 +00:00
#include <QIODevice>
2024-11-19 06:29:06 +00:00
#include <QMetaMethod>
2024-11-04 10:15:32 +00:00
#include <QMetaObject>
#include <QObject>
#include <QString>
#include <QByteArray>
#include <cstring>
2024-11-19 06:29:06 +00:00
#include <QTimerEvent>
2024-11-04 10:15:32 +00:00
#include <qaudiosource.h>
#include "gen_qaudiosource.h"
#include "_cgo_export.h"
2024-11-19 06:29:06 +00:00
class MiqtVirtualQAudioSource : public virtual QAudioSource {
public:
MiqtVirtualQAudioSource(): QAudioSource() {};
MiqtVirtualQAudioSource(const QAudioDevice& audioDeviceInfo): QAudioSource(audioDeviceInfo) {};
MiqtVirtualQAudioSource(const QAudioFormat& format): QAudioSource(format) {};
MiqtVirtualQAudioSource(const QAudioFormat& format, QObject* parent): QAudioSource(format, parent) {};
MiqtVirtualQAudioSource(const QAudioDevice& audioDeviceInfo, const QAudioFormat& format): QAudioSource(audioDeviceInfo, format) {};
MiqtVirtualQAudioSource(const QAudioDevice& audioDeviceInfo, const QAudioFormat& format, QObject* parent): QAudioSource(audioDeviceInfo, format, parent) {};
virtual ~MiqtVirtualQAudioSource() = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__Event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* event) override {
if (handle__Event == 0) {
return QAudioSource::event(event);
}
QEvent* sigval1 = event;
bool callback_return_value = miqt_exec_callback_QAudioSource_Event(this, handle__Event, sigval1);
return callback_return_value;
}
// Wrapper to allow calling protected method
bool virtualbase_Event(QEvent* event) {
return QAudioSource::event(event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__EventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* watched, QEvent* event) override {
if (handle__EventFilter == 0) {
return QAudioSource::eventFilter(watched, event);
}
QObject* sigval1 = watched;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QAudioSource_EventFilter(this, handle__EventFilter, sigval1, sigval2);
return callback_return_value;
}
// Wrapper to allow calling protected method
bool virtualbase_EventFilter(QObject* watched, QEvent* event) {
return QAudioSource::eventFilter(watched, event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__TimerEvent = 0;
// Subclass to allow providing a Go implementation
virtual void timerEvent(QTimerEvent* event) override {
if (handle__TimerEvent == 0) {
QAudioSource::timerEvent(event);
return;
}
QTimerEvent* sigval1 = event;
miqt_exec_callback_QAudioSource_TimerEvent(this, handle__TimerEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_TimerEvent(QTimerEvent* event) {
QAudioSource::timerEvent(event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ChildEvent = 0;
// Subclass to allow providing a Go implementation
virtual void childEvent(QChildEvent* event) override {
if (handle__ChildEvent == 0) {
QAudioSource::childEvent(event);
return;
}
QChildEvent* sigval1 = event;
miqt_exec_callback_QAudioSource_ChildEvent(this, handle__ChildEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ChildEvent(QChildEvent* event) {
QAudioSource::childEvent(event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__CustomEvent = 0;
// Subclass to allow providing a Go implementation
virtual void customEvent(QEvent* event) override {
if (handle__CustomEvent == 0) {
QAudioSource::customEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QAudioSource_CustomEvent(this, handle__CustomEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_CustomEvent(QEvent* event) {
QAudioSource::customEvent(event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ConnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void connectNotify(const QMetaMethod& signal) override {
if (handle__ConnectNotify == 0) {
QAudioSource::connectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QAudioSource_ConnectNotify(this, handle__ConnectNotify, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ConnectNotify(QMetaMethod* signal) {
QAudioSource::connectNotify(*signal);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__DisconnectNotify = 0;
// Subclass to allow providing a Go implementation
virtual void disconnectNotify(const QMetaMethod& signal) override {
if (handle__DisconnectNotify == 0) {
QAudioSource::disconnectNotify(signal);
return;
}
const QMetaMethod& signal_ret = signal;
// Cast returned reference into pointer
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
miqt_exec_callback_QAudioSource_DisconnectNotify(this, handle__DisconnectNotify, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_DisconnectNotify(QMetaMethod* signal) {
QAudioSource::disconnectNotify(*signal);
}
};
void QAudioSource_new(QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource();
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
void QAudioSource_new2(QAudioDevice* audioDeviceInfo, QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource(*audioDeviceInfo);
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
void QAudioSource_new3(QAudioFormat* format, QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource(*format);
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
void QAudioSource_new4(QAudioFormat* format, QObject* parent, QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource(*format, parent);
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
void QAudioSource_new5(QAudioDevice* audioDeviceInfo, QAudioFormat* format, QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource(*audioDeviceInfo, *format);
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
void QAudioSource_new6(QAudioDevice* audioDeviceInfo, QAudioFormat* format, QObject* parent, QAudioSource** outptr_QAudioSource, QObject** outptr_QObject) {
MiqtVirtualQAudioSource* ret = new MiqtVirtualQAudioSource(*audioDeviceInfo, *format, parent);
*outptr_QAudioSource = ret;
*outptr_QObject = static_cast<QObject*>(ret);
2024-11-04 10:15:32 +00:00
}
QMetaObject* QAudioSource_MetaObject(const QAudioSource* self) {
return (QMetaObject*) self->metaObject();
}
void* QAudioSource_Metacast(QAudioSource* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QAudioSource_Tr(const char* s) {
QString _ret = QAudioSource::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;
}
bool QAudioSource_IsNull(const QAudioSource* self) {
return self->isNull();
}
QAudioFormat* QAudioSource_Format(const QAudioSource* self) {
return new QAudioFormat(self->format());
}
void QAudioSource_Start(QAudioSource* self, QIODevice* device) {
self->start(device);
}
QIODevice* QAudioSource_Start2(QAudioSource* self) {
return self->start();
}
void QAudioSource_Stop(QAudioSource* self) {
self->stop();
}
void QAudioSource_Reset(QAudioSource* self) {
self->reset();
}
void QAudioSource_Suspend(QAudioSource* self) {
self->suspend();
}
void QAudioSource_Resume(QAudioSource* self) {
self->resume();
}
void QAudioSource_SetBufferSize(QAudioSource* self, ptrdiff_t bytes) {
self->setBufferSize((qsizetype)(bytes));
}
ptrdiff_t QAudioSource_BufferSize(const QAudioSource* self) {
qsizetype _ret = self->bufferSize();
return static_cast<ptrdiff_t>(_ret);
}
ptrdiff_t QAudioSource_BytesAvailable(const QAudioSource* self) {
qsizetype _ret = self->bytesAvailable();
return static_cast<ptrdiff_t>(_ret);
}
void QAudioSource_SetVolume(QAudioSource* self, double volume) {
self->setVolume(static_cast<qreal>(volume));
}
double QAudioSource_Volume(const QAudioSource* self) {
qreal _ret = self->volume();
return static_cast<double>(_ret);
}
long long QAudioSource_ProcessedUSecs(const QAudioSource* self) {
qint64 _ret = self->processedUSecs();
return static_cast<long long>(_ret);
}
long long QAudioSource_ElapsedUSecs(const QAudioSource* self) {
qint64 _ret = self->elapsedUSecs();
return static_cast<long long>(_ret);
}
int QAudioSource_Error(const QAudioSource* self) {
QAudio::Error _ret = self->error();
return static_cast<int>(_ret);
}
int QAudioSource_State(const QAudioSource* self) {
QAudio::State _ret = self->state();
return static_cast<int>(_ret);
}
void QAudioSource_StateChanged(QAudioSource* self, int state) {
self->stateChanged(static_cast<QAudio::State>(state));
}
void QAudioSource_connect_StateChanged(QAudioSource* self, intptr_t slot) {
2024-11-19 06:29:06 +00:00
MiqtVirtualQAudioSource::connect(self, static_cast<void (QAudioSource::*)(QAudio::State)>(&QAudioSource::stateChanged), self, [=](QAudio::State state) {
2024-11-04 10:15:32 +00:00
QAudio::State state_ret = state;
int sigval1 = static_cast<int>(state_ret);
miqt_exec_callback_QAudioSource_StateChanged(slot, sigval1);
});
}
struct miqt_string QAudioSource_Tr2(const char* s, const char* c) {
QString _ret = QAudioSource::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 QAudioSource_Tr3(const char* s, const char* c, int n) {
QString _ret = QAudioSource::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;
}
2024-11-19 06:29:06 +00:00
void QAudioSource_override_virtual_Event(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__Event = slot;
}
bool QAudioSource_virtualbase_Event(void* self, QEvent* event) {
return ( (MiqtVirtualQAudioSource*)(self) )->virtualbase_Event(event);
}
void QAudioSource_override_virtual_EventFilter(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__EventFilter = slot;
}
bool QAudioSource_virtualbase_EventFilter(void* self, QObject* watched, QEvent* event) {
return ( (MiqtVirtualQAudioSource*)(self) )->virtualbase_EventFilter(watched, event);
}
void QAudioSource_override_virtual_TimerEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__TimerEvent = slot;
}
void QAudioSource_virtualbase_TimerEvent(void* self, QTimerEvent* event) {
( (MiqtVirtualQAudioSource*)(self) )->virtualbase_TimerEvent(event);
}
void QAudioSource_override_virtual_ChildEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__ChildEvent = slot;
}
void QAudioSource_virtualbase_ChildEvent(void* self, QChildEvent* event) {
( (MiqtVirtualQAudioSource*)(self) )->virtualbase_ChildEvent(event);
}
void QAudioSource_override_virtual_CustomEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__CustomEvent = slot;
}
void QAudioSource_virtualbase_CustomEvent(void* self, QEvent* event) {
( (MiqtVirtualQAudioSource*)(self) )->virtualbase_CustomEvent(event);
}
void QAudioSource_override_virtual_ConnectNotify(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__ConnectNotify = slot;
}
void QAudioSource_virtualbase_ConnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQAudioSource*)(self) )->virtualbase_ConnectNotify(signal);
}
void QAudioSource_override_virtual_DisconnectNotify(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQAudioSource*>( (QAudioSource*)(self) )->handle__DisconnectNotify = slot;
}
void QAudioSource_virtualbase_DisconnectNotify(void* self, QMetaMethod* signal) {
( (MiqtVirtualQAudioSource*)(self) )->virtualbase_DisconnectNotify(signal);
}
void QAudioSource_Delete(QAudioSource* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<MiqtVirtualQAudioSource*>( self );
} else {
delete self;
}
2024-11-04 10:15:32 +00:00
}