mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 21:30:46 +00:00
Update vban.ps1
vban is now a custom class of subclasses for each vban stream type.
This commit is contained in:
parent
2761ea9ffe
commit
a70843385f
46
lib/vban.ps1
46
lib/vban.ps1
@ -4,10 +4,8 @@ class Vban {
|
|||||||
[Array]$stringparams
|
[Array]$stringparams
|
||||||
|
|
||||||
# Constructor
|
# Constructor
|
||||||
Vban ([Int]$id, [String]$direction)
|
Vban()
|
||||||
{
|
{
|
||||||
$this.id = $id
|
|
||||||
$this.direction = $direction
|
|
||||||
$this.stringparams = @('name', 'ip')
|
$this.stringparams = @('name', 'ip')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,18 +167,40 @@ class Vban {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Vban_In {
|
|
||||||
[System.Collections.ArrayList]$vban_in = @()
|
class VbanInstream : Vban {
|
||||||
0..$($layout.vban_in-1) | ForEach-Object {
|
# Constructor
|
||||||
[void]$vban_in.Add([Vban]::new($_, "in"))
|
VbanInstream ($id)
|
||||||
|
{
|
||||||
|
$this.id = $id
|
||||||
|
$this.direction = "in"
|
||||||
}
|
}
|
||||||
$vban_in
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Vban_Out {
|
|
||||||
[System.Collections.ArrayList]$vban_out = @()
|
class VbanOutstream : Vban {
|
||||||
0..$($layout.vban_out-1) | ForEach-Object {
|
# Constructor
|
||||||
[void]$vban_out.Add([Vban]::new($_, "out"))
|
VbanOutstream ($id)
|
||||||
|
{
|
||||||
|
$this.id = $id
|
||||||
|
$this.direction = "out"
|
||||||
}
|
}
|
||||||
$vban_out
|
}
|
||||||
|
|
||||||
|
Function Vban {
|
||||||
|
[System.Collections.ArrayList]$instream = @()
|
||||||
|
[System.Collections.ArrayList]$outstream = @()
|
||||||
|
|
||||||
|
0..$($layout.vban_in-1) | ForEach-Object {
|
||||||
|
[void]$instream.Add([VbanInstream]::new($_))
|
||||||
|
}
|
||||||
|
0..$($layout.vban_out-1) | ForEach-Object {
|
||||||
|
[void]$outstream.Add([VbanOutstream]::new($_))
|
||||||
|
}
|
||||||
|
|
||||||
|
$obj = [PSCustomObject]@{
|
||||||
|
instream = $instream
|
||||||
|
outstream = $outstream
|
||||||
|
}
|
||||||
|
return $obj
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user