mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-25 05:57:47 +00:00
pass parent object references to EqChannel and EqCell
This commit is contained in:
parent
8679b4199f
commit
21eab2e528
16
lib/io.ps1
16
lib/io.ps1
@ -64,30 +64,30 @@ class IOEq : IRemote {
|
||||
|
||||
class EqChannel : IRemote {
|
||||
[System.Collections.ArrayList]$cell
|
||||
[string]$eqId
|
||||
[Object]$eq
|
||||
|
||||
EqChannel ([int]$index, [Object]$eq) : base ($index, $eq.remote) {
|
||||
$this.eqId = $eq.identifier()
|
||||
$this.eq = $eq
|
||||
|
||||
if ($eq.kindOfEq -eq 'Bus') { AddFloatMembers -PARAMS @('trim', 'delay') }
|
||||
|
||||
$this.cell = @()
|
||||
$cellCount = $this.remote.kind.cells
|
||||
for ($c = 0; $c -lt $cellCount; $c++) {
|
||||
$this.cell.Add([EqCell]::new($c, $this.remote, $this.identifier()))
|
||||
$this.cell.Add([EqCell]::new($c, $this))
|
||||
}
|
||||
}
|
||||
|
||||
[string] identifier () {
|
||||
return '{0}.Channel[{1}]' -f $this.eqId, $this.index
|
||||
return '{0}.Channel[{1}]' -f $this.eq.identifier(), $this.index
|
||||
}
|
||||
}
|
||||
|
||||
class EqCell : IRemote {
|
||||
[string]$channelId
|
||||
[Object]$channel
|
||||
|
||||
EqCell ([int]$index, [Object]$remote, [string]$channelId) : base ($index, $remote) {
|
||||
$this.channelId = $channelId
|
||||
EqCell ([int]$index, [Object]$channel) : base ($index, $channel.remote) {
|
||||
$this.channel = $channel
|
||||
|
||||
AddBoolMembers -PARAMS @('on')
|
||||
AddIntMembers -PARAMS @('type')
|
||||
@ -95,7 +95,7 @@ class EqCell : IRemote {
|
||||
}
|
||||
|
||||
[string] identifier () {
|
||||
return '{0}.Cell[{1}]' -f $this.channelId, $this.index
|
||||
return '{0}.Cell[{1}]' -f $this.channel.identifier(), $this.index
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user