recorder module added.

recorder module added.
This commit is contained in:
onyx-and-iris 2022-03-08 22:54:34 +00:00
parent c7de3bbeef
commit cea6d500dd
3 changed files with 48 additions and 0 deletions

View File

@ -7,6 +7,7 @@ class Remote {
[System.Collections.ArrayList]$button [System.Collections.ArrayList]$button
[PSCustomObject]$vban [PSCustomObject]$vban
[Object]$command [Object]$command
[Object]$recorder
[Object]$profiles [Object]$profiles
# Constructor # Constructor
@ -26,6 +27,7 @@ class Remote {
$this.button = Make_Buttons $this.button = Make_Buttons
$this.vban = Make_Vban $this.vban = Make_Vban
$this.command = Make_Command $this.command = Make_Command
$this.recorder = Make_Recorder
} }
else { Exit } else { Exit }
} }

View File

@ -5,6 +5,7 @@
. $PSScriptRoot\macrobuttons.ps1 . $PSScriptRoot\macrobuttons.ps1
. $PSScriptRoot\vban.ps1 . $PSScriptRoot\vban.ps1
. $PSScriptRoot\command.ps1 . $PSScriptRoot\command.ps1
. $PSScriptRoot\recorder.ps1
$global:layout = $null $global:layout = $null

45
lib/recorder.ps1 Normal file
View File

@ -0,0 +1,45 @@
. $PSScriptRoot\meta.ps1
class Recorder {
# Constructor
Recorder()
{
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rw')
AddChannelMembers
}
[Single] Getter($cmd) {
return Param_Get -PARAM $cmd -IS_STRING $false
}
[void] Setter($param, $val) {
if ($val -is [Boolean]) {
Param_Set -PARAM $param -VALUE $(if ($val) {1} else {0})
}
else {
Param_Set -PARAM $param -VALUE $val
}
}
[String] cmd ($arg) {
return "Recorder.$arg"
}
hidden $_loop = $($this | Add-Member ScriptProperty 'loop' `
{
return Write-Warning("ERROR: " + $this.cmd('mode.loop') + " is write only")
}`
{
param( [bool]$arg )
$this._loop = $this.Setter($this.cmd('mode.loop'), $arg)
}
)
[void] load([String]$filename) {
$this.Setter($this.cmd('load'), $filename)
}
}
Function Make_Recorder {
return [Recorder]::new()
}