Compare commits

..

No commits in common. "07028478cca41aed9aeba22034917706a4956f12" and "b20f62f17c8dbc58e0cdbc485d0fd5f24fa349de" have entirely different histories.

8 changed files with 137 additions and 201 deletions

View File

@ -15,7 +15,6 @@ Before any major/minor/patch is released all test units will be run to verify th
- ArrayMember classes for array-like properties - ArrayMember classes for array-like properties
- Patch class - Patch class
- Option class - Option class
- Device classes
## [3.3.0] - 2024-06-29 ## [3.3.0] - 2024-06-29

View File

@ -312,7 +312,6 @@ $vmr.bus[0].device.name
name, sr are defined as read only. name, sr are defined as read only.
wdm, ks, mme, asio are defined as write only. wdm, ks, mme, asio are defined as write only.
asio only defined for Bus[0].Device
#### eq #### eq

View File

@ -4,7 +4,6 @@
. $PSScriptRoot\kinds.ps1 . $PSScriptRoot\kinds.ps1
. $PSScriptRoot\iremote.ps1 . $PSScriptRoot\iremote.ps1
. $PSScriptRoot\arraymember.ps1 . $PSScriptRoot\arraymember.ps1
. $PSScriptRoot\device.ps1
. $PSScriptRoot\strip.ps1 . $PSScriptRoot\strip.ps1
. $PSScriptRoot\bus.ps1 . $PSScriptRoot\bus.ps1
. $PSScriptRoot\macrobuttons.ps1 . $PSScriptRoot\macrobuttons.ps1

View File

