voicemeeter-api-powershell/lib/recorder.ps1

52 lines
1.2 KiB
PowerShell
Raw Normal View History

. $PSScriptRoot\meta.ps1
class Recorder {
[Object]$remote
2022-12-17 17:47:42 +00:00
Recorder ([Object]$remote) {
$this.remote = $remote
AddActionMembers -PARAMS @('play', 'stop', 'pause', 'replay', 'record', 'ff', 'rew')
AddChannelMembers
}
2022-12-16 17:29:04 +00:00
[string] identifier () {
return "Recorder"
}
[string] ToString() {
return $this.GetType().Name
}
2022-12-16 17:29:04 +00:00
[single] Getter ($param) {
return Param_Get -PARAM "$($this.identifier()).$param" -IS_STRING $false
}
[void] Setter ($param, $val) {
if ($val -is [Boolean]) {
2022-12-16 17:29:04 +00:00
Param_Set -PARAM "$($this.identifier()).$param" -Value $(if ($val) { 1 } else { 0 })
}
else {
2022-12-16 17:29:04 +00:00
Param_Set -PARAM "$($this.identifier()).$param" -Value $val
}
}
hidden $_loop = $($this | Add-Member ScriptProperty 'loop' `
{
2022-12-16 17:29:04 +00:00
return Write-Warning ("ERROR: $($this.identifier()).mode.loop is write only")
} `
{
param([bool]$arg)
2022-12-16 17:29:04 +00:00
$this._loop = $this.Setter('mode.loop', $arg)
}
)
[void] Load ([string]$filename) {
2022-12-16 17:29:04 +00:00
$this.Setter('load', $filename)
}
}
function Make_Recorder ([Object]$remote) {
return [Recorder]::new($remote)
}