Get prefix removed from getters

True for Bus, Strip, Vban and Output types.

Bus[i].Eq() and Strip[i].Eq() now return pointers to eQ structs.
This makes it easier to extend Eq types in future if desired.

Strip[i].Comp()  now return pointer to comp struct
Strip[i].Gain() now return pointer to gain struct
This is to support the new API features in Potato 3.0.2.8

Removed casting in factory function return statements.
Since types are satisfied implicitly.

eQ struct type tests added
This commit is contained in:
onyx-and-iris 2022-12-08 10:23:35 +00:00
parent 38973810d7
commit b116f04f51
6 changed files with 493 additions and 219 deletions

141
bus.go
View File

@ -8,17 +8,16 @@ import (
// iBus defines the interface bus types must satisfy // iBus defines the interface bus types must satisfy
type iBus interface { type iBus interface {
String() string String() string
GetMute() bool Mute() bool
SetMute(val bool) SetMute(val bool)
GetEq() bool Mono() bool
SetEq(val bool)
GetMono() bool
SetMono(val bool) SetMono(val bool)
GetLabel() string Label() string
SetLabel(val string) SetLabel(val string)
GetGain() float64 Gain() float64
SetGain(val float64) SetGain(val float64)
Mode() iBusMode Eq() *eQ
Mode() *busMode
Levels() *levels Levels() *levels
FadeTo(target float32, time_ int) FadeTo(target float32, time_ int)
FadeBy(change float32, time_ int) FadeBy(change float32, time_ int)
@ -27,12 +26,13 @@ type iBus interface {
// bus represents a bus channel // bus represents a bus channel
type bus struct { type bus struct {
iRemote iRemote
mode busMode eQ *eQ
mode *busMode
levels levels
} }
// GetMute returns the value of the Mute parameter // Mute returns the value of the Mute parameter
func (b *bus) GetMute() bool { func (b *bus) Mute() bool {
return b.getter_bool("Mute") return b.getter_bool("Mute")
} }
@ -41,18 +41,8 @@ func (b *bus) SetMute(val bool) {
b.setter_bool("Mute", val) b.setter_bool("Mute", val)
} }
// GetEq returns the value of the Eq.On parameter // Mono returns the value of the Mute parameter
func (b *bus) GetEq() bool { func (b *bus) Mono() bool {
return b.getter_bool("Eq.On")
}
// SetEq sets the value of the Eq.On parameter
func (b *bus) SetEq(val bool) {
b.setter_bool("Eq.On", val)
}
// GetMono returns the value of the Mute parameter
func (b *bus) GetMono() bool {
return b.getter_bool("Mono") return b.getter_bool("Mono")
} }
@ -61,8 +51,8 @@ func (b *bus) SetMono(val bool) {
b.setter_bool("Mono", val) b.setter_bool("Mono", val)
} }
// GetLabel returns the value of the MC parameter // Label returns the value of the MC parameter
func (b *bus) GetLabel() string { func (b *bus) Label() string {
return b.getter_string("Label") return b.getter_string("Label")
} }
@ -71,8 +61,8 @@ func (b *bus) SetLabel(val string) {
b.setter_string("Label", val) b.setter_string("Label", val)
} }
// GetGain returns the value of the Gain parameter // Gain returns the value of the Gain parameter
func (b *bus) GetGain() float64 { func (b *bus) Gain() float64 {
return b.getter_float("Gain") return b.getter_float("Gain")
} }
@ -81,9 +71,14 @@ func (b *bus) SetGain(val float64) {
b.setter_float("Gain", val) b.setter_float("Gain", val)
} }
// Eq returns the eQ field
func (b *bus) Eq() *eQ {
return b.eQ
}
// Mode returns address of a busMode struct // Mode returns address of a busMode struct
func (b *bus) Mode() iBusMode { func (b *bus) Mode() *busMode {
return &b.mode return b.mode
} }
// Levels returns the levels field // Levels returns the levels field
@ -110,11 +105,12 @@ type physicalBus struct {
// newPhysicalBus returns a physicalBus type cast to an iBus // newPhysicalBus returns a physicalBus type cast to an iBus
func newPhysicalBus(i int, k *kind) iBus { func newPhysicalBus(i int, k *kind) iBus {
e := newEq(fmt.Sprintf("bus[%d].EQ", i), i)
b := newBusMode(i) b := newBusMode(i)
l := newBusLevels(i, k) l := newBusLevels(i, k)
pb := physicalBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}, b, l}} pb := physicalBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}, e, b, l}}
return iBus(&pb) return &pb
} }
// String implements the fmt.stringer interface // String implements the fmt.stringer interface
@ -129,10 +125,11 @@ type virtualBus struct {
// newVirtualBus returns a virtualBus type cast to an iBus // newVirtualBus returns a virtualBus type cast to an iBus
func newVirtualBus(i int, k *kind) iBus { func newVirtualBus(i int, k *kind) iBus {
e := newEq(fmt.Sprintf("bus[%d].EQ", i), i)
b := newBusMode(i) b := newBusMode(i)
l := newBusLevels(i, k) l := newBusLevels(i, k)
vb := virtualBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}, b, l}} vb := virtualBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}, e, b, l}}
return iBus(&vb) return &vb
} }
// String implements the fmt.stringer interface // String implements the fmt.stringer interface
@ -140,46 +137,18 @@ func (v *virtualBus) String() string {
return fmt.Sprintf("VirtualBus%d", v.index) return fmt.Sprintf("VirtualBus%d", v.index)
} }
// iBusMode defines the interface busMode type must satisfy
type iBusMode interface {
SetNormal(val bool)
GetNormal() bool
SetAmix(val bool)
GetAmix() bool
SetBmix(val bool)
GetBmix() bool
SetRepeat(val bool)
GetRepeat() bool
SetComposite(val bool)
GetComposite() bool
SetTvMix(val bool)
GetTvMix() bool
SetUpMix21(val bool)
GetUpMix21() bool
SetUpMix41(val bool)
GetUpMix41() bool
SetUpMix61(val bool)
GetUpMix61() bool
SetCenterOnly(val bool)
GetCenterOnly() bool
SetLfeOnly(val bool)
GetLfeOnly() bool
SetRearOnly(val bool)
GetRearOnly() bool
}
// busMode offers methods for getting/setting bus mode states // busMode offers methods for getting/setting bus mode states
type busMode struct { type busMode struct {
iRemote iRemote
} }
// newBusMode returns a busMode struct // newBusMode returns a busMode struct
func newBusMode(i int) busMode { func newBusMode(i int) *busMode {
return busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}} return &busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}}
} }
// GetNormal gets the value of the Mode.Normal parameter // Normal gets the value of the Mode.Normal parameter
func (bm *busMode) GetNormal() bool { func (bm *busMode) Normal() bool {
return bm.getter_bool("Normal") return bm.getter_bool("Normal")
} }
@ -188,8 +157,8 @@ func (bm *busMode) SetNormal(val bool) {
bm.setter_bool("Normal", val) bm.setter_bool("Normal", val)
} }
// GetAmix gets the value of the Mode.Amix parameter // Amix gets the value of the Mode.Amix parameter
func (bm *busMode) GetAmix() bool { func (bm *busMode) Amix() bool {
return bm.getter_bool("Amix") return bm.getter_bool("Amix")
} }
@ -198,8 +167,8 @@ func (bm *busMode) SetAmix(val bool) {
bm.setter_bool("Amix", val) bm.setter_bool("Amix", val)
} }
// GetBmix gets the value of the Mode.Bmix parameter // Bmix gets the value of the Mode.Bmix parameter
func (bm *busMode) GetBmix() bool { func (bm *busMode) Bmix() bool {
return bm.getter_bool("Bmix") return bm.getter_bool("Bmix")
} }
@ -208,8 +177,8 @@ func (bm *busMode) SetBmix(val bool) {
bm.setter_bool("Bmix", val) bm.setter_bool("Bmix", val)
} }
// GetRepeat gets the value of the Mode.Repeat parameter // Repeat gets the value of the Mode.Repeat parameter
func (bm *busMode) GetRepeat() bool { func (bm *busMode) Repeat() bool {
return bm.getter_bool("Repeat") return bm.getter_bool("Repeat")
} }
@ -218,8 +187,8 @@ func (bm *busMode) SetRepeat(val bool) {
bm.setter_bool("Repeat", val) bm.setter_bool("Repeat", val)
} }
// GetComposite gets the value of the Mode.Composite parameter // Composite gets the value of the Mode.Composite parameter
func (bm *busMode) GetComposite() bool { func (bm *busMode) Composite() bool {
return bm.getter_bool("Composite") return bm.getter_bool("Composite")
} }
@ -228,8 +197,8 @@ func (bm *busMode) SetComposite(val bool) {
bm.setter_bool("Composite", val) bm.setter_bool("Composite", val)
} }
// GetTvMix gets the value of the Mode.TvMix parameter // TvMix gets the value of the Mode.TvMix parameter
func (bm *busMode) GetTvMix() bool { func (bm *busMode) TvMix() bool {
return bm.getter_bool("TvMix") return bm.getter_bool("TvMix")
} }
@ -238,8 +207,8 @@ func (bm *busMode) SetTvMix(val bool) {
bm.setter_bool("TvMix", val) bm.setter_bool("TvMix", val)
} }
// GetUpMix21 gets the value of the Mode.UpMix21 parameter // UpMix21 gets the value of the Mode.UpMix21 parameter
func (bm *busMode) GetUpMix21() bool { func (bm *busMode) UpMix21() bool {
return bm.getter_bool("UpMix21") return bm.getter_bool("UpMix21")
} }
@ -248,8 +217,8 @@ func (bm *busMode) SetUpMix21(val bool) {
bm.setter_bool("UpMix21", val) bm.setter_bool("UpMix21", val)
} }
// GetUpMix41 gets the value of the Mode.UpMix41 parameter // UpMix41 gets the value of the Mode.UpMix41 parameter
func (bm *busMode) GetUpMix41() bool { func (bm *busMode) UpMix41() bool {
return bm.getter_bool("UpMix41") return bm.getter_bool("UpMix41")
} }
@ -258,8 +227,8 @@ func (bm *busMode) SetUpMix41(val bool) {
bm.setter_bool("UpMix41", val) bm.setter_bool("UpMix41", val)
} }
// GetUpMix61 gets the value of the Mode.UpMix61 parameter // UpMix61 gets the value of the Mode.UpMix61 parameter
func (bm *busMode) GetUpMix61() bool { func (bm *busMode) UpMix61() bool {
return bm.getter_bool("UpMix61") return bm.getter_bool("UpMix61")
} }
@ -268,8 +237,8 @@ func (bm *busMode) SetUpMix61(val bool) {
bm.setter_bool("UpMix61", val) bm.setter_bool("UpMix61", val)
} }
// GetCenterOnly gets the value of the Mode.CenterOnly parameter // CenterOnly gets the value of the Mode.CenterOnly parameter
func (bm *busMode) GetCenterOnly() bool { func (bm *busMode) CenterOnly() bool {
return bm.getter_bool("CenterOnly") return bm.getter_bool("CenterOnly")
} }
@ -278,8 +247,8 @@ func (bm *busMode) SetCenterOnly(val bool) {
bm.setter_bool("CenterOnly", val) bm.setter_bool("CenterOnly", val)
} }
// GetLfeOnly gets the value of the Mode.LFE parameter // LfeOnly gets the value of the Mode.LFE parameter
func (bm *busMode) GetLfeOnly() bool { func (bm *busMode) LfeOnly() bool {
return bm.getter_bool("LfeOnly") return bm.getter_bool("LfeOnly")
} }
@ -288,8 +257,8 @@ func (bm *busMode) SetLfeOnly(val bool) {
bm.setter_bool("LfeOnly", val) bm.setter_bool("LfeOnly", val)
} }
// GetRearOnly gets the value of the Mode.RearOnly parameter // RearOnly gets the value of the Mode.RearOnly parameter
func (bm *busMode) GetRearOnly() bool { func (bm *busMode) RearOnly() bool {
return bm.getter_bool("RearOnly") return bm.getter_bool("RearOnly")
} }

