diff --git a/CHANGELOG.md b/CHANGELOG.md index b13bd15..1b0307e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ AddActionMembers now adds ScriptMethods instead of ScriptProperties: Deprecated Recorder.Loop removed: use Recorder.Mode.Loop Recorder.FileType changed from method to write-only property +Strip Gainlayers are now FloatArrayMember objects, see README for details + ### Added - IRemote base class diff --git a/README.md b/README.md index 00d6e14..6d2460b 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,6 @@ The following strip commands are available: - postdelay: bool - postfx1: bool - postfx2: bool -- gainlayer0-gainlayer7: float - eqgain1/bass/low: float, from -12.00 to 12.00 - eqgain2/mid/med: float, from -12.00 to 12.00 - eqgain3/treble/high: float, from -12.00 to 12.00 @@ -148,7 +147,6 @@ The following strip commands are available: for example: ```powershell -$vmr.strip[5].gainlayer1 = -8.3 ``` A,B commands depend on Voicemeeter type. @@ -235,6 +233,19 @@ for example: $vmr.strip[1].audibility.knob = 2.66 ``` +#### Gainlayer[i] + +The following strip.gainlayer[i] methods are available: + +- Set($val) : float, from -60.00 to 12.00 +- Get() + +for example: + +```powershell +$vmr.strip[4].gainlayer[7].set(-26.81) +``` + #### AppGain | AppMute - AppGain($appname or $appindex, $gain) : string or int, float, from 0.00 to 1.00 diff --git a/lib/kinds.ps1 b/lib/kinds.ps1 index 059ae38..6f8e98f 100644 --- a/lib/kinds.ps1 +++ b/lib/kinds.ps1 @@ -12,6 +12,7 @@ $KindMap = @{ 'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 0 } 'cells' = 0 + 'gainlayer' = 0 }; 'banana' = @{ 'name' = 'banana' @@ -26,6 +27,7 @@ $KindMap = @{ 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 8 } 'cells' = 6 + 'gainlayer' = 0 }; 'potato' = @{ 'name' = 'potato' @@ -40,6 +42,7 @@ $KindMap = @{ 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'eq_ch' = @{ 'strip' = 2; 'bus' = 8 } 'cells' = 6 + 'gainlayer' = 8 }; } diff --git a/lib/meta.ps1 b/lib/meta.ps1 index e44220f..9d79186 100644 --- a/lib/meta.ps1 +++ b/lib/meta.ps1 @@ -96,21 +96,6 @@ function AddChannelMembers () { AddBoolMembers -PARAMS $channels } -function AddGainlayerMembers () { - [hashtable]$Signatures = @{} - 0..7 | ForEach-Object { - # Define getter - $Signatures['Getter'] = "`$this.Getter('gainlayer[{0}]')" -f $_ - # Define setter - $Signatures['Setter'] = "param ( [Single]`$arg )`n`$this.Setter('gainlayer[{0}]', `$arg)" ` - -f $_ - $param = 'gainlayer{0}' -f $_ - $null = $param - - Addmember - } -} - function Addmember { $AddMemberParams = @{ Name = $param diff --git a/lib/strip.ps1 b/lib/strip.ps1 index cdd2136..ec4f275 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -1,4 +1,5 @@ class Strip : IRemote { + [System.Collections.ArrayList]$gainlayer [Object]$levels Strip ([int]$index, [Object]$remote) : base ($index, $remote) { @@ -7,9 +8,13 @@ class Strip : IRemote { AddStringMembers -PARAMS @('label') AddChannelMembers - AddGainlayerMembers $this.levels = [StripLevels]::new($index, $remote) + + $this.gainlayer = @() + for ($i = 0; $i -lt $remote.kind.gainlayer; $i++) { + $this.gainlayer.Add([FloatArrayMember]::new($i, 'gainlayer', $this)) + } } [string] identifier () { diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 3ec131c..513b28e 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -286,6 +286,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { $vmr.strip[$index].limit = $gain $vmr.strip[$index].limit | Should -Be $gain } + + Context 'Gainlayers' -Skip:$ifNotPotato -ForEach @( + @{ Layer = $phys_out }, @{ Layer = $virt_out } + ) { + It "Should set Strip[$index].Gainlayer[$layer]" { + $vmr.strip[$index].gainlayer[$layer].set($gain) + $vmr.strip[$index].gainlayer[$layer].get() | Should -Be $gain + } + } } Context 'Strip, physical only' -ForEach @(