mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-05 05:07:47 +00:00
stripeq, buseq
- replace iremote with eq for stripeq and buseq - move identifier to eq - avoid passing entire parent objects
This commit is contained in:
parent
6154af7ad7
commit
60d97a89b4
@ -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
|
||||
|
||||
@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
20
lib/eq.ps1
20
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')
|
||||
|
||||
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user