mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
debug statements added to getters and setters
made some rearrangements to the dot sourcing ButtonTypes enum added to macrobuttons.ps1 login string now includes version number Test-RegistryValue added to inst.ps1
This commit is contained in:
26
lib/bus.ps1
26
lib/bus.ps1
@@ -1,5 +1,3 @@
|
||||
. $PSScriptRoot\meta.ps1
|
||||
|
||||
class IBus {
|
||||
[int]$index
|
||||
[Object]$remote
|
||||
@@ -13,20 +11,26 @@ class IBus {
|
||||
return "Bus[" + $this.index + "]"
|
||||
}
|
||||
|
||||
[string] ToString() {
|
||||
return $this.GetType().Name + $this.index
|
||||
}
|
||||
|
||||
[single] Getter ($param) {
|
||||
return $this.remote.Getter("$($this.identifier()).$param")
|
||||
$this.ToString() + " Getter: $($this.Cmd($param))" | Write-Debug
|
||||
return $this.remote.Getter($this.Cmd($param))
|
||||
}
|
||||
|
||||
[string] Getter_String ($param) {
|
||||
return $this.remote.Getter_String("$($this.identifier()).$param")
|
||||
$this.ToString() + " Getter_String: $($this.Cmd($param))" | Write-Debug
|
||||
return $this.remote.Getter_String($this.Cmd($param))
|
||||
}
|
||||
|
||||
[void] Setter ($param, $val) {
|
||||
$this.remote.Setter("$($this.identifier()).$param", $val)
|
||||
$this.ToString() + " Setter: $($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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +49,10 @@ class Bus : IBus {
|
||||
$this.levels = [BusLevels]::new($index, $remote)
|
||||
}
|
||||
|
||||
[string] ToString() {
|
||||
return $this.GetType().Name + $this.index
|
||||
}
|
||||
|
||||
[void] FadeTo ([single]$target, [int]$time) {
|
||||
$this.Setter('FadeTo', "($target, $time)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user