mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-18 05:23:32 +00:00
VBVMR_GetLevel binding added
Get_Level implemented in base.ps1
strip.{PreFader,PostFader,PostMute} methods added
bus.{All} added
This commit is contained in:
33
lib/bus.ps1
33
lib/bus.ps1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user