2022-01-19 21:52:59 +00:00
|
|
|
class Special {
|
2023-08-12 03:09:23 +01:00
|
|
|
[Object]$remote
|
|
|
|
|
|
|
|
Special ([Object]$remote) {
|
2022-03-08 23:03:35 +00:00
|
|
|
AddActionMembers -PARAMS @('restart', 'shutdown', 'show')
|
2023-08-12 03:09:23 +01:00
|
|
|
|
|
|
|
$this.remote = $remote
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-12-16 17:27:05 +00:00
|
|
|
[string] identifier () {
|
|
|
|
return "Command"
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] ToString() {
|
|
|
|
return $this.GetType().Name
|
|
|
|
}
|
|
|
|
|
2022-12-16 17:27:05 +00:00
|
|
|
[single] Getter ($param) {
|
2023-08-12 03:09:23 +01:00
|
|
|
return $this.remote.Getter("$($this.identifier()).$param")
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] Setter ($param, $val) {
|
2022-03-08 23:03:35 +00:00
|
|
|
if ($val -is [Boolean]) {
|
2023-08-12 03:09:23 +01:00
|
|
|
$this.remote.Setter("$($this.identifier()).$param", $(if ($val) { 1 } else { 0 }))
|
2022-03-08 23:03:35 +00:00
|
|
|
}
|
|
|
|
else {
|
2023-08-12 03:09:23 +01:00
|
|
|
$this.remote.Setter("$($this.identifier()).$param", $val)
|
2022-03-08 23:03:35 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-23 15:24:05 +01:00
|
|
|
|
2023-08-12 01:40:29 +01:00
|
|
|
[void] RunMacrobuttons() {
|
2023-08-16 02:52:12 +01:00
|
|
|
"Launching the MacroButtons app" | Write-Verbose
|
|
|
|
Start-Process -FilePath $(Join-Path -Path $this.remote.vmpath -ChildPath "VoicemeeterMacroButtons.exe")
|
2023-08-12 01:40:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[void] CloseMacrobuttons() {
|
2023-08-16 02:52:12 +01:00
|
|
|
"Closing the MacroButtons app" | Write-Verbose
|
2023-08-12 01:40:29 +01:00
|
|
|
Stop-Process -Name "VoicemeeterMacroButtons"
|
|
|
|
}
|
|
|
|
|
2022-03-08 23:03:35 +00:00
|
|
|
hidden $_hide = $($this | Add-Member ScriptProperty 'hide' `
|
|
|
|
{
|
2022-12-16 17:27:05 +00:00
|
|
|
$this._hide = $this.Setter('show', $false)
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2022-03-08 23:03:35 +00:00
|
|
|
{}
|
|
|
|
)
|
|
|
|
|
2021-08-23 15:24:05 +01:00
|
|
|
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
|
|
|
{
|
2022-12-16 17:27:05 +00:00
|
|
|
$this.Getter('DialogShow.VBANCHAT')
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2021-08-23 15:24:05 +01:00
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
param([bool]$arg)
|
2022-12-16 17:27:05 +00:00
|
|
|
$this._showvbanchat = $this.Setter('DialogShow.VBANCHAT', $arg)
|
2022-01-09 14:24:09 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
hidden $_lock = $($this | Add-Member ScriptProperty 'lock' `
|
|
|
|
{
|
2022-12-16 17:27:05 +00:00
|
|
|
$this._lock = $this.Getter('lock')
|
2022-10-27 21:20:03 +01:00
|
|
|
} `
|
2022-01-09 14:24:09 +00:00
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
param([bool]$arg)
|
2022-12-16 17:27:05 +00:00
|
|
|
$this._lock = $this.Setter('lock', $arg)
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
)
|
2022-12-14 19:37:11 +00:00
|
|
|
|
|
|
|
[void] Load ([string]$filename) {
|
2022-12-16 17:27:05 +00:00
|
|
|
$this.Setter('load', $filename)
|
2022-12-14 19:37:11 +00:00
|
|
|
}
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|
|
|
|
|
2023-08-12 03:09:23 +01:00
|
|
|
function Make_Command([Object]$remote) {
|
|
|
|
return [Special]::new($remote)
|
2021-08-23 15:24:05 +01:00
|
|
|
}
|