gainlayer, busmodes + mc,k added

gainlayers and busmodes added.

mc, k added to virtual strips
This commit is contained in:
onyx-and-iris 2022-03-08 22:55:11 +00:00
parent cea6d500dd
commit 15bec82ec4
3 changed files with 51 additions and 5 deletions

View File

@ -11,6 +11,9 @@ class Bus {
AddBoolMembers -PARAMS @('mono', 'mute') AddBoolMembers -PARAMS @('mono', 'mute')
AddStringMembers -PARAMS @('label') AddStringMembers -PARAMS @('label')
AddFloatMembers -PARAMS @('gain') AddFloatMembers -PARAMS @('gain')
AddBusModeMembers -PARAMS @('normal', 'amix', 'bmix', 'repeat', 'composite', 'tvmix', 'upmix21',
'upmix41', 'upmix61', 'centeronly', 'lfeonly', 'rearonly')
} }
[Single] Getter($cmd) { [Single] Getter($cmd) {
@ -31,13 +34,23 @@ class Bus {
hidden $_eq = $($this | Add-Member ScriptProperty 'eq' ` hidden $_eq = $($this | Add-Member ScriptProperty 'eq' `
{ {
$this.Getter($this.cmd('EQ.on')) [bool]$this.Getter($this.cmd('EQ.on'))
}` }`
{ {
param ( $arg ) param ( $arg )
$this._eq = $this.Setter($this.cmd('EQ.on'), $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 { class PhysicalBus : Bus {

View File

@ -62,16 +62,16 @@ Function AddStringMembers() {
} }
} }
Function AddCommandMembers() { Function AddActionMembers() {
param( param(
[String[]]$PARAMS [String[]]$PARAMS
) )
[HashTable]$Signatures = @{} [HashTable]$Signatures = @{}
ForEach($param in $PARAMS) { ForEach($param in $PARAMS) {
# Define getter # Define getter
$Signatures["Getter"] = "`$this.Getter(`$this.cmd('{0}'))" -f $_ $Signatures["Getter"] = "`$this.Setter(`$this.cmd('{0}'), `$true)" -f $param
# Define setter # Define setter
$Signatures["Setter"] = "`$this.Setter(`$this.cmd('{0}'))" -f $_ $Signatures["Setter"] = ""
Addmember Addmember
} }
@ -89,6 +89,37 @@ Function AddChannelMembers() {
AddBoolMembers -PARAMS $channels 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{ Function Addmember{
$AddMemberParams = @{ $AddMemberParams = @{
Name = $param Name = $param

View File

@ -3,7 +3,6 @@
class Strip { class Strip {
[Int]$id [Int]$id
# Constructor
Strip ([Int]$id) Strip ([Int]$id)
{ {
$this.id = $id $this.id = $id
@ -14,6 +13,7 @@ class Strip {
AddStringMembers -PARAMS @('label') AddStringMembers -PARAMS @('label')
AddChannelMembers AddChannelMembers
AddGainlayerMembers
} }
[Single] Getter($cmd) { [Single] Getter($cmd) {
@ -59,6 +59,8 @@ class PhysicalStrip : Strip {
class VirtualStrip : Strip { class VirtualStrip : Strip {
VirtualStrip ([Int]$id) : base ($id) { VirtualStrip ([Int]$id) : base ($id) {
AddBoolMembers -PARAMS @('mc')
AddIntMembers -PARAMS @('k')
} }
} }