mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-05 05:07:47 +00:00
vban
implement iremote
This commit is contained in:
parent
62d9e89b5f
commit
78f7fc80d4
38
lib/vban.ps1
38
lib/vban.ps1
@ -1,11 +1,7 @@
|
||||
class IVban {
|
||||
[int32]$index
|
||||
[Object]$remote
|
||||
class Vban : IRemote {
|
||||
[string]$direction
|
||||
|
||||
IVban ([int]$index, [Object]$remote, [string]$direction) {
|
||||
$this.index = $index
|
||||
$this.remote = $remote
|
||||
Vban ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote) {
|
||||
$this.direction = $direction
|
||||
}
|
||||
|
||||
@ -13,36 +9,6 @@ class IVban {
|
||||
return 'vban.' + $this.direction + 'stream[' + $this.index + ']'
|
||||
}
|
||||
|
||||
[single] Getter ($param) {
|
||||
return $this.remote.Getter($this.Cmd($param))
|
||||
}
|
||||
|
||||
[string] Getter_String ($param) {
|
||||
$this.Cmd($param) | Write-Debug
|
||||
return $this.remote.Getter_String($this.Cmd($param))
|
||||
}
|
||||
|
||||
[void] Setter ($param, $val) {
|
||||
"$($this.Cmd($param))=$val" | Write-Debug
|
||||
$this.remote.Setter($this.Cmd($param), $val)
|
||||
}
|
||||
|
||||
[string] Cmd ($param) {
|
||||
if ([string]::IsNullOrEmpty($param)) {
|
||||
return $this.identifier()
|
||||
}
|
||||
return "$($this.identifier()).$param"
|
||||
}
|
||||
}
|
||||
|
||||
class Vban : IVban {
|
||||
Vban ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) {
|
||||
}
|
||||
|
||||
[string] ToString() {
|
||||
return $this.GetType().Name + $this.index
|
||||
}
|
||||
|
||||
hidden $_on = $($this | Add-Member ScriptProperty 'on' `
|
||||
{
|
||||
$this.Getter('on')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user