VBVMR_GetLevel binding added

Get_Level implemented in base.ps1

strip.{PreFader,PostFader,PostMute} methods added

bus.{All} added
This commit is contained in:
2023-08-09 14:16:27 +01:00
parent aee3430962
commit 1c9c400f12
5 changed files with 257 additions and 130 deletions

View File

@@ -33,6 +33,7 @@ class IBus {
class Bus : IBus {
[Object]$mode
[Object]$eq
[Object]$levels
Bus ([int]$index, [Object]$remote) : base ($index, $remote) {
AddBoolMembers -PARAMS @('mono', 'mute')
@@ -41,6 +42,7 @@ class Bus : IBus {
$this.mode = [Mode]::new($index, $remote)
$this.eq = [Eq]::new($index, $remote)
$this.levels = [Levels]::new($index, $remote)
}
[void] FadeTo ([single]$target, [int]$time) {
@@ -52,6 +54,37 @@ class Bus : IBus {
}
}
class Levels : IBus {
[int]$init
[int]$offset
Levels ([int]$index, [Object]$remote) : base ($index, $remote) {
$this.init = $index * 8
$this.offset = 8
}
[float] Convert([float]$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] All() {
return $this.Getter(3)
}
}
class Mode : IBus {
[System.Collections.ArrayList]$modes