miqt/qt/multimedia/gen_qaudiosystemplugin.go

266 lines
9.2 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qaudiosystemplugin.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
type QAudioSystemFactoryInterface struct {
2024-11-19 06:29:06 +00:00
h *C.QAudioSystemFactoryInterface
isSubclass bool
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemFactoryInterface) cPointer() *C.QAudioSystemFactoryInterface {
if this == nil {
return nil
}
return this.h
}
func (this *QAudioSystemFactoryInterface) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQAudioSystemFactoryInterface constructs the type using only CGO pointers.
2024-11-04 10:15:32 +00:00
func newQAudioSystemFactoryInterface(h *C.QAudioSystemFactoryInterface) *QAudioSystemFactoryInterface {
if h == nil {
return nil
}
return &QAudioSystemFactoryInterface{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQAudioSystemFactoryInterface constructs the type using only unsafe pointers.
2024-11-04 10:15:32 +00:00
func UnsafeNewQAudioSystemFactoryInterface(h unsafe.Pointer) *QAudioSystemFactoryInterface {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QAudioSystemFactoryInterface{h: (*C.QAudioSystemFactoryInterface)(h)}
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemFactoryInterface) AvailableDevices(param1 QAudio__Mode) [][]byte {
var _ma C.struct_miqt_array = C.QAudioSystemFactoryInterface_AvailableDevices(this.h, (C.int)(param1))
_ret := make([][]byte, int(_ma.len))
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
var _lv_bytearray C.struct_miqt_string = _outCast[i]
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
C.free(unsafe.Pointer(_lv_bytearray.data))
_ret[i] = _lv_ret
}
return _ret
}
func (this *QAudioSystemFactoryInterface) CreateInput(device []byte) *QAbstractAudioInput {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioInput(unsafe.Pointer(C.QAudioSystemFactoryInterface_CreateInput(this.h, device_alias)), nil)
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemFactoryInterface) CreateOutput(device []byte) *QAbstractAudioOutput {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioOutput(unsafe.Pointer(C.QAudioSystemFactoryInterface_CreateOutput(this.h, device_alias)), nil)
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemFactoryInterface) CreateDeviceInfo(device []byte, mode QAudio__Mode) *QAbstractAudioDeviceInfo {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioDeviceInfo(unsafe.Pointer(C.QAudioSystemFactoryInterface_CreateDeviceInfo(this.h, device_alias, (C.int)(mode))), nil)
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemFactoryInterface) OperatorAssign(param1 *QAudioSystemFactoryInterface) {
C.QAudioSystemFactoryInterface_OperatorAssign(this.h, param1.cPointer())
}
// Delete this object from C++ memory.
func (this *QAudioSystemFactoryInterface) Delete() {
2024-11-19 06:29:06 +00:00
C.QAudioSystemFactoryInterface_Delete(this.h, C.bool(this.isSubclass))
2024-11-04 10:15:32 +00:00
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QAudioSystemFactoryInterface) GoGC() {
runtime.SetFinalizer(this, func(this *QAudioSystemFactoryInterface) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QAudioSystemPlugin struct {
2024-11-19 06:29:06 +00:00
h *C.QAudioSystemPlugin
isSubclass bool
2024-11-04 10:15:32 +00:00
*qt.QObject
*QAudioSystemFactoryInterface
}
func (this *QAudioSystemPlugin) cPointer() *C.QAudioSystemPlugin {
if this == nil {
return nil
}
return this.h
}
func (this *QAudioSystemPlugin) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQAudioSystemPlugin constructs the type using only CGO pointers.
func newQAudioSystemPlugin(h *C.QAudioSystemPlugin, h_QObject *C.QObject, h_QAudioSystemFactoryInterface *C.QAudioSystemFactoryInterface) *QAudioSystemPlugin {
2024-11-04 10:15:32 +00:00
if h == nil {
return nil
}
2024-11-19 06:29:06 +00:00
return &QAudioSystemPlugin{h: h,
QObject: qt.UnsafeNewQObject(unsafe.Pointer(h_QObject)),
QAudioSystemFactoryInterface: newQAudioSystemFactoryInterface(h_QAudioSystemFactoryInterface)}
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQAudioSystemPlugin constructs the type using only unsafe pointers.
func UnsafeNewQAudioSystemPlugin(h unsafe.Pointer, h_QObject unsafe.Pointer, h_QAudioSystemFactoryInterface unsafe.Pointer) *QAudioSystemPlugin {
if h == nil {
return nil
}
return &QAudioSystemPlugin{h: (*C.QAudioSystemPlugin)(h),
QObject: qt.UnsafeNewQObject(h_QObject),
QAudioSystemFactoryInterface: UnsafeNewQAudioSystemFactoryInterface(h_QAudioSystemFactoryInterface)}
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemPlugin) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QAudioSystemPlugin_MetaObject(this.h)))
}
func (this *QAudioSystemPlugin) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QAudioSystemPlugin_Metacast(this.h, param1_Cstring))
}
func QAudioSystemPlugin_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioSystemPlugin_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QAudioSystemPlugin) AvailableDevices(param1 QAudio__Mode) [][]byte {
var _ma C.struct_miqt_array = C.QAudioSystemPlugin_AvailableDevices(this.h, (C.int)(param1))
_ret := make([][]byte, int(_ma.len))
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
var _lv_bytearray C.struct_miqt_string = _outCast[i]
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
C.free(unsafe.Pointer(_lv_bytearray.data))
_ret[i] = _lv_ret
}
return _ret
}
func (this *QAudioSystemPlugin) CreateInput(device []byte) *QAbstractAudioInput {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioInput(unsafe.Pointer(C.QAudioSystemPlugin_CreateInput(this.h, device_alias)), nil)
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemPlugin) CreateOutput(device []byte) *QAbstractAudioOutput {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioOutput(unsafe.Pointer(C.QAudioSystemPlugin_CreateOutput(this.h, device_alias)), nil)
2024-11-04 10:15:32 +00:00
}
func (this *QAudioSystemPlugin) CreateDeviceInfo(device []byte, mode QAudio__Mode) *QAbstractAudioDeviceInfo {
device_alias := C.struct_miqt_string{}
device_alias.data = (*C.char)(unsafe.Pointer(&device[0]))
device_alias.len = C.size_t(len(device))
2024-11-19 06:29:06 +00:00
return UnsafeNewQAbstractAudioDeviceInfo(unsafe.Pointer(C.QAudioSystemPlugin_CreateDeviceInfo(this.h, device_alias, (C.int)(mode))), nil)
2024-11-04 10:15:32 +00:00
}
func QAudioSystemPlugin_Tr2(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioSystemPlugin_Tr3(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_Tr3(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioSystemPlugin_TrUtf82(s string, c string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioSystemPlugin_TrUtf83(s string, c string, n int) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
c_Cstring := C.CString(c)
defer C.free(unsafe.Pointer(c_Cstring))
var _ms C.struct_miqt_string = C.QAudioSystemPlugin_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
// Delete this object from C++ memory.
func (this *QAudioSystemPlugin) Delete() {
2024-11-19 06:29:06 +00:00
C.QAudioSystemPlugin_Delete(this.h, C.bool(this.isSubclass))
2024-11-04 10:15:32 +00:00
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QAudioSystemPlugin) GoGC() {
runtime.SetFinalizer(this, func(this *QAudioSystemPlugin) {
this.Delete()
runtime.KeepAlive(this.h)
})
}