package multimedia /* #include "gen_qaudiooutput.h" #include */ import "C" import ( "github.com/mappu/miqt/qt" "runtime" "runtime/cgo" "unsafe" ) type QAudioOutput struct { h *C.QAudioOutput isSubclass bool *qt.QObject } func (this *QAudioOutput) cPointer() *C.QAudioOutput { if this == nil { return nil } return this.h } func (this *QAudioOutput) UnsafePointer() unsafe.Pointer { if this == nil { return nil } return unsafe.Pointer(this.h) } // newQAudioOutput constructs the type using only CGO pointers. func newQAudioOutput(h *C.QAudioOutput, h_QObject *C.QObject) *QAudioOutput { if h == nil { return nil } return &QAudioOutput{h: h, QObject: qt.UnsafeNewQObject(unsafe.Pointer(h_QObject))} } // UnsafeNewQAudioOutput constructs the type using only unsafe pointers. func UnsafeNewQAudioOutput(h unsafe.Pointer, h_QObject unsafe.Pointer) *QAudioOutput { if h == nil { return nil } return &QAudioOutput{h: (*C.QAudioOutput)(h), QObject: qt.UnsafeNewQObject(h_QObject)} } // NewQAudioOutput constructs a new QAudioOutput object. func NewQAudioOutput() *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new(&outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } // NewQAudioOutput2 constructs a new QAudioOutput object. func NewQAudioOutput2(audioDeviceInfo *QAudioDeviceInfo) *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new2(audioDeviceInfo.cPointer(), &outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } // NewQAudioOutput3 constructs a new QAudioOutput object. func NewQAudioOutput3(format *QAudioFormat) *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new3(format.cPointer(), &outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } // NewQAudioOutput4 constructs a new QAudioOutput object. func NewQAudioOutput4(format *QAudioFormat, parent *qt.QObject) *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new4(format.cPointer(), (*C.QObject)(parent.UnsafePointer()), &outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } // NewQAudioOutput5 constructs a new QAudioOutput object. func NewQAudioOutput5(audioDeviceInfo *QAudioDeviceInfo, format *QAudioFormat) *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new5(audioDeviceInfo.cPointer(), format.cPointer(), &outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } // NewQAudioOutput6 constructs a new QAudioOutput object. func NewQAudioOutput6(audioDeviceInfo *QAudioDeviceInfo, format *QAudioFormat, parent *qt.QObject) *QAudioOutput { var outptr_QAudioOutput *C.QAudioOutput = nil var outptr_QObject *C.QObject = nil C.QAudioOutput_new6(audioDeviceInfo.cPointer(), format.cPointer(), (*C.QObject)(parent.UnsafePointer()), &outptr_QAudioOutput, &outptr_QObject) ret := newQAudioOutput(outptr_QAudioOutput, outptr_QObject) ret.isSubclass = true return ret } func (this *QAudioOutput) MetaObject() *qt.QMetaObject { return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QAudioOutput_MetaObject(this.h))) } func (this *QAudioOutput) Metacast(param1 string) unsafe.Pointer { param1_Cstring := C.CString(param1) defer C.free(unsafe.Pointer(param1_Cstring)) return (unsafe.Pointer)(C.QAudioOutput_Metacast(this.h, param1_Cstring)) } func QAudioOutput_Tr(s string) string { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) var _ms C.struct_miqt_string = C.QAudioOutput_Tr(s_Cstring) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) C.free(unsafe.Pointer(_ms.data)) return _ret } func QAudioOutput_TrUtf8(s string) string { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) var _ms C.struct_miqt_string = C.QAudioOutput_TrUtf8(s_Cstring) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) C.free(unsafe.Pointer(_ms.data)) return _ret } func (this *QAudioOutput) Format() *QAudioFormat { _ret := C.QAudioOutput_Format(this.h) _goptr := newQAudioFormat(_ret) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer return _goptr } func (this *QAudioOutput) Start(device *qt.QIODevice) { C.QAudioOutput_Start(this.h, (*C.QIODevice)(device.UnsafePointer())) } func (this *QAudioOutput) Start2() *qt.QIODevice { return qt.UnsafeNewQIODevice(unsafe.Pointer(C.QAudioOutput_Start2(this.h)), nil) } func (this *QAudioOutput) Stop() { C.QAudioOutput_Stop(this.h) } func (this *QAudioOutput) Reset() { C.QAudioOutput_Reset(this.h) } func (this *QAudioOutput) Suspend() { C.QAudioOutput_Suspend(this.h) } func (this *QAudioOutput) Resume() { C.QAudioOutput_Resume(this.h) } func (this *QAudioOutput) SetBufferSize(bytes int) { C.QAudioOutput_SetBufferSize(this.h, (C.int)(bytes)) } func (this *QAudioOutput) BufferSize() int { return (int)(C.QAudioOutput_BufferSize(this.h)) } func (this *QAudioOutput) BytesFree() int { return (int)(C.QAudioOutput_BytesFree(this.h)) } func (this *QAudioOutput) PeriodSize() int { return (int)(C.QAudioOutput_PeriodSize(this.h)) } func (this *QAudioOutput) SetNotifyInterval(milliSeconds int) { C.QAudioOutput_SetNotifyInterval(this.h, (C.int)(milliSeconds)) } func (this *QAudioOutput) NotifyInterval() int { return (int)(C.QAudioOutput_NotifyInterval(this.h)) } func (this *QAudioOutput) ProcessedUSecs() int64 { return (int64)(C.QAudioOutput_ProcessedUSecs(this.h)) } func (this *QAudioOutput) ElapsedUSecs() int64 { return (int64)(C.QAudioOutput_ElapsedUSecs(this.h)) } func (this *QAudioOutput) Error() QAudio__Error { return (QAudio__Error)(C.QAudioOutput_Error(this.h)) } func (this *QAudioOutput) State() QAudio__State { return (QAudio__State)(C.QAudioOutput_State(this.h)) } func (this *QAudioOutput) SetVolume(volume float64) { C.QAudioOutput_SetVolume(this.h, (C.double)(volume)) } func (this *QAudioOutput) Volume() float64 { return (float64)(C.QAudioOutput_Volume(this.h)) } func (this *QAudioOutput) Category() string { var _ms C.struct_miqt_string = C.QAudioOutput_Category(this.h) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) C.free(unsafe.Pointer(_ms.data)) return _ret } func (this *QAudioOutput) SetCategory(category string) { category_ms := C.struct_miqt_string{} category_ms.data = C.CString(category) category_ms.len = C.size_t(len(category)) defer C.free(unsafe.Pointer(category_ms.data)) C.QAudioOutput_SetCategory(this.h, category_ms) } func (this *QAudioOutput) StateChanged(state QAudio__State) { C.QAudioOutput_StateChanged(this.h, (C.int)(state)) } func (this *QAudioOutput) OnStateChanged(slot func(state QAudio__State)) { C.QAudioOutput_connect_StateChanged(this.h, C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_StateChanged func miqt_exec_callback_QAudioOutput_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 *QAudioOutput) Notify() { C.QAudioOutput_Notify(this.h) } func (this *QAudioOutput) OnNotify(slot func()) { C.QAudioOutput_connect_Notify(this.h, C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_Notify func miqt_exec_callback_QAudioOutput_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 QAudioOutput_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.QAudioOutput_Tr2(s_Cstring, c_Cstring) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) C.free(unsafe.Pointer(_ms.data)) return _ret } func QAudioOutput_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.QAudioOutput_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 QAudioOutput_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.QAudioOutput_TrUtf82(s_Cstring, c_Cstring) _ret := C.GoStringN(_ms.data, C.int(int64(_ms.len))) C.free(unsafe.Pointer(_ms.data)) return _ret } func QAudioOutput_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.QAudioOutput_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 } func (this *QAudioOutput) callVirtualBase_Event(event *qt.QEvent) bool { return (bool)(C.QAudioOutput_virtualbase_Event(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer()))) } func (this *QAudioOutput) OnEvent(slot func(super func(event *qt.QEvent) bool, event *qt.QEvent) bool) { C.QAudioOutput_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_Event func miqt_exec_callback_QAudioOutput_Event(self *C.QAudioOutput, 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((&QAudioOutput{h: self}).callVirtualBase_Event, slotval1) return (C.bool)(virtualReturn) } func (this *QAudioOutput) callVirtualBase_EventFilter(watched *qt.QObject, event *qt.QEvent) bool { return (bool)(C.QAudioOutput_virtualbase_EventFilter(unsafe.Pointer(this.h), (*C.QObject)(watched.UnsafePointer()), (*C.QEvent)(event.UnsafePointer()))) } func (this *QAudioOutput) OnEventFilter(slot func(super func(watched *qt.QObject, event *qt.QEvent) bool, watched *qt.QObject, event *qt.QEvent) bool) { C.QAudioOutput_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_EventFilter func miqt_exec_callback_QAudioOutput_EventFilter(self *C.QAudioOutput, 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)) slotval2 := qt.UnsafeNewQEvent(unsafe.Pointer(event)) virtualReturn := gofunc((&QAudioOutput{h: self}).callVirtualBase_EventFilter, slotval1, slotval2) return (C.bool)(virtualReturn) } func (this *QAudioOutput) callVirtualBase_TimerEvent(event *qt.QTimerEvent) { C.QAudioOutput_virtualbase_TimerEvent(unsafe.Pointer(this.h), (*C.QTimerEvent)(event.UnsafePointer())) } func (this *QAudioOutput) OnTimerEvent(slot func(super func(event *qt.QTimerEvent), event *qt.QTimerEvent)) { C.QAudioOutput_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_TimerEvent func miqt_exec_callback_QAudioOutput_TimerEvent(self *C.QAudioOutput, 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 slotval1 := qt.UnsafeNewQTimerEvent(unsafe.Pointer(event), nil) gofunc((&QAudioOutput{h: self}).callVirtualBase_TimerEvent, slotval1) } func (this *QAudioOutput) callVirtualBase_ChildEvent(event *qt.QChildEvent) { C.QAudioOutput_virtualbase_ChildEvent(unsafe.Pointer(this.h), (*C.QChildEvent)(event.UnsafePointer())) } func (this *QAudioOutput) OnChildEvent(slot func(super func(event *qt.QChildEvent), event *qt.QChildEvent)) { C.QAudioOutput_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_ChildEvent func miqt_exec_callback_QAudioOutput_ChildEvent(self *C.QAudioOutput, 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 slotval1 := qt.UnsafeNewQChildEvent(unsafe.Pointer(event), nil) gofunc((&QAudioOutput{h: self}).callVirtualBase_ChildEvent, slotval1) } func (this *QAudioOutput) callVirtualBase_CustomEvent(event *qt.QEvent) { C.QAudioOutput_virtualbase_CustomEvent(unsafe.Pointer(this.h), (*C.QEvent)(event.UnsafePointer())) } func (this *QAudioOutput) OnCustomEvent(slot func(super func(event *qt.QEvent), event *qt.QEvent)) { C.QAudioOutput_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_CustomEvent func miqt_exec_callback_QAudioOutput_CustomEvent(self *C.QAudioOutput, 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((&QAudioOutput{h: self}).callVirtualBase_CustomEvent, slotval1) } func (this *QAudioOutput) callVirtualBase_ConnectNotify(signal *qt.QMetaMethod) { C.QAudioOutput_virtualbase_ConnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())) } func (this *QAudioOutput) OnConnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) { C.QAudioOutput_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_ConnectNotify func miqt_exec_callback_QAudioOutput_ConnectNotify(self *C.QAudioOutput, 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((&QAudioOutput{h: self}).callVirtualBase_ConnectNotify, slotval1) } func (this *QAudioOutput) callVirtualBase_DisconnectNotify(signal *qt.QMetaMethod) { C.QAudioOutput_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), (*C.QMetaMethod)(signal.UnsafePointer())) } func (this *QAudioOutput) OnDisconnectNotify(slot func(super func(signal *qt.QMetaMethod), signal *qt.QMetaMethod)) { C.QAudioOutput_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot))) } //export miqt_exec_callback_QAudioOutput_DisconnectNotify func miqt_exec_callback_QAudioOutput_DisconnectNotify(self *C.QAudioOutput, 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((&QAudioOutput{h: self}).callVirtualBase_DisconnectNotify, slotval1) } // Delete this object from C++ memory. func (this *QAudioOutput) Delete() { C.QAudioOutput_Delete(this.h, C.bool(this.isSubclass)) } // 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 *QAudioOutput) GoGC() { runtime.SetFinalizer(this, func(this *QAudioOutput) { this.Delete() runtime.KeepAlive(this.h) }) }