mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-12-05 05:07:47 +00:00
prefix, filetype
changed to write-only properties pester tests pass for all kinds
This commit is contained in:
parent
1d41be7396
commit
df86ad2175
@ -16,6 +16,7 @@ AddActionMembers now adds ScriptMethods instead of ScriptProperties:
|
||||
- See Recorder section of README for details on using playback/record actions
|
||||
|
||||
Deprecated Recorder.Loop removed: use Recorder.Mode.Loop
|
||||
Recorder.FileType changed from method to write-only property
|
||||
|
||||
### Added
|
||||
|
||||
@ -35,7 +36,7 @@ Deprecated Recorder.Loop removed: use Recorder.Mode.Loop
|
||||
- Bus.Mode.Set($mode)
|
||||
- Recorder.Armedbus
|
||||
- Recorder.PreRecTime
|
||||
- Recorder.Prefix($prefix)
|
||||
- Recorder.Prefix
|
||||
- Recorder.Eject() references 'Command.Eject'
|
||||
- Recorder.State
|
||||
|
||||
|
||||
@ -531,6 +531,8 @@ The following commands are available:
|
||||
- armedbus: int, from 0 to bus index
|
||||
- state: string, ('play', 'stop', 'record', 'pause')
|
||||
- prerectime: int, from 0 to 20 seconds
|
||||
- prefix: string, write-only
|
||||
- filetype: string, write-only, ('wav', 'aiff', 'bwf', 'mp3')
|
||||
- samplerate: int, (22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000)
|
||||
- bitresolution: int, (8, 16, 24, 32)
|
||||
- channel: int, (2, 4, 6, 8)
|
||||
@ -548,8 +550,6 @@ The following methods are available:
|
||||
- Eject()
|
||||
- Load($filepath): string
|
||||
- GoTo($timestring): string, must match the format 'hh:mm:ss'
|
||||
- FileType($format): string, ('wav', 'aiff', 'bwf', 'mp3')
|
||||
- Prefix($prefix): string
|
||||
|
||||
example:
|
||||
|
||||
|
||||
@ -41,22 +41,6 @@ class Recorder : IRemote {
|
||||
$this.Setter('load', $filename)
|
||||
}
|
||||
|
||||
[void] Prefix ([string]$prefix) {
|
||||
$this.Setter('prefix', $prefix)
|
||||
}
|
||||
|
||||
[void] FileType([string]$format) {
|
||||
[int]$val = 0
|
||||
switch ($format) {
|
||||
'wav' { $val = 1 }
|
||||
'aiff' { $val = 2 }
|
||||
'bwf' { $val = 3 }
|
||||
'mp3' { $val = 100 }
|
||||
default { "Filetype() got: $format, expected one of 'wav', 'aiff', 'bwf', 'mp3'" }
|
||||
}
|
||||
$this.Setter('filetype', $val)
|
||||
}
|
||||
|
||||
[void] GoTo ([string]$timestring) {
|
||||
try {
|
||||
if ([datetime]::ParseExact($timestring, 'HH:mm:ss', $null)) {
|
||||
@ -133,6 +117,34 @@ class Recorder : IRemote {
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_prefix = $($this | Add-Member ScriptProperty 'prefix' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).prefix is write only")
|
||||
} `
|
||||
{
|
||||
param([string]$arg)
|
||||
$this._prefix = $this.Setter('prefix', $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_filetype = $($this | Add-Member ScriptProperty 'filetype' `
|
||||
{
|
||||
return Write-Warning ("ERROR: $($this.identifier()).filetype is write only")
|
||||
} `
|
||||
{
|
||||
param([string]$arg)
|
||||
[int]$val = 0
|
||||
switch ($arg) {
|
||||
'wav' { $val = 1 }
|
||||
'aiff' { $val = 2 }
|
||||
'bwf' { $val = 3 }
|
||||
'mp3' { $val = 100 }
|
||||
default { "Filetype() got: $arg, expected one of 'wav', 'aiff', 'bwf', 'mp3'" }
|
||||
}
|
||||
$this._filetype = $this.Setter('filetype', $val)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_armedbus = $($this | Add-Member ScriptProperty 'armedbus' `
|
||||
{
|
||||
foreach ($bus in 0..$($this.remote.kind.p_out + $this.remote.kind.v_out - 1)) {
|
||||
|
||||
@ -910,8 +910,8 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
||||
try {
|
||||
$prefix = 'stringtest'
|
||||
$filetype = 'wav'
|
||||
$vmr.recorder.prefix($prefix)
|
||||
$vmr.recorder.filetype($filetype)
|
||||
$vmr.recorder.prefix = $prefix
|
||||
$vmr.recorder.filetype = $filetype
|
||||
|
||||
$vmr.recorder.state = 'record'
|
||||
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
|
||||
@ -956,8 +956,8 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
||||
BeforeAll {
|
||||
$prefix = 'actiontest'
|
||||
$filetype = 'wav'
|
||||
$vmr.recorder.prefix($prefix)
|
||||
$vmr.recorder.filetype($filetype)
|
||||
$vmr.recorder.prefix = $prefix
|
||||
$vmr.recorder.filetype = $filetype
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
|
||||
@ -6,8 +6,8 @@ Import-Module (Join-Path (Split-Path $PSScriptRoot -Parent) 'lib\Voicemeeter.psm
|
||||
function Test-RecDir ([object]$vmr, [string]$recDir) {
|
||||
$prefix = 'temp'
|
||||
$filetype = 'wav'
|
||||
$vmr.recorder.prefix($prefix)
|
||||
$vmr.recorder.filetype($filetype)
|
||||
$vmr.recorder.prefix = $prefix
|
||||
$vmr.recorder.filetype = $filetype
|
||||
|
||||
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user