mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-05 05:07:47 +00:00
hide Convert, add mode.set
tests pass for all kinds
This commit is contained in:
parent
ec05790312
commit
7eb82c41a2
11
lib/bus.ps1
11
lib/bus.ps1
@ -36,7 +36,7 @@ class BusLevels : IRemote {
|
|||||||
$this.offset = 8
|
$this.offset = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
[single] Convert([single]$val) {
|
hidden [single] Convert([single]$val) {
|
||||||
if ($val -gt 0) {
|
if ($val -gt 0) {
|
||||||
return [math]::Round(20 * [math]::Log10($val), 1)
|
return [math]::Round(20 * [math]::Log10($val), 1)
|
||||||
}
|
}
|
||||||
@ -82,6 +82,15 @@ class BusMode : IRemote {
|
|||||||
}
|
}
|
||||||
return $mode
|
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 {
|
class BusEq : Eq {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
|||||||
$vmr.bus[$index].sel | Should -Be $expected
|
$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 = $value
|
||||||
$vmr.bus[$index].mode.amix | Should -Be $expected
|
$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
|
$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 @(
|
Context 'EQ' -Skip:$ifBasic -ForEach @(
|
||||||
@{ Eq = $vmr.bus[$index].eq }
|
@{ Eq = $vmr.bus[$index].eq }
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user