mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-09 01:13:32 +00:00
add special commands
Added special commands: show restart showvbanchat shutdown Updated README and CHANGELOG to reflect changes. Minor version bump
This commit is contained in:
@@ -7,6 +7,7 @@ class Remote {
|
||||
[System.Collections.ArrayList]$bus
|
||||
[System.Collections.ArrayList]$vban_in
|
||||
[System.Collections.ArrayList]$vban_out
|
||||
$command
|
||||
|
||||
# Constructor
|
||||
Remote ([String]$type)
|
||||
@@ -24,6 +25,7 @@ class Remote {
|
||||
$this.bus = Buses
|
||||
$this.vban_in = Vban_In
|
||||
$this.vban_out = Vban_Out
|
||||
$this.command = Special
|
||||
}
|
||||
else { Exit }
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
. $PSScriptRoot\bus.ps1
|
||||
. $PSScriptRoot\macrobuttons.ps1
|
||||
. $PSScriptRoot\vban.ps1
|
||||
. $PSScriptRoot\special.ps1
|
||||
|
||||
$global:layout = $null
|
||||
|
||||
|
||||
49
lib/special.ps1
Normal file
49
lib/special.ps1
Normal file
@@ -0,0 +1,49 @@
|
||||
class Special {
|
||||
hidden AddPublicMembers($commands) {
|
||||
$commands | ForEach-Object {
|
||||
# Define getter
|
||||
# $GetterSignature = "`$this.Getter(`$this.cmd('{0}'))" -f $_
|
||||
# Define setter
|
||||
$SetterSignature = "`$this.Setter(`$this.cmd('{0}'))" -f $_
|
||||
|
||||
$AddMemberParams = @{
|
||||
Name = $_
|
||||
MemberType = 'ScriptProperty'
|
||||
Value = [ScriptBlock]::Create($SetterSignature)
|
||||
SecondValue = [ScriptBlock]::Create($SetterSignature)
|
||||
}
|
||||
$this | Add-Member @AddMemberParams
|
||||
}
|
||||
}
|
||||
|
||||
# Constructor
|
||||
Special()
|
||||
{
|
||||
$this.AddPublicMembers(@('restart', 'shutdown', 'show'))
|
||||
}
|
||||
|
||||
[String] Getter($param) {
|
||||
return Write-Warning("ERROR: " + $param + " is a write only parameter")
|
||||
}
|
||||
|
||||
[void] Setter($param) {
|
||||
Param_Set -PARAM $param -VALUE 1
|
||||
}
|
||||
|
||||
[String] cmd ($arg) {
|
||||
return "Command.$arg"
|
||||
}
|
||||
|
||||
hidden $_showvbanchat = $($this | Add-Member ScriptProperty 'showvbanchat' `
|
||||
{
|
||||
$this._showvbanchat = $this.Setter($this.cmd('DialogShow.VBANCHAT'))
|
||||
}`
|
||||
{
|
||||
$this._showvbanchat = $this.Setter($this.cmd('DialogShow.VBANCHAT'))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Function Special {
|
||||
return [Special]::new()
|
||||
}
|
||||
Reference in New Issue
Block a user