miqt/qt/multimedia/gen_qaudioinput.go

491 lines
16 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qaudioinput.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"runtime/cgo"
"unsafe"
)
type QAudioInput struct {
2024-11-19 06:29:06 +00:00
h *C.QAudioInput
isSubclass bool
2024-11-04 10:15:32 +00:00
*qt.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 06:29:06 +00:00
// newQAudioInput constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQAudioInput(h *C.QAudioInput) *QAudioInput {
2024-11-04 10:15:32 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QObject *C.QObject = nil
C.QAudioInput_virtbase(h, &outptr_QObject)
2024-11-19 06:29:06 +00:00
return &QAudioInput{h: h,
2024-12-07 04:15:57 +00:00
QObject: qt.UnsafeNewQObject(unsafe.Pointer(outptr_QObject))}
2024-11-04 10:15:32 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQAudioInput constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQAudioInput(h unsafe.Pointer) *QAudioInput {
return newQAudioInput((*C.QAudioInput)(h))
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput constructs a new QAudioInput object.
func NewQAudioInput() *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput2 constructs a new QAudioInput object.
func NewQAudioInput2(audioDeviceInfo *QAudioDeviceInfo) *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new2(audioDeviceInfo.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput3 constructs a new QAudioInput object.
func NewQAudioInput3(format *QAudioFormat) *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new3(format.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput4 constructs a new QAudioInput object.
func NewQAudioInput4(format *QAudioFormat, parent *qt.QObject) *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new4(format.cPointer(), (*C.QObject)(parent.UnsafePointer())))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput5 constructs a new QAudioInput object.
func NewQAudioInput5(audioDeviceInfo *QAudioDeviceInfo, format *QAudioFormat) *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new5(audioDeviceInfo.cPointer(), format.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQAudioInput6 constructs a new QAudioInput object.
func NewQAudioInput6(audioDeviceInfo *QAudioDeviceInfo, format *QAudioFormat, parent *qt.QObject) *QAudioInput {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAudioInput(C.QAudioInput_new6(audioDeviceInfo.cPointer(), format.cPointer(), (*C.QObject)(parent.UnsafePointer())))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
func (this *QAudioInput) MetaObject() *qt.QMetaObject {
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QAudioInput_MetaObject(this.h)))
}
func (this *QAudioInput) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QAudioInput_Metacast(this.h, param1_Cstring))
}
func QAudioInput_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QAudioInput_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioInput_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QAudioInput_TrUtf8(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QAudioInput) Format() *QAudioFormat {
_goptr := newQAudioFormat(C.QAudioInput_Format(this.h))
2024-11-04 10:15:32 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QAudioInput) Start(device *qt.QIODevice) {
C.QAudioInput_Start(this.h, (*C.QIODevice)(device.UnsafePointer()))
}
func (this *QAudioInput) Start2() *qt.QIODevice {
2024-12-07 04:15:57 +00:00
return qt.UnsafeNewQIODevice(unsafe.Pointer(C.QAudioInput_Start2(this.h)))
2024-11-04 10:15:32 +00:00
}
func (this *QAudioInput) Stop() {
C.QAudioInput_Stop(this.h)
}
func (this *QAudioInput) Reset() {
C.QAudioInput_Reset(this.h)
}
func (this *QAudioInput) Suspend() {
C.QAudioInput_Suspend(this.h)
}
func (this *QAudioInput) Resume() {
C.QAudioInput_Resume(this.h)
}
func (this *QAudioInput) SetBufferSize(bytes int) {
C.QAudioInput_SetBufferSize(this.h, (C.int)(bytes))
}
func (this *QAudioInput) BufferSize() int {
return (int)(C.QAudioInput_BufferSize(this.h))
}
func (this *QAudioInput) BytesReady() int {
return (int)(C.QAudioInput_BytesReady(this.h))
}
func (this *QAudioInput) PeriodSize() int {
return (int)(C.QAudioInput_PeriodSize(this.h))
}
func (this *QAudioInput) SetNotifyInterval(milliSeconds int) {
C.QAudioInput_SetNotifyInterval(this.h, (C.int)(milliSeconds))
}
func (this *QAudioInput) NotifyInterval() int {
return (int)(C.QAudioInput_NotifyInterval(this.h))
}
func (this *QAudioInput) SetVolume(volume float64) {
C.QAudioInput_SetVolume(this.h, (C.double)(volume))
}
func (this *QAudioInput) Volume() float64 {
return (float64)(C.QAudioInput_Volume(this.h))
}
func (this *QAudioInput) ProcessedUSecs() int64 {
return (int64)(C.QAudioInput_ProcessedUSecs(this.h))
}
func (this *QAudioInput) ElapsedUSecs() int64 {
return (int64)(C.QAudioInput_ElapsedUSecs(this.h))
}
func (this *QAudioInput) Error() QAudio__Error {
return (QAudio__Error)(C.QAudioInput_Error(this.h))
}
func (this *QAudioInput) State() QAudio__State {
return (QAudio__State)(C.QAudioInput_State(this.h))
}
func (this *QAudioInput) StateChanged(state QAudio__State) {
C.QAudioInput_StateChanged(this.h, (C.int)(state))
}
func (this *QAudioInput) OnStateChanged(slot func(state QAudio__State)) {
C.QAudioInput_connect_StateChanged(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_StateChanged
func miqt_exec_callback_QAudioInput_StateChanged(cb C.intptr_t, state C.int) {
gofunc, ok := cgo.Handle(cb).Value().(func(state QAudio__State))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := (QAudio__State)(state)
gofunc(slotval1)
}
func (this *QAudioInput) Notify() {
C.QAudioInput_Notify(this.h)
}
func (this *QAudioInput) OnNotify(slot func()) {
C.QAudioInput_connect_Notify(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_Notify
func miqt_exec_callback_QAudioInput_Notify(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
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))
var _ms C.struct_miqt_string = C.QAudioInput_Tr2(s_Cstring, c_Cstring)
_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))
var _ms C.struct_miqt_string = C.QAudioInput_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 QAudioInput_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.QAudioInput_TrUtf82(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAudioInput_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.QAudioInput_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
}
2024-11-19 06:29:06 +00:00
func (this *QAudioInput) callVirtualBase_Event(event *qt.QEvent) bool {
return (bool)(C.QAudioInput_virtualbase_Event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QAudioInput) OnEvent(slot func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_Event
func miqt_exec_callback_QAudioInput_Event(self *C.QAudioInput, cb C.intptr_t, event *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QAudioInput{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QAudioInput) callVirtualBase_EventFilter(watched *qt.QObject, event *qt.QEvent) bool {
return (bool)(C.QAudioInput_virtualbase_EventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
}
func (this *QAudioInput) OnEventFilter(slot func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//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 {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQObject(unsafe.Pointer(watched))
2024-11-19 06:29:06 +00:00
slotval2 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
virtualReturn := gofunc((&QAudioInput{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QAudioInput) callVirtualBase_TimerEvent(event *qt.QTimerEvent) {
C.QAudioInput_virtualbase_TimerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
}
func (this *QAudioInput) OnTimerEvent(slot func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_TimerEvent
func miqt_exec_callback_QAudioInput_TimerEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QTimerEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 04:15:57 +00:00
slotval1 := qt.UnsafeNewQTimerEvent(unsafe.Pointer(event))
2024-11-19 06:29:06 +00:00
gofunc((&QAudioInput{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_ChildEvent(event *qt.QChildEvent) {
C.QAudioInput_virtualbase_ChildEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
}
func (this *QAudioInput) OnChildEvent(slot func(super func(event *qt.QChildEvent), event *qt.QChildEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_ChildEvent
func miqt_exec_callback_QAudioInput_ChildEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QChildEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QChildEvent), event *qt.QChildEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
2024-12-07 04:15:57 +00:00
slotval1 := qt.UnsafeNewQChildEvent(unsafe.Pointer(event))
2024-11-19 06:29:06 +00:00
gofunc((&QAudioInput{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_CustomEvent(event *qt.QEvent) {
C.QAudioInput_virtualbase_CustomEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
}
func (this *QAudioInput) OnCustomEvent(slot func(super func(event *qt.QEvent), event *qt.QEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_CustomEvent
func miqt_exec_callback_QAudioInput_CustomEvent(self *C.QAudioInput, cb C.intptr_t, event *C.QEvent) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *qt.QEvent), event *qt.QEvent))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQEvent(unsafe.Pointer(event))
gofunc((&QAudioInput{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QAudioInput) callVirtualBase_ConnectNotify(signal *qt.QMetaMethod) {
C.QAudioInput_virtualbase_ConnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QAudioInput) OnConnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_ConnectNotify
func miqt_exec_callback_QAudioInput_ConnectNotify(self *C.QAudioInput, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QAudioInput{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QAudioInput) callVirtualBase_DisconnectNotify(signal *qt.QMetaMethod) {
C.QAudioInput_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
}
func (this *QAudioInput) OnDisconnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QAudioInput_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAudioInput_DisconnectNotify
func miqt_exec_callback_QAudioInput_DisconnectNotify(self *C.QAudioInput, cb C.intptr_t, signal *C.QMetaMethod) {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod))
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := qt.UnsafeNewQMetaMethod(unsafe.Pointer(signal))
gofunc((&QAudioInput{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
2024-11-04 10:15:32 +00:00
// Delete this object from C++ memory.
func (this *QAudioInput) Delete() {
2024-11-19 06:29:06 +00:00
C.QAudioInput_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 *QAudioInput) GoGC() {
runtime.SetFinalizer(this, func(this *QAudioInput) {
this.Delete()
runtime.KeepAlive(this.h)
})
}