mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-01-02 16:57:46 +00:00
Compare commits
No commits in common. "df2d1bb156c3a6165594cb72087209cee7cc3643" and "e944dc46e672d7847b24e470613da75adaaa3aea" have entirely different histories.
df2d1bb156
...
e944dc46e6
@ -23,8 +23,6 @@ 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
|
||||
- Bus.Mode.Set($mode)
|
||||
|
||||
### Changed
|
||||
|
||||
@ -33,8 +31,6 @@ 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
|
||||
|
||||
|
||||
@ -234,10 +234,8 @@ $vmr.strip[2].levels.PreFader() -Join ', ' | Write-Host
|
||||
The following bus commands are available:
|
||||
|
||||
- mute: bool
|
||||
- sel: bool
|
||||
- monitor: bool
|
||||
- vaio: bool
|
||||
- mono: int, 0 off, 1 mono, 2 stereo reverse
|
||||
- mono: bool
|
||||
- limit: int, from -40 to 12
|
||||
- gain: float, from -60.0 to 12.0
|
||||
- label: string
|
||||
- returnreverb: float, from 0.0 to 10.0
|
||||
@ -270,7 +268,6 @@ 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:
|
||||
@ -491,7 +488,6 @@ The following Option commands are available:
|
||||
- asiosr: bool
|
||||
- monitorOnSel: bool
|
||||
- sliderMode: bool
|
||||
- monitoringBus: int, from 0 to bus index
|
||||
|
||||
The following Option.delay[i] methods are available:
|
||||
|
||||
|
||||
18
lib/bus.ps1
18
lib/bus.ps1
@ -4,8 +4,7 @@ class Bus : IRemote {
|
||||
[Object]$levels
|
||||
|
||||
Bus ([int]$index, [Object]$remote) : base ($index, $remote) {
|
||||
AddBoolMembers -PARAMS @('mute', 'sel', 'monitor')
|
||||
AddIntMembers -PARAMS @('mono')
|
||||
AddBoolMembers -PARAMS @('mono', 'mute')
|
||||
AddStringMembers -PARAMS @('label')
|
||||
AddFloatMembers -PARAMS @('gain', 'returnreverb', 'returndelay', 'returnfx1', 'returnfx2')
|
||||
|
||||
@ -36,7 +35,7 @@ class BusLevels : IRemote {
|
||||
$this.offset = 8
|
||||
}
|
||||
|
||||
hidden [single] Convert([single]$val) {
|
||||
[float] Convert([float]$val) {
|
||||
if ($val -gt 0) {
|
||||
return [math]::Round(20 * [math]::Log10($val), 1)
|
||||
}
|
||||
@ -82,15 +81,6 @@ 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 {
|
||||
@ -107,8 +97,6 @@ class PhysicalBus : Bus {
|
||||
|
||||
PhysicalBus ([int]$index, [Object]$remote) : base ($index, $remote) {
|
||||
$this.device = [BusDevice]::new($index, $remote)
|
||||
|
||||
AddBoolMembers -PARAMS @('vaio')
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,7 +126,7 @@ class BusDevice : Device {
|
||||
-Value {
|
||||
return Write-Warning ("ERROR: $($this.identifier()).asio is write only")
|
||||
} -SecondValue {
|
||||
param([string]$arg)
|
||||
param($arg)
|
||||
return $this.Setter('asio', $arg)
|
||||
} -Force
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class Option : IRemote {
|
||||
|
||||
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
|
||||
{
|
||||
[int]$this.Getter('sr')
|
||||
$this.Getter('sr')
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
@ -37,28 +37,6 @@ class Option : IRemote {
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_monitoringBus = $($this | Add-Member ScriptProperty 'monitoringBus' `
|
||||
{
|
||||
foreach ($bus in 0..$($this.remote.kind.p_out + $this.remote.kind.v_out - 1)) {
|
||||
if ($this.remote.Getter("Bus[$bus].Monitor")) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return $bus
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
$busMax = $this.remote.kind.p_out + $this.remote.kind.v_out - 1
|
||||
if ($arg -ge 0 -and $arg -le $busMax) {
|
||||
$this._monitoringBus = $this.remote.Setter("Bus[$arg].Monitor", $arg)
|
||||
}
|
||||
else {
|
||||
Write-Warning ("Expected a bus index between 0 and $busMax")
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
class OptionBuffer : IRemote {
|
||||
@ -70,7 +48,7 @@ class OptionBuffer : IRemote {
|
||||
|
||||
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
|
||||
{
|
||||
[int]$this.Getter('mme')
|
||||
$this.Getter('mme')
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
@ -86,7 +64,7 @@ class OptionBuffer : IRemote {
|
||||
|
||||
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
|
||||
{
|
||||
[int]$this.Getter('wdm')
|
||||
$this.Getter('wdm')
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
@ -102,7 +80,7 @@ class OptionBuffer : IRemote {
|
||||
|
||||
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
|
||||
{
|
||||
[int]$this.Getter('ks')
|
||||
$this.Getter('ks')
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
@ -118,7 +96,7 @@ class OptionBuffer : IRemote {
|
||||
|
||||
hidden $_asio = $($this | Add-Member ScriptProperty 'asio' `
|
||||
{
|
||||
[int]$this.Getter('asio')
|
||||
$this.Getter('asio')
|
||||
} `
|
||||
{
|
||||
param([int]$arg)
|
||||
|
||||
@ -53,22 +53,12 @@ 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].Monitor" -Skip:$ifNotPotato {
|
||||
$vmr.bus[$index].monitor = $value
|
||||
$vmr.bus[$index].monitor | Should -Be $expected
|
||||
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].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" {
|
||||
It "Should set and get Bus[$index].mode.amix" -Skip:$ifBasic {
|
||||
$vmr.bus[$index].mode.amix = $value
|
||||
$vmr.bus[$index].mode.amix | Should -Be $expected
|
||||
}
|
||||
@ -98,15 +88,6 @@ 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 }
|
||||
) {
|
||||
@ -405,15 +386,6 @@ 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 }
|
||||
) {
|
||||
@ -574,13 +546,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
||||
$vmr.option.sr | Should -Be $value
|
||||
}
|
||||
|
||||
It 'Should set and get Option.MonitoringBus' -Skip:$ifNotPotato -ForEach @(
|
||||
@{ Value = $phys_out }, @{ Value = $virt_out }
|
||||
) {
|
||||
$vmr.option.monitoringbus = $value
|
||||
$vmr.option.monitoringbus | Should -Be $value
|
||||
}
|
||||
|
||||
Context 'Option.buffer' -ForEach @(
|
||||
@{ Value = 1024 }, @{ Value = 512 }
|
||||
) {
|
||||
@ -698,15 +663,6 @@ 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 }
|
||||
) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user