mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-08 00:53:30 +00:00
Initial commit
Initial commit Added readme
This commit is contained in:
76
lib/macrobuttons.ps1
Normal file
76
lib/macrobuttons.ps1
Normal file
@@ -0,0 +1,76 @@
|
||||
class MacroButton {
|
||||
[int32]$id
|
||||
|
||||
# Constructor
|
||||
MacroButton ([Int]$id)
|
||||
{
|
||||
$this.id = $id
|
||||
}
|
||||
|
||||
[void] Setter($set, $mode) {
|
||||
MB_Set -ID $this.id -SET $set -MODE $mode
|
||||
}
|
||||
|
||||
[int] Getter($mode) {
|
||||
return MB_Get -ID $this.id -MODE $mode
|
||||
}
|
||||
|
||||
hidden $_state = $($this | Add-Member ScriptProperty 'state' `
|
||||
{
|
||||
# get
|
||||
$this.Getter(1)
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( $arg )
|
||||
$this._state = $this.Setter($arg, 1)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_stateonly = $($this | Add-Member ScriptProperty 'stateonly' `
|
||||
{
|
||||
# get
|
||||
$this.Getter(2)
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( $arg )
|
||||
$this._stateonly = $this.Setter($arg, 2)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_trigger = $($this | Add-Member ScriptProperty 'trigger' `
|
||||
{
|
||||
# get
|
||||
$this.Getter(3)
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( $arg )
|
||||
$this._trigger = $this.Setter($arg, 3)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Function Buttons {
|
||||
[System.Collections.ArrayList]$button = @()
|
||||
0..69 | ForEach-Object {
|
||||
[void]$button.Add([MacroButton]::new($_))
|
||||
}
|
||||
$button
|
||||
}
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
|
||||
Login
|
||||
|
||||
$button = Buttons
|
||||
|
||||
$button[0].state = 1
|
||||
$button[0].state
|
||||
$button[0].state = 0
|
||||
$button[0].state
|
||||
|
||||
Logout
|
||||
}
|
||||
Reference in New Issue
Block a user