Compare commits

..

No commits in common. "21eab2e528f927d225faa76d18fb5ba0840a1627" and "f5bdeb6d57dd8f9d837157461f74c02feefd92f8" have entirely different histories.

7 changed files with 221 additions and 372 deletions

View File

@ -9,28 +9,6 @@ Before any major/minor/patch is released all unit tests will be run to verify th
## [Unreleased] These changes have not been added to PSGallery yet ## [Unreleased] These changes have not been added to PSGallery yet
### Added
- Bus.EQ.Channel.Trim
- Bus.EQ.Channel.Delay
- MIDI Vban.Outstream.Route: 'none', 'midi_in', 'aux_in', 'vban_in', 'all_in', 'midi_out'
- Video Vban.Outstream
- Vban.Outstream.Vfps
- Vban.Outstream.Vformat: 'png', 'jpg'
- Vban.Outstream.Vquality
- Vban.Outstream.Vcursor
- Vban.Outstream.Route (VMR bug: currently write-only)
### Changed
- `on`, `name`, `ip` now read/write on all streams
- Simple ranges of consecutive integers moved to `AddIntMembers`
- Retained warning for `sr` and anything with atypical behavior, consistent with the rest of the module
- Retained warning for `port` because Voicemeeter will allow this to be set below 1024
- Audio instream/outstream divergent behavior via 'if' dropped in favor of explicit separation in derived classes
- Updated EQ.Channel.Cell.Gain range in README
## [4.0.0] - 2025-12-16 ## [4.0.0] - 2025-12-16

View File

