miqt/qt6/spatialaudio/gen_qambientsound.go

427 lines
14 KiB
Go
Raw Normal View History

2024-11-04 23:15:32 +13:00
package spatialaudio
/*
#include "gen_qambientsound.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt6"
"runtime"
"runtime/cgo"
"unsafe"
)
type QAmbientSound__Loops int
const (
QAmbientSound__Infinite QAmbientSound__Loops = -1
QAmbientSound__Once QAmbientSound__Loops = 1
)
type QAmbientSound struct {
h *C.QAmbientSound
2024-11-04 23:15:32 +13:00
*qt6.QObject
}
func (this *QAmbientSound) cPointer() *C.QAmbientSound {
if this == nil {
return nil
}
return this.h
}
func (this *QAmbientSound) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQAmbientSound constructs the type using only CGO pointers.
2024-12-07 17:15:57 +13:00
func newQAmbientSound(h *C.QAmbientSound) *QAmbientSound {
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.QAmbientSound_virtbase(h, &outptr_QObject)
2024-11-19 19:29:06 +13:00
return &QAmbientSound{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
// UnsafeNewQAmbientSound constructs the type using only unsafe pointers.
2024-12-07 17:15:57 +13:00
func UnsafeNewQAmbientSound(h unsafe.Pointer) *QAmbientSound {
return newQAmbientSound((*C.QAmbientSound)(h))
2024-11-04 23:15:32 +13:00
}
// NewQAmbientSound constructs a new QAmbientSound object.
func NewQAmbientSound(engine *QAudioEngine) *QAmbientSound {
2024-11-19 19:29:06 +13:00
return newQAmbientSound(C.QAmbientSound_new(engine.cPointer()))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) MetaObject() *qt6.QMetaObject {
2025-02-01 13:45:16 +13:00
return qt6.UnsafeNewQMetaObject(unsafe.Pointer(C.QAmbientSound_metaObject(this.h)))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) 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.QAmbientSound_metacast(this.h, param1_Cstring))
2024-11-04 23:15:32 +13:00
}
func QAmbientSound_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.QAmbientSound_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 *QAmbientSound) SetSource(url *qt6.QUrl) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_setSource(this.h, (*C.QUrl)(url.UnsafePointer()))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) Source() *qt6.QUrl {
2025-02-01 13:45:16 +13:00
_goptr := qt6.UnsafeNewQUrl(unsafe.Pointer(C.QAmbientSound_source(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 *QAmbientSound) Loops() int {
2025-02-01 13:45:16 +13:00
return (int)(C.QAmbientSound_loops(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) SetLoops(loops int) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_setLoops(this.h, (C.int)(loops))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) AutoPlay() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAmbientSound_autoPlay(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) SetAutoPlay(autoPlay bool) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_setAutoPlay(this.h, (C.bool)(autoPlay))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) SetVolume(volume float32) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_setVolume(this.h, (C.float)(volume))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) Volume() float32 {
2025-02-01 13:45:16 +13:00
return (float32)(C.QAmbientSound_volume(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) Engine() *QAudioEngine {
2025-02-01 13:45:16 +13:00
return newQAudioEngine(C.QAmbientSound_engine(this.h))
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) SourceChanged() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_sourceChanged(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) OnSourceChanged(slot func()) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_connect_sourceChanged(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_QAmbientSound_sourceChanged
func miqt_exec_callback_QAmbientSound_sourceChanged(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 *QAmbientSound) LoopsChanged() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_loopsChanged(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) OnLoopsChanged(slot func()) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_connect_loopsChanged(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_QAmbientSound_loopsChanged
func miqt_exec_callback_QAmbientSound_loopsChanged(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 *QAmbientSound) AutoPlayChanged() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_autoPlayChanged(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) OnAutoPlayChanged(slot func()) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_connect_autoPlayChanged(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_QAmbientSound_autoPlayChanged
func miqt_exec_callback_QAmbientSound_autoPlayChanged(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 *QAmbientSound) VolumeChanged() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_volumeChanged(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) OnVolumeChanged(slot func()) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_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_QAmbientSound_volumeChanged
func miqt_exec_callback_QAmbientSound_volumeChanged(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 *QAmbientSound) Play() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_play(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) Pause() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_pause(this.h)
2024-11-04 23:15:32 +13:00
}
func (this *QAmbientSound) Stop() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_stop(this.h)
2024-11-04 23:15:32 +13:00
}
func QAmbientSound_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.QAmbientSound_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 QAmbientSound_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.QAmbientSound_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
}
2024-11-19 19:29:06 +13:00
func (this *QAmbientSound) callVirtualBase_Event(event *qt6.QEvent) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAmbientSound_virtualbase_event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) Onevent(slot func(super func(event *qt6.QEvent) bool, event *qt6.QEvent) bool) {
ok := C.QAmbientSound_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_QAmbientSound_event
func miqt_exec_callback_QAmbientSound_event(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QAmbientSound) callVirtualBase_EventFilter(watched *qt6.QObject, event *qt6.QEvent) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QAmbientSound_virtualbase_eventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer())))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OneventFilter(slot func(super func(watched *qt6.QObject, event *qt6.QEvent) bool, watched *qt6.QObject, event *qt6.QEvent) bool) {
ok := C.QAmbientSound_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_QAmbientSound_eventFilter
func miqt_exec_callback_QAmbientSound_eventFilter(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QAmbientSound) callVirtualBase_TimerEvent(event *qt6.QTimerEvent) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_virtualbase_timerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OntimerEvent(slot func(super func(event *qt6.QTimerEvent), event *qt6.QTimerEvent)) {
ok := C.QAmbientSound_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_QAmbientSound_timerEvent
func miqt_exec_callback_QAmbientSound_timerEvent(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QAmbientSound) callVirtualBase_ChildEvent(event *qt6.QChildEvent) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_virtualbase_childEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OnchildEvent(slot func(super func(event *qt6.QChildEvent), event *qt6.QChildEvent)) {
ok := C.QAmbientSound_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_QAmbientSound_childEvent
func miqt_exec_callback_QAmbientSound_childEvent(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QAmbientSound) callVirtualBase_CustomEvent(event *qt6.QEvent) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_virtualbase_customEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OncustomEvent(slot func(super func(event *qt6.QEvent), event *qt6.QEvent)) {
ok := C.QAmbientSound_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_QAmbientSound_customEvent
func miqt_exec_callback_QAmbientSound_customEvent(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QAmbientSound) callVirtualBase_ConnectNotify(signal *qt6.QMetaMethod) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_virtualbase_connectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OnconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QAmbientSound_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_QAmbientSound_connectNotify
func miqt_exec_callback_QAmbientSound_connectNotify(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QAmbientSound) callVirtualBase_DisconnectNotify(signal *qt6.QMetaMethod) {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_virtualbase_disconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer()))
2024-11-19 19:29:06 +13:00
}
2025-02-01 13:45:16 +13:00
func (this *QAmbientSound) OndisconnectNotify(slot func(super func(signal *qt6.QMetaMethod), signal *qt6.QMetaMethod)) {
ok := C.QAmbientSound_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_QAmbientSound_disconnectNotify
func miqt_exec_callback_QAmbientSound_disconnectNotify(self *C.QAmbientSound, 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((&QAmbientSound{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
2024-11-04 23:15:32 +13:00
// Delete this object from C++ memory.
func (this *QAmbientSound) Delete() {
2025-02-01 13:45:16 +13:00
C.QAmbientSound_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 *QAmbientSound) GoGC() {
runtime.SetFinalizer(this, func(this *QAmbientSound) {
this.Delete()
runtime.KeepAlive(this.h)
})
}