mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 00:17:00 +08:00
60 lines
2.3 KiB
Go
60 lines
2.3 KiB
Go
package gst
|
|
|
|
// #include "gst.go.h"
|
|
import "C"
|
|
import (
|
|
"strconv"
|
|
"unsafe"
|
|
|
|
"github.com/go-gst/go-glib/glib"
|
|
)
|
|
|
|
type InterpolationControlSource struct{ *Object }
|
|
|
|
type InterpolationMode int
|
|
|
|
const (
|
|
//steps-like interpolation, default
|
|
InterpolationModeNone InterpolationMode = 0 // GST_INTERPOLATION_MODE_NONE
|
|
//linear interpolation
|
|
InterpolationModeLinear InterpolationMode = 1 // GST_INTERPOLATION_MODE_LINEAR
|
|
//cubic interpolation (natural), may overshoot the min or max values set by the control point, but is more 'curvy'
|
|
InterpolationModeCubic InterpolationMode = 2 // GST_INTERPOLATION_MODE_CUBIC
|
|
//monotonic cubic interpolation, will not produce any values outside of the min-max range set by the control points (Since: 1.8)
|
|
InterpolationModeCubicMonotonic InterpolationMode = 3 // GST_INTERPOLATION_MODE_CUBIC_MONOTONIC
|
|
)
|
|
|
|
//
|
|
// Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead.
|
|
func (cs *InterpolationControlSource) Instance() *C.GstControlSource {
|
|
return C.toGstControlSource(cs.Unsafe())
|
|
}
|
|
|
|
//
|
|
// Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead.
|
|
func NewInterpolationControlSource() *InterpolationControlSource {
|
|
cCs := C.gst_interpolation_control_source_new()
|
|
|
|
return &InterpolationControlSource{
|
|
Object: wrapObject(glib.TransferFull(unsafe.Pointer(cCs))),
|
|
}
|
|
}
|
|
|
|
//
|
|
// Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead.
|
|
func (cs *InterpolationControlSource) SetInterpolationMode(mode InterpolationMode) {
|
|
cs.SetArg("mode", strconv.Itoa(int(mode)))
|
|
}
|
|
|
|
//
|
|
// Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead.
|
|
func (cs *InterpolationControlSource) SetTimedValue(time ClockTime, value float64) bool {
|
|
return gobool(C.gst_timed_value_control_source_set(C.toGstTimedValueControlSource(cs.Unsafe()), C.GstClockTime(time), C.double(value)))
|
|
}
|
|
|
|
//
|
|
// Deprecated: This is handwritten and will be removed in a future version. Please use the autogenerated bindings instead.
|
|
func (cs *InterpolationControlSource) UnsetAll() {
|
|
C.gst_timed_value_control_source_unset_all(C.toGstTimedValueControlSource(cs.Unsafe()))
|
|
}
|