mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +00:00
8e03c4e53b
rename factory functions. class getters now send is_string parameter. each property type for each class now has separate meta function.
56 lines
1.1 KiB
PowerShell
56 lines
1.1 KiB
PowerShell
class MacroButton {
|
|
[int32]$id
|
|
|
|
# Constructor
|
|
MacroButton ([Int]$id)
|
|
{
|
|
$this.id = $id
|
|
}
|
|
|
|
[int] Getter($mode) {
|
|
return MB_Get -ID $this.id -MODE $mode
|
|
}
|
|
|
|
[void] Setter($set, $mode) {
|
|
MB_Set -ID $this.id -SET $set -MODE $mode
|
|
}
|
|
|
|
hidden $_state = $($this | Add-Member ScriptProperty 'state' `
|
|
{
|
|
$this.Getter(1)
|
|
}`
|
|
{
|
|
param ( $arg )
|
|
$this._state = $this.Setter($arg, 1)
|
|
}
|
|
)
|
|
|
|
hidden $_stateonly = $($this | Add-Member ScriptProperty 'stateonly' `
|
|
{
|
|
$this.Getter(2)
|
|
}`
|
|
{
|
|
param ( $arg )
|
|
$this._stateonly = $this.Setter($arg, 2)
|
|
}
|
|
)
|
|
|
|
hidden $_trigger = $($this | Add-Member ScriptProperty 'trigger' `
|
|
{
|
|
$this.Getter(3)
|
|
}`
|
|
{
|
|
param ( $arg )
|
|
$this._trigger = $this.Setter($arg, 3)
|
|
}
|
|
)
|
|
}
|
|
|
|
Function Make_Buttons {
|
|
[System.Collections.ArrayList]$button = @()
|
|
0..69 | ForEach-Object {
|
|
[void]$button.Add([MacroButton]::new($_))
|
|
}
|
|
$button
|
|
}
|