2022-06-22 20:51:25 +01:00
|
|
|
package voicemeeter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2022-07-10 23:08:14 +01:00
|
|
|
"time"
|
2022-10-10 18:51:30 +01:00
|
|
|
|
|
|
|
log "github.com/sirupsen/logrus"
|
2022-06-22 20:51:25 +01:00
|
|
|
)
|
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
// iStrip defines the interface strip types must satisfy
|
2022-07-10 23:08:14 +01:00
|
|
|
type iStrip interface {
|
2022-06-25 01:18:20 +01:00
|
|
|
String() string
|
2022-12-08 10:23:35 +00:00
|
|
|
Mute() bool
|
2022-06-23 10:42:11 +01:00
|
|
|
SetMute(val bool)
|
2022-12-08 10:23:35 +00:00
|
|
|
Mono() bool
|
2022-06-23 10:42:11 +01:00
|
|
|
SetMono(val bool)
|
2022-12-08 10:23:35 +00:00
|
|
|
Solo() bool
|
2022-06-23 10:42:11 +01:00
|
|
|
SetSolo(val bool)
|
2022-12-08 10:23:35 +00:00
|
|
|
Limit() int
|
2022-06-23 10:42:11 +01:00
|
|
|
SetLimit(val int)
|
2022-12-08 10:23:35 +00:00
|
|
|
Label() string
|
2022-06-23 10:42:11 +01:00
|
|
|
SetLabel(val string)
|
2022-12-08 10:23:35 +00:00
|
|
|
Gain() float64
|
2022-09-14 00:58:05 +01:00
|
|
|
SetGain(val float64)
|
2022-12-08 10:23:35 +00:00
|
|
|
Mc() bool
|
2022-06-23 10:42:11 +01:00
|
|
|
SetMc(val bool)
|
2022-12-08 10:23:35 +00:00
|
|
|
Audibility() float64
|
2022-09-14 00:58:05 +01:00
|
|
|
SetAudibility(val float64)
|
2022-12-08 10:23:35 +00:00
|
|
|
PanX() float64
|
|
|
|
SetPanX(val float64)
|
|
|
|
PanY() float64
|
|
|
|
SetPanY(val float64)
|
|
|
|
ColorX() float64
|
|
|
|
SetColorX(val float64)
|
|
|
|
ColorY() float64
|
|
|
|
SetColorY(val float64)
|
|
|
|
FxX() float64
|
|
|
|
SetFxX(val float64)
|
|
|
|
FxY() float64
|
|
|
|
SetFxY(val float64)
|
2022-09-14 00:58:05 +01:00
|
|
|
FadeTo(target float64, time_ int)
|
|
|
|
FadeBy(change float64, time_ int)
|
|
|
|
AppGain(name string, gain float64)
|
2022-07-10 23:08:14 +01:00
|
|
|
AppMute(name string, val bool)
|
2022-12-08 10:23:35 +00:00
|
|
|
Eq() *eQ
|
|
|
|
Comp() *comp
|
|
|
|
Gate() *gate
|
2022-12-08 19:44:06 +00:00
|
|
|
Denoiser() *denoiser
|
2022-12-08 10:23:35 +00:00
|
|
|
GainLayer() []gainLayer
|
|
|
|
Levels() *levels
|
2022-07-10 23:08:14 +01:00
|
|
|
iOutputs
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
|
|
|
|
2022-06-23 10:42:11 +01:00
|
|
|
// strip represents a strip channel
|
|
|
|
type strip struct {
|
2022-06-23 14:03:00 +01:00
|
|
|
iRemote
|
2022-06-25 04:01:19 +01:00
|
|
|
outputs
|
2022-12-08 10:23:35 +00:00
|
|
|
eQ *eQ
|
|
|
|
comp *comp
|
|
|
|
gate *gate
|
2022-12-08 19:44:06 +00:00
|
|
|
denoiser *denoiser
|
2022-06-28 19:30:37 +01:00
|
|
|
gainLayer []gainLayer
|
2022-12-08 10:23:35 +00:00
|
|
|
levels *levels
|
2022-06-22 20:51:25 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Mute returns the value of the Mute parameter
|
|
|
|
func (s *strip) Mute() bool {
|
2022-06-22 20:51:25 +01:00
|
|
|
return s.getter_bool("Mute")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetMute sets the value of the Mute parameter
|
|
|
|
func (s *strip) SetMute(val bool) {
|
|
|
|
s.setter_bool("Mute", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Mono returns the value of the Mono parameter
|
|
|
|
func (s *strip) Mono() bool {
|
2022-06-23 10:42:11 +01:00
|
|
|
return s.getter_bool("Mono")
|
|
|
|
}
|
|
|
|
|
2022-06-24 14:54:17 +01:00
|
|
|
// SetMono sets the value of the Mono parameter
|
2022-06-23 10:42:11 +01:00
|
|
|
func (s *strip) SetMono(val bool) {
|
|
|
|
s.setter_bool("Mono", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Solo returns the value of the Solo parameter
|
|
|
|
func (s *strip) Solo() bool {
|
2022-06-23 10:42:11 +01:00
|
|
|
return s.getter_bool("Solo")
|
|
|
|
}
|
|
|
|
|
2022-06-24 14:54:17 +01:00
|
|
|
// SetSolo sets the value of the Solo parameter
|
2022-06-23 10:42:11 +01:00
|
|
|
func (s *strip) SetSolo(val bool) {
|
|
|
|
s.setter_bool("Solo", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Limit returns the value of the Limit parameter
|
|
|
|
func (s *strip) Limit() int {
|
2022-06-22 20:51:25 +01:00
|
|
|
return s.getter_int("Limit")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetLimit sets the value of the Limit parameter
|
|
|
|
func (s *strip) SetLimit(val int) {
|
|
|
|
s.setter_int("Limit", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Label returns the value of the Label parameter
|
|
|
|
func (s *strip) Label() string {
|
2022-06-22 20:51:25 +01:00
|
|
|
return s.getter_string("Label")
|
|
|
|
}
|
|
|
|
|
2022-06-24 14:54:17 +01:00
|
|
|
// SetLabel sets the value of the Label parameter
|
2022-06-22 20:51:25 +01:00
|
|
|
func (s *strip) SetLabel(val string) {
|
|
|
|
s.setter_string("Label", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Gain returns the value of the Gain parameter
|
|
|
|
func (s *strip) Gain() float64 {
|
2022-06-22 20:51:25 +01:00
|
|
|
return s.getter_float("Gain")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetGain sets the value of the Gain parameter
|
2022-09-14 00:58:05 +01:00
|
|
|
func (s *strip) SetGain(val float64) {
|
2022-06-22 20:51:25 +01:00
|
|
|
s.setter_float("Gain", val)
|
|
|
|
}
|
2022-06-23 10:42:11 +01:00
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// PanX returns the value of the Pan_X parameter
|
|
|
|
func (s *strip) PanX() float64 {
|
|
|
|
return s.getter_float("Pan_x")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPanX sets the value of the Pan_X parameter
|
|
|
|
func (s *strip) SetPanX(val float64) {
|
|
|
|
s.setter_float("Pan_x", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
// PanY returns the value of the Pan_Y parameter
|
|
|
|
func (s *strip) PanY() float64 {
|
|
|
|
return s.getter_float("Pan_y")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPanY sets the value of the Pan_Y parameter
|
|
|
|
func (s *strip) SetPanY(val float64) {
|
|
|
|
s.setter_float("Pan_y", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Eq returns the eQ field
|
|
|
|
func (s *strip) Eq() *eQ {
|
|
|
|
return s.eQ
|
|
|
|
}
|
|
|
|
|
2022-06-30 20:08:46 +01:00
|
|
|
// GainLayer returns the gainlayer field
|
2022-06-28 19:30:37 +01:00
|
|
|
func (s *strip) GainLayer() []gainLayer {
|
|
|
|
return s.gainLayer
|
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// Levels returns the levels field
|
2022-06-30 20:08:46 +01:00
|
|
|
func (s *strip) Levels() *levels {
|
2022-12-08 10:23:35 +00:00
|
|
|
return s.levels
|
2022-06-30 20:08:46 +01:00
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// FadeTo sets the value of gain to target over at time interval of time_
|
2022-09-14 00:58:05 +01:00
|
|
|
func (s *strip) FadeTo(target float64, time_ int) {
|
2022-07-10 23:08:14 +01:00
|
|
|
s.setter_string("FadeTo", fmt.Sprintf("(\"%f\", %d)", target, time_))
|
|
|
|
time.Sleep(time.Millisecond)
|
|
|
|
}
|
|
|
|
|
|
|
|
// FadeBy adjusts the value of gain by change over a time interval of time_
|
2022-09-14 00:58:05 +01:00
|
|
|
func (s *strip) FadeBy(change float64, time_ int) {
|
2022-07-10 23:08:14 +01:00
|
|
|
s.setter_string("FadeBy", fmt.Sprintf("(\"%f\", %d)", change, time_))
|
|
|
|
time.Sleep(time.Millisecond)
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// PhysicalStrip represents a single physical strip
|
|
|
|
type PhysicalStrip struct {
|
2022-06-23 10:42:11 +01:00
|
|
|
strip
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// newPhysicalStrip returns a PhysicalStrip type
|
2022-07-10 23:08:14 +01:00
|
|
|
func newPhysicalStrip(i int, k *kind) iStrip {
|
2022-07-01 01:35:54 +01:00
|
|
|
o := newOutputs(fmt.Sprintf("strip[%d]", i), i)
|
2022-12-08 10:23:35 +00:00
|
|
|
e := newEq(fmt.Sprintf("strip[%d].EQ", i), i)
|
|
|
|
c := newComp(i)
|
|
|
|
g := newGate(i)
|
2022-12-08 19:44:06 +00:00
|
|
|
d := newDenoiser(i)
|
2022-06-28 19:30:37 +01:00
|
|
|
gl := make([]gainLayer, 8)
|
|
|
|
for j := 0; j < 8; j++ {
|
|
|
|
gl[j] = newGainLayer(i, j)
|
|
|
|
}
|
2022-06-30 20:08:46 +01:00
|
|
|
l := newStripLevels(i, k)
|
2022-12-08 19:44:06 +00:00
|
|
|
ps := PhysicalStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, e, c, g, d, gl, l}}
|
2022-12-08 10:23:35 +00:00
|
|
|
return &ps
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// String implements fmt.stringer interface
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) String() string {
|
2022-06-25 01:18:20 +01:00
|
|
|
return fmt.Sprintf("PhysicalStrip%d", p.index)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Audibility returns the value of the Audibility parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) Audibility() float64 {
|
2022-06-30 22:20:18 +01:00
|
|
|
return p.getter_float("Audibility")
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-06-24 14:54:17 +01:00
|
|
|
// SetAudibility sets the value of the Audibility parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetAudibility(val float64) {
|
2022-06-30 22:20:18 +01:00
|
|
|
p.setter_float("Audibility", val)
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Mc logs a warning reason invalid parameter
|
2022-10-10 18:51:30 +01:00
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) Mc() bool {
|
2022-10-10 18:51:30 +01:00
|
|
|
log.Warn("invalid parameter MC for physicalStrip")
|
|
|
|
return false
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
// SetMc logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetMc(val bool) {
|
2022-10-10 18:51:30 +01:00
|
|
|
log.Warn("invalid parameter MC for physicalStrip")
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Comp returns the comp field
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) Comp() *comp {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.comp
|
|
|
|
}
|
|
|
|
|
|
|
|
// Gate returns the gate field
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) Gate() *gate {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.gate
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// Denoiser returns the denoiser field
|
|
|
|
func (p *PhysicalStrip) Denoiser() *denoiser {
|
|
|
|
return p.denoiser
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// ColorX returns the value of the Color_X parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) ColorX() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.getter_float("Color_x")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetColorX sets the value of the Color_X parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetColorX(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
p.setter_float("Color_x", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ColorY returns the value of the Color_Y parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) ColorY() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.getter_float("Color_y")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetColorY sets the value of the Color_Y parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetColorY(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
p.setter_float("Color_y", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
// FxX returns the value of the Color_X parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) FxX() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.getter_float("fx_x")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetFxX sets the value of the Color_X parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetFxX(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
p.setter_float("fx_x", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
// FxY returns the value of the Color_Y parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) FxY() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
return p.getter_float("fx_y")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetFxY sets the value of the Color_Y parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (p *PhysicalStrip) SetFxY(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
p.setter_float("fx_y", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// VirtualStrip represents a single virtual strip
|
|
|
|
type VirtualStrip struct {
|
2022-06-23 10:42:11 +01:00
|
|
|
strip
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// newVirtualStrip returns a VirtualStrip type
|
2022-07-10 23:08:14 +01:00
|
|
|
func newVirtualStrip(i int, k *kind) iStrip {
|
2022-07-01 01:35:54 +01:00
|
|
|
o := newOutputs(fmt.Sprintf("strip[%d]", i), i)
|
2022-12-08 10:23:35 +00:00
|
|
|
e := newEq(fmt.Sprintf("strip[%d].EQ", i), i)
|
|
|
|
c := newComp(i)
|
|
|
|
g := newGate(i)
|
2022-12-08 19:44:06 +00:00
|
|
|
d := newDenoiser(i)
|
2022-06-28 19:30:37 +01:00
|
|
|
gl := make([]gainLayer, 8)
|
|
|
|
for j := 0; j < 8; j++ {
|
|
|
|
gl[j] = newGainLayer(i, j)
|
|
|
|
}
|
2022-06-30 20:08:46 +01:00
|
|
|
l := newStripLevels(i, k)
|
2022-12-08 19:44:06 +00:00
|
|
|
vs := VirtualStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, e, c, g, d, gl, l}}
|
2022-12-08 10:23:35 +00:00
|
|
|
return &vs
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// String implements fmt.stringer interface
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) String() string {
|
2022-06-25 01:18:20 +01:00
|
|
|
return fmt.Sprintf("VirtualStrip%d", v.index)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Comp returns the comp field
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) Comp() *comp {
|
2022-12-08 10:23:35 +00:00
|
|
|
return v.comp
|
|
|
|
}
|
|
|
|
|
|
|
|
// Gate returns the gate field
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) Gate() *gate {
|
2022-12-08 10:23:35 +00:00
|
|
|
return v.gate
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
// Denoiser returns the denoiser field
|
|
|
|
func (v *VirtualStrip) Denoiser() *denoiser {
|
|
|
|
return v.denoiser
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// Mc returns the value of the MC parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) Mc() bool {
|
2022-06-23 10:42:11 +01:00
|
|
|
return v.getter_bool("MC")
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetMc sets the value of the MC parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetMc(val bool) {
|
2022-06-23 10:42:11 +01:00
|
|
|
v.setter_bool("MC", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// ColorX logs a warning reason invalid parameter
|
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) ColorX() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter ColorX for virtualStrip")
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetColorX logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetColorX(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter ColorX for virtualStrip")
|
|
|
|
}
|
|
|
|
|
|
|
|
// ColorY logs a warning reason invalid parameter
|
2022-10-10 18:51:30 +01:00
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) ColorY() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter ColorY for virtualStrip")
|
2022-10-10 18:51:30 +01:00
|
|
|
return 0
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// SetColorY logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetColorY(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter ColorY for virtualStrip")
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// FxX logs a warning reason invalid parameter
|
2022-10-10 18:51:30 +01:00
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) FxX() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter FxX for virtualStrip")
|
2022-10-10 18:51:30 +01:00
|
|
|
return 0
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// SetFxX logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetFxX(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter SetFxX for virtualStrip")
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
// FxY logs a warning reason invalid parameter
|
2022-10-10 18:51:30 +01:00
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) FxY() float64 {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter FxY for virtualStrip")
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetFxY logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetFxY(val float64) {
|
2022-12-08 10:23:35 +00:00
|
|
|
log.Warn("invalid parameter SetFxY for virtualStrip")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Audibility logs a warning reason invalid parameter
|
|
|
|
// it always returns zero value
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) Audibility() float64 {
|
2022-10-10 18:51:30 +01:00
|
|
|
log.Warn("invalid parameter Audibility for virtualStrip")
|
|
|
|
return 0
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
// SetAudibility logs a warning reason invalid parameter
|
2022-12-08 19:44:06 +00:00
|
|
|
func (v *VirtualStrip) SetAudibility(val float64) {
|
2022-10-10 18:51:30 +01:00
|
|
|
log.Warn("invalid parameter Audibility for virtualStrip")
|
2022-06-23 10:42:11 +01:00
|
|
|
}
|
2022-06-28 19:30:37 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// AppGain sets the gain in db by val for the app matching name.
|
2022-09-14 00:58:05 +01:00
|
|
|
func (v *strip) AppGain(name string, val float64) {
|
2022-07-10 23:08:14 +01:00
|
|
|
v.setter_string("AppGain", fmt.Sprintf("(\"%s\", %f)", name, val))
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppMute sets mute state as val for the app matching name.
|
|
|
|
func (v *strip) AppMute(name string, val bool) {
|
|
|
|
var value int
|
|
|
|
if val {
|
|
|
|
value = 1
|
|
|
|
} else {
|
|
|
|
value = 0
|
|
|
|
}
|
2022-09-14 00:58:05 +01:00
|
|
|
v.setter_string("AppMute", fmt.Sprintf("(\"%s\", %f)", name, float64(value)))
|
2022-07-10 23:08:14 +01:00
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
type denoiser struct {
|
|
|
|
iRemote
|
|
|
|
}
|
|
|
|
|
|
|
|
func newDenoiser(i int) *denoiser {
|
|
|
|
return &denoiser{iRemote{fmt.Sprintf("strip[%d].denoiser", i), i}}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *denoiser) Knob() float64 {
|
|
|
|
return d.getter_float("")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *denoiser) SetKnob(val float64) {
|
|
|
|
d.setter_float("", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 10:23:35 +00:00
|
|
|
type comp struct {
|
|
|
|
iRemote
|
|
|
|
}
|
|
|
|
|
|
|
|
func newComp(i int) *comp {
|
|
|
|
return &comp{iRemote{fmt.Sprintf("strip[%d].comp", i), i}}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Knob() float64 {
|
|
|
|
return c.getter_float("")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetKnob(val float64) {
|
|
|
|
c.setter_float("", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) GainIn() float64 {
|
|
|
|
return c.getter_float("GainIn")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetGainIn(val float64) {
|
|
|
|
c.setter_float("GainIn", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Ratio() float64 {
|
|
|
|
return c.getter_float("Ratio")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetRatio(val float64) {
|
|
|
|
c.setter_float("Ratio", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Threshold() float64 {
|
|
|
|
return c.getter_float("Threshold")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetThreshold(val float64) {
|
|
|
|
c.setter_float("Threshold", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Attack() float64 {
|
|
|
|
return c.getter_float("Attack")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetAttack(val float64) {
|
|
|
|
c.setter_float("Attack", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Release() float64 {
|
|
|
|
return c.getter_float("Release")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetRelease(val float64) {
|
|
|
|
c.setter_float("Release", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) Knee() float64 {
|
|
|
|
return c.getter_float("Knee")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetKnee(val float64) {
|
|
|
|
c.setter_float("Knee", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) GainOut() float64 {
|
|
|
|
return c.getter_float("GainOut")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetGainOut(val float64) {
|
|
|
|
c.setter_float("GainOut", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) MakeUp() bool {
|
|
|
|
return c.getter_bool("MakeUp")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *comp) SetMakeUp(val bool) {
|
|
|
|
c.setter_bool("MakeUp", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
type gate struct {
|
|
|
|
iRemote
|
|
|
|
}
|
|
|
|
|
|
|
|
func newGate(i int) *gate {
|
|
|
|
return &gate{iRemote{fmt.Sprintf("strip[%d].gate", i), i}}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Knob() float64 {
|
|
|
|
return g.getter_float("")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetKnob(val float64) {
|
|
|
|
g.setter_float("", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Threshold() float64 {
|
|
|
|
return g.getter_float("Threshold")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetThreshold(val float64) {
|
|
|
|
g.setter_float("Threshold", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Damping() float64 {
|
|
|
|
return g.getter_float("Damping")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetDamping(val float64) {
|
|
|
|
g.setter_float("Damping", val)
|
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
func (g *gate) BPSidechain() int {
|
|
|
|
return g.getter_int("BPSidechain")
|
2022-12-08 10:23:35 +00:00
|
|
|
}
|
|
|
|
|
2022-12-08 19:44:06 +00:00
|
|
|
func (g *gate) SetBPSidechain(val int) {
|
|
|
|
g.setter_int("BPSidechain", val)
|
2022-12-08 10:23:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Attack() float64 {
|
|
|
|
return g.getter_float("Attack")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetAttack(val float64) {
|
|
|
|
g.setter_float("Attack", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Hold() float64 {
|
|
|
|
return g.getter_float("Hold")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetHold(val float64) {
|
|
|
|
g.setter_float("Hold", val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) Release() float64 {
|
|
|
|
return g.getter_float("Release")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *gate) SetRelease(val float64) {
|
|
|
|
g.setter_float("Release", val)
|
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// gainLayer represents the 8 gainlayers for a single strip
|
2022-06-28 19:30:37 +01:00
|
|
|
type gainLayer struct {
|
|
|
|
iRemote
|
|
|
|
index int
|
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// newGainLayer returns a gainlayer struct
|
2022-06-28 19:30:37 +01:00
|
|
|
func newGainLayer(i, j int) gainLayer {
|
|
|
|
return gainLayer{iRemote{fmt.Sprintf("strip[%d]", i), i}, j}
|
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// Get gets the gain value for a single gainlayer
|
2022-06-28 19:30:37 +01:00
|
|
|
func (gl *gainLayer) Get() float64 {
|
|
|
|
return gl.getter_float(fmt.Sprintf("gainlayer[%d]", gl.index))
|
|
|
|
}
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// Set sets the gain value for a single gainlayer
|
2022-09-14 00:58:05 +01:00
|
|
|
func (gl *gainLayer) Set(val float64) {
|
2022-06-28 19:30:37 +01:00
|
|
|
gl.setter_float(fmt.Sprintf("gainlayer[%d]", gl.index), val)
|
|
|
|
}
|
2022-06-30 20:08:46 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
// newStripLevels returns a levels struct
|
2022-12-08 10:23:35 +00:00
|
|
|
func newStripLevels(i int, k *kind) *levels {
|
2022-06-30 20:08:46 +01:00
|
|
|
var init int
|
|
|
|
var os int
|
2022-07-18 16:23:15 +01:00
|
|
|
if i < k.PhysIn {
|
2022-06-30 20:08:46 +01:00
|
|
|
init = i * 2
|
|
|
|
os = 2
|
|
|
|
} else {
|
2022-07-18 16:23:15 +01:00
|
|
|
init = (k.PhysIn * 2) + ((i - k.PhysIn) * 8)
|
2022-06-30 20:08:46 +01:00
|
|
|
os = 8
|
|
|
|
}
|
2022-12-08 10:23:35 +00:00
|
|
|
return &levels{iRemote{fmt.Sprintf("strip[%d]", i), i}, k, init, os, "strip"}
|
2022-06-30 20:08:46 +01:00
|
|
|
}
|
|
|
|
|
2022-07-12 17:33:50 +01:00
|
|
|
// PreFader returns the level values for this strip, PREFADER mode
|
2022-09-14 00:58:05 +01:00
|
|
|
func (l *levels) PreFader() []float64 {
|
2022-07-09 19:01:58 +01:00
|
|
|
_levelCache.stripMode = 0
|
2022-12-09 00:54:40 +00:00
|
|
|
levels := make([]float64, l.offset)
|
|
|
|
for i := range levels {
|
|
|
|
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
|
2022-06-30 20:08:46 +01:00
|
|
|
}
|
|
|
|
return levels
|
|
|
|
}
|
|
|
|
|
2022-07-12 17:33:50 +01:00
|
|
|
// PostFader returns the level values for this strip, POSTFADER mode
|
2022-09-14 00:58:05 +01:00
|
|
|
func (l *levels) PostFader() []float64 {
|
2022-07-09 19:01:58 +01:00
|
|
|
_levelCache.stripMode = 1
|
2022-12-09 00:54:40 +00:00
|
|
|
levels := make([]float64, l.offset)
|
|
|
|
for i := range levels {
|
|
|
|
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
|
2022-06-30 20:08:46 +01:00
|
|
|
}
|
|
|
|
return levels
|
|
|
|
}
|
|
|
|
|
2022-07-12 17:33:50 +01:00
|
|
|
// PostMute returns the level values for this strip, POSTMUTE mode
|
2022-09-14 00:58:05 +01:00
|
|
|
func (l *levels) PostMute() []float64 {
|
2022-07-09 19:01:58 +01:00
|
|
|
_levelCache.stripMode = 2
|
2022-12-09 00:54:40 +00:00
|
|
|
levels := make([]float64, l.offset)
|
|
|
|
for i := range levels {
|
|
|
|
levels[i] = convertLevel(_levelCache.stripLevels[i+l.init])
|
2022-06-30 20:08:46 +01:00
|
|
|
}
|
|
|
|
return levels
|
|
|
|
}
|