25
eq.go Normal file
View File

@ -0,0 +1,25 @@
package voicemeeter
type eQ struct {
iRemote
}
func newEq(id string, i int) *eQ {
return &eQ{iRemote{id, i}}
}
func (e *eQ) On() bool {
return e.getter_bool("on")
}
func (e *eQ) SetOn(val bool) {
e.setter_bool("on", val)
}
func (e *eQ) Ab() bool {
return e.getter_bool("AB")
}
func (e *eQ) SetAb(val bool) {
e.setter_bool("AB", val)
}

15
eq_test.go Normal file
View File

@ -0,0 +1,15 @@
package voicemeeter
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetEq(t *testing.T) {
//t.Skip("skipping test")
__e := newEq("strip[0].EQ", 0)
t.Run("Should return an eQ type", func(t *testing.T) {
assert.NotNil(t, __e)
})
}

View File

@ -2,21 +2,21 @@ package voicemeeter
// iOutputs defines the interface outputs type must satisfy // iOutputs defines the interface outputs type must satisfy
type iOutputs interface { type iOutputs interface {
GetA1() bool A1() bool
SetA1(val bool) SetA1(val bool)
GetA2() bool A2() bool
SetA2(val bool) SetA2(val bool)
GetA3() bool A3() bool
SetA3(val bool) SetA3(val bool)
GetA4() bool A4() bool
SetA4(val bool) SetA4(val bool)
GetA5() bool A5() bool
SetA5(val bool) SetA5(val bool)
GetB1() bool B1() bool
SetB1(val bool) SetB1(val bool)
GetB2() bool B2() bool
SetB2(val bool) SetB2(val bool)
GetB3() bool B3() bool
SetB3(val bool) SetB3(val bool)
} }
@ -32,8 +32,8 @@ func newOutputs(id string, i int) outputs {
return o return o
} }
// GetA1 returns the value of the A1 parameter // A1 returns the value of the A1 parameter
func (o *outputs) GetA1() bool { func (o *outputs) A1() bool {
return o.getter_bool("A1") return o.getter_bool("A1")
} }
@ -42,8 +42,8 @@ func (o *outputs) SetA1(val bool) {
o.setter_bool("A1", val) o.setter_bool("A1", val)
} }
// GetA2 returns the value of the A2 parameter // A2 returns the value of the A2 parameter
func (o *outputs) GetA2() bool { func (o *outputs) A2() bool {
return o.getter_bool("A2") return o.getter_bool("A2")
} }
@ -52,8 +52,8 @@ func (o *outputs) SetA2(val bool) {
o.setter_bool("A2", val) o.setter_bool("A2", val)
} }
// GetA3 returns the value of the A3 parameter // A3 returns the value of the A3 parameter
func (o *outputs) GetA3() bool { func (o *outputs) A3() bool {
return o.getter_bool("A3") return o.getter_bool("A3")
} }
@ -62,8 +62,8 @@ func (o *outputs) SetA3(val bool) {
o.setter_bool("A3", val) o.setter_bool("A3", val)
} }
// GetA4 returns the value of the A4 parameter // A4 returns the value of the A4 parameter
func (o *outputs) GetA4() bool { func (o *outputs) A4() bool {
return o.getter_bool("A4") return o.getter_bool("A4")
} }
@ -72,8 +72,8 @@ func (o *outputs) SetA4(val bool) {
o.setter_bool("A4", val) o.setter_bool("A4", val)
} }
// GetA5 returns the value of the A5 parameter // A5 returns the value of the A5 parameter
func (o *outputs) GetA5() bool { func (o *outputs) A5() bool {
return o.getter_bool("A5") return o.getter_bool("A5")
} }
@ -82,8 +82,8 @@ func (o *outputs) SetA5(val bool) {
o.setter_bool("A5", val) o.setter_bool("A5", val)
} }
// GetB1 returns the value of the B1 parameter // B1 returns the value of the B1 parameter
func (o *outputs) GetB1() bool { func (o *outputs) B1() bool {
return o.getter_bool("B1") return o.getter_bool("B1")
} }
@ -92,8 +92,8 @@ func (o *outputs) SetB1(val bool) {
o.setter_bool("B1", val) o.setter_bool("B1", val)
} }
// GetB2 returns the value of the B2 parameter // B2 returns the value of the B2 parameter
func (o *outputs) GetB2() bool { func (o *outputs) B2() bool {
return o.getter_bool("B2") return o.getter_bool("B2")
} }
@ -102,8 +102,8 @@ func (o *outputs) SetB2(val bool) {
o.setter_bool("B2", val) o.setter_bool("B2", val)
} }
// GetB3 returns the value of the B3 parameter // B3 returns the value of the B3 parameter
func (o *outputs) GetB3() bool { func (o *outputs) B3() bool {
return o.getter_bool("B3") return o.getter_bool("B3")
} }

