miqt/qt/multimedia/gen_qmediatimerange.go

304 lines
9.2 KiB
Go
Raw Normal View History

2024-11-04 10:15:32 +00:00
package multimedia
/*
#include "gen_qmediatimerange.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QMediaTimeInterval struct {
2024-11-19 06:29:06 +00:00
h *C.QMediaTimeInterval
isSubclass bool
2024-11-04 10:15:32 +00:00
}
func (this *QMediaTimeInterval) cPointer() *C.QMediaTimeInterval {
if this == nil {
return nil
}
return this.h
}
func (this *QMediaTimeInterval) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQMediaTimeInterval constructs the type using only CGO pointers.
2024-11-04 10:15:32 +00:00
func newQMediaTimeInterval(h *C.QMediaTimeInterval) *QMediaTimeInterval {
if h == nil {
return nil
}
return &QMediaTimeInterval{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQMediaTimeInterval constructs the type using only unsafe pointers.
2024-11-04 10:15:32 +00:00
func UnsafeNewQMediaTimeInterval(h unsafe.Pointer) *QMediaTimeInterval {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QMediaTimeInterval{h: (*C.QMediaTimeInterval)(h)}
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeInterval constructs a new QMediaTimeInterval object.
func NewQMediaTimeInterval() *QMediaTimeInterval {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeInterval *C.QMediaTimeInterval = nil
C.QMediaTimeInterval_new(&outptr_QMediaTimeInterval)
ret := newQMediaTimeInterval(outptr_QMediaTimeInterval)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeInterval2 constructs a new QMediaTimeInterval object.
func NewQMediaTimeInterval2(start int64, end int64) *QMediaTimeInterval {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeInterval *C.QMediaTimeInterval = nil
C.QMediaTimeInterval_new2((C.longlong)(start), (C.longlong)(end), &outptr_QMediaTimeInterval)
ret := newQMediaTimeInterval(outptr_QMediaTimeInterval)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeInterval3 constructs a new QMediaTimeInterval object.
func NewQMediaTimeInterval3(param1 *QMediaTimeInterval) *QMediaTimeInterval {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeInterval *C.QMediaTimeInterval = nil
C.QMediaTimeInterval_new3(param1.cPointer(), &outptr_QMediaTimeInterval)
ret := newQMediaTimeInterval(outptr_QMediaTimeInterval)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
func (this *QMediaTimeInterval) OperatorAssign(param1 *QMediaTimeInterval) {
C.QMediaTimeInterval_OperatorAssign(this.h, param1.cPointer())
}
func (this *QMediaTimeInterval) Start() int64 {
return (int64)(C.QMediaTimeInterval_Start(this.h))
}
func (this *QMediaTimeInterval) End() int64 {
return (int64)(C.QMediaTimeInterval_End(this.h))
}
func (this *QMediaTimeInterval) Contains(time int64) bool {
return (bool)(C.QMediaTimeInterval_Contains(this.h, (C.longlong)(time)))
}
func (this *QMediaTimeInterval) IsNormal() bool {
return (bool)(C.QMediaTimeInterval_IsNormal(this.h))
}
func (this *QMediaTimeInterval) Normalized() *QMediaTimeInterval {
_ret := C.QMediaTimeInterval_Normalized(this.h)
_goptr := newQMediaTimeInterval(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QMediaTimeInterval) Translated(offset int64) *QMediaTimeInterval {
_ret := C.QMediaTimeInterval_Translated(this.h, (C.longlong)(offset))
_goptr := newQMediaTimeInterval(_ret)
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Delete this object from C++ memory.
func (this *QMediaTimeInterval) Delete() {
2024-11-19 06:29:06 +00:00
C.QMediaTimeInterval_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 *QMediaTimeInterval) GoGC() {
runtime.SetFinalizer(this, func(this *QMediaTimeInterval) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QMediaTimeRange struct {
2024-11-19 06:29:06 +00:00
h *C.QMediaTimeRange
isSubclass bool
2024-11-04 10:15:32 +00:00
}
func (this *QMediaTimeRange) cPointer() *C.QMediaTimeRange {
if this == nil {
return nil
}
return this.h
}
func (this *QMediaTimeRange) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQMediaTimeRange constructs the type using only CGO pointers.
2024-11-04 10:15:32 +00:00
func newQMediaTimeRange(h *C.QMediaTimeRange) *QMediaTimeRange {
if h == nil {
return nil
}
return &QMediaTimeRange{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQMediaTimeRange constructs the type using only unsafe pointers.
2024-11-04 10:15:32 +00:00
func UnsafeNewQMediaTimeRange(h unsafe.Pointer) *QMediaTimeRange {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QMediaTimeRange{h: (*C.QMediaTimeRange)(h)}
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeRange constructs a new QMediaTimeRange object.
func NewQMediaTimeRange() *QMediaTimeRange {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeRange *C.QMediaTimeRange = nil
C.QMediaTimeRange_new(&outptr_QMediaTimeRange)
ret := newQMediaTimeRange(outptr_QMediaTimeRange)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeRange2 constructs a new QMediaTimeRange object.
func NewQMediaTimeRange2(start int64, end int64) *QMediaTimeRange {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeRange *C.QMediaTimeRange = nil
C.QMediaTimeRange_new2((C.longlong)(start), (C.longlong)(end), &outptr_QMediaTimeRange)
ret := newQMediaTimeRange(outptr_QMediaTimeRange)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeRange3 constructs a new QMediaTimeRange object.
func NewQMediaTimeRange3(param1 *QMediaTimeInterval) *QMediaTimeRange {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeRange *C.QMediaTimeRange = nil
C.QMediaTimeRange_new3(param1.cPointer(), &outptr_QMediaTimeRange)
ret := newQMediaTimeRange(outptr_QMediaTimeRange)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
// NewQMediaTimeRange4 constructs a new QMediaTimeRange object.
func NewQMediaTimeRange4(rangeVal *QMediaTimeRange) *QMediaTimeRange {
2024-11-19 06:29:06 +00:00
var outptr_QMediaTimeRange *C.QMediaTimeRange = nil
C.QMediaTimeRange_new4(rangeVal.cPointer(), &outptr_QMediaTimeRange)
ret := newQMediaTimeRange(outptr_QMediaTimeRange)
ret.isSubclass = true
return ret
2024-11-04 10:15:32 +00:00
}
func (this *QMediaTimeRange) OperatorAssign(param1 *QMediaTimeRange) {
C.QMediaTimeRange_OperatorAssign(this.h, param1.cPointer())
}
func (this *QMediaTimeRange) OperatorAssignWithQMediaTimeInterval(param1 *QMediaTimeInterval) {
C.QMediaTimeRange_OperatorAssignWithQMediaTimeInterval(this.h, param1.cPointer())
}
func (this *QMediaTimeRange) EarliestTime() int64 {
return (int64)(C.QMediaTimeRange_EarliestTime(this.h))
}
func (this *QMediaTimeRange) LatestTime() int64 {
return (int64)(C.QMediaTimeRange_LatestTime(this.h))
}
func (this *QMediaTimeRange) Intervals() []QMediaTimeInterval {
var _ma C.struct_miqt_array = C.QMediaTimeRange_Intervals(this.h)
_ret := make([]QMediaTimeInterval, int(_ma.len))
_outCast := (*[0xffff]*C.QMediaTimeInterval)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_ret := _outCast[i]
_lv_goptr := newQMediaTimeInterval(_lv_ret)
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QMediaTimeRange) IsEmpty() bool {
return (bool)(C.QMediaTimeRange_IsEmpty(this.h))
}
func (this *QMediaTimeRange) IsContinuous() bool {
return (bool)(C.QMediaTimeRange_IsContinuous(this.h))
}
func (this *QMediaTimeRange) Contains(time int64) bool {
return (bool)(C.QMediaTimeRange_Contains(this.h, (C.longlong)(time)))
}
func (this *QMediaTimeRange) AddInterval(start int64, end int64) {
C.QMediaTimeRange_AddInterval(this.h, (C.longlong)(start), (C.longlong)(end))
}
func (this *QMediaTimeRange) AddIntervalWithInterval(interval *QMediaTimeInterval) {
C.QMediaTimeRange_AddIntervalWithInterval(this.h, interval.cPointer())
}
func (this *QMediaTimeRange) AddTimeRange(param1 *QMediaTimeRange) {
C.QMediaTimeRange_AddTimeRange(this.h, param1.cPointer())
}
func (this *QMediaTimeRange) RemoveInterval(start int64, end int64) {
C.QMediaTimeRange_RemoveInterval(this.h, (C.longlong)(start), (C.longlong)(end))
}
func (this *QMediaTimeRange) RemoveIntervalWithInterval(interval *QMediaTimeInterval) {
C.QMediaTimeRange_RemoveIntervalWithInterval(this.h, interval.cPointer())
}
func (this *QMediaTimeRange) RemoveTimeRange(param1 *QMediaTimeRange) {
C.QMediaTimeRange_RemoveTimeRange(this.h, param1.cPointer())
}
func (this *QMediaTimeRange) OperatorPlusAssign(param1 *QMediaTimeRange) *QMediaTimeRange {
return UnsafeNewQMediaTimeRange(unsafe.Pointer(C.QMediaTimeRange_OperatorPlusAssign(this.h, param1.cPointer())))
}
func (this *QMediaTimeRange) OperatorPlusAssignWithQMediaTimeInterval(param1 *QMediaTimeInterval) *QMediaTimeRange {
return UnsafeNewQMediaTimeRange(unsafe.Pointer(C.QMediaTimeRange_OperatorPlusAssignWithQMediaTimeInterval(this.h, param1.cPointer())))
}
func (this *QMediaTimeRange) OperatorMinusAssign(param1 *QMediaTimeRange) *QMediaTimeRange {
return UnsafeNewQMediaTimeRange(unsafe.Pointer(C.QMediaTimeRange_OperatorMinusAssign(this.h, param1.cPointer())))
}
func (this *QMediaTimeRange) OperatorMinusAssignWithQMediaTimeInterval(param1 *QMediaTimeInterval) *QMediaTimeRange {
return UnsafeNewQMediaTimeRange(unsafe.Pointer(C.QMediaTimeRange_OperatorMinusAssignWithQMediaTimeInterval(this.h, param1.cPointer())))
}
func (this *QMediaTimeRange) Clear() {
C.QMediaTimeRange_Clear(this.h)
}
// Delete this object from C++ memory.
func (this *QMediaTimeRange) Delete() {
2024-11-19 06:29:06 +00:00
C.QMediaTimeRange_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 *QMediaTimeRange) GoGC() {
runtime.SetFinalizer(this, func(this *QMediaTimeRange) {
this.Delete()
runtime.KeepAlive(this.h)
})
}