vban methods implemented

This commit is contained in:
onyx-and-iris 2022-06-25 04:00:15 +01:00
parent 6ec36dda4e
commit ce96e7f9ac

View File

@ -3,6 +3,22 @@ package voicemeeter
type t_vban interface {
GetOn() bool
SetOn(val bool)
GetName() string
SetName(val string)
GetIp() string
SetIp(val string)
GetPort() int
SetPort(val int)
GetSr() int
SetSr(val int)
GetChannel() int
SetChannel(val int)
GetBit() int
SetBit(val int)
GetQuality() int
SetQuality(val int)
GetRoute() int
SetRoute(val int)
}
type vbanStream struct {
@ -19,6 +35,98 @@ func (v *vbanStream) SetOn(val bool) {
v.setter_bool("On", val)
}
// GetName returns the value of the Name parameter
func (v *vbanStream) GetName() string {
return v.getter_string("Name")
}
// SetLabel sets the value of the Name parameter
func (v *vbanStream) SetName(val string) {
v.setter_string("Name", val)
}
// GetIp returns the value of the Ip parameter
func (v *vbanStream) GetIp() string {
return v.getter_string("Ip")
}
// SetIp sets the value of the Ip parameter
func (v *vbanStream) SetIp(val string) {
v.setter_string("Ip", val)
}
// GetPort returns the value of the Port parameter
func (v *vbanStream) GetPort() int {
return v.getter_int("Port")
}
// SetPort sets the value of the Port parameter
func (v *vbanStream) SetPort(val int) {
v.setter_int("Port", val)
}
// GetSr returns the value of the Sr parameter
func (v *vbanStream) GetSr() int {
return v.getter_int("Sr")
}
// SetSr sets the value of the Sr parameter
func (v *vbanStream) SetSr(val int) {
v.setter_int("Sr", val)
}
// GetChannel returns the value of the Channel parameter
func (v *vbanStream) GetChannel() int {
return v.getter_int("Channel")
}
// SetChannel sets the value of the Channel parameter
func (v *vbanStream) SetChannel(val int) {
v.setter_int("Channel", val)
}
// GetBit returns the value of the Bit parameter
func (v *vbanStream) GetBit() int {
val := v.getter_int("Bit")
if val == 1 {
return 16
}
return 24
}
// SetBit sets the value of the Bit parameter
func (v *vbanStream) SetBit(val int) {
switch val {
case 16:
val = 1
case 24:
val = 2
default:
panic("expected value 16 or 24")
}
v.setter_int("Bit", val)
}
// GetQuality returns the value of the Quality parameter
func (v *vbanStream) GetQuality() int {
return v.getter_int("Quality")
}
// SetQuality sets the value of the Quality parameter
func (v *vbanStream) SetQuality(val int) {
v.setter_int("Quality", val)
}
// GetRoute returns the value of the Route parameter
func (v *vbanStream) GetRoute() int {
return v.getter_int("Route")
}
// SetRoute sets the value of the Route parameter
func (v *vbanStream) SetRoute(val int) {
v.setter_int("Route", val)
}
type vbanInStream struct {
vbanStream
}
@ -28,6 +136,21 @@ func newVbanInStream(i int) t_vban {
return t_vban(&vbi)
}
// SetSr panics reason read only
func (vbi *vbanInStream) SetSr(val int) {
panic("SR is readonly for vban instreams")
}
// SetChannel panics reason read only
func (vbi *vbanInStream) SetChannel(val int) {
panic("channel is readonly for vban instreams")
}
// SetBit panics reason read only
func (vbi *vbanInStream) SetBit(val int) {
panic("bit is readonly for vban instreams")
}
type vbanOutStream struct {
vbanStream
}
@ -56,3 +179,11 @@ func newVban(k *kind) *vban {
OutStream: _vbanOut,
}
}
func (v *vban) Enable() {
setParameterFloat("vban.Enable", 1)
}
func (v *vban) Disable() {
setParameterFloat("vban.Enable", 0)
}