gainlayers

gainlayers are now FloatArrayMember objects - this is a breaking change

prelim pester tests for potato pass
This commit is contained in:
pblivingston 2025-12-08 14:49:15 -05:00
parent a5bade4fbb
commit ac3e36838e
6 changed files with 33 additions and 18 deletions

View File

@ -18,6 +18,8 @@ AddActionMembers now adds ScriptMethods instead of ScriptProperties:
Deprecated Recorder.Loop removed: use Recorder.Mode.Loop Deprecated Recorder.Loop removed: use Recorder.Mode.Loop
Recorder.FileType changed from method to write-only property Recorder.FileType changed from method to write-only property
Strip Gainlayers are now FloatArrayMember objects, see README for details
### Added ### Added
- IRemote base class - IRemote base class

View File

@ -140,7 +140,6 @@ The following strip commands are available:
- postdelay: bool - postdelay: bool
- postfx1: bool - postfx1: bool
- postfx2: bool - postfx2: bool
- gainlayer0-gainlayer7: float
- eqgain1/bass/low: float, from -12.00 to 12.00 - eqgain1/bass/low: float, from -12.00 to 12.00
- eqgain2/mid/med: 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 - eqgain3/treble/high: float, from -12.00 to 12.00
@ -148,7 +147,6 @@ The following strip commands are available:
for example: for example:
```powershell ```powershell
$vmr.strip[5].gainlayer1 = -8.3
``` ```
A,B commands depend on Voicemeeter type. A,B commands depend on Voicemeeter type.
@ -235,6 +233,19 @@ for example:
$vmr.strip[1].audibility.knob = 2.66 $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 | AppMute
- AppGain($appname or $appindex, $gain) : string or int, float, from 0.00 to 1.00 - AppGain($appname or $appindex, $gain) : string or int, float, from 0.00 to 1.00

View File

@ -12,6 +12,7 @@ $KindMap = @{
'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 0 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 0 }
'cells' = 0 'cells' = 0
'gainlayer' = 0
}; };
'banana' = @{ 'banana' = @{
'name' = 'banana' 'name' = 'banana'
@ -26,6 +27,7 @@ $KindMap = @{
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 0
}; };
'potato' = @{ 'potato' = @{
'name' = 'potato' 'name' = 'potato'
@ -40,6 +42,7 @@ $KindMap = @{
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 2; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 2; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 8
}; };
} }

View File

@ -96,21 +96,6 @@ function AddChannelMembers () {
AddBoolMembers -PARAMS $channels 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 { function Addmember {
$AddMemberParams = @{ $AddMemberParams = @{
Name = $param Name = $param

View File

@ -1,4 +1,5 @@
class Strip : IRemote { class Strip : IRemote {
[System.Collections.ArrayList]$gainlayer
[Object]$levels [Object]$levels
Strip ([int]$index, [Object]$remote) : base ($index, $remote) { Strip ([int]$index, [Object]$remote) : base ($index, $remote) {
@ -7,9 +8,13 @@ class Strip : IRemote {
AddStringMembers -PARAMS @('label') AddStringMembers -PARAMS @('label')
AddChannelMembers AddChannelMembers
AddGainlayerMembers
$this.levels = [StripLevels]::new($index, $remote) $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 () { [string] identifier () {

View File

@ -286,6 +286,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.strip[$index].limit = $gain $vmr.strip[$index].limit = $gain
$vmr.strip[$index].limit | Should -Be $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 @( Context 'Strip, physical only' -ForEach @(