diff --git a/lib/Voicemeeter.psm1 b/lib/Voicemeeter.psm1 index 5ee04d7..f8962ae 100644 --- a/lib/Voicemeeter.psm1 +++ b/lib/Voicemeeter.psm1 @@ -7,6 +7,7 @@ class Remote { [System.Collections.ArrayList]$button [PSCustomObject]$vban [Object]$command + [Object]$recorder [Object]$profiles # Constructor @@ -26,6 +27,7 @@ class Remote { $this.button = Make_Buttons $this.vban = Make_Vban $this.command = Make_Command + $this.recorder = Make_Recorder } else { Exit } } diff --git a/lib/base.ps1 b/lib/base.ps1 index 835c0e0..cd66b9f 100644 --- a/lib/base.ps1 +++ b/lib/base.ps1 @@ -5,6 +5,7 @@ . $PSScriptRoot\macrobuttons.ps1 . $PSScriptRoot\vban.ps1 . $PSScriptRoot\command.ps1 +. $PSScriptRoot\recorder.ps1 $global:layout = $null diff --git a/lib/recorder.ps1 b/lib/recorder.ps1 new file mode 100644 index 0000000..ab2f823 --- /dev/null +++ b/lib/recorder.ps1 @@ -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() +}