413
strip.go
View File

@ -10,32 +10,45 @@ import (
// iStrip defines the interface strip types must satisfy // iStrip defines the interface strip types must satisfy
type iStrip interface { type iStrip interface {
String() string String() string
GetMute() bool Mute() bool
SetMute(val bool) SetMute(val bool)
GetMono() bool Mono() bool
SetMono(val bool) SetMono(val bool)
GetSolo() bool Solo() bool
SetSolo(val bool) SetSolo(val bool)
GetLimit() int Limit() int
SetLimit(val int) SetLimit(val int)
GetLabel() string Label() string
SetLabel(val string) SetLabel(val string)
GetGain() float64 Gain() float64
SetGain(val float64) SetGain(val float64)
GetMc() bool Mc() bool
SetMc(val bool) SetMc(val bool)
GetComp() float64 Audibility() float64
SetComp(val float64)
GetGate() float64
SetGate(val float64)
GetAudibility() float64
SetAudibility(val float64) SetAudibility(val float64)
GainLayer() []gainLayer Denoiser() float64
Levels() *levels SetDenoiser(val float64)
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)
FadeTo(target float64, time_ int) FadeTo(target float64, time_ int)
FadeBy(change float64, time_ int) FadeBy(change float64, time_ int)
AppGain(name string, gain float64) AppGain(name string, gain float64)
AppMute(name string, val bool) AppMute(name string, val bool)
Eq() *eQ
Comp() *comp
Gate() *gate
GainLayer() []gainLayer
Levels() *levels
iOutputs iOutputs
} }
@ -43,12 +56,15 @@ type iStrip interface {
type strip struct { type strip struct {
iRemote iRemote
outputs outputs
eQ *eQ
comp *comp
gate *gate
gainLayer []gainLayer gainLayer []gainLayer
levels levels *levels
} }
// GetMute returns the value of the Mute parameter // Mute returns the value of the Mute parameter
func (s *strip) GetMute() bool { func (s *strip) Mute() bool {
return s.getter_bool("Mute") return s.getter_bool("Mute")
} }
@ -57,8 +73,8 @@ func (s *strip) SetMute(val bool) {
s.setter_bool("Mute", val) s.setter_bool("Mute", val)
} }
// GetMono returns the value of the Mono parameter // Mono returns the value of the Mono parameter
func (s *strip) GetMono() bool { func (s *strip) Mono() bool {
return s.getter_bool("Mono") return s.getter_bool("Mono")
} }
@ -67,8 +83,8 @@ func (s *strip) SetMono(val bool) {
s.setter_bool("Mono", val) s.setter_bool("Mono", val)
} }
// GetSolo returns the value of the Solo parameter // Solo returns the value of the Solo parameter
func (s *strip) GetSolo() bool { func (s *strip) Solo() bool {
return s.getter_bool("Solo") return s.getter_bool("Solo")
} }
@ -77,8 +93,8 @@ func (s *strip) SetSolo(val bool) {
s.setter_bool("Solo", val) s.setter_bool("Solo", val)
} }
// GetLimit returns the value of the Limit parameter // Limit returns the value of the Limit parameter
func (s *strip) GetLimit() int { func (s *strip) Limit() int {
return s.getter_int("Limit") return s.getter_int("Limit")
} }
@ -87,8 +103,8 @@ func (s *strip) SetLimit(val int) {
s.setter_int("Limit", val) s.setter_int("Limit", val)
} }
// GetLabel returns the value of the Label parameter // Label returns the value of the Label parameter
func (s *strip) GetLabel() string { func (s *strip) Label() string {
return s.getter_string("Label") return s.getter_string("Label")
} }
@ -97,8 +113,8 @@ func (s *strip) SetLabel(val string) {
s.setter_string("Label", val) s.setter_string("Label", val)
} }
// GetGain returns the value of the Gain parameter // Gain returns the value of the Gain parameter
func (s *strip) GetGain() float64 { func (s *strip) Gain() float64 {
return s.getter_float("Gain") return s.getter_float("Gain")
} }
@ -107,6 +123,41 @@ func (s *strip) SetGain(val float64) {
s.setter_float("Gain", val) s.setter_float("Gain", val)
} }
// Denoiser returns the value of the Denoiser parameter
func (s *strip) Denoiser() float64 {
return s.getter_float("Denoiser")
}
// SetDenoiser sets the value of the Denoiser parameter
func (s *strip) SetDenoiser(val float64) {
s.setter_float("Denoiser", val)
}
// 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
}
// GainLayer returns the gainlayer field // GainLayer returns the gainlayer field
func (s *strip) GainLayer() []gainLayer { func (s *strip) GainLayer() []gainLayer {
return s.gainLayer return s.gainLayer
@ -114,7 +165,7 @@ func (s *strip) GainLayer() []gainLayer {
// Levels returns the levels field // Levels returns the levels field
func (s *strip) Levels() *levels { func (s *strip) Levels() *levels {
return &s.levels return s.levels
} }
// FadeTo sets the value of gain to target over at time interval of time_ // FadeTo sets the value of gain to target over at time interval of time_
@ -137,13 +188,16 @@ type physicalStrip struct {
// newPhysicalStrip returns a physicalStrip type cast to an iStrip // newPhysicalStrip returns a physicalStrip type cast to an iStrip
func newPhysicalStrip(i int, k *kind) iStrip { func newPhysicalStrip(i int, k *kind) iStrip {
o := newOutputs(fmt.Sprintf("strip[%d]", i), i) o := newOutputs(fmt.Sprintf("strip[%d]", i), i)
e := newEq(fmt.Sprintf("strip[%d].EQ", i), i)
c := newComp(i)
g := newGate(i)
gl := make([]gainLayer, 8) gl := make([]gainLayer, 8)
for j := 0; j < 8; j++ { for j := 0; j < 8; j++ {
gl[j] = newGainLayer(i, j) gl[j] = newGainLayer(i, j)
} }
l := newStripLevels(i, k) l := newStripLevels(i, k)
ps := physicalStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, gl, l}} ps := physicalStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, e, c, g, gl, l}}
return iStrip(&ps) return &ps
} }
// String implements fmt.stringer interface // String implements fmt.stringer interface
@ -151,28 +205,8 @@ func (p *physicalStrip) String() string {
return fmt.Sprintf("PhysicalStrip%d", p.index) return fmt.Sprintf("PhysicalStrip%d", p.index)
} }
// GetComp returns the value of the Comp parameter // Audibility returns the value of the Audibility parameter
func (p *physicalStrip) GetComp() float64 { func (p *physicalStrip) Audibility() float64 {
return p.getter_float("Comp")
}
// SetComp sets the value of the Comp parameter
func (p *physicalStrip) SetComp(val float64) {
p.setter_float("Comp", val)
}
// GetGate returns the value of the Gate parameter
func (p *physicalStrip) GetGate() float64 {
return p.getter_float("Gate")
}
// SetGate sets the value of the Gate parameter
func (p *physicalStrip) SetGate(val float64) {
p.setter_float("Gate", val)
}
// GetAudibility returns the value of the Audibility parameter
func (p *physicalStrip) GetAudibility() float64 {
return p.getter_float("Audibility") return p.getter_float("Audibility")
} }
@ -181,9 +215,9 @@ func (p *physicalStrip) SetAudibility(val float64) {
p.setter_float("Audibility", val) p.setter_float("Audibility", val)
} }
// GetMc logs a warning reason invalid parameter // Mc logs a warning reason invalid parameter
// it always returns zero value // it always returns zero value
func (p *physicalStrip) GetMc() bool { func (p *physicalStrip) Mc() bool {
log.Warn("invalid parameter MC for physicalStrip") log.Warn("invalid parameter MC for physicalStrip")
return false return false
} }
@ -193,6 +227,56 @@ func (p *physicalStrip) SetMc(val bool) {
log.Warn("invalid parameter MC for physicalStrip") log.Warn("invalid parameter MC for physicalStrip")
} }
// Comp returns the comp field
func (p *physicalStrip) Comp() *comp {
return p.comp
}
// Gate returns the gate field
func (p *physicalStrip) Gate() *gate {
return p.gate
}
// ColorX returns the value of the Color_X parameter
func (p *physicalStrip) ColorX() float64 {
return p.getter_float("Color_x")
}
// SetColorX sets the value of the Color_X parameter
func (p *physicalStrip) SetColorX(val float64) {
p.setter_float("Color_x", val)
}
// ColorY returns the value of the Color_Y parameter
func (p *physicalStrip) ColorY() float64 {
return p.getter_float("Color_y")
}
// SetColorY sets the value of the Color_Y parameter
func (p *physicalStrip) SetColorY(val float64) {
p.setter_float("Color_y", val)
}
// FxX returns the value of the Color_X parameter
func (p *physicalStrip) FxX() float64 {
return p.getter_float("fx_x")
}
// SetFxX sets the value of the Color_X parameter
func (p *physicalStrip) SetFxX(val float64) {
p.setter_float("fx_x", val)
}
// FxY returns the value of the Color_Y parameter
func (p *physicalStrip) FxY() float64 {
return p.getter_float("fx_y")
}
// SetFxY sets the value of the Color_Y parameter
func (p *physicalStrip) SetFxY(val float64) {
p.setter_float("fx_y", val)
}
// virtualStrip represents a single virtual strip // virtualStrip represents a single virtual strip
type virtualStrip struct { type virtualStrip struct {
strip strip
@ -201,13 +285,16 @@ type virtualStrip struct {
// newVirtualStrip returns a virtualStrip type cast to an iStrip // newVirtualStrip returns a virtualStrip type cast to an iStrip
func newVirtualStrip(i int, k *kind) iStrip { func newVirtualStrip(i int, k *kind) iStrip {
o := newOutputs(fmt.Sprintf("strip[%d]", i), i) o := newOutputs(fmt.Sprintf("strip[%d]", i), i)
e := newEq(fmt.Sprintf("strip[%d].EQ", i), i)
c := newComp(i)
g := newGate(i)
gl := make([]gainLayer, 8) gl := make([]gainLayer, 8)
for j := 0; j < 8; j++ { for j := 0; j < 8; j++ {
gl[j] = newGainLayer(i, j) gl[j] = newGainLayer(i, j)
} }
l := newStripLevels(i, k) l := newStripLevels(i, k)
vs := virtualStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, gl, l}} vs := virtualStrip{strip{iRemote{fmt.Sprintf("strip[%d]", i), i}, o, e, c, g, gl, l}}
return iStrip(&vs) return &vs
} }
// String implements fmt.stringer interface // String implements fmt.stringer interface
@ -215,8 +302,18 @@ func (v *virtualStrip) String() string {
return fmt.Sprintf("VirtualStrip%d", v.index) return fmt.Sprintf("VirtualStrip%d", v.index)
} }
// GetMc returns the value of the MC parameter // Comp returns the comp field
func (v *virtualStrip) GetMc() bool { func (v *virtualStrip) Comp() *comp {
return v.comp
}
// Gate returns the gate field
func (v *virtualStrip) Gate() *gate {
return v.gate
}
// Mc returns the value of the MC parameter
func (v *virtualStrip) Mc() bool {
return v.getter_bool("MC") return v.getter_bool("MC")
} }
@ -225,33 +322,57 @@ func (v *virtualStrip) SetMc(val bool) {
v.setter_bool("MC", val) v.setter_bool("MC", val)
} }
// GetComp logs a warning reason invalid parameter // ColorX logs a warning reason invalid parameter
// it always returns zero value // it always returns zero value
func (v *virtualStrip) GetComp() float64 { func (v *virtualStrip) ColorX() float64 {
log.Warn("invalid parameter Comp for virtualStrip") log.Warn("invalid parameter ColorX for virtualStrip")
return 0 return 0
} }
// SetComp logs a warning reason invalid parameter // SetColorX logs a warning reason invalid parameter
func (v *virtualStrip) SetComp(val float64) { func (v *virtualStrip) SetColorX(val float64) {
log.Warn("invalid parameter Comp for virtualStrip") log.Warn("invalid parameter ColorX for virtualStrip")
} }
// GetGate logs a warning reason invalid parameter // ColorY logs a warning reason invalid parameter
// it always returns zero value // it always returns zero value
func (v *virtualStrip) GetGate() float64 { func (v *virtualStrip) ColorY() float64 {
log.Warn("invalid parameter Gate for virtualStrip") log.Warn("invalid parameter ColorY for virtualStrip")
return 0 return 0
} }
// SetGate logs a warning reason invalid parameter // SetColorY logs a warning reason invalid parameter
func (v *virtualStrip) SetGate(val float64) { func (v *virtualStrip) SetColorY(val float64) {
log.Warn("invalid parameter Gate for virtualStrip") log.Warn("invalid parameter ColorY for virtualStrip")
} }
// GetAudibility logs a warning reason invalid parameter // FxX logs a warning reason invalid parameter
// it always returns zero value // it always returns zero value
func (v *virtualStrip) GetAudibility() float64 { func (v *virtualStrip) FxX() float64 {
log.Warn("invalid parameter FxX for virtualStrip")
return 0
}
// SetFxX logs a warning reason invalid parameter
func (v *virtualStrip) SetFxX(val float64) {
log.Warn("invalid parameter SetFxX for virtualStrip")
}
// FxY logs a warning reason invalid parameter
// it always returns zero value
func (v *virtualStrip) FxY() float64 {
log.Warn("invalid parameter FxY for virtualStrip")
return 0
}
// SetFxY logs a warning reason invalid parameter
func (v *virtualStrip) SetFxY(val float64) {
log.Warn("invalid parameter SetFxY for virtualStrip")
}
// Audibility logs a warning reason invalid parameter
// it always returns zero value
func (v *virtualStrip) Audibility() float64 {
log.Warn("invalid parameter Audibility for virtualStrip") log.Warn("invalid parameter Audibility for virtualStrip")
return 0 return 0
} }
@ -277,6 +398,150 @@ func (v *strip) AppMute(name string, val bool) {
v.setter_string("AppMute", fmt.Sprintf("(\"%s\", %f)", name, float64(value))) v.setter_string("AppMute", fmt.Sprintf("(\"%s\", %f)", name, float64(value)))
} }
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)
}
func (g *gate) BPSidechain() float64 {
return g.getter_float("BPSidechain")
}
func (g *gate) SetBPSidechain(val float64) {
g.setter_float("BPSidechain", val)
}
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)
}
// gainLayer represents the 8 gainlayers for a single strip // gainLayer represents the 8 gainlayers for a single strip
type gainLayer struct { type gainLayer struct {
iRemote iRemote
@ -299,7 +564,7 @@ func (gl *gainLayer) Set(val float64) {
} }
// newStripLevels returns a levels struct // newStripLevels returns a levels struct
func newStripLevels(i int, k *kind) levels { func newStripLevels(i int, k *kind) *levels {
var init int var init int
var os int var os int
if i < k.PhysIn { if i < k.PhysIn {
@ -309,7 +574,7 @@ func newStripLevels(i int, k *kind) levels {
init = (k.PhysIn * 2) + ((i - k.PhysIn) * 8) init = (k.PhysIn * 2) + ((i - k.PhysIn) * 8)
os = 8 os = 8
} }
return levels{iRemote{fmt.Sprintf("strip[%d]", i), i}, k, init, os, "strip"} return &levels{iRemote{fmt.Sprintf("strip[%d]", i), i}, k, init, os, "strip"}
} }
// PreFader returns the level values for this strip, PREFADER mode // PreFader returns the level values for this strip, PREFADER mode

70
vban.go
View File

@ -8,23 +8,23 @@ import (
// iVban defines the interface vban types must satisfy // iVban defines the interface vban types must satisfy
type iVban interface { type iVban interface {
GetOn() bool On() bool
SetOn(val bool) SetOn(val bool)
GetName() string Name() string
SetName(val string) SetName(val string)
GetIp() string Ip() string
SetIp(val string) SetIp(val string)
GetPort() int Port() int
SetPort(val int) SetPort(val int)
GetSr() int Sr() int
SetSr(val int) SetSr(val int)
GetChannel() int Channel() int
SetChannel(val int) SetChannel(val int)
GetBit() int Bit() int
SetBit(val int) SetBit(val int)
GetQuality() int Quality() int
SetQuality(val int) SetQuality(val int)
GetRoute() int Route() int
SetRoute(val int) SetRoute(val int)
} }
@ -32,8 +32,8 @@ type vbanStream struct {
iRemote iRemote
} }
// GetOn returns the value of the On parameter // On returns the value of the On parameter
func (v *vbanStream) GetOn() bool { func (v *vbanStream) On() bool {
return v.getter_bool("On") return v.getter_bool("On")
} }
@ -42,8 +42,8 @@ func (v *vbanStream) SetOn(val bool) {
v.setter_bool("On", val) v.setter_bool("On", val)
} }
// GetName returns the value of the Name parameter // Name returns the value of the Name parameter
func (v *vbanStream) GetName() string { func (v *vbanStream) Name() string {
return v.getter_string("Name") return v.getter_string("Name")
} }
@ -52,8 +52,8 @@ func (v *vbanStream) SetName(val string) {
v.setter_string("Name", val) v.setter_string("Name", val)
} }
// GetIp returns the value of the Ip parameter // Ip returns the value of the Ip parameter
func (v *vbanStream) GetIp() string { func (v *vbanStream) Ip() string {
return v.getter_string("Ip") return v.getter_string("Ip")
} }
@ -62,8 +62,8 @@ func (v *vbanStream) SetIp(val string) {
v.setter_string("Ip", val) v.setter_string("Ip", val)
} }
// GetPort returns the value of the Port parameter // Port returns the value of the Port parameter
func (v *vbanStream) GetPort() int { func (v *vbanStream) Port() int {
return v.getter_int("Port") return v.getter_int("Port")
} }
@ -72,8 +72,8 @@ func (v *vbanStream) SetPort(val int) {
v.setter_int("Port", val) v.setter_int("Port", val)
} }
// GetSr returns the value of the Sr parameter // Sr returns the value of the Sr parameter
func (v *vbanStream) GetSr() int { func (v *vbanStream) Sr() int {
return v.getter_int("Sr") return v.getter_int("Sr")
} }
@ -82,8 +82,8 @@ func (v *vbanStream) SetSr(val int) {
v.setter_int("Sr", val) v.setter_int("Sr", val)
} }
// GetChannel returns the value of the Channel parameter // Channel returns the value of the Channel parameter
func (v *vbanStream) GetChannel() int { func (v *vbanStream) Channel() int {
return v.getter_int("Channel") return v.getter_int("Channel")
} }
@ -92,8 +92,8 @@ func (v *vbanStream) SetChannel(val int) {
v.setter_int("Channel", val) v.setter_int("Channel", val)
} }
// GetBit returns the value of the Bit parameter // Bit returns the value of the Bit parameter
func (v *vbanStream) GetBit() int { func (v *vbanStream) Bit() int {
val := v.getter_int("Bit") val := v.getter_int("Bit")
if val == 1 { if val == 1 {
return 16 return 16
@ -115,8 +115,8 @@ func (v *vbanStream) SetBit(val int) {
v.setter_int("Bit", val) v.setter_int("Bit", val)
} }
// GetQuality returns the value of the Quality parameter // Quality returns the value of the Quality parameter
func (v *vbanStream) GetQuality() int { func (v *vbanStream) Quality() int {
return v.getter_int("Quality") return v.getter_int("Quality")
} }
@ -125,8 +125,8 @@ func (v *vbanStream) SetQuality(val int) {
v.setter_int("Quality", val) v.setter_int("Quality", val)
} }
// GetRoute returns the value of the Route parameter // Route returns the value of the Route parameter
func (v *vbanStream) GetRoute() int { func (v *vbanStream) Route() int {
return v.getter_int("Route") return v.getter_int("Route")
} }
@ -141,7 +141,7 @@ type vbanInStream struct {
func newVbanInStream(i int) iVban { func newVbanInStream(i int) iVban {
vbi := vbanInStream{vbanStream{iRemote{fmt.Sprintf("vban.instream[%d]", i), i}}} vbi := vbanInStream{vbanStream{iRemote{fmt.Sprintf("vban.instream[%d]", i), i}}}
return iVban(&vbi) return &vbi
} }
// SetSr logs a warning reason read only // SetSr logs a warning reason read only
@ -165,7 +165,7 @@ type vbanOutStream struct {
func newVbanOutStream(i int) iVban { func newVbanOutStream(i int) iVban {
vbo := vbanOutStream{vbanStream{iRemote{fmt.Sprintf("vban.outstream[%d]", i), i}}} vbo := vbanOutStream{vbanStream{iRemote{fmt.Sprintf("vban.outstream[%d]", i), i}}}
return iVban(&vbo) return &vbo
} }
type vban struct { type vban struct {
@ -174,17 +174,17 @@ type vban struct {
} }
func newVban(k *kind) *vban { func newVban(k *kind) *vban {
_vbanIn := make([]iVban, k.VbanIn) vbanIn := make([]iVban, k.VbanIn)
for i := 0; i < k.VbanIn; i++ { for i := 0; i < k.VbanIn; i++ {
_vbanIn[i] = newVbanInStream(i) vbanIn[i] = newVbanInStream(i)
} }
_vbanOut := make([]iVban, k.VbanOut) vbanOut := make([]iVban, k.VbanOut)
for i := 0; i < k.VbanOut; i++ { for i := 0; i < k.VbanOut; i++ {
_vbanOut[i] = newVbanOutStream(i) vbanOut[i] = newVbanOutStream(i)
} }
return &vban{ return &vban{
InStream: _vbanIn, InStream: vbanIn,
OutStream: _vbanOut, OutStream: vbanOut,
} }
} }