@ -8,9 +8,9 @@ For past/future changes to this project refer to: [CHANGELOG](CHANGELOG.md)
## Tested against ## Tested against
- Basic 1.1.2.2 - Basic 1.1.1.9
- Banana 2.1.2.2 - Banana 2.1.1.9
- Potato 3.1.2.2 - Potato 3.1.1.9
## Requirements ## Requirements
@ -404,21 +404,14 @@ $vmr.strip[0].eq.on = $true
$vmr.bus[0].eq.ab = $false $vmr.bus[0].eq.ab = $false
``` ```
##### channel ##### channel.cell
The following bus.eq.channel.cell properties are available:
- trim: float, from -24.00 to 24.00
- delay: float, from 0.00 to 500.00
###### cell
The following eq.channel.cell properties are available: The following eq.channel.cell properties are available:
- on: bool - on: bool
- type: int, from 0 to 6 - type: int, from 0 to 6
- f: float, from 20.00 to 20000.00 - f: float, from 20.00 to 20000.00
- gain: float, from -36.00 to 18.00 - gain: float, from -12.00 to 12.00
- q: float, from 0.30 to 100.00 - q: float, from 0.30 to 100.00
for example: for example:
@ -465,65 +458,21 @@ The following Vban.instream | Vban.outstream properties are available:
- on: bool - on: bool
- name: string - name: string
- ip: string - ip: string
- sr: in, (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
- channel: int from 1 to 8
- bit: int, 16 or 24
- quality: int, from 0 to 4
- route: int, from 0 to 8
for example: for example:
```powershell ```powershell
$vmr.vban.instream[0].on = $true $vmr.vban.instream[0].on = $true
$vmr.vban.outstream[9].ip = '192.168.1.154'
```
##### audio
The following audio Vban.instream | Vban.outstream properties are available:
- sr: int, (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
- channel: int, from 1 to 8
- bit: int, 16 or 24
- quality: int, from 0 to 4
- route: int, from 0 to 8
SR, channel and bit are defined as readonly for instreams. Attempting to write
to those parameters will throw an error. They are read and write for outstreams.
for example:
```powershell
$vmr.vban.instream[0].route = 4
$vmr.vban.outstream[3].bit = 16 $vmr.vban.outstream[3].bit = 16
``` ```
##### midi SR, channel and bit are defined as readonly for instreams. Attempting to write
to those parameters will throw an error. They are read and write for outstreams.
The following midi Vban.outstream properties are available:
- route: string, ('none', 'midi_in', 'aux_in', 'vban_in', 'all_in', 'midi_out')
for example:
```powershell
$vmr.vban.outstream[8].route = 'aux_in'
```
##### video
The following video Vban.outstream properties are available:
- vfps: int, from 1 to 30
- vformat: string, ('png', 'jpg')
- vquality: int, from 1 to 100
- vcursor: bool
- route: int, from 0 to 4
Route is currently write-only. This is a VMR bug.
for example:
```powershell
$vmr.vban.outstream[9].vformat = 'jpg'
$vmr.vban.outstream[9].vquality = 85
$vmr.vban.outstream[9].vcursor = $true
```
### Command ### Command

View File

@ -47,7 +47,7 @@ class IOEq : IRemote {
$this.channel = @() $this.channel = @()
for ($ch = 0; $ch -lt $remote.kind.eq_ch[$this.kindOfEq]; $ch++) { for ($ch = 0; $ch -lt $remote.kind.eq_ch[$this.kindOfEq]; $ch++) {
$this.channel.Add([EqChannel]::new($ch, $this)) $this.channel.Add([EqChannel]::new($ch, $remote, $this.identifier()))
} }
} }
@ -64,30 +64,28 @@ class IOEq : IRemote {
class EqChannel : IRemote { class EqChannel : IRemote {
[System.Collections.ArrayList]$cell [System.Collections.ArrayList]$cell
[Object]$eq [string]$eqId
EqChannel ([int]$index, [Object]$eq) : base ($index, $eq.remote) { EqChannel ([int]$index, [Object]$remote, [string]$eqId) : base ($index, $remote) {
$this.eq = $eq $this.eqId = $eqId
if ($eq.kindOfEq -eq 'Bus') { AddFloatMembers -PARAMS @('trim', 'delay') }
$this.cell = @() $this.cell = @()
$cellCount = $this.remote.kind.cells $cellCount = $this.remote.kind.cells
for ($c = 0; $c -lt $cellCount; $c++) { for ($c = 0; $c -lt $cellCount; $c++) {
$this.cell.Add([EqCell]::new($c, $this)) $this.cell.Add([EqCell]::new($c, $remote, $this.identifier()))
} }
} }
[string] identifier () { [string] identifier () {
return '{0}.Channel[{1}]' -f $this.eq.identifier(), $this.index return '{0}.Channel[{1}]' -f $this.eqId, $this.index
} }
} }
class EqCell : IRemote { class EqCell : IRemote {
[Object]$channel [string]$channelId
EqCell ([int]$index, [Object]$channel) : base ($index, $channel.remote) { EqCell ([int]$index, [Object]$remote, [string]$channelId) : base ($index, $remote) {
$this.channel = $channel $this.channelId = $channelId
AddBoolMembers -PARAMS @('on') AddBoolMembers -PARAMS @('on')
AddIntMembers -PARAMS @('type') AddIntMembers -PARAMS @('type')
@ -95,7 +93,7 @@ class EqCell : IRemote {
} }
[string] identifier () { [string] identifier () {
return '{0}.Cell[{1}]' -f $this.channel.identifier(), $this.index return '{0}.Cell[{1}]' -f $this.channelId, $this.index
} }
} }

View File

@ -9,7 +9,7 @@ $KindMap = @{
'asio_out' = 8 'asio_out' = 8
'composite' = 0 'composite' = 0
'insert' = 0 'insert' = 0
'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1; 'video' = 1 } 'vban' = @{ 'in' = 4; 'out' = 4; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 0 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 0 }
'cells' = 0 'cells' = 0
'gainlayer' = 0 'gainlayer' = 0
@ -24,7 +24,7 @@ $KindMap = @{
'asio_out' = 8 'asio_out' = 8
'composite' = 8 'composite' = 8
'insert' = 22 'insert' = 22
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1; 'video' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 0; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 0; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 0 'gainlayer' = 0
@ -39,7 +39,7 @@ $KindMap = @{
'asio_out' = 8 'asio_out' = 8
'composite' = 8 'composite' = 8
'insert' = 34 'insert' = 34
'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1; 'video' = 1 } 'vban' = @{ 'in' = 8; 'out' = 8; 'midi' = 1; 'text' = 1 }
'eq_ch' = @{ 'strip' = 2; 'bus' = 8 } 'eq_ch' = @{ 'strip' = 2; 'bus' = 8 }
'cells' = 6 'cells' = 6
'gainlayer' = 8 'gainlayer' = 8

View File

@ -3,14 +3,18 @@ class Vban : IRemote {
Vban ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote) { Vban ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote) {
$this.direction = $direction $this.direction = $direction
AddBoolMembers -PARAMS @('on')
AddStringMembers -PARAMS @('name', 'ip')
} }
[string] identifier () { [string] identifier () {
return 'vban.' + $this.direction + 'stream[' + $this.index + ']' return 'vban.' + $this.direction + 'stream[' + $this.index + ']'
} }
}
class VbanAudio : Vban {
VbanAudio ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) {
AddBoolMembers -PARAMS @('on')
AddStringMembers -PARAMS @('name', 'ip')
}
hidden $_port = $($this | Add-Member ScriptProperty 'port' ` hidden $_port = $($this | Add-Member ScriptProperty 'port' `
{ {
@ -26,33 +30,43 @@ class Vban : IRemote {
} }
} }
) )
}
class VbanAudio : Vban { hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
VbanAudio ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) { {
AddIntMembers -PARAMS @('quality', 'route') [int]$this.Getter('sr')
} } `
} {
param([int]$arg)
if ($this.direction -eq 'in') { Write-Warning ('Error, read only value') }
else {
$opts = @(11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
if ($opts.Contains($arg)) {
$this._sr = $this.Setter('sr', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
}
)
class VbanMidi : Vban { hidden $_channel = $($this | Add-Member ScriptProperty 'channel' `
VbanMidi ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) { {
} [int]$this.Getter('channel')
} } `
{
class VbanText : Vban { param([int]$arg)
VbanText ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) { if ($this.direction -eq 'in') { Write-Warning ('Error, read only value') }
} else {
} if ($arg -ge 1 -and $arg -le 8) {
$this._channel = $this.Setter('channel', $arg)
class VbanVideo : Vban { }
VbanVideo ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) { else {
} Write-Warning ('Expected value from 1 to 8')
} }
}
class VbanInAudio : VbanAudio { }
VbanInAudio ([int]$index, [Object]$remote) : base ($index, $remote, 'in') { )
AddIntMembers -ReadOnly -PARAMS @('sr', 'channel')
}
hidden $_bit = $($this | Add-Member ScriptProperty 'bit' ` hidden $_bit = $($this | Add-Member ScriptProperty 'bit' `
{ {
@ -60,9 +74,125 @@ class VbanInAudio : VbanAudio {
return $val return $val
} ` } `
{ {
Write-Warning ("ERROR: $($this.identifier()).bit is read only") param([int]$arg)
if ($this.direction -eq 'in') { Write-Warning ('Error, read only value') }
else {
if (@(16, 24).Contains($arg)) {
$val = if ($arg -eq 16) { 1 } else { 2 }
$this._bit = $this.Setter('bit', $val)
}
else {
Write-Warning ('Expected value 16 or 24')
}
}
} }
) )
hidden $_quality = $($this | Add-Member ScriptProperty 'quality' `
{
[int]$this.Getter('quality')
} `
{
param([int]$arg)
if ($arg -ge 0 -and $arg -le 4) {
$this._quality = $this.Setter('quality', $arg)
}
else {
Write-Warning ('Expected value from 0 to 4')
}
}
)
hidden $_route = $($this | Add-Member ScriptProperty 'route' `
{
[int]$this.Getter('route')
} `
{
param([int]$arg)
$rt = $this.remote.kind['p_' + $this.direction] + $this.remote.kind['v_' + $this.direction] - 1
if ($arg -ge 0 -and $arg -le $rt) {
$this._route = $this.Setter('route', $arg)
}
else {
Write-Warning ("Expected value from 0 to $rt")
}
}
)
}
class VbanMidi : Vban {
VbanMidi ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) {
}
hidden $_on = $($this | Add-Member ScriptProperty 'on' `
{
return Write-Warning ("ERROR: $($this.identifier()).on is write only")
} `
{
param([bool]$arg)
$this._on = $this.Setter('on', $arg)
}
)
hidden $_name = $($this | Add-Member ScriptProperty 'name' `
{
return Write-Warning ("ERROR: $($this.identifier()).name is write only")
} `
{
param([string]$arg)
$this._name = $this.Setter('name', $arg)
}
)
hidden $_ip = $($this | Add-Member ScriptProperty 'ip' `
{
return Write-Warning ("ERROR: $($this.identifier()).ip is write only")
} `
{
param([string]$arg)
$this._ip = $this.Setter('ip', $arg)
}
)
}
class VbanText : Vban {
VbanText ([int]$index, [Object]$remote, [string]$direction) : base ($index, $remote, $direction) {
}
hidden $_on = $($this | Add-Member ScriptProperty 'on' `
{
return Write-Warning ("ERROR: $($this.identifier()).on is write only")
} `
{
param([bool]$arg)
$this._on = $this.Setter('on', $arg)
}
)
hidden $_name = $($this | Add-Member ScriptProperty 'name' `
{
return Write-Warning ("ERROR: $($this.identifier()).name is write only")
} `
{
param([string]$arg)
$this._name = $this.Setter('name', $arg)
}
)
hidden $_ip = $($this | Add-Member ScriptProperty 'ip' `
{
return Write-Warning ("ERROR: $($this.identifier()).ip is write only")
} `
{
param([string]$arg)
$this._ip = $this.Setter('ip', $arg)
}
)
}
class VbanInAudio : VbanAudio {
VbanInAudio ([int]$index, [Object]$remote) : base ($index, $remote, 'in') {
}
} }
class VbanInMidi : VbanMidi { class VbanInMidi : VbanMidi {
@ -77,104 +207,12 @@ class VbanInText : VbanText {
class VbanOutAudio : VbanAudio { class VbanOutAudio : VbanAudio {
VbanOutAudio ([int]$index, [Object]$remote) : base ($index, $remote, 'out') { VbanOutAudio ([int]$index, [Object]$remote) : base ($index, $remote, 'out') {
AddIntMembers -PARAMS @('channel')
} }
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
{
[int]$this.Getter('sr')
} `
{
param([int]$arg)
$opts = @(11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
if ($opts.Contains($arg)) {
$this._sr = $this.Setter('sr', $arg)
}
else {
Write-Warning ('Expected one of', $opts)
}
}
)
hidden $_bit = $($this | Add-Member ScriptProperty 'bit' `
{
$val = if ($this.Getter('bit') -eq 1) { 16 } else { 24 }
return $val
} `
{
param([int]$arg)
if (@(16, 24).Contains($arg)) {
$val = if ($arg -eq 16) { 1 } else { 2 }
$this._bit = $this.Setter('bit', $val)
}
else {
Write-Warning ('Expected value 16 or 24')
}
}
)
} }
class VbanOutMidi : VbanMidi { class VbanOutMidi : VbanMidi {
VbanOutMidi ([int]$index, [Object]$remote) : base ($index, $remote, 'out') { VbanOutMidi ([int]$index, [Object]$remote) : base ($index, $remote, 'out') {
} }
hidden $_route = $($this | Add-Member ScriptProperty 'route' `
{
[string]$val = ''
switch ($this.Getter('route')) {
0 { $val = 'none' }
1 { $val = 'midi_in' }
2 { $val = 'aux_in' }
4 { $val = 'vban_in' }
7 { $val = 'all_in' }
8 { $val = 'midi_out' }
}
return $val
} `
{
param([string]$arg)
[int]$val = 0
switch ($arg) {
'none' { $val = 0 }
'midi_in' { $val = 1 }
'aux_in' { $val = 2 }
'vban_in' { $val = 4 }
'all_in' { $val = 7 }
'midi_out' { $val = 8 }
default { Write-Warning ("route got: $arg, expected one of 'none', 'midi_in', 'aux_in', 'vban_in', 'all_in', 'midi_out'") }
}
$this._route = $this.Setter('route', $val)
}
)
}
class VbanOutVideo : VbanVideo {
VbanOutVideo ([int]$index, [Object]$remote) : base ($index, $remote, 'out') {
AddIntMembers -PARAMS @('vfps', 'vquality')
AddIntMembers -WriteOnly -PARAMS @('route')
AddBoolMembers -PARAMS @('vcursor')
}
hidden $_vformat = $($this | Add-Member ScriptProperty 'vformat' `
{
[string]$val = ''
switch ($this.Getter('vformat')) {
1 { $val = 'png' }
2 { $val = 'jpg' }
}
return $val
} `
{
param([string]$arg)
[int]$val = 0
switch ($arg) {
'png' { $val = 1 }
'jpg' { $val = 2 }
default { Write-Warning ("vformat got: $arg, expected one of 'png', 'jpg'") }
}
$this._vformat = $this.Setter('vformat', $val)
}
)
} }
function Make_Vban ([Object]$remote) { function Make_Vban ([Object]$remote) {
@ -182,7 +220,7 @@ function Make_Vban ([Object]$remote) {
[System.Collections.ArrayList]$outstream = @() [System.Collections.ArrayList]$outstream = @()
$totalInstreams = $remote.kind.vban.in + $remote.kind.vban.midi + $remote.kind.vban.text $totalInstreams = $remote.kind.vban.in + $remote.kind.vban.midi + $remote.kind.vban.text
$totalOutstreams = $remote.kind.vban.out + $remote.kind.vban.midi + $remote.kind.vban.video $totalOutstreams = $remote.kind.vban.out + $remote.kind.vban.midi
for ($i = 0; $i -lt $totalInstreams; $i++) { for ($i = 0; $i -lt $totalInstreams; $i++) {
if ($i -lt $remote.kind.vban.in) { if ($i -lt $remote.kind.vban.in) {
@ -199,11 +237,8 @@ function Make_Vban ([Object]$remote) {
if ($i -lt $remote.kind.vban.out) { if ($i -lt $remote.kind.vban.out) {
[void]$outstream.Add([VbanOutAudio]::new($i, $remote)) [void]$outstream.Add([VbanOutAudio]::new($i, $remote))
} }
elseif ($i -lt ($remote.kind.vban.out + $remote.kind.vban.midi)) {
[void]$outstream.Add([VbanOutMidi]::new($i, $remote))
}
else { else {
[void]$outstream.Add([VbanOutVideo]::new($i, $remote)) [void]$outstream.Add([VbanOutMidi]::new($i, $remote))
} }
} }

View File

@ -150,10 +150,10 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.enable | Should -Be $expected $vmr.vban.enable | Should -Be $expected
} }
Context 'Instream, audio, midi, text' -ForEach @( Context 'Instream' -ForEach @(
@{ Index = $vban_inA } @{ Index = $vban_inA }
@{ Index = $vban_inM } # @{ Index = $vban_inM }
@{ Index = $vban_inT } # @{ Index = $vban_inT }
) { ) {
It "Should set vban.instream[$index].on" { It "Should set vban.instream[$index].on" {
$vmr.vban.instream[$index].on = $value $vmr.vban.instream[$index].on = $value
@ -161,25 +161,15 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Outstream, audio, midi, video' -ForEach @( Context 'Outstream' -ForEach @(
@{ Index = $vban_outA } @{ Index = $vban_outA }
@{ Index = $vban_outM } # @{ Index = $vban_outM }
@{ Index = $vban_outV }
) { ) {
It "Should set vban.outstream[$index].on" { It "Should set vban.outstream[$index].on" {
$vmr.vban.outstream[$index].on = $value $vmr.vban.outstream[$index].on = $value
$vmr.vban.outstream[$index].on | Should -Be $expected $vmr.vban.outstream[$index].on | Should -Be $expected
} }
} }
Context 'Outstream, video only' -ForEach @(
@{ Index = $vban_outV }
) {
It "Should set vban.outstream[$index].vcursor" {
$vmr.vban.outstream[$index].vcursor = $value
$vmr.vban.outstream[$index].vcursor | Should -Be $expected
}
}
} }
Context 'Recorder' -Skip:$ifBasic { Context 'Recorder' -Skip:$ifBasic {
@ -475,33 +465,19 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Context 'EQ' -Skip:$ifBasic -ForEach @( Context 'EQ' -Skip:$ifBasic -ForEach @(
@{ Eq = $vmr.bus[$index].eq } @{ Eq = $vmr.bus[$index].eq }
) { ) {
Context "Channel[$bus_ch]" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].F" {
It "Should set Bus[$index].EQ.Channel[$bus_ch].Trim" { $eq.channel[$bus_ch].cell[$cells].f = $msHz
$eq.channel[$bus_ch].trim = $slide $eq.channel[$bus_ch].cell[$cells].f | Should -Be $msHz
$eq.channel[$bus_ch].trim | Should -Be $slide }
}
It "Should set Bus[$index].EQ.Channel[$bus_ch].Delay" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Gain" {
$eq.channel[$bus_ch].delay = $msHz $eq.channel[$bus_ch].cell[$cells].gain = $slide
$eq.channel[$bus_ch].delay | Should -Be $msHz $eq.channel[$bus_ch].cell[$cells].gain | Should -Be $slide
} }
Context "Cell[$cells]" {
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].F" {
$eq.channel[$bus_ch].cell[$cells].f = $msHz
$eq.channel[$bus_ch].cell[$cells].f | Should -Be $msHz
}
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Gain" { It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Q" {
$eq.channel[$bus_ch].cell[$cells].gain = $slide $eq.channel[$bus_ch].cell[$cells].q = $knob
$eq.channel[$bus_ch].cell[$cells].gain | Should -Be $slide $eq.channel[$bus_ch].cell[$cells].q | Should -Be $knob
}
It "Should set Bus[$index].EQ.Channel[$bus_ch].Cell[$cells].Q" {
$eq.channel[$bus_ch].cell[$cells].q = $knob
$eq.channel[$bus_ch].cell[$cells].q | Should -Be $knob
}
}
} }
} }
} }
@ -606,10 +582,8 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.port | Should -Be $expected $vmr.vban.port | Should -Be $expected
} }
Context 'Instream, audio, midi, text' -ForEach @( Context 'Instream' -ForEach @(
@{ Index = $vban_inA } @{ Index = $vban_inA }
@{ Index = $vban_inM }
@{ Index = $vban_inT }
) { ) {
It "Should set vban.instream[$index].port" -ForEach @( It "Should set vban.instream[$index].port" -ForEach @(
@{ Value = 1024; Expected = 1024 } @{ Value = 1024; Expected = 1024 }
@ -620,21 +594,16 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$vmr.vban.instream[$index].port | Should -Be $expected $vmr.vban.instream[$index].port | Should -Be $expected
} }
}
Context 'Instream, audio only' -ForEach @( It "Should set vban.instream[$index].sr" {
@{ Index = $vban_inA }
) {
It "Should get vban.instream[$index].sr" {
$vmr.vban.instream[$index].sr | Should -BeOfType [int] $vmr.vban.instream[$index].sr | Should -BeOfType [int]
} }
It "Should get vban.instream[$index].channel" { It "Should set vban.instream[$index].channel" {
$vmr.vban.instream[$index].channel | Should -BeOfType [int] $vmr.vban.instream[$index].channel | Should -BeOfType [int]
} }
It "Should get vban.instream[$index].bit" { It "Should set vban.instream[$index].bit" {
$vmr.vban.instream[$index].bit | Should -BeOfType [int] $vmr.vban.instream[$index].bit | Should -BeOfType [int]
} }
@ -656,10 +625,8 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Outstream, audio, midi, video' -ForEach @( Context 'Outstream' -ForEach @(
@{ Index = $vban_outA } @{ Index = $vban_outA }
@{ Index = $vban_outM }
@{ Index = $vban_outV }
) { ) {
It "Should set vban.outstream[$index].port" -ForEach @( It "Should set vban.outstream[$index].port" -ForEach @(
@{ Value = 1024; Expected = 1024 } @{ Value = 1024; Expected = 1024 }
@ -670,11 +637,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$vmr.vban.outstream[$index].port | Should -Be $expected $vmr.vban.outstream[$index].port | Should -Be $expected
} }
}
Context 'Outstream, audio only' -ForEach @(
@{ Index = $vban_outA }
) {
It "Should set vban.outstream[$index].sr" -ForEach @( It "Should set vban.outstream[$index].sr" -ForEach @(
@{ Value = 44100; Expected = 44100 } @{ Value = 44100; Expected = 44100 }
@ -717,34 +679,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.outstream[$index].route | Should -Be $expected $vmr.vban.outstream[$index].route | Should -Be $expected
} }
} }
Context 'Outstream, video only' -ForEach @(
@{ Index = $vban_outV }
) {
It "Should set vban.outstream[$index].vfps" -ForEach @(
@{ Value = 6; Expected = 6 }
@{ Value = 24; Expected = 24 }
) {
$vmr.vban.outstream[$index].vfps = $value
$vmr.vban.outstream[$index].vfps | Should -Be $expected
}
It "Should set vban.outstream[$index].vquality" -ForEach @(
@{ Value = 80; Expected = 80 }
@{ Value = 100; Expected = 100 }
) {
$vmr.vban.outstream[$index].vquality = $value
$vmr.vban.outstream[$index].vquality | Should -Be $expected
}
<# It "Should set vban.outstream[$index].route" -ForEach @(
@{ Value = 1; Expected = 1 }
@{ Value = 4; Expected = 4 }
) {
$vmr.vban.outstream[$index].route = $value
$vmr.vban.outstream[$index].route | Should -Be $expected
} #>
}
} }
Context 'Patch' { Context 'Patch' {
@ -1032,10 +966,10 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
Describe 'Vban' { Describe 'Vban' {
Context 'Instream, audio, midi, text' -ForEach @( Context 'Instream' -ForEach @(
@{ Index = $vban_inA } @{ Index = $vban_inA }
@{ Index = $vban_inM } # @{ Index = $vban_inM }
@{ Index = $vban_inT } # @{ Index = $vban_inT }
) { ) {
It "Should set vban.instream[$index].name" -ForEach @( It "Should set vban.instream[$index].name" -ForEach @(
@{ Value = 'TestIn0'; Expected = 'TestIn0' } @{ Value = 'TestIn0'; Expected = 'TestIn0' }
@ -1053,10 +987,9 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Outstream, audio, midi, video' -ForEach @( Context 'Outstream' -ForEach @(
@{ Index = $vban_outA } @{ Index = $vban_outA }
@{ Index = $vban_outM } # @{ Index = $vban_outM }
@{ Index = $vban_outV }
) { ) {
It "Should set vban.outstream[$index].name" -ForEach @( It "Should set vban.outstream[$index].name" -ForEach @(
@{ Value = 'TestOut0'; Expected = 'TestOut0' } @{ Value = 'TestOut0'; Expected = 'TestOut0' }
@ -1073,31 +1006,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.vban.outstream[$index].ip | Should -Be $expected $vmr.vban.outstream[$index].ip | Should -Be $expected
} }
} }
Context 'Outstream, midi only' -ForEach @(
@{ Index = $vban_outM }
) {
It "Should set vban.outstream[$index].route" -ForEach @(
@{ Value = 'aux_in'; Expected = 'aux_in' }
@{ Value = 'all_in'; Expected = 'all_in' }
@{ Value = 'midi_out'; Expected = 'midi_out' }
) {
$vmr.vban.outstream[$index].route = $value
$vmr.vban.outstream[$index].route | Should -Be $expected
}
}
Context 'Outstream, video only' -ForEach @(
@{ Index = $vban_outV }
) {
It "Should set vban.outstream[$index].vformat" -ForEach @(
@{ Value = 'png'; Expected = 'png' }
@{ Value = 'jpg'; Expected = 'jpg' }
) {
$vmr.vban.outstream[$index].vformat = $value
$vmr.vban.outstream[$index].vformat | Should -Be $expected
}
}
} }
Context 'Recorder' -Skip:$ifBasic { Context 'Recorder' -Skip:$ifBasic {
@ -1108,19 +1016,13 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
$vmr.recorder.prefix = $prefix $vmr.recorder.prefix = $prefix
$vmr.recorder.filetype = $filetype $vmr.recorder.filetype = $filetype
$start = Get-Date
$vmr.recorder.state = 'record' $vmr.recorder.state = 'record'
Start-Sleep -Milliseconds 10
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
$vmr.recorder.state | Should -Be 'record' $vmr.recorder.state | Should -Be 'record'
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue | $tmp = [System.IO.Path]::Combine($recDir, ("{0} {1}.{2}" -f $prefix, $stamp, $filetype))
Where-Object { $_.LastWriteTime -gt $start } |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if (-not $tmp) {
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
}
$vmr.recorder.state = 'stop' $vmr.recorder.state = 'stop'
$vmr.recorder.eject() $vmr.recorder.eject()
@ -1208,18 +1110,12 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
BeforeEach { BeforeEach {
$start = Get-Date
$vmr.recorder.record() $vmr.recorder.record()
Start-Sleep -Milliseconds 10
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue | $tmp = [System.IO.Path]::Combine($recDir, ("{0} {1}.{2}" -f $prefix, $stamp, $filetype))
Where-Object { $_.LastWriteTime -gt $start } |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if (-not $tmp) {
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
}
$vmr.recorder.pause() $vmr.recorder.pause()
Start-Sleep -Milliseconds 500 Start-Sleep -Milliseconds 500

View File

@ -11,18 +11,12 @@ function Test-RecDir ([object]$vmr, [string]$recDir) {
try { try {
$start = Get-Date
$vmr.recorder.record() $vmr.recorder.record()
Start-Sleep -Milliseconds 10
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
Start-Sleep -Milliseconds 2000 Start-Sleep -Milliseconds 2000
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue | $tmp = Join-Path $recDir ("{0} {1}.{2}" -f $prefix, $stamp, $filetype)
Where-Object { $_.LastWriteTime -gt $start } |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if (-not $tmp) {
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
}
$vmr.recorder.stop() $vmr.recorder.stop()
$vmr.recorder.eject() $vmr.recorder.eject()
@ -59,7 +53,6 @@ function main() {
$vban_inT = $vmr.kind.vban.in + $vmr.kind.vban.midi + $vmr.kind.vban.text - 1 $vban_inT = $vmr.kind.vban.in + $vmr.kind.vban.midi + $vmr.kind.vban.text - 1
$vban_outA = $vmr.kind.vban.out - 1 $vban_outA = $vmr.kind.vban.out - 1
$vban_outM = $vmr.kind.vban.out + $vmr.kind.vban.midi - 1 $vban_outM = $vmr.kind.vban.out + $vmr.kind.vban.midi - 1
$vban_outV = $vmr.kind.vban.out + $vmr.kind.vban.midi + $vmr.kind.vban.video - 1
$insert = $vmr.kind.insert - 1 $insert = $vmr.kind.insert - 1
$composite = $vmr.kind.composite - 1 $composite = $vmr.kind.composite - 1
$strip_ch = $vmr.kind.eq_ch['strip'] - 1 $strip_ch = $vmr.kind.eq_ch['strip'] - 1