Patch class with:
- Patch.asio[i]
- Patch.OutA2[i]-OutA5[i]
- Patch.composite[i]
- Patch.insert[i]
- Patch.postFaderComposite
- Patch.postFxInsert
This commit is contained in:
pblivingston 2025-11-25 20:38:57 -05:00
parent c086f58ade
commit 3a5c7286f6
2 changed files with 56 additions and 0 deletions

View File

@ -10,6 +10,7 @@
. $PSScriptRoot\vban.ps1
. $PSScriptRoot\command.ps1
. $PSScriptRoot\recorder.ps1
. $PSScriptRoot\patch.ps1
. $PSScriptRoot\profiles.ps1
class Remote {
@ -79,6 +80,7 @@ class RemoteBasic : Remote {
[System.Collections.ArrayList]$button
[PSCustomObject]$vban
[Object]$command
[Object]$patch
RemoteBasic () : base ('basic') {
$this.strip = Make_Strips($this)
@ -86,6 +88,7 @@ class RemoteBasic : Remote {
$this.button = Make_Buttons
$this.vban = Make_Vban($this)
$this.command = Make_Command($this)
$this.patch = Make_Patch($this)
}
}
@ -95,6 +98,7 @@ class RemoteBanana : Remote {
[System.Collections.ArrayList]$button
[PSCustomObject]$vban
[Object]$command
[Object]$patch
[Object]$recorder
RemoteBanana () : base ('banana') {
@ -103,6 +107,7 @@ class RemoteBanana : Remote {
$this.button = Make_Buttons
$this.vban = Make_Vban($this)
$this.command = Make_Command($this)
$this.patch = Make_Patch($this)
$this.recorder = Make_Recorder($this)
}
}
@ -113,6 +118,7 @@ class RemotePotato : Remote {
[System.Collections.ArrayList]$button
[PSCustomObject]$vban
[Object]$command
[Object]$patch
[Object]$recorder
RemotePotato () : base ('potato') {
@ -121,6 +127,7 @@ class RemotePotato : Remote {
$this.button = Make_Buttons
$this.vban = Make_Vban($this)
$this.command = Make_Command($this)
$this.patch = Make_Patch($this)
$this.recorder = Make_Recorder($this)
}
}

49
lib/patch.ps1 Normal file
View File

@ -0,0 +1,49 @@
class Patch : IRemote {
[System.Collections.ArrayList]$asio
[System.Collections.ArrayList]$composite
[System.Collections.ArrayList]$insert
Patch ([Object]$remote) : base ($remote) {
AddBoolMembers -PARAMS @('postFaderComposite', 'postFxInsert')
$this.AddASIOOutMembers()
$this.asio = @()
for ($i = 0; $i -lt $remote.kind.asio_in; $i++) {
$this.asio.Add([IntArrayMember]::new($i, 'asio', $this))
}
$this.composite = @()
for ($i = 0; $i -lt $remote.kind.composite; $i++) {
$this.composite.Add([IntArrayMember]::new($i, 'composite', $this))
}
$this.insert = @()
for ($i = 0; $i -lt $remote.kind.insert; $i++) {
$this.insert.Add([BoolArrayMember]::new($i, 'insert', $this))
}
}
[string] identifier () {
return 'Patch'
}
hidden [void] AddASIOOutMembers () {
$num_A = $this.remote.kind.p_out
$asio_out = $this.remote.kind.asio_out
if ($asio_out -le 0) { return }
for ($a = 2; $a -le $num_A; $a++) {
[System.Collections.ArrayList]$members = @()
for ($i = 0; $i -lt $asio_out; $i++) {
$members.Add([IntArrayMember]::new($i, "OutA$a", $this))
}
Add-Member -InputObject $this -MemberType NoteProperty -Name "OutA$a" -Value $members -Force
}
}
}
function Make_Patch ([Object]$remote) {
return [Patch]::new($remote)
}