rename some of the internal classes

RecorderMode class added to Recorder

RunMacrobuttons() and CloseMacrobuttons() added to Special (Command)
This commit is contained in:
2023-08-12 01:40:29 +01:00
parent 5bda43131b
commit bee52b6541
7 changed files with 79 additions and 49 deletions

View File

@@ -1,21 +1,10 @@
. $PSScriptRoot\meta.ps1
class Recorder {
class IRecorder {
[Object]$remote
Recorder ([Object]$remote) {
IRecorder ([Object]$remote) {
$this.remote = $remote
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
AddChannelMembers
}
[string] identifier () {
return "Recorder"
}
[string] ToString() {
return $this.GetType().Name
}
[single] Getter ($param) {
@@ -29,15 +18,36 @@ class Recorder {
else {
Param_Set -PARAM "$($this.identifier()).$param" -Value $val
}
}
}
class Recorder : IRecorder {
[Object]$remote
[Object]$mode
Recorder ([Object]$remote) : base ($remote) {
$this.remote = $remote
$this.mode = [RecorderMode]::new($remote)
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
AddChannelMembers
}
[string] identifier () {
return "Recorder"
}
[string] ToString() {
return $this.GetType().Name
}
hidden $_loop = $($this | Add-Member ScriptProperty 'loop' `
{
return Write-Warning ("ERROR: $($this.identifier()).mode.loop is write only")
[bool]$this.mode.loop
} `
{
param([bool]$arg)
$this._loop = $this.Setter('mode.loop', $arg)
param($arg)
$this.mode.loop = $arg
}
)
@@ -46,6 +56,16 @@ class Recorder {
}
}
class RecorderMode : IRecorder {
RecorderMode ([Object]$remote) : base ($remote) {
AddBoolMembers -PARAMS @('loop')
}
[string] identifier () {
return "Recorder.Mode"
}
}
function Make_Recorder ([Object]$remote) {
return [Recorder]::new($remote)
}