limit, alias members

- limit [int] -> [float]
- moved mono bool member to physicalstrip
- added AddAliasMembers meta function
- mono and karaoke aliases added to virtualstrip

prelim pester tests for potato pass
This commit is contained in:
pblivingston 2025-12-07 02:20:30 -05:00
parent 46584236d4
commit 6d511d8aa6
5 changed files with 53 additions and 17 deletions

View File

@ -43,6 +43,8 @@ Recorder.FileType changed from method to write-only property
- Command.Save($filepath)
- Command.StorePreset()
- Command.RecallPreset()
- AddAliasMembers meta function takes a hashtable `-MAP` of `alias = property`
- Strip.Karaoke alias for Strip.K
### Changed
@ -58,6 +60,7 @@ Recorder.FileType changed from method to write-only property
- Recorder.Armstrip|Armbus -> BoolArrayMember: now have .Get()
- Cast Recorder getters to types for consistency
- Floats getters/setters now default to two decimal places.
- Strip.Mono is now an alias for Strip.MC on virtual strips
### Fixed
@ -69,6 +72,7 @@ Recorder.FileType changed from method to write-only property
- vban route range (API documentation is incorrect)
- vban.stream.sr: $this._port -> $this._sr
- Recorder.channel values: 1..8 -> (2, 4, 6, 8)
- Strip.Limit type [int] -> [float]
## [3.3.0] - 2024-06-29

View File

@ -118,11 +118,11 @@ The following strip commands are available:
- mute: bool
- mono: bool
- mc: bool
- k: int, from 0 to 4
- k/karaoke: int, from 0 to 4
- solo: bool
- A1-A5: bool
- B1-B3: bool
- limit: int, from -40 to 12
- limit: float, from -40.00 to 12.00
- gain: float, from -60.00 to 12.00
- label: string
- reverb: float, from 0.00 to 10.00

View File

@ -74,6 +74,16 @@ function AddActionMembers () {
}
}
function AddAliasMembers () {
param(
[hashtable]$MAP
)
foreach ($alias in $MAP.Keys) {
$this | Add-Member -MemberType AliasProperty -Name $alias `
-Value $MAP[$alias] -Force
}
}
function AddChannelMembers () {
$num_A = $this.remote.kind.p_out
$num_B = $this.remote.kind.v_out

View File

@ -2,9 +2,8 @@ class Strip : IRemote {
[Object]$levels
Strip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('mono', 'solo', 'mute')
AddIntMembers -PARAMS @('limit')
AddFloatMembers -PARAMS @('gain', 'pan_x', 'pan_y')
AddBoolMembers -PARAMS @('solo', 'mute')
AddFloatMembers -PARAMS @('gain', 'limit', 'pan_x', 'pan_y')
AddStringMembers -PARAMS @('label')
AddChannelMembers
@ -83,6 +82,7 @@ class PhysicalStrip : Strip {
AddFloatMembers -PARAMS @('color_x', 'color_y', 'fx_x', 'fx_y')
AddFloatMembers -PARAMS @('reverb', 'delay', 'fx1', 'fx2')
AddBoolMembers -PARAMS @('postreverb', 'postdelay', 'postfx1', 'postfx2')
AddBoolMembers -PARAMS @('mono')
$this.comp = [StripComp]::new($index, $remote)
$this.gate = [StripGate]::new($index, $remote)
@ -174,6 +174,8 @@ class VirtualStrip : Strip {
VirtualStrip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('mc')
AddIntMembers -PARAMS @('k')
AddAliasMembers -MAP @{ mono = 'mc'; karaoke = 'k' }
}
[void] AppGain ([string]$appname, [single]$gain) {

View File

@ -30,6 +30,11 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in }
) {
It "Should set Strip[$index].Mono" {
$vmr.strip[$index].mono = $value
$vmr.strip[$index].mono | Should -Be $expected
}
Context 'Eq' -Skip:$ifNotPotato -ForEach @(
@{ Eq = $vmr.strip[$index].eq }
) {
@ -50,6 +55,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
}
}
Context 'Strip, first virtual' -ForEach @(
@{ Index = $phys_in + 1 }
) {
It "Should set Strip[$index].MC via alias 'Mono'" {
$vmr.strip[$index].mono = $value
$vmr.strip[$index].mc | Should -Be $expected
}
}
Context 'Bus, one physical one virtual' -ForEach @(
@{ Index = $phys_out }, @{ Index = $virt_out }
) {
@ -255,6 +269,11 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.strip[$index].gain = $gain
$vmr.strip[$index].gain | Should -Be $gain
}
It "Should set Strip[$index].Limit" -Skip:$ifBasic {
$vmr.strip[$index].limit = $gain
$vmr.strip[$index].limit | Should -Be $gain
}
}
Context 'Strip, physical only' -ForEach @(
@ -362,18 +381,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
}
Describe 'Int Tests' -Tag 'int' {
Context 'Strip, one physical, one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in }
) {
It "Should set and get Strip[$index].Limit" -Skip:$ifBasic -ForEach @(
@{ Value = 3; Expected = 3 }
@{ Value = -6; Expected = -6 }
) {
$vmr.strip[$index].limit = $value
$vmr.strip[$index].limit | Should -Be $expected
}
}
Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in }
) {
@ -395,6 +402,19 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
}
}
Context 'Strip, second virtual' -Skip:$ifBasic -ForEach @(
@{ Index = $phys_in + 2 }
) {
It "Should set Strip[$index].K via alias 'Karaoke'" -ForEach @(
@{ Value = 0; Expected = 0 }
@{ Value = 2; Expected = 2 }
@{ Value = 4; Expected = 4 }
) {
$vmr.strip[$index].karaoke = $value
$vmr.strip[$index].k | Should -Be $expected
}
}
Context 'Bus, one physical one virtual' -ForEach @(
@{ Index = $phys_out }, @{ Index = $virt_out }
) {