diff --git a/lib/Voicemeeter.psm1 b/lib/Voicemeeter.psm1 index 42b0762..b786667 100644 --- a/lib/Voicemeeter.psm1 +++ b/lib/Voicemeeter.psm1 @@ -5,6 +5,7 @@ . $PSScriptRoot\iremote.ps1 . $PSScriptRoot\arraymember.ps1 . $PSScriptRoot\device.ps1 +. $PSScriptRoot\eq.ps1 . $PSScriptRoot\strip.ps1 . $PSScriptRoot\bus.ps1 . $PSScriptRoot\macrobuttons.ps1 diff --git a/lib/bus.ps1 b/lib/bus.ps1 index bd0ac15..03fe3b1 100644 --- a/lib/bus.ps1 +++ b/lib/bus.ps1 @@ -83,13 +83,8 @@ class BusMode : IRemote { } } -class BusEq : IRemote { - BusEq ([int]$index, [Object]$remote) : base ($index, $remote) { - AddBoolMembers -PARAMS @('on', 'ab') - } - - [string] identifier () { - return 'Bus[' + $this.index + '].EQ' +class BusEq : Eq { + BusEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Bus', $remote.kind.bus_ch) { } } diff --git a/lib/eq.ps1 b/lib/eq.ps1 index bf2162c..13b11e5 100644 --- a/lib/eq.ps1 +++ b/lib/eq.ps1 @@ -2,15 +2,19 @@ class Eq : IRemote { [System.Collections.ArrayList]$channel [string]$prefix - Eq ([string]$prefix, [int]$chCount, [Object]$parent) : base ($parent.index, $parent.remote) { + Eq ([int]$index, [Object]$remote, [string]$prefix, [int]$chCount) : base ($index, $remote) { + $this.prefix = $prefix + AddBoolMembers -PARAMS @('on', 'ab') $this.channel = @() for ($ch = 0; $ch -lt $chCount; $ch++) { - $this.channel.Add([EqChannel]::new($ch, $this)) + $this.channel.Add([EqChannel]::new($ch, $remote, $this.identifier())) } + } - $this.prefix = $prefix + [string] identifier () { + return '{0}[{1}].EQ' -f $this.prefix, $this.index } [void] Load ([string]$filename) { @@ -28,13 +32,13 @@ class EqChannel : IRemote { [System.Collections.ArrayList]$cell [string]$eqId - EqChannel ([int]$index, [Object]$eq) : base ($index, $eq.remote) { - $this.eqId = $eq.identifier() + EqChannel ([int]$index, [Object]$remote, [string]$eqId) : base ($index, $remote) { + $this.eqId = $eqId $this.cell = @() $cellCount = $this.remote.kind.cells for ($c = 0; $c -lt $cellCount; $c++) { - $this.cell.Add([EqCell]::new($c, $this)) + $this.cell.Add([EqCell]::new($c, $remote, $this.identifier())) } } @@ -46,8 +50,8 @@ class EqChannel : IRemote { class EqCell : IRemote { [string]$channelId - EqCell ([int]$index, [Object]$channel) : base ($index, $channel.remote) { - $this.channelId = $channel.identifier() + EqCell ([int]$index, [Object]$remote, [string]$channelId) : base ($index, $remote) { + $this.channelId = $channelId AddBoolMembers -PARAMS @('on') AddIntMembers -PARAMS @('type') diff --git a/lib/kinds.ps1 b/lib/kinds.ps1 index e2cc224..27766e8 100644 --- a/lib/kinds.ps1 +++ b/lib/kinds.ps1 @@ -11,6 +11,9 @@ $KindMap = @{ 'insert' = 0 'vban_in' = 4 'vban_out' = 4 + 'strip_ch' = 0 + 'bus_ch' = 0 + 'cells' = 0 }; 'banana' = @{ 'name' = 'banana' @@ -24,6 +27,9 @@ $KindMap = @{ 'insert' = 22 'vban_in' = 8 'vban_out' = 8 + 'strip_ch' = 0 + 'bus_ch' = 8 + 'cells' = 6 }; 'potato' = @{ 'name' = 'potato' @@ -37,6 +43,9 @@ $KindMap = @{ 'insert' = 34 'vban_in' = 8 'vban_out' = 8 + 'strip_ch' = 2 + 'bus_ch' = 8 + 'cells' = 6 }; } diff --git a/lib/strip.ps1 b/lib/strip.ps1 index ef16163..b73aecb 100644 --- a/lib/strip.ps1 +++ b/lib/strip.ps1 @@ -152,13 +152,8 @@ class StripDenoiser : IRemote { ) } -class StripEq : IRemote { - StripEq ([int]$index, [Object]$remote) : base ($index, $remote) { - AddBoolMembers -PARAMS @('on', 'ab') - } - - [string] identifier () { - return 'Strip[' + $this.index + '].EQ' +class StripEq : Eq { + StripEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Strip', $remote.kind.strip_ch) { } }