implement io classes

prelim pester tests for potato pass
This commit is contained in:
pblivingston
2025-12-09 11:37:23 -05:00
parent 0c60c5e6c5
commit 126e6172cb
5 changed files with 13 additions and 178 deletions

View File

@@ -1,11 +1,10 @@
class Strip : IRemote {
class Strip : IOControl {
[System.Collections.ArrayList]$gainlayer
[Object]$levels
Strip ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('solo', 'mute')
AddFloatMembers -PARAMS @('gain', 'limit', 'pan_x', 'pan_y')
AddStringMembers -PARAMS @('label')
AddBoolMembers -PARAMS @('solo')
AddFloatMembers -PARAMS @('limit', 'pan_x', 'pan_y')
AddChannelMembers
@@ -20,17 +19,9 @@ class Strip : IRemote {
[string] identifier () {
return 'Strip[' + $this.index + ']'
}
[void] FadeTo ([single]$target, [int]$time) {
$this.Setter('FadeTo', "($target, $time)")
}
[void] FadeBy ([single]$target, [int]$time) {
$this.Setter('FadeBy', "($target, $time)")
}
}
class StripLevels : IRemote {
class StripLevels : IOLevels {
[int]$init
[int]$offset
@@ -46,23 +37,6 @@ class StripLevels : IRemote {
}
}
hidden [single] Convert([single]$val) {
if ($val -gt 0) {
return [math]::Round(20 * [math]::Log10($val), 1)
}
else {
return -200.0
}
}
[System.Collections.ArrayList] Getter([int]$mode) {
[System.Collections.ArrayList]$vals = @()
$this.init..$($this.init + $this.offset - 1) | ForEach-Object {
$vals.Add($this.Convert($(Get_Level -MODE $mode -INDEX $_)))
}
return $vals
}
[System.Collections.ArrayList] PreFader() {
return $this.Getter(0)
}
@@ -196,7 +170,7 @@ class StripAudibility : IRemote {
)
}
class StripEq : Eq {
class StripEq : IOEq {
StripEq ([int]$index, [Object]$remote) : base ($index, $remote, 'Strip') {
}
@@ -205,7 +179,7 @@ class StripEq : Eq {
}
}
class StripDevice : Device {
class StripDevice : IODevice {
StripDevice ([int]$index, [Object]$remote) : base ($index, $remote) {
}