miqt/qt6/multimedia/gen_qaudioinput.go

461 lines
15 KiB
Go
Raw Normal View History

2024-11-04 23:15:32 +13:00
package multimedia
/*
#include "gen_qaudioinput.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QAudioInput struct {
h *C.QAudioInput
2024-11-04 23:15:32 +13:00
*qt6.QObject
}
func (this *QAudioInput) cPointer() *C.QAudioInput {
if this == nil {
return nil
}
return this.h
}
func (this *QAudioInput) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQAudioInput constructs the type using only CGO pointers.
2024-12-07 17:15:57 +13:00
func newQAudioInput(h *C.QAudioInput) *QAudioInput {
2024-11-04 23:15:32 +13:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
var outptr_QObject *C.QObject = nil
C.QAudioInput_virtbase(h, &outptr_QObject)
2024-11-19 19:29:06 +13:00
return &QAudioInput{h: h,
2024-12-07 17:15:57 +13:00
QObject: qt6.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
2024-11-04 23:15:32 +13:00
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQAudioInput constructs the type using only unsafe pointers.
2024-12-07 17:15:57 +13:00
func UnsafeNewQAudioInput(h unsafe.Pointer) *QAudioInput {
return newQAudioInput((*C.QAudioInput)(h))
2024-11-04 23:15:32 +13:00
}
// NewQAudioInput constructs a new QAudioInput object.
func NewQAudioInput() *QAudioInput {
2024-11-19 19:29:06 +13:00
return newQAudioInput(C.QAudioInput_new())
2024-11-04 23:15:32 +13:00
}
// NewQAudioInput2 constructs a new QAudioInput object.
func NewQAudioInput2(deviceInfo *QAudioDevice) *QAudioInput {
2024-11-19 19:29:06 +13:00
return newQAudioInput(C.QAudioInput_new2(deviceInfo.cPointer()))
2024-11-04 23:15:32 +13:00
}
// NewQAudioInput3 constructs a new QAudioInput object.
func NewQAudioInput3(parent *qt6.QObject) *QAudioInput {
2024-11-19 19:29:06 +13:00
return newQAudioInput(C.QAudioInput_new3((*C.QObject)(parent.UnsafePointer())))
2024-11-04 23:15:32 +13:00
}
// NewQAudioInput4 constructs a new QAudioInput object.
func NewQAudioInput4(deviceInfo *QAudioDevice, parent *qt6.QObject) *QAudioInput {
2024-11-19 19:29:06 +13:00
return newQAudioInput(C.QAudioInput_new4(deviceInfo.cPointer(), (*C.QObject)(parent.UnsafePointer())))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) MetaObject() *qt6.QMetaObject {
2025-02-01 13:45:16 +13:00
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QAudioInput_metaObject(this.h)))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
2025-02-01 13:45:16 +13:00
return (unsafe.Pointer)(C.QAudioInput_metacast(this.h, param1_Cstring))
2024-11-04 23:15:32 +13:00
}
func QAudioInput_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QAudioInput_tr(s_Cstring)
2024-11-04 23:15:32 +13:00
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QAudioInput) Device() *QAudioDevice {
2025-02-01 13:45:16 +13:00
_goptr := newQAudioDevice(C.QAudioInput_device(this.h))
2024-11-04 23:15:32 +13:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QAudioInput) Volume() float32 {
2025-02-01 13:45:16 +13:00
return (float32)(C.QAudioInput_volume(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) IsMuted() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAudioInput_isMuted(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) SetDevice(device *QAudioDevice) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_setDevice(this.h, device.cPointer())
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) SetVolume(volume float32) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_setVolume(this.h, (C.float)(volume))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) SetMuted(muted bool) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_setMuted(this.h, (C.bool)(muted))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) DeviceChanged() {
2025-02-01 13:45:16 +13:00
C.QAudioInput_deviceChanged(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) OnDeviceChanged(slot func()) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_connect_deviceChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_deviceChanged
func miqt_exec_callback_QAudioInput_deviceChanged(cb C.intptr_t) {
2024-11-04 23:15:32 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func (this *QAudioInput) VolumeChanged(volume float32) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_volumeChanged(this.h, (C.float)(volume))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) OnVolumeChanged(slot func(volume float32)) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_connect_volumeChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_volumeChanged
func miqt_exec_callback_QAudioInput_volumeChanged(cb C.intptr_t, volume C.float) {
2024-11-04 23:15:32 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(volume float32))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (float32)(volume)
gofunc(slotval1)
}
func (this *QAudioInput) MutedChanged(muted bool) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_mutedChanged(this.h, (C.bool)(muted))
2024-11-04 23:15:32 +13:00
}
func (this *QAudioInput) OnMutedChanged(slot func(muted bool)) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_connect_mutedChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
2024-11-04 23:15:32 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_mutedChanged
func miqt_exec_callback_QAudioInput_mutedChanged(cb C.intptr_t, muted C.bool) {
2024-11-04 23:15:32 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(muted bool))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (bool)(muted)
gofunc(slotval1)
}
func QAudioInput_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))
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QAudioInput_tr2(s_Cstring, c_Cstring)
2024-11-04 23:15:32 +13:00
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioInput_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))
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QAudioInput_tr3(s_Cstring, c_Cstring, (C.int)(n))
2024-11-04 23:15:32 +13:00
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
2025-02-06 15:05:01 +13:00
// Sender can only be called from a QAudioInput that was directly constructed.
func (this *QAudioInput) Sender() *qt6.QObject {
var _dynamic_cast_ok C.bool = false
_method_ret := qt6.UnsafeNewQObject(unsafe.Pointer(C.QAudioInput_protectedbase_sender(&_dynamic_cast_ok, unsafe.Pointer(this.h))))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// SenderSignalIndex can only be called from a QAudioInput that was directly constructed.
func (this *QAudioInput) SenderSignalIndex() int {
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QAudioInput_protectedbase_senderSignalIndex(&_dynamic_cast_ok, unsafe.Pointer(this.h)))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// Receivers can only be called from a QAudioInput that was directly constructed.
func (this *QAudioInput) Receivers(signal string) int {
signal_Cstring := C.CString(signal)
defer C.free(unsafe.Pointer(signal_Cstring))
var _dynamic_cast_ok C.bool = false
_method_ret := (int)(C.QAudioInput_protectedbase_receivers(&_dynamic_cast_ok, unsafe.Pointer(this.h), signal_Cstring))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
// IsSignalConnected can only be called from a QAudioInput that was directly constructed.
func (this *QAudioInput) IsSignalConnected(signal *qt6.QMetaMethod) bool {
var _dynamic_cast_ok C.bool = false
_method_ret := (bool)(C.QAudioInput_protectedbase_isSignalConnected(&_dynamic_cast_ok, unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())))
if !_dynamic_cast_ok {
panic("miqt: can only call protected methods for directly constructed types")
}
return _method_ret
}
2024-11-19 19:29:06 +13:00
func (this *QAudioInput) callVirtualBase_Event(event *qt6.QEvent) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAudioInput_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnEvent(slot func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_event
func miqt_exec_callback_QAudioInput_event(self *C.QAudioInput, cb C.intptr_t, event *C.QEvent) C.bool {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QAudioInput{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QAudioInput) callVirtualBase_EventFilter(watched *qt6.QObject, event *qt6.QEvent) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAudioInput_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnEventFilter(slot func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_eventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_eventFilter
func miqt_exec_callback_QAudioInput_eventFilter(self *C.QAudioInput, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQObject(unsafe.Pointer(watched))
2024-11-19 19:29:06 +13:00
slotval2 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QAudioInput{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QAudioInput) callVirtualBase_TimerEvent(event *qt6.QTimerEvent) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnTimerEvent(slot func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent)) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_timerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_timerEvent
func miqt_exec_callback_QAudioInput_timerEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QTimerEvent) {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 17:15:57 +13:00
slotval1 := qt6.UnsafeNewQTimerEvent(unsafe.Pointer(event))
2024-11-19 19:29:06 +13:00
gofunc((&QAudioInput{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_ChildEvent(event *qt6.QChildEvent) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnChildEvent(slot func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent)) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_childEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_childEvent
func miqt_exec_callback_QAudioInput_childEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QChildEvent) {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 17:15:57 +13:00
slotval1 := qt6.UnsafeNewQChildEvent(unsafe.Pointer(event))
2024-11-19 19:29:06 +13:00
gofunc((&QAudioInput{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_CustomEvent(event *qt6.QEvent) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnCustomEvent(slot func(super func(event *qt6.QEvent), event *qt6.QEvent)) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_customEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_customEvent
func miqt_exec_callback_QAudioInput_customEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QEvent) {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt6.QEvent), event *qt6.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QAudioInput{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_ConnectNotify(signal *qt6.QMetaMethod) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnConnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_connectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_connectNotify
func miqt_exec_callback_QAudioInput_connectNotify(self *C.QAudioInput, cb C.intptr_t, signal *C.QMetaMethod) {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QAudioInput{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QAudioInput) callVirtualBase_DisconnectNotify(signal *qt6.QMetaMethod) {
2025-02-01 13:45:16 +13:00
C.QAudioInput_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
func (this *QAudioInput) OnDisconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
2025-02-01 13:45:16 +13:00
ok := C.QAudioInput_override_virtual_disconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
if !ok {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
//export miqt_exec_callback_QAudioInput_disconnectNotify
func miqt_exec_callback_QAudioInput_disconnectNotify(self *C.QAudioInput, cb C.intptr_t, signal *C.QMetaMethod) {
2024-11-19 19:29:06 +13:00
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt6.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QAudioInput{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
2024-11-04 23:15:32 +13:00
// Delete this object from C++ memory.
func (this *QAudioInput) Delete() {
2025-02-01 13:45:16 +13:00
C.QAudioInput_delete(this.h)
2024-11-04 23:15:32 +13: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 *QAudioInput) GoGC() {
runtime.SetFinalizer(this, func(this *QAudioInput) {
this.Delete()
runtime.KeepAlive(this.h)
})
}