@ -101,35 +101,75 @@ class PhysicalBus : Bus {
} }
} }
class VirtualBus : Bus { class BusDevice : IRemote {
[Object]$device
VirtualBus ([int]$index, [Object]$remote) : base ($index, $remote) {
if ($this.remote.kind.name -eq 'basic') {
$this.device = [BusDevice]::new($index, $remote)
}
}
}
class BusDevice : Device {
BusDevice ([int]$index, [Object]$remote) : base ($index, $remote) { BusDevice ([int]$index, [Object]$remote) : base ($index, $remote) {
if ($this.index -eq 0) {
$this.AddASIO()
}
} }
[string] identifier () { [string] identifier () {
return 'Bus[' + $this.index + '].Device' return 'Bus[' + $this.index + '].Device'
} }
hidden [void] AddASIO () { hidden $_name = $($this | Add-Member ScriptProperty 'name' `
Add-Member -InputObject $this -MemberType ScriptProperty -Name 'asio' ` {
-Value { $this.Getter_String('name')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).name is read only")
}
)
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
{
$this.Getter('sr')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).sr is read only")
}
)
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
{
return Write-Warning ("ERROR: $($this.identifier()).wdm is write only")
} `
{
param($arg)
return $this.Setter('wdm', $arg)
}
)
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
{
return Write-Warning ("ERROR: $($this.identifier()).ks is write only")
} `
{
param($arg)
return $this.Setter('ks', $arg)
}
)
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
{
return Write-Warning ("ERROR: $($this.identifier()).mme is write only")
} `
{
param($arg)
return $this.Setter('mme', $arg)
}
)
hidden $_asio = $($this | Add-Member ScriptProperty 'asio' `
{
return Write-Warning ("ERROR: $($this.identifier()).asio is write only") return Write-Warning ("ERROR: $($this.identifier()).asio is write only")
} -SecondValue { } `
{
param($arg) param($arg)
return $this.Setter('asio', $arg) return $this.Setter('asio', $arg)
} -Force }
)
}
class VirtualBus : Bus {
VirtualBus ([int]$index, [Object]$remote) : base ($index, $remote) {
} }
} }

View File

@ -1,52 +0,0 @@
class Device : IRemote {
Device ([int]$index, [Object]$remote) : base ($index, $remote) {
}
hidden $_name = $($this | Add-Member ScriptProperty 'name' `
{
$this.Getter_String('name')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).name is read only")
}
)
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
{
[int]$this.Getter('sr')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).sr is read only")
}
)
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
{
return Write-Warning ("ERROR: $($this.identifier()).wdm is write only")
} `
{
param($arg)
return $this.Setter('wdm', $arg)
}
)
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
{
return Write-Warning ("ERROR: $($this.identifier()).ks is write only")
} `
{
param($arg)
return $this.Setter('ks', $arg)
}
)
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
{
return Write-Warning ("ERROR: $($this.identifier()).mme is write only")
} `
{
param($arg)
return $this.Setter('mme', $arg)
}
)
}

View File

@ -162,13 +162,71 @@ class StripEq : IRemote {
} }
} }
class StripDevice : Device { class StripDevice : IRemote {
StripDevice ([int]$index, [Object]$remote) : base ($index, $remote) { StripDevice ([int]$index, [Object]$remote) : base ($index, $remote) {
} }
[string] identifier () { [string] identifier () {
return 'Strip[' + $this.index + '].Device' return 'Strip[' + $this.index + '].Device'
} }
hidden $_name = $($this | Add-Member ScriptProperty 'name' `
{
$this.Getter_String('name')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).name is read only")
}
)
hidden $_sr = $($this | Add-Member ScriptProperty 'sr' `
{
$this.Getter('sr')
} `
{
return Write-Warning ("ERROR: $($this.identifier()).sr is read only")
}
)
hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' `
{
return Write-Warning ("ERROR: $($this.identifier()).wdm is write only")
} `
{
param($arg)
return $this.Setter('wdm', $arg)
}
)
hidden $_ks = $($this | Add-Member ScriptProperty 'ks' `
{
return Write-Warning ("ERROR: $($this.identifier()).ks is write only")
} `
{
param($arg)
return $this.Setter('ks', $arg)
}
)
hidden $_mme = $($this | Add-Member ScriptProperty 'mme' `
{
return Write-Warning ("ERROR: $($this.identifier()).mme is write only")
} `
{
param($arg)
return $this.Setter('mme', $arg)
}
)
hidden $_asio = $($this | Add-Member ScriptProperty 'asio' `
{
return Write-Warning ("ERROR: $($this.identifier()).asio is write only")
} `
{
param($arg)
return $this.Setter('asio', $arg)
}
)
} }
class VirtualStrip : Strip { class VirtualStrip : Strip {

View File

@ -251,68 +251,40 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Describe 'Int Tests' { Describe 'Int Tests' -ForEach @(
Context 'Strip, one physical, one virtual' -ForEach @(
@{ Index = $phys_in }, @{ Index = $virt_in } @{ Index = $phys_in }, @{ Index = $virt_in }
) { ) {
It "Should set and get Strip[$index].Limit" -Skip:$ifBasic -ForEach @( Context 'Strip, one physical, one virtual' -Skip:$ifBasic -ForEach @(
@{ Value = 3; Expected = 3 } @{ Value = 3; Expected = 3 }
@{ Value = -6; Expected = -6 } @{ Value = -6; Expected = -6 }
) { ) {
It "Should set Strip[$index].Limit to 3" {
$vmr.strip[$index].limit = $value $vmr.strip[$index].limit = $value
$vmr.strip[$index].limit | Should -Be $expected $vmr.strip[$index].limit | Should -Be $expected
} }
} }
Context 'Strip, physical only' -ForEach @( Context 'Vban outstream' {
@{ Index = $phys_in } Context 'sr' -ForEach @(
) {
Context 'Device' {
It "Should get Strip[$index].Device.sr" {
$vmr.strip[$index].device.sr | Should -BeOfType [int]
}
}
}
Context 'Bus, physical only' -ForEach @(
@{ Index = $phys_out }
) {
Context 'Device' {
It "Should get Bus[$index].Device.sr" {
$vmr.bus[$index].device.sr | Should -BeOfType [int]
}
}
}
Context 'Bus, virtual only' -ForEach @(
@{ Index = $virt_out }
) {
Context 'Device' -Skip:$ifNotBasic {
It "Should get Bus[$index].Device.sr" {
$vmr.bus[$index].device.sr | Should -BeOfType [int]
}
}
}
Context 'Vban outstream' -ForEach @(
@{ Index = $vban_out }
) {
It "Should set vban.outstream[$index].sr to $value" -ForEach @(
@{ Value = 44100; Expected = 44100 } @{ Value = 44100; Expected = 44100 }
@{ Value = 48000; Expected = 48000 } @{ Value = 48000; Expected = 48000 }
) { ) {
It "Should set vban.outstream[$index].sr to $value" {
$vmr.vban.outstream[$index].sr = $value $vmr.vban.outstream[$index].sr = $value
$vmr.vban.outstream[$index].sr | Should -Be $expected $vmr.vban.outstream[$index].sr | Should -Be $expected
} }
}
It 'Should set vban.outstream[0].channel to 1' -ForEach @( Context 'channel' -ForEach @(
@{ Value = 1; Expected = 1 } @{ Value = 1; Expected = 1 }
@{ Value = 2; Expected = 2 } @{ Value = 2; Expected = 2 }
) { ) {
It 'Should set vban.outstream[0].channel to 1' {
$vmr.vban.outstream[$index].channel = $value $vmr.vban.outstream[$index].channel = $value
$vmr.vban.outstream[$index].channel | Should -Be $expected $vmr.vban.outstream[$index].channel | Should -Be $expected
} }
} }
}
Context 'Patch' { Context 'Patch' {
It 'Should set and get Patch.composite[$composite]' -Skip:$ifBasic -ForEach @( It 'Should set and get Patch.composite[$composite]' -Skip:$ifBasic -ForEach @(
@ -369,32 +341,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Strip, physical only' -ForEach @(
@{ Index = $phys_in }
) {
Context 'Device' -ForEach @(
@{ Value = 'testInput' }, @{ Value = '' }
) {
It "Should set Strip[$index].Device.wdm" {
$vmr.strip[$index].device.wdm = $value
Start-Sleep -Milliseconds 800
$vmr.strip[$index].device.name | Should -Be $value
}
It "Should set Strip[$index].Device.ks" {
$vmr.strip[$index].device.ks = $value
Start-Sleep -Milliseconds 800
$vmr.strip[$index].device.name | Should -Be $value
}
It "Should set Strip[$index].Device.mme" {
$vmr.strip[$index].device.mme = $value
Start-Sleep -Milliseconds 800
$vmr.strip[$index].device.name | Should -Be $value
}
}
}
Context 'Bus, one physical, one virtual' -ForEach @( Context 'Bus, one physical, one virtual' -ForEach @(
@{ Index = $phys_out }, @{ Index = $virt_out } @{ Index = $phys_out }, @{ Index = $virt_out }
) { ) {
@ -407,58 +353,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
} }
} }
Context 'Bus, physical only' -ForEach @(
@{ Index = $phys_out }
) {
Context 'Device' -ForEach @(
@{ Value = 'testOutput' }, @{ Value = '' }
) {
It "Should set Bus[$index].Device.wdm" {
$vmr.bus[$index].device.wdm = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
It "Should set Bus[$index].Device.ks" {
$vmr.bus[$index].device.ks = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
It "Should set Bus[$index].Device.mme" {
$vmr.bus[$index].device.mme = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
}
}
Context 'Bus, virtual only' -ForEach @(
@{ Index = $virt_out }
) {
Context 'Device' -Skip:$ifNotBasic -ForEach @(
@{ Value = 'testOutput' }, @{ Value = '' }
) {
It "Should set Bus[$index].Device.wdm" {
$vmr.bus[$index].device.wdm = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
It "Should set Bus[$index].Device.ks" {
$vmr.bus[$index].device.ks = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
It "Should set Bus[$index].Device.mme" {
$vmr.bus[$index].device.mme = $value
Start-Sleep -Milliseconds 800
$vmr.bus[$index].device.name | Should -Be $value
}
}
}
Describe 'Vban' -ForEach @( Describe 'Vban' -ForEach @(
@{ Index = $vban_in } @{ Index = $vban_in }
) { ) {

View File

@ -21,7 +21,6 @@ function main() {
# skip conditions by kind # skip conditions by kind
$ifBasic = $vmr.kind.name -eq 'basic' $ifBasic = $vmr.kind.name -eq 'basic'
$ifNotBasic = $vmr.kind.name -ne 'basic'
$ifNotPotato = $vmr.kind.name -ne 'potato' $ifNotPotato = $vmr.kind.name -ne 'potato'
Invoke-Pester -Tag $tag -PassThru | Out-Null Invoke-Pester -Tag $tag -PassThru | Out-Null