mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-05 05:07:47 +00:00
armstrip, armbus, armedbus
- armstrip, armbus -> boolarraymembers - armedbus prelim tests pass for potato
This commit is contained in:
parent
f40e0afb0d
commit
9209bbbc65
@ -5,13 +5,17 @@ class Recorder : IRemote {
|
|||||||
|
|
||||||
Recorder ([Object]$remote) : base ($remote) {
|
Recorder ([Object]$remote) : base ($remote) {
|
||||||
$this.mode = [RecorderMode]::new($remote)
|
$this.mode = [RecorderMode]::new($remote)
|
||||||
|
|
||||||
$this.armstrip = @()
|
$this.armstrip = @()
|
||||||
0..($remote.kind.p_in + $remote.kind.v_in - 1) | ForEach-Object {
|
$stripCount = $($remote.kind.p_in + $remote.kind.v_in)
|
||||||
$this.armstrip.Add([RecorderArmStrip]::new($_, $remote))
|
for ($i = 0; $i -lt $stripCount; $i++) {
|
||||||
|
$this.armstrip.Add([BoolArrayMember]::new($i, 'armstrip', $this))
|
||||||
}
|
}
|
||||||
|
|
||||||
$this.armbus = @()
|
$this.armbus = @()
|
||||||
0..($remote.kind.p_out + $remote.kind.v_out - 1) | ForEach-Object {
|
$busCount = $($remote.kind.p_out + $remote.kind.v_out)
|
||||||
$this.armbus.Add([RecorderArmBus]::new($_, $remote))
|
for ($i = 0; $i -lt $busCount; $i++) {
|
||||||
|
$this.armbus.Add([BoolArrayMember]::new($i, 'armbus', $this))
|
||||||
}
|
}
|
||||||
|
|
||||||
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
|
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
|
||||||
@ -96,6 +100,26 @@ class Recorder : IRemote {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
hidden $_armedbus = $($this | Add-Member ScriptProperty 'armedbus' `
|
||||||
|
{
|
||||||
|
foreach ($bus in 0..$($this.remote.kind.p_out + $this.remote.kind.v_out - 1)) {
|
||||||
|
if ($this.remote.Getter("Recorder.ArmBus[$bus]")) {
|
||||||
|
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._armedbus = $this.remote.Setter("Recorder.ArmBus[$arg]", 1)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Warning ("Expected a bus index between 0 and $busMax")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
[void] Load ([string]$filename) {
|
[void] Load ([string]$filename) {
|
||||||
$this.Setter('load', $filename)
|
$this.Setter('load', $filename)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,6 +160,20 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
|||||||
It 'Should set and get Recorder.loop' {
|
It 'Should set and get Recorder.loop' {
|
||||||
$vmr.recorder.loop = $value
|
$vmr.recorder.loop = $value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It 'Should set and get Recorder.armstrip[i]' -ForEach @(
|
||||||
|
@{ Index = $phys_in }, @{ Index = $virt_in }
|
||||||
|
) {
|
||||||
|
$vmr.recorder.armstrip[$index].set($value)
|
||||||
|
$vmr.recorder.armstrip[$index].get() | Should -Be $value
|
||||||
|
}
|
||||||
|
|
||||||
|
It 'Should set and get Recorder.armbus[i]' -ForEach @(
|
||||||
|
@{ Index = $phys_out }, @{ Index = $virt_out }
|
||||||
|
) {
|
||||||
|
$vmr.recorder.armbus[$index].set($value)
|
||||||
|
$vmr.recorder.armbus[$index].get() | Should -Be $value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context 'Command' {
|
Context 'Command' {
|
||||||
@ -603,6 +617,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Context 'Recorder' -Skip:$ifBasic {
|
||||||
|
It 'Should set and get Recorder.armedbus' -ForEach @(
|
||||||
|
@{ Value = $phys_out }, @{ Value = $virt_out }
|
||||||
|
) {
|
||||||
|
$vmr.recorder.armedbus = $value
|
||||||
|
$vmr.recorder.armedbus | Should -Be $value
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe 'String Tests' -Tag 'string' {
|
Describe 'String Tests' -Tag 'string' {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user