bus mode implemented

bus mode test added to higher

#3
This commit is contained in:
onyx-and-iris 2022-06-28 17:32:03 +01:00
parent 3394c9b423
commit 0fb0daf558
3 changed files with 150 additions and 4 deletions

View File

@ -98,6 +98,14 @@ func TestBus4Label(t *testing.T) {
})
}
func TestBus3ModeAmix(t *testing.T) {
//t.Skip("skipping test")
vmRem.Bus[3].Mode().SetAmix(true)
t.Run("Should return true when Mode().SetAmix(true)", func(t *testing.T) {
assert.True(t, vmRem.Bus[3].Mode().GetAmix())
})
}
func TestVbanInStream0On(t *testing.T) {
//t.Skip("skipping test")
vmRem.Vban.InStream[0].SetOn(true)

View File

@ -16,12 +16,13 @@ type t_bus interface {
SetLabel(val string)
GetGain() float64
SetGain(val float32)
Mode() t_busMode
}
// bus represents a bus channel
// embeds channel struct
type bus struct {
iRemote
mode busMode
}
// GetMute returns the value of the Mute parameter
@ -74,12 +75,20 @@ func (b *bus) SetGain(val float32) {
b.setter_float("Gain", val)
}
// Mode returns address of a busMode struct
func (b *bus) Mode() t_busMode {
return &b.mode
}
type physicalBus struct {
bus
}
func newPhysicalBus(i int) t_bus {
pb := physicalBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}}}
pb := physicalBus{bus{
iRemote{fmt.Sprintf("bus[%d]", i), i},
busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}},
}}
return t_bus(&pb)
}
@ -93,7 +102,10 @@ type virtualBus struct {
}
func newVirtualBus(i int) t_bus {
vb := virtualBus{bus{iRemote{fmt.Sprintf("bus[%d]", i), i}}}
vb := virtualBus{bus{
iRemote{fmt.Sprintf("bus[%d]", i), i},
busMode{iRemote{fmt.Sprintf("bus[%d].mode", i), i}},
}}
return t_bus(&vb)
}
@ -101,3 +113,130 @@ func newVirtualBus(i int) t_bus {
func (v *virtualBus) String() string {
return fmt.Sprintf("VirtualBus%d", v.index)
}
type t_busMode 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
}
type busMode struct {
iRemote
}
func (bm *busMode) SetNormal(val bool) {
bm.setter_bool("Normal", val)
}
func (bm *busMode) GetNormal() bool {
return bm.getter_bool("Normal")
}
func (bm *busMode) SetAmix(val bool) {
bm.setter_bool("Amix", val)
}
func (bm *busMode) GetAmix() bool {
return bm.getter_bool("Amix")
}
func (bm *busMode) SetBmix(val bool) {
bm.setter_bool("Bmix", val)
}
func (bm *busMode) GetBmix() bool {
return bm.getter_bool("Bmix")
}
func (bm *busMode) SetRepeat(val bool) {
bm.setter_bool("Repeat", val)
}
func (bm *busMode) GetRepeat() bool {
return bm.getter_bool("Repeat")
}
func (bm *busMode) SetComposite(val bool) {
bm.setter_bool("Composite", val)
}
func (bm *busMode) GetComposite() bool {
return bm.getter_bool("Composite")
}
func (bm *busMode) SetTvMix(val bool) {
bm.setter_bool("TvMix", val)
}
func (bm *busMode) GetTvMix() bool {
return bm.getter_bool("TvMix")
}
func (bm *busMode) SetUpMix21(val bool) {
bm.setter_bool("UpMix21", val)
}
func (bm *busMode) GetUpMix21() bool {
return bm.getter_bool("UpMix21")
}
func (bm *busMode) SetUpMix41(val bool) {
bm.setter_bool("UpMix41", val)
}
func (bm *busMode) GetUpMix41() bool {
return bm.getter_bool("UpMix41")
}
func (bm *busMode) SetUpMix61(val bool) {
bm.setter_bool("UpMix61", val)
}
func (bm *busMode) GetUpMix61() bool {
return bm.getter_bool("UpMix61")
}
func (bm *busMode) SetCenterOnly(val bool) {
bm.setter_bool("CenterOnly", val)
}
func (bm *busMode) GetCenterOnly() bool {
return bm.getter_bool("CenterOnly")
}
func (bm *busMode) SetLfeOnly(val bool) {
bm.setter_bool("LfeOnly", val)
}
func (bm *busMode) GetLfeOnly() bool {
return bm.getter_bool("LfeOnly")
}
func (bm *busMode) SetRearOnly(val bool) {
bm.setter_bool("RearOnly", val)
}
func (bm *busMode) GetRearOnly() bool {
return bm.getter_bool("RearOnly")
}

View File

@ -30,7 +30,6 @@ type t_strip interface {
}
// strip represents a strip channel
// embeds channel struct
type strip struct {
iRemote
outputs