From c5a8813e9a1cb63aed2ca5e390dcb2096e56025f Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 10:40:20 -0500 Subject: [PATCH 1/7] option.ps1 --- lib/Voicemeeter.psm1 | 7 +++ lib/option.ps1 | 123 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 lib/option.ps1 diff --git a/lib/Voicemeeter.psm1 b/lib/Voicemeeter.psm1 index 05fad2e..4c24d3e 100644 --- a/lib/Voicemeeter.psm1 +++ b/lib/Voicemeeter.psm1 @@ -11,6 +11,7 @@ . $PSScriptRoot\command.ps1 . $PSScriptRoot\recorder.ps1 . $PSScriptRoot\patch.ps1 +. $PSScriptRoot\option.ps1 . $PSScriptRoot\profiles.ps1 class Remote { @@ -81,6 +82,7 @@ class RemoteBasic : Remote { [PSCustomObject]$vban [Object]$command [Object]$patch + [Object]$option RemoteBasic () : base ('basic') { $this.strip = Make_Strips($this) @@ -89,6 +91,7 @@ class RemoteBasic : Remote { $this.vban = Make_Vban($this) $this.command = Make_Command($this) $this.patch = Make_Patch($this) + $this.option = Make_Option($this) } } @@ -99,6 +102,7 @@ class RemoteBanana : Remote { [PSCustomObject]$vban [Object]$command [Object]$patch + [Object]$option [Object]$recorder RemoteBanana () : base ('banana') { @@ -108,6 +112,7 @@ class RemoteBanana : Remote { $this.vban = Make_Vban($this) $this.command = Make_Command($this) $this.patch = Make_Patch($this) + $this.option = Make_Option($this) $this.recorder = Make_Recorder($this) } } @@ -119,6 +124,7 @@ class RemotePotato : Remote { [PSCustomObject]$vban [Object]$command [Object]$patch + [Object]$option [Object]$recorder RemotePotato () : base ('potato') { @@ -128,6 +134,7 @@ class RemotePotato : Remote { $this.vban = Make_Vban($this) $this.command = Make_Command($this) $this.patch = Make_Patch($this) + $this.option = Make_Option($this) $this.recorder = Make_Recorder($this) } } diff --git a/lib/option.ps1 b/lib/option.ps1 new file mode 100644 index 0000000..dec3bf4 --- /dev/null +++ b/lib/option.ps1 @@ -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) +} \ No newline at end of file From e887e1516847745e5f539065f139555cbf48e5e6 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:17:42 -0500 Subject: [PATCH 2/7] Update higher.Tests.ps1 pester tests pass --- tests/higher.Tests.ps1 | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 0206ab7..aa825ae 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -127,6 +127,22 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.patch.postfxinsert | Should -Be $value } } + + Context 'Option' { + It 'Should set and get Option.monitoronsel' -Skip:$ifNotPotato { + $vmr.option.monitoronsel = $value + $vmr.command.restart + Start-Sleep -Milliseconds 500 + $vmr.option.monitoronsel | Should -Be $value + } + + It 'Should set and get Option.slidermode' -Skip:$ifNotPotato { + $vmr.option.slidermode = $value + $vmr.command.restart + Start-Sleep -Milliseconds 500 + $vmr.option.slidermode | Should -Be $value + } + } } Describe 'Float Tests' { @@ -222,6 +238,17 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { } } } + + Context 'Option' { + It "Should set and get Option.delay[$phys_out]" -ForEach @( + @{ Value = 486.57 }, @{ Value = 26.41 } + ) { + $vmr.option.delay[$phys_out].set($value) + $vmr.command.restart + Start-Sleep -Milliseconds 500 + $vmr.option.delay[$phys_out].get() | Should -Be $value + } + } } Describe 'Int Tests' -ForEach @( @@ -267,6 +294,38 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.patch.composite[$composite].get() | Should -Be $value } } + + Context 'Option' { + It 'Should set and get Option.sr' -ForEach @( + @{ Value = 44100 }, @{ Value = 48000 } + ) { + $vmr.option.sr = $value + Start-Sleep -Milliseconds 500 + $vmr.option.sr | Should -Be $value + } + + Context 'Option.buffer' -ForEach @( + @{ Value = 1024 }, @{ Value = 512 } + ) { + It 'Should set and get mme buffer' { + $vmr.option.buffer.mme = $value + Start-Sleep -Milliseconds 500 + $vmr.option.buffer.mme | Should -Be $value + } + + It 'Should set and get wdm buffer' { + $vmr.option.buffer.wdm = $value + Start-Sleep -Milliseconds 500 + $vmr.option.buffer.wdm | Should -Be $value + } + + It 'Should set and get ks buffer' { + $vmr.option.buffer.ks = $value + Start-Sleep -Milliseconds 500 + $vmr.option.buffer.ks | Should -Be $value + } + } + } } Describe 'String Tests' { From d81cd3239205fdfb10a5c1e457a93ee3b5b6aff7 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:37:51 -0500 Subject: [PATCH 3/7] update docs manual tests pass - option.asiosr - option.buffer.asio --- CHANGELOG.md | 1 + README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ac4fbb..95abcc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Before any major/minor/patch is released all test units will be run to verify th - IRemote base class - ArrayMember classes for array-like properties - Patch class +- Option class ## [3.3.0] - 2024-06-29 diff --git a/README.md b/README.md index e567f20..ad54cba 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,56 @@ $vmr.patch.composite[5].set(0) # sets composite channel 6 (5) to default bus c $vmr.patch.insert[4].get() ``` +### Option + +The following Option commands are available: + +- sr: int, (32000, 44100, 48000, 88200, 96000, 176400, 192000) +- asiosr: bool +- monitorOnSel: bool +- sliderMode: bool + +The following Option.delay[i] methods are available: + +- Set($val): float, from 0.00 to 500.00 +- Get() + +for example: + +```powershell +$vmr.Option.delay[2].set(30.26) # sets the delay for the third (2) bus +$vmr.Option.sliderMode = $false # sets slider mode to absolute +``` + +#### buffers + +The following Option.buffer commands are available: + +- mme: int, (441, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) +- wdm: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) +- ks: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) +- asio: int, (0, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024) + +for example: + +```powershell +$vmr.Option.buffer.wdm = 512 +$vmr.Option.buffer.asio = 0 # to use default buffer size +``` + +#### modes + +The following Option.mode commands are available: + +- exclusif: bool +- swift: bool + +for example: + +```powershell +$vmr.Option.mode.exclusif = $true # sets WDM exclusive mode +``` + ### Recorder The following commands are available: From 10c85cead5aa780b032085971ff461ddf7250a93 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 12:16:43 -0500 Subject: [PATCH 4/7] remove mode - mode.exclusif - mode.swift are not available without registry edits --- README.md | 13 ------------- lib/option.ps1 | 12 ------------ 2 files changed, 25 deletions(-) diff --git a/README.md b/README.md index ad54cba..5db2487 100644 --- a/README.md +++ b/README.md @@ -477,19 +477,6 @@ $vmr.Option.buffer.wdm = 512 $vmr.Option.buffer.asio = 0 # to use default buffer size ``` -#### modes - -The following Option.mode commands are available: - -- exclusif: bool -- swift: bool - -for example: - -```powershell -$vmr.Option.mode.exclusif = $true # sets WDM exclusive mode -``` - ### Recorder The following commands are available: diff --git a/lib/option.ps1 b/lib/option.ps1 index dec3bf4..8dd2ed3 100644 --- a/lib/option.ps1 +++ b/lib/option.ps1 @@ -1,13 +1,11 @@ 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++) { @@ -108,16 +106,6 @@ class OptionBuffer : IRemote { ) } -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) } \ No newline at end of file From a69902ec490fe8185e2b1fdb19ee5b57660de0e0 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:32:06 -0500 Subject: [PATCH 5/7] formatting --- lib/option.ps1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/option.ps1 b/lib/option.ps1 index 8dd2ed3..0526b6f 100644 --- a/lib/option.ps1 +++ b/lib/option.ps1 @@ -24,12 +24,12 @@ class Option : IRemote { { 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) - } + if ($opts.Contains($arg)) { + $this._sr = $this.Setter('sr', $arg) + } + else { + Write-Warning ('Expected one of', $opts) + } } ) } @@ -48,12 +48,12 @@ class OptionBuffer : IRemote { { 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) - } + if ($opts.Contains($arg)) { + $this._mme = $this.Setter('mme', $arg) + } + else { + Write-Warning ('Expected one of', $opts) + } } ) From 88468d4e52f86af422e34bbc53c49de5f0599693 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:33:14 -0500 Subject: [PATCH 6/7] accepted buffers removed 896 from wdm and ks --- README.md | 4 ++-- lib/option.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5db2487..12223c6 100644 --- a/README.md +++ b/README.md @@ -466,8 +466,8 @@ $vmr.Option.sliderMode = $false # sets slider mode to absolute The following Option.buffer commands are available: - mme: int, (441, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) -- wdm: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) -- ks: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 896, 1024, 1536, 2048) +- wdm: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048) +- ks: int, (128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048) - asio: int, (0, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024) for example: diff --git a/lib/option.ps1 b/lib/option.ps1 index 0526b6f..8b6dc82 100644 --- a/lib/option.ps1 +++ b/lib/option.ps1 @@ -63,7 +63,7 @@ class OptionBuffer : IRemote { } ` { 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) + $opts = @(128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048) if ($opts.Contains($arg)) { $this._wdm = $this.Setter('wdm', $arg) } @@ -79,7 +79,7 @@ class OptionBuffer : IRemote { } ` { 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) + $opts = @(128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 441, 448, 480, 512, 576, 640, 704, 768, 1024, 1536, 2048) if ($opts.Contains($arg)) { $this._ks = $this.Setter('ks', $arg) } From 1587b2ea6afd90c30fedfa6b5a6157cacd6c816a Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:33:42 -0500 Subject: [PATCH 7/7] basic a2 delay --- lib/option.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/option.ps1 b/lib/option.ps1 index 8b6dc82..cae66f2 100644 --- a/lib/option.ps1 +++ b/lib/option.ps1 @@ -7,8 +7,13 @@ class Option : IRemote { $this.buffer = [OptionBuffer]::new($remote) + $num_A = $this.remote.kind.p_out + if ($this.remote.kind.name -eq 'basic') { + $num_A += $this.remote.kind.v_out + } + $this.delay = @() - for ($i = 0; $i -lt $remote.kind.p_out; $i++) { + for ($i = 0; $i -lt $num_A; $i++) { $this.delay.Add([FloatArrayMember]::new($i, 'delay', $this, 2)) } }