xy and fx parameters added to strip/bus classes.

GetType, GetVersion, SendText added to Remote class.

Console output now written to Debug stream.

ToString() method overriden for higher classes.

formatter run through all files.
This commit is contained in:
onyx-and-iris
2022-10-27 21:20:03 +01:00
parent 7c60f564b2
commit 62c65e1c08
14 changed files with 331 additions and 258 deletions

View File

@@ -1,25 +1,29 @@
class MacroButton {
[int32]$id
[int32]$index
# Constructor
MacroButton ([Int]$id) {
$this.id = $id
MacroButton ([int]$index) {
$this.index = $index
}
[int] Getter($mode) {
return MB_Get -ID $this.id -MODE $mode
[string] ToString() {
return $this.GetType().Name + $this.index
}
[void] Setter($set, $mode) {
MB_Set -ID $this.id -SET $set -MODE $mode
[int] Getter ($mode) {
return MB_Get -Id $this.index -Mode $mode
}
[void] Setter ($set, $mode) {
MB_Set -Id $this.index -SET $set -Mode $mode
}
hidden $_state = $($this | Add-Member ScriptProperty 'state' `
{
$this.Getter(1)
}`
} `
{
param ( $arg )
param($arg)
$this._state = $this.Setter($arg, 1)
}
)
@@ -27,9 +31,9 @@ class MacroButton {
hidden $_stateonly = $($this | Add-Member ScriptProperty 'stateonly' `
{
$this.Getter(2)
}`
} `
{
param ( $arg )
param($arg)
$this._stateonly = $this.Setter($arg, 2)
}
)
@@ -37,15 +41,15 @@ class MacroButton {
hidden $_trigger = $($this | Add-Member ScriptProperty 'trigger' `
{
$this.Getter(3)
}`
} `
{
param ( $arg )
param($arg)
$this._trigger = $this.Setter($arg, 3)
}
)
}
Function Make_Buttons {
function Make_Buttons {
[System.Collections.ArrayList]$button = @()
0..79 | ForEach-Object {
[void]$button.Add([MacroButton]::new($_))