mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +00:00
gainlayer, busmodes + mc,k added
gainlayers and busmodes added. mc, k added to virtual strips
This commit is contained in:
parent
cea6d500dd
commit
15bec82ec4
15
lib/bus.ps1
15
lib/bus.ps1
@ -11,6 +11,9 @@ class Bus {
|
||||
AddBoolMembers -PARAMS @('mono', 'mute')
|
||||
AddStringMembers -PARAMS @('label')
|
||||
AddFloatMembers -PARAMS @('gain')
|
||||
|
||||
AddBusModeMembers -PARAMS @('normal', 'amix', 'bmix', 'repeat', 'composite', 'tvmix', 'upmix21',
|
||||
'upmix41', 'upmix61', 'centeronly', 'lfeonly', 'rearonly')
|
||||
}
|
||||
|
||||
[Single] Getter($cmd) {
|
||||
@ -31,13 +34,23 @@ class Bus {
|
||||
|
||||
hidden $_eq = $($this | Add-Member ScriptProperty 'eq' `
|
||||
{
|
||||
$this.Getter($this.cmd('EQ.on'))
|
||||
[bool]$this.Getter($this.cmd('EQ.on'))
|
||||
}`
|
||||
{
|
||||
param ( $arg )
|
||||
$this._eq = $this.Setter($this.cmd('EQ.on'), $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_eq_ab = $($this | Add-Member ScriptProperty 'eq_ab' `
|
||||
{
|
||||
[bool]$this.Getter($this.cmd('eq.ab'))
|
||||
}`
|
||||
{
|
||||
param ( $arg )
|
||||
$this._eq = $this.Setter($this.cmd('eq.ab'), $arg)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
class PhysicalBus : Bus {
|
||||
|
37
lib/meta.ps1
37
lib/meta.ps1
@ -62,16 +62,16 @@ Function AddStringMembers() {
|
||||
}
|
||||
}
|
||||
|
||||
Function AddCommandMembers() {
|
||||
Function AddActionMembers() {
|
||||
param(
|
||||
[String[]]$PARAMS
|
||||
)
|
||||
[HashTable]$Signatures = @{}
|
||||
ForEach($param in $PARAMS) {
|
||||
# Define getter
|
||||
$Signatures["Getter"] = "`$this.Getter(`$this.cmd('{0}'))" -f $_
|
||||
$Signatures["Getter"] = "`$this.Setter(`$this.cmd('{0}'), `$true)" -f $param
|
||||
# Define setter
|
||||
$Signatures["Setter"] = "`$this.Setter(`$this.cmd('{0}'))" -f $_
|
||||
$Signatures["Setter"] = ""
|
||||
|
||||
Addmember
|
||||
}
|
||||
@ -89,6 +89,37 @@ Function AddChannelMembers() {
|
||||
AddBoolMembers -PARAMS $channels
|
||||
}
|
||||
|
||||
Function AddGainlayerMembers() {
|
||||
[HashTable]$Signatures = @{}
|
||||
0..7 | ForEach-Object {
|
||||
# Define getter
|
||||
$Signatures["Getter"] = "`$this.Getter(`$this.cmd('gainlayer[{0}]'))" -f $_
|
||||
# Define setter
|
||||
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter(`$this.cmd('gainlayer[{0}]'), `$arg)" `
|
||||
-f $_
|
||||
$param = "gainlayer{0}" -f $_
|
||||
|
||||
Addmember
|
||||
}
|
||||
}
|
||||
|
||||
Function AddBusModeMembers() {
|
||||
param(
|
||||
[String[]]$PARAMS
|
||||
)
|
||||
[HashTable]$Signatures = @{}
|
||||
ForEach($param in $PARAMS) {
|
||||
# Define getter
|
||||
$Signatures["Getter"] = "[bool]`$this.Getter(`$this.cmd('mode.{0}'))" -f $param
|
||||
# Define setter
|
||||
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter(`$this.cmd('mode.{0}'), `$arg)" `
|
||||
-f $param
|
||||
$param = "mode_{0}" -f $param
|
||||
|
||||
Addmember
|
||||
}
|
||||
}
|
||||
|
||||
Function Addmember{
|
||||
$AddMemberParams = @{
|
||||
Name = $param
|
||||
|
@ -3,7 +3,6 @@
|
||||
class Strip {
|
||||
[Int]$id
|
||||
|
||||
# Constructor
|
||||
Strip ([Int]$id)
|
||||
{
|
||||
$this.id = $id
|
||||
@ -14,6 +13,7 @@ class Strip {
|
||||
AddStringMembers -PARAMS @('label')
|
||||
|
||||
AddChannelMembers
|
||||
AddGainlayerMembers
|
||||
}
|
||||
|
||||
[Single] Getter($cmd) {
|
||||
@ -59,6 +59,8 @@ class PhysicalStrip : Strip {
|
||||
|
||||
class VirtualStrip : Strip {
|
||||
VirtualStrip ([Int]$id) : base ($id) {
|
||||
AddBoolMembers -PARAMS @('mc')
|
||||
AddIntMembers -PARAMS @('k')
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user