2022-01-06 15:27:11 +00:00
|
|
|
. $PSScriptRoot\meta.ps1
|
|
|
|
|
2021-04-28 17:38:36 +01:00
|
|
|
class Strip {
|
2022-01-08 16:10:14 +00:00
|
|
|
[Int]$id
|
2021-04-28 17:38:36 +01:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
Strip ([Int]$id)
|
2021-04-28 17:38:36 +01:00
|
|
|
{
|
|
|
|
$this.id = $id
|
2022-01-08 16:10:14 +00:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
AddBoolMembers -PARAMS @('mono', 'solo', 'mute')
|
|
|
|
AddIntMembers -PARAMS @('limit')
|
2022-01-24 20:01:55 +00:00
|
|
|
AddFloatMembers -PARAMS @('gain')
|
2022-01-19 21:52:59 +00:00
|
|
|
AddStringMembers -PARAMS @('label')
|
2021-04-28 17:38:36 +01:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
AddChannelMembers
|
2022-03-08 22:55:11 +00:00
|
|
|
AddGainlayerMembers
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
2021-04-28 18:21:32 +01:00
|
|
|
[Single] Getter($cmd) {
|
2022-01-19 21:52:59 +00:00
|
|
|
return Param_Get -PARAM $cmd -IS_STRING $false
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
2021-05-11 19:09:57 +01:00
|
|
|
[String] Getter_String($cmd) {
|
2022-01-19 21:52:59 +00:00
|
|
|
return Param_Get -PARAM $cmd -IS_STRING $true
|
|
|
|
}
|
|
|
|
|
|
|
|
[void] Setter($cmd, $set) {
|
|
|
|
Param_Set -PARAM $cmd -VALUE $set
|
2021-05-11 19:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[String] cmd ($arg) {
|
2021-04-28 17:38:36 +01:00
|
|
|
return "Strip[" + $this.id + "].$arg"
|
|
|
|
}
|
2022-01-24 20:01:55 +00:00
|
|
|
}
|
2022-01-08 16:10:14 +00:00
|
|
|
|
2022-01-24 20:01:55 +00:00
|
|
|
class PhysicalStrip : Strip {
|
|
|
|
PhysicalStrip ([Int]$id) : base ($id) {
|
|
|
|
AddFloatMembers -PARAMS @('comp', 'gate')
|
|
|
|
}
|
|
|
|
|
2022-01-10 20:56:17 +00:00
|
|
|
hidden $_device = $($this | Add-Member ScriptProperty 'device' `
|
|
|
|
{
|
|
|
|
$this.Getter_String($this.cmd('device.name'))
|
|
|
|
}`
|
|
|
|
{
|
|
|
|
return Write-Warning("ERROR: " + $this.cmd('device.name') + " is read only")
|
2022-01-08 16:10:14 +00:00
|
|
|
}
|
2022-01-10 20:56:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
|
|
|
|
{
|
2022-01-19 21:52:59 +00:00
|
|
|
$this.Getter($this.cmd('device.sr'))
|
2022-01-10 20:56:17 +00:00
|
|
|
}`
|
|
|
|
{
|
|
|
|
return Write-Warning("ERROR: " + $this.cmd('device.sr') + " is read only")
|
2022-01-08 16:10:14 +00:00
|
|
|
}
|
2022-01-10 20:56:17 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
class VirtualStrip : Strip {
|
2022-01-19 21:52:59 +00:00
|
|
|
VirtualStrip ([Int]$id) : base ($id) {
|
2022-03-08 22:55:11 +00:00
|
|
|
AddBoolMembers -PARAMS @('mc')
|
|
|
|
AddIntMembers -PARAMS @('k')
|
2022-01-08 16:10:14 +00:00
|
|
|
}
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
|
2022-01-08 16:10:14 +00:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
Function Make_Strips {
|
2021-04-28 17:38:36 +01:00
|
|
|
[System.Collections.ArrayList]$strip = @()
|
2022-01-10 20:56:17 +00:00
|
|
|
0..$($layout.p_in + $layout.v_in - 1) | ForEach-Object {
|
|
|
|
if ($_ -lt $layout.p_in) {
|
2022-01-19 21:52:59 +00:00
|
|
|
[void]$strip.Add([PhysicalStrip]::new($_))
|
2022-01-10 20:56:17 +00:00
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
else { [void]$strip.Add([VirtualStrip]::new($_)) }
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
$strip
|
|
|
|
}
|