2021-04-28 17:38:36 +01:00
|
|
|
class Bus {
|
|
|
|
[int32]$id
|
|
|
|
|
|
|
|
# Constructor
|
|
|
|
Bus ([Int]$id)
|
|
|
|
{
|
|
|
|
$this.id = $id
|
|
|
|
}
|
|
|
|
|
|
|
|
[void] Setter($cmd, $set) {
|
|
|
|
Param_Set -PARAM $cmd -VALUE $set
|
|
|
|
}
|
|
|
|
|
2021-04-28 18:21:32 +01:00
|
|
|
[Single] Getter($cmd) {
|
2021-04-28 17:38:36 +01:00
|
|
|
return Param_Get -PARAM $cmd
|
|
|
|
}
|
|
|
|
|
|
|
|
[string] cmd ($arg) {
|
|
|
|
return "Bus[" + $this.id + "].$arg"
|
|
|
|
}
|
|
|
|
|
|
|
|
hidden $_mono = $($this | Add-Member ScriptProperty 'mono' `
|
|
|
|
{
|
|
|
|
$this.Getter($this.cmd('Mono'))
|
|
|
|
}`
|
|
|
|
{
|
|
|
|
param ( [Single]$arg )
|
|
|
|
$this._mono = $this.Setter($this.cmd('Mono'), $arg)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_mute = $($this | Add-Member ScriptProperty 'mute' `
|
|
|
|
{
|
|
|
|
$this.Getter($this.cmd('Mute'))
|
|
|
|
}`
|
|
|
|
{
|
|
|
|
param ( [Single]$arg )
|
|
|
|
$this._mute = $this.Setter($this.cmd('Mute'), $arg)
|
|
|
|
}
|
|
|
|
)
|
2021-04-28 18:21:32 +01:00
|
|
|
|
|
|
|
hidden $_gain = $($this | Add-Member ScriptProperty 'gain' `
|
|
|
|
{
|
2021-04-30 18:41:10 +01:00
|
|
|
[math]::Round($this.Getter($this.cmd('gain')), 1)
|
2021-04-28 18:21:32 +01:00
|
|
|
}`
|
|
|
|
{
|
|
|
|
param ( [Single]$arg )
|
|
|
|
$this._gain = $this.Setter($this.cmd('gain'), $arg)
|
|
|
|
}
|
|
|
|
)
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Function Buses {
|
|
|
|
[System.Collections.ArrayList]$bus = @()
|
|
|
|
0..$($layout.Bus-1) | ForEach-Object {
|
|
|
|
[void]$bus.Add([Bus]::new($_))
|
|
|
|
}
|
|
|
|
$bus
|
|
|
|
}
|