2022-06-23 14:07:26 +01:00
|
|
|
package voicemeeter
|
|
|
|
|
2022-06-28 14:34:03 +01:00
|
|
|
import "fmt"
|
|
|
|
|
2022-06-23 14:07:26 +01:00
|
|
|
type t_vban interface {
|
|
|
|
GetOn() bool
|
|
|
|
SetOn(val bool)
|
2022-06-25 04:00:15 +01:00
|
|
|
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)
|
2022-06-23 14:07:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type vbanStream struct {
|
|
|
|
iRemote
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetOn returns the value of the On parameter
|
|
|
|
func (v *vbanStream) GetOn() bool {
|
|
|
|
return v.getter_bool("On")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetOn sets the value of the On parameter
|
|
|
|
func (v *vbanStream) SetOn(val bool) {
|
|
|
|
v.setter_bool("On", val)
|
|
|
|
}
|
|
|
|
|
2022-06-25 04:00:15 +01:00
|
|
|
// 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)
|
|
|
|
}
|
|
|
|
|
2022-06-23 14:07:26 +01:00
|
|
|
type vbanInStream struct {
|
|
|
|
vbanStream
|
|
|
|
}
|
|
|
|
|
2022-06-25 01:18:20 +01:00
|
|
|
func newVbanInStream(i int) t_vban {
|
2022-06-28 14:34:03 +01:00
|
|
|
vbi := vbanInStream{vbanStream{iRemote{fmt.Sprintf("vban.instream[%d]", i), i}}}
|
2022-06-23 14:07:26 +01:00
|
|
|
return t_vban(&vbi)
|
|
|
|
}
|
|
|
|
|
2022-06-25 04:00:15 +01:00
|
|
|
// 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")
|
|
|
|
}
|
|
|
|
|
2022-06-23 14:07:26 +01:00
|
|
|
type vbanOutStream struct {
|
|
|
|
vbanStream
|
|
|
|
}
|
|
|
|
|
2022-06-25 01:18:20 +01:00
|
|
|
func newVbanOutStream(i int) t_vban {
|
2022-06-28 14:34:03 +01:00
|
|
|
vbo := vbanOutStream{vbanStream{iRemote{fmt.Sprintf("vban.outstream[%d]", i), i}}}
|
2022-06-23 14:07:26 +01:00
|
|
|
return t_vban(&vbo)
|
|
|
|
}
|
|
|
|
|
|
|
|
type vban struct {
|
|
|
|
InStream []t_vban
|
|
|
|
OutStream []t_vban
|
|
|
|
}
|
|
|
|
|
|
|
|
func newVban(k *kind) *vban {
|
|
|
|
_vbanIn := make([]t_vban, k.vbanIn)
|
|
|
|
for i := 0; i < k.vbanIn; i++ {
|
2022-06-25 01:18:20 +01:00
|
|
|
_vbanIn[i] = newVbanInStream(i)
|
2022-06-23 14:07:26 +01:00
|
|
|
}
|
|
|
|
_vbanOut := make([]t_vban, k.vbanOut)
|
|
|
|
for i := 0; i < k.vbanOut; i++ {
|
2022-06-25 01:18:20 +01:00
|
|
|
_vbanOut[i] = newVbanOutStream(i)
|
2022-06-23 14:07:26 +01:00
|
|
|
}
|
|
|
|
return &vban{
|
|
|
|
InStream: _vbanIn,
|
|
|
|
OutStream: _vbanOut,
|
|
|
|
}
|
|
|
|
}
|
2022-06-25 04:00:15 +01:00
|
|
|
|
|
|
|
func (v *vban) Enable() {
|
|
|
|
setParameterFloat("vban.Enable", 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *vban) Disable() {
|
|
|
|
setParameterFloat("vban.Enable", 0)
|
|
|
|
}
|