option.ps1

This commit is contained in:
pblivingston 2025-11-26 10:40:20 -05:00
parent 15a977834d
commit c5a8813e9a
2 changed files with 130 additions and 0 deletions

View File

@ -11,6 +11,7 @@
. $PSScriptRoot\command.ps1 . $PSScriptRoot\command.ps1
. $PSScriptRoot\recorder.ps1 . $PSScriptRoot\recorder.ps1
. $PSScriptRoot\patch.ps1 . $PSScriptRoot\patch.ps1
. $PSScriptRoot\option.ps1
. $PSScriptRoot\profiles.ps1 . $PSScriptRoot\profiles.ps1
class Remote { class Remote {
@ -81,6 +82,7 @@ class RemoteBasic : Remote {
[PSCustomObject]$vban [PSCustomObject]$vban
[Object]$command [Object]$command
[Object]$patch [Object]$patch
[Object]$option
RemoteBasic () : base ('basic') { RemoteBasic () : base ('basic') {
$this.strip = Make_Strips($this) $this.strip = Make_Strips($this)
@ -89,6 +91,7 @@ class RemoteBasic : Remote {
$this.vban = Make_Vban($this) $this.vban = Make_Vban($this)
$this.command = Make_Command($this) $this.command = Make_Command($this)
$this.patch = Make_Patch($this) $this.patch = Make_Patch($this)
$this.option = Make_Option($this)
} }
} }
@ -99,6 +102,7 @@ class RemoteBanana : Remote {
[PSCustomObject]$vban [PSCustomObject]$vban
[Object]$command [Object]$command
[Object]$patch [Object]$patch
[Object]$option
[Object]$recorder [Object]$recorder
RemoteBanana () : base ('banana') { RemoteBanana () : base ('banana') {
@ -108,6 +112,7 @@ class RemoteBanana : Remote {
$this.vban = Make_Vban($this) $this.vban = Make_Vban($this)
$this.command = Make_Command($this) $this.command = Make_Command($this)
$this.patch = Make_Patch($this) $this.patch = Make_Patch($this)
$this.option = Make_Option($this)
$this.recorder = Make_Recorder($this) $this.recorder = Make_Recorder($this)
} }
} }
@ -119,6 +124,7 @@ class RemotePotato : Remote {
[PSCustomObject]$vban [PSCustomObject]$vban
[Object]$command [Object]$command
[Object]$patch [Object]$patch
[Object]$option
[Object]$recorder [Object]$recorder
RemotePotato () : base ('potato') { RemotePotato () : base ('potato') {
@ -128,6 +134,7 @@ class RemotePotato : Remote {
$this.vban = Make_Vban($this) $this.vban = Make_Vban($this)
$this.command = Make_Command($this) $this.command = Make_Command($this)
$this.patch = Make_Patch($this) $this.patch = Make_Patch($this)
$this.option = Make_Option($this)
$this.recorder = Make_Recorder($this) $this.recorder = Make_Recorder($this)
} }
} }

123
lib/option.ps1 Normal file
View File

@ -0,0 +1,123 @@
class Option : IRemote {
[System.Collections.ArrayList]$delay
[Object]$buffer
[Object]$mode
Option ([Object]$remote) : base ($remote) {
AddBoolMembers -PARAMS @('asiosr', 'monitorOnSel', 'sliderMode')
$this.buffer = [OptionBuffer]::new($remote)
$this.mode = [OptionMode]::new($remote)
$this.delay = @()
for ($i = 0; $i -lt $remote.kind.p_out; $i++) {
$this.delay.Add([FloatArrayMember]::new($i, 'delay', $this, 2))
}
}
[string] identifier () {
return 'Option'
}
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
{
$this.Getter('sr')
} `
{
param([int]$arg)
$opts = @(32000, 44100, 48000, 88200, 96000, 176400, 192000)
if ($opts.Contains($arg)) {
$this._sr = $this.Setter('sr', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
}
class OptionBuffer : IRemote {
OptionBuffer ([Object]$remote) : base ($remote) {}
[string] identifier () {
return 'Option.Buffer'
}
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
{
$this.Getter('mme')
} `
{
param([int]$arg)
$opts = @(441, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048)
if ($opts.Contains($arg)) {
$this._mme = $this.Setter('mme', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
{
$this.Getter('wdm')
} `
{
param([int]$arg)
$opts = @(128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048)
if ($opts.Contains($arg)) {
$this._wdm = $this.Setter('wdm', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
{
$this.Getter('ks')
} `
{
param([int]$arg)
$opts = @(128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048)
if ($opts.Contains($arg)) {
$this._ks = $this.Setter('ks', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
hidden $_asio = $($this | Add-Member ScriptProperty 'asio' `
{
$this.Getter('asio')
} `
{
param([int]$arg)
$opts = @(0, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024)
if ($opts.Contains($arg)) {
$this._asio = $this.Setter('asio', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
}
class OptionMode : IRemote {
OptionMode ([Object]$remote) : base ($remote) {
AddBoolMembers -PARAMS @('exclusif', 'swift')
}
[string] identifier () {
return 'Option.Mode'
}
}
function Make_Option ([Object]$remote) {
return [Option]::new($remote)
}