diff --git a/CHANGELOG.md b/CHANGELOG.md index 322be71..c0e74b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,9 @@ Recorder.FileType changed from method to write-only property - AddAliasMembers meta function takes a hashtable `-MAP` of `alias = property` - Strip.Karaoke alias for Strip.K - Strip.EQGain1|EQGain2|EQGain3 with bass/low, mid/med, treble/high aliases, respectively +- StripAudibility class with Strip.Audibility.Knob +- Strip.Denoiser.Threshold +- Strip.VAIO ### Changed @@ -63,6 +66,7 @@ Recorder.FileType changed from method to write-only property - Floats getters/setters now default to two decimal places. - Strip.Mono is now an alias for Strip.MC on virtual strips - Strip.AppMute|AppGain can now take an app index; see README for details +- Strip Knob setters: explicit $arg types for consistency ### Fixed @@ -76,6 +80,7 @@ Recorder.FileType changed from method to write-only property - Recorder.channel values: 1..8 -> (2, 4, 6, 8) - Strip.Limit type [int] -> [float] - Missing closing parenthesis in AppMute value string +- Strip Knob getters: `this.Getter_String('') -> [math]::Round($this.Getter(''), 2)` ## [3.3.0] - 2024-06-29 diff --git a/README.md b/README.md index 4cb2c73..b83d477 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ The following strip commands are available: - solo: bool - A1-A5: bool - B1-B3: bool +- vaio: bool - limit: float, from -40.00 to 12.00 - gain: float, from -60.00 to 12.00 - label: string @@ -199,6 +200,7 @@ $vmr.strip[3].gate.threshold = -40.5 The following strip.denoiser commands are available: - knob: float, from 0.00 to 10.00 +- threshold: float, from 0.00 to 10.00 for example: @@ -206,6 +208,18 @@ for example: $vmr.strip[3].denoiser.knob = 5 ``` +#### audibility + +The following strip.audibility commands are available: + +- knob: float, from 0.00 to 10.00 + +for example: + +```powershell +$vmr.strip[1].audibility.knob = 2.66 +``` + #### AppGain | AppMute - AppGain($appname or $appindex, $gain) : string or int, float, from 0.00 to 1.00 diff --git a/lib/strip.ps1 b/lib/strip.ps1 index 965941d..ddbcf8e 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -77,16 +77,18 @@ class PhysicalStrip : Strip { [Object]$denoiser [Object]$eq [Object]$device + [Object]$audibility PhysicalStrip ([int]$index, [Object]$remote) : base ($index, $remote) { 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') + AddBoolMembers -PARAMS @('mono', 'vaio') $this.comp = [StripComp]::new($index, $remote) $this.gate = [StripGate]::new($index, $remote) $this.denoiser = [StripDenoiser]::new($index, $remote) + $this.audibility = [StripAudibility]::new($index, $remote) $this.eq = [StripEq]::new($index, $remote) $this.device = [StripDevice]::new($index, $remote) } @@ -104,10 +106,10 @@ class StripComp : IRemote { hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` { - $this.Getter_String('') + [math]::Round($this.Getter(''), 2) } ` { - param($arg) + param([single]$arg) return $this.Setter('', $arg) } ) @@ -124,10 +126,10 @@ class StripGate : IRemote { hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` { - $this.Getter_String('') + [math]::Round($this.Getter(''), 2) } ` { - param($arg) + param([single]$arg) return $this.Setter('', $arg) } ) @@ -135,6 +137,7 @@ class StripGate : IRemote { class StripDenoiser : IRemote { StripDenoiser ([int]$index, [Object]$remote) : base ($index, $remote) { + AddFloatMembers -PARAMS @('threshold') } [string] identifier () { @@ -143,10 +146,29 @@ class StripDenoiser : IRemote { hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` { - $this.Getter_String('') + [math]::Round($this.Getter(''), 2) } ` { - param($arg) + param([single]$arg) + return $this.Setter('', $arg) + } + ) +} + +class StripAudibility : IRemote { + StripAudibility ([int]$index, [Object]$remote) : base ($index, $remote) { + } + + [string] identifier () { + return 'Strip[' + $this.index + '].Audibility' + } + + hidden $_knob = $($this | Add-Member ScriptProperty 'knob' ` + { + [math]::Round($this.Getter(''), 2) + } ` + { + param([single]$arg) return $this.Setter('', $arg) } ) diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 7bf8cad..d381d30 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -34,6 +34,11 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.strip[$index].mono = $value $vmr.strip[$index].mono | Should -Be $expected } + + It "Should set Strip[$index].VAIO" { + $vmr.strip[$index].vaio = $value + $vmr.strip[$index].vaio | Should -Be $expected + } Context 'Eq' -Skip:$ifNotPotato -ForEach @( @{ Eq = $vmr.strip[$index].eq } @@ -320,6 +325,18 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.strip[$index].denoiser.knob = $knob $vmr.strip[$index].denoiser.knob | Should -Be $knob } + + It "Should set Strip[$index].Denoiser.Threshold" { + $vmr.strip[$index].denoiser.threshold = $knob + $vmr.strip[$index].denoiser.threshold | Should -Be $knob + } + } + + Context 'Audibility' -Skip:$ifNotBasic { + It "Should set Strip[$index].Audibility" { + $vmr.strip[$index].audibility.knob = $knob + $vmr.strip[$index].audibility.knob | Should -Be $knob + } } Context 'EQ' -Skip:$ifNotPotato -ForEach @(