2024-11-04 23:15:32 +13:00
|
|
|
package multimedia
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qvideodeviceselectorcontrol.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mappu/miqt/qt"
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QVideoDeviceSelectorControl struct {
|
2025-01-18 17:57:48 +13:00
|
|
|
h *C.QVideoDeviceSelectorControl
|
2024-11-04 23:15:32 +13:00
|
|
|
*QMediaControl
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) cPointer() *C.QVideoDeviceSelectorControl {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// newQVideoDeviceSelectorControl constructs the type using only CGO pointers.
|
2024-12-07 17:15:57 +13:00
|
|
|
func newQVideoDeviceSelectorControl(h *C.QVideoDeviceSelectorControl) *QVideoDeviceSelectorControl {
|
2024-11-04 23:15:32 +13:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 17:15:57 +13:00
|
|
|
var outptr_QMediaControl *C.QMediaControl = nil
|
|
|
|
C.QVideoDeviceSelectorControl_virtbase(h, &outptr_QMediaControl)
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
return &QVideoDeviceSelectorControl{h: h,
|
2024-12-07 17:15:57 +13:00
|
|
|
QMediaControl: newQMediaControl(outptr_QMediaControl)}
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
2024-11-19 19:29:06 +13:00
|
|
|
// UnsafeNewQVideoDeviceSelectorControl constructs the type using only unsafe pointers.
|
2024-12-07 17:15:57 +13:00
|
|
|
func UnsafeNewQVideoDeviceSelectorControl(h unsafe.Pointer) *QVideoDeviceSelectorControl {
|
|
|
|
return newQVideoDeviceSelectorControl((*C.QVideoDeviceSelectorControl)(h))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) MetaObject() *qt.QMetaObject {
|
2025-02-01 13:45:16 +13:00
|
|
|
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QVideoDeviceSelectorControl_metaObject(this.h)))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) 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.QVideoDeviceSelectorControl_metacast(this.h, param1_Cstring))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVideoDeviceSelectorControl_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.QVideoDeviceSelectorControl_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 QVideoDeviceSelectorControl_TrUtf8(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.QVideoDeviceSelectorControl_trUtf8(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 *QVideoDeviceSelectorControl) DeviceCount() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QVideoDeviceSelectorControl_deviceCount(this.h))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) DeviceName(index int) string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QVideoDeviceSelectorControl_deviceName(this.h, (C.int)(index))
|
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 *QVideoDeviceSelectorControl) DeviceDescription(index int) string {
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QVideoDeviceSelectorControl_deviceDescription(this.h, (C.int)(index))
|
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 *QVideoDeviceSelectorControl) DefaultDevice() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QVideoDeviceSelectorControl_defaultDevice(this.h))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) SelectedDevice() int {
|
2025-02-01 13:45:16 +13:00
|
|
|
return (int)(C.QVideoDeviceSelectorControl_selectedDevice(this.h))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) SetSelectedDevice(index int) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_setSelectedDevice(this.h, (C.int)(index))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) SelectedDeviceChanged(index int) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_selectedDeviceChanged(this.h, (C.int)(index))
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
func (this *QVideoDeviceSelectorControl) OnSelectedDeviceChanged(slot func(index int)) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_connect_selectedDeviceChanged(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_QVideoDeviceSelectorControl_selectedDeviceChanged
|
|
|
|
func miqt_exec_callback_QVideoDeviceSelectorControl_selectedDeviceChanged(cb C.intptr_t, index C.int) {
|
2024-11-04 23:15:32 +13:00
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(index int))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := (int)(index)
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) SelectedDeviceChangedWithName(name string) {
|
|
|
|
name_ms := C.struct_miqt_string{}
|
|
|
|
name_ms.data = C.CString(name)
|
|
|
|
name_ms.len = C.size_t(len(name))
|
|
|
|
defer C.free(unsafe.Pointer(name_ms.data))
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_selectedDeviceChangedWithName(this.h, name_ms)
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
func (this *QVideoDeviceSelectorControl) OnSelectedDeviceChangedWithName(slot func(name string)) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_connect_selectedDeviceChangedWithName(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_QVideoDeviceSelectorControl_selectedDeviceChangedWithName
|
|
|
|
func miqt_exec_callback_QVideoDeviceSelectorControl_selectedDeviceChangedWithName(cb C.intptr_t, name C.struct_miqt_string) {
|
2024-11-04 23:15:32 +13:00
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(name string))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
var name_ms C.struct_miqt_string = name
|
|
|
|
name_ret := C.GoStringN(name_ms.data, C.int(int64(name_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(name_ms.data))
|
|
|
|
slotval1 := name_ret
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVideoDeviceSelectorControl) DevicesChanged() {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_devicesChanged(this.h)
|
2024-11-04 23:15:32 +13:00
|
|
|
}
|
|
|
|
func (this *QVideoDeviceSelectorControl) OnDevicesChanged(slot func()) {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_connect_devicesChanged(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_QVideoDeviceSelectorControl_devicesChanged
|
|
|
|
func miqt_exec_callback_QVideoDeviceSelectorControl_devicesChanged(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 QVideoDeviceSelectorControl_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.QVideoDeviceSelectorControl_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 QVideoDeviceSelectorControl_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.QVideoDeviceSelectorControl_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
|
|
|
|
}
|
|
|
|
|
|
|
|
func QVideoDeviceSelectorControl_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))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QVideoDeviceSelectorControl_trUtf82(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 QVideoDeviceSelectorControl_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))
|
2025-02-01 13:45:16 +13:00
|
|
|
var _ms C.struct_miqt_string = C.QVideoDeviceSelectorControl_trUtf83(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
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QVideoDeviceSelectorControl) Delete() {
|
2025-02-01 13:45:16 +13:00
|
|
|
C.QVideoDeviceSelectorControl_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 *QVideoDeviceSelectorControl) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QVideoDeviceSelectorControl) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|