mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-18 21:43:30 +00:00
gainlayers implemented
tests adjusted for potato. gainlayer unit test added factory method for bus mode added.
This commit is contained in:
@@ -112,7 +112,7 @@ func mdirty() bool {
|
||||
}
|
||||
|
||||
func sync() {
|
||||
time.Sleep(20 * time.Millisecond)
|
||||
time.Sleep(30 * time.Millisecond)
|
||||
for pdirty() || mdirty() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ type physicalBus struct {
|
||||
func newPhysicalBus(i int) t_bus {
|
||||
pb := physicalBus{bus{
|
||||
iRemote{fmt.Sprintf("bus[%d]", i), i},
|
||||
busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}},
|
||||
newBusMode(i),
|
||||
}}
|
||||
return t_bus(&pb)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ type virtualBus struct {
|
||||
func newVirtualBus(i int) t_bus {
|
||||
vb := virtualBus{bus{
|
||||
iRemote{fmt.Sprintf("bus[%d]", i), i},
|
||||
busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}},
|
||||
newBusMode(i),
|
||||
}}
|
||||
return t_bus(&vb)
|
||||
}
|
||||
@@ -145,6 +145,10 @@ type busMode struct {
|
||||
iRemote
|
||||
}
|
||||
|
||||
func newBusMode(i int) busMode {
|
||||
return busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}}
|
||||
}
|
||||
|
||||
func (bm *busMode) SetNormal(val bool) {
|
||||
bm.setter_bool("Normal", val)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ type t_strip interface {
|
||||
SetGate(val bool)
|
||||
GetAudibility() bool
|
||||
SetAudibility(val bool)
|
||||
GainLayer() []gainLayer
|
||||
t_outputs
|
||||
}
|
||||
|
||||
@@ -33,6 +34,7 @@ type t_strip interface {
|
||||
type strip struct {
|
||||
iRemote
|
||||
outputs
|
||||
gainLayer []gainLayer
|
||||
}
|
||||
|
||||
// GetMute returns the value of the Mute parameter
|
||||
@@ -95,13 +97,22 @@ func (s *strip) SetGain(val float32) {
|
||||
s.setter_float("Gain", val)
|
||||
}
|
||||
|
||||
// Mode returns address of a busMode struct
|
||||
func (s *strip) GainLayer() []gainLayer {
|
||||
return s.gainLayer
|
||||
}
|
||||
|
||||
type physicalStrip struct {
|
||||
strip
|
||||
}
|
||||
|
||||
func newPhysicalStrip(i int) t_strip {
|
||||
o := newOutputs("strip", i)
|
||||
ps := physicalStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o}}
|
||||
gl := make([]gainLayer, 8)
|
||||
for j := 0; j < 8; j++ {
|
||||
gl[j] = newGainLayer(i, j)
|
||||
}
|
||||
ps := physicalStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, gl}}
|
||||
return t_strip(&ps)
|
||||
}
|
||||
|
||||
@@ -156,7 +167,11 @@ type virtualStrip struct {
|
||||
|
||||
func newVirtualStrip(i int) t_strip {
|
||||
o := newOutputs("strip", i)
|
||||
vs := virtualStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o}}
|
||||
gl := make([]gainLayer, 8)
|
||||
for j := 0; j < 8; j++ {
|
||||
gl[j] = newGainLayer(i, j)
|
||||
}
|
||||
vs := virtualStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, gl}}
|
||||
return t_strip(&vs)
|
||||
}
|
||||
|
||||
@@ -204,3 +219,20 @@ func (v *virtualStrip) GetAudibility() bool {
|
||||
func (v *virtualStrip) SetAudibility(val bool) {
|
||||
panic("invalid parameter Audibility for virtualStrip")
|
||||
}
|
||||
|
||||
type gainLayer struct {
|
||||
iRemote
|
||||
index int
|
||||
}
|
||||
|
||||
func newGainLayer(i, j int) gainLayer {
|
||||
return gainLayer{iRemote{fmt.Sprintf("strip[%d]", i), i}, j}
|
||||
}
|
||||
|
||||
func (gl *gainLayer) Get() float64 {
|
||||
return gl.getter_float(fmt.Sprintf("gainlayer[%d]", gl.index))
|
||||
}
|
||||
|
||||
func (gl *gainLayer) Set(val float32) {
|
||||
gl.setter_float(fmt.Sprintf("gainlayer[%d]", gl.index), val)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user