From 36d4e5f6c4a36f01575ce87d6e6bcfbdf7e28dec Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 11:17:58 -0500 Subject: [PATCH 1/5] Update bus.ps1 - sel - monitor - vaio - mono to int - levels.convert [float] -> [single] - device.asio $arg -> [string]$arg --- lib/bus.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/bus.ps1 b/lib/bus.ps1 index 0ba086d..3697198 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -4,7 +4,8 @@ class Bus : IRemote { [Object]$levels Bus ([int]$index, [Object]$remote) : base ($index, $remote) { - AddBoolMembers -PARAMS @('mono', 'mute') + AddBoolMembers -PARAMS @('mute', 'sel', 'monitor') + AddIntMembers -PARAMS @('mono') AddStringMembers -PARAMS @('label') AddFloatMembers -PARAMS @('gain', 'returnreverb', 'returndelay', 'returnfx1', 'returnfx2') @@ -35,7 +36,7 @@ class BusLevels : IRemote { $this.offset = 8 } - [float] Convert([float]$val) { + [single] Convert([single]$val) { if ($val -gt 0) { return [math]::Round(20 * [math]::Log10($val), 1) } @@ -97,6 +98,8 @@ class PhysicalBus : Bus { PhysicalBus ([int]$index, [Object]$remote) : base ($index, $remote) { $this.device = [BusDevice]::new($index, $remote) + + AddBoolMembers -PARAMS @('vaio') } } @@ -126,7 +129,7 @@ class BusDevice : Device { -Value { return Write-Warning ("ERROR: $($this.identifier()).asio is write only") } -SecondValue { - param($arg) + param([string]$arg) return $this.Setter('asio', $arg) } -Force } From 2def27573d206e8440d398fe2184164f161e2529 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:06:51 -0500 Subject: [PATCH 2/5] update docs --- CHANGELOG.md | 3 +++ README.md | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f298a35..e4809d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Before any major/minor/patch is released all test units will be run to verify th - on, write-only - name, write-only - ip, write-only +- Bus.Sel, Bus.Monitor, Bus.Vaio ### Changed @@ -31,6 +32,8 @@ Before any major/minor/patch is released all test units will be run to verify th - name - ip - cast vban getters to types for consistency +- Bus.Mono -> [int] for stereo reverse +- Bus.Levels.Convert return type [float] -> [single] for naming consistency, no functional change ### Fixed diff --git a/README.md b/README.md index aa08db7..8343c6a 100644 --- a/README.md +++ b/README.md @@ -234,8 +234,10 @@ $vmr.strip[2].levels.PreFader() -Join ', ' | Write-Host The following bus commands are available: - mute: bool -- mono: bool -- limit: int, from -40 to 12 +- sel: bool +- monitor: bool +- vaio: bool +- mono: int, 0 off, 1 mono, 2 stereo reverse - gain: float, from -60.0 to 12.0 - label: string - returnreverb: float, from 0.0 to 10.0 From ec05790312a1b80e84df88fb0423dbb57df31c8c Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:22:07 -0500 Subject: [PATCH 3/5] Update higher.Tests.ps1 pester tests pass for all kinds manual tests for safety pass: - bus.levels.all() - bus.device.asio --- tests/higher.Tests.ps1 | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 8ae38fe..8c950ef 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -53,9 +53,19 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { Context 'Bus, one physical one virtual' -ForEach @( @{ Index = $phys_out }, @{ Index = $virt_out } ) { - It "Should set and get Bus[$index].Mono" { - $vmr.bus[$index].mono = $value - $vmr.bus[$index].mono | Should -Be $expected + It "Should set and get Bus[$index].Monitor" -Skip:$ifNotPotato { + $vmr.bus[$index].monitor = $value + $vmr.bus[$index].monitor | Should -Be $expected + } + + It "Should set and get Bus[$index].Mute" { + $vmr.bus[$index].mute = $value + $vmr.bus[$index].mute | Should -Be $expected + } + + It "Should set and get Bus[$index].Sel" -Skip:$ifNotPotato { + $vmr.bus[$index].sel = $value + $vmr.bus[$index].sel | Should -Be $expected } It "Should set and get Bus[$index].mode.amix" -Skip:$ifBasic { @@ -88,6 +98,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { } } + Context 'Bus, physical only' -ForEach @( + @{ Index = $phys_out } + ) { + It "Should set and get Bus[$index].vaio" { + $vmr.bus[$index].vaio = $value + $vmr.bus[$index].vaio | Should -Be $expected + } + } + Context 'Macrobutton' -ForEach @( @{ Index = 0 }, @{ Index = 69 } ) { @@ -386,6 +405,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { Context 'Bus, one physical one virtual' -ForEach @( @{ Index = $phys_out }, @{ Index = $virt_out } ) { + It "Should set and get Bus[$index].Mono" -ForEach @( + @{ Value = 0; Expected = 0 } + @{ Value = 1; Expected = 1 } + @{ Value = 2; Expected = 2 } + ) { + $vmr.bus[$index].mono = $value + $vmr.bus[$index].mono | Should -Be $expected + } + Context 'Eq' -Skip:$ifBasic -ForEach @( @{ Eq = $vmr.bus[$index].eq } ) { From 7eb82c41a2e6cf93937a1d8507d6272256bba6b4 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:05:58 -0500 Subject: [PATCH 4/5] hide Convert, add mode.set tests pass for all kinds --- lib/bus.ps1 | 11 ++++++++++- tests/higher.Tests.ps1 | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/bus.ps1 b/lib/bus.ps1 index 3697198..3145574 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -36,7 +36,7 @@ class BusLevels : IRemote { $this.offset = 8 } - [single] Convert([single]$val) { + hidden [single] Convert([single]$val) { if ($val -gt 0) { return [math]::Round(20 * [math]::Log10($val), 1) } @@ -82,6 +82,15 @@ class BusMode : IRemote { } return $mode } + + [void] Set ([string]$mode) { + if ($this.modes.Contains($mode)) { + $this.Setter($mode, $true) + } + else { + throw [System.ArgumentException]::new("Invalid mode: $mode") + } + } } class BusEq : Eq { diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 8c950ef..de9825f 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -68,7 +68,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.bus[$index].sel | Should -Be $expected } - It "Should set and get Bus[$index].mode.amix" -Skip:$ifBasic { + It "Should set and get Bus[$index].mode.amix" { $vmr.bus[$index].mode.amix = $value $vmr.bus[$index].mode.amix | Should -Be $expected } @@ -691,6 +691,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.bus[$index].label | Should -Be $expected } + It "Should set Bus[$index].Mode" -Skip:$ifBasic -ForEach @( + @{ Value = 'bmix'; Expected = 'bmix' } + @{ Value = 'upmix41'; Expected = 'upmix41' } + @{ Value = 'rearonly'; Expected = 'rearonly' } + ) { + $vmr.bus[$index].mode.Set($value) + $vmr.bus[$index].mode.Get() | Should -Be $expected + } + Context 'EQ' -Skip:$ifBasic -ForEach @( @{ Eq = $vmr.bus[$index].eq } ) { From 8f5536f139ef4230b2326fc9ec07250660eea237 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:08:47 -0500 Subject: [PATCH 5/5] update docs --- CHANGELOG.md | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4809d9..3ed42d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Before any major/minor/patch is released all test units will be run to verify th - name, write-only - ip, write-only - Bus.Sel, Bus.Monitor, Bus.Vaio +- Bus.Mode.Set($mode) ### Changed diff --git a/README.md b/README.md index 8343c6a..aa4707e 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ The following bus.mode members are available: The following bus.mode commands are available: +- Set($mode): string, sets the current bus mode - Get(): returns the current bus mode. for example: