2022-03-08 22:54:34 +00:00
|
|
|
. $PSScriptRoot\meta.ps1
|
|
|
|
|
|
|
|
class Recorder {
|
2022-06-25 23:12:02 +01:00
|
|
|
[Object]$remote
|
2022-03-08 22:54:34 +00:00
|
|
|
# Constructor
|
2022-10-27 21:20:03 +01:00
|
|
|
Recorder ([Object]$remote) {
|
2022-06-25 23:12:02 +01:00
|
|
|
$this.remote = $remote
|
2022-10-27 21:20:03 +01:00
|
|
|
|
2022-06-25 15:20:36 +01:00
|
|
|
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
|
2022-03-08 22:54:34 +00:00
|
|
|
AddChannelMembers
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] ToString() {
|
|
|
|
return $this.GetType().Name
|
|
|
|
}
|
|
|
|
|
|
|
|
[single] Getter ($cmd) {
|
2022-03-08 22:54:34 +00:00
|
|
|
return Param_Get -PARAM $cmd -IS_STRING $false
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] Setter ($param, $val) {
|
2022-03-08 22:54:34 +00:00
|
|
|
if ($val -is [Boolean]) {
|
2022-10-27 21:20:03 +01:00
|
|
|
Param_Set -PARAM $param -Value $(if ($val) { 1 } else { 0 })
|
2022-03-08 22:54:34 +00:00
|
|
|
}
|
|
|
|
else {
|
2022-10-27 21:20:03 +01:00
|
|
|
Param_Set -PARAM $param -Value $val
|
2022-03-08 22:54:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[string] cmd ($arg) {
|
2022-03-08 22:54:34 +00:00
|
|
|
return "Recorder.$arg"
|
|
|
|
}
|
|
|
|
|
|
|
|
hidden $_loop = $($this | Add-Member ScriptProperty 'loop' `
|
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
return Write-Warning ("ERROR: " + $this.cmd('mode.loop') + " is write only")
|
|
|
|
} `
|
2022-03-08 22:54:34 +00:00
|
|
|
{
|
2022-10-27 21:20:03 +01:00
|
|
|
param([bool]$arg)
|
2022-03-08 22:54:34 +00:00
|
|
|
$this._loop = $this.Setter($this.cmd('mode.loop'), $arg)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
[void] Load ([string]$filename) {
|
2022-03-08 22:54:34 +00:00
|
|
|
$this.Setter($this.cmd('load'), $filename)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function Make_Recorder ([Object]$remote) {
|
2022-06-25 23:12:02 +01:00
|
|
|
return [Recorder]::new($remote)
|
2022-03-08 22:54:34 +00:00
|
|
|
}
|