mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +00:00
added gain param
Added gain param for strip/bus. Getter now returns type single instead of int.
This commit is contained in:
parent
e1867d0731
commit
12b0085ab6
@ -1,3 +1,7 @@
|
||||
. $PSScriptRoot\strip.ps1
|
||||
. $PSScriptRoot\bus.ps1
|
||||
. $PSScriptRoot\macrobuttons.ps1
|
||||
|
||||
$Handles = @'
|
||||
[DllImport(@"C:\Program Files (x86)\VB\Voicemeeter\VoicemeeterRemote64.dll")]
|
||||
public static extern int VBVMR_Login();
|
||||
|
35
lib/bus.ps1
35
lib/bus.ps1
@ -11,7 +11,7 @@ class Bus {
|
||||
Param_Set -PARAM $cmd -VALUE $set
|
||||
}
|
||||
|
||||
[int] Getter($cmd) {
|
||||
[Single] Getter($cmd) {
|
||||
return Param_Get -PARAM $cmd
|
||||
}
|
||||
|
||||
@ -42,6 +42,18 @@ class Bus {
|
||||
$this._mute = $this.Setter($this.cmd('Mute'), $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_gain = $($this | Add-Member ScriptProperty 'gain' `
|
||||
{
|
||||
# get
|
||||
$this.Getter($this.cmd('gain'))
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( [Single]$arg )
|
||||
$this._gain = $this.Setter($this.cmd('gain'), $arg)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Function Buses {
|
||||
@ -54,14 +66,21 @@ Function Buses {
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
Login
|
||||
. .\voicemeeter.ps1
|
||||
|
||||
$bus = Buses
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$bus[0].mono = 1
|
||||
$bus[0].mono
|
||||
$bus[0].mono = 0
|
||||
$bus[0].mono
|
||||
$vmr.Login()
|
||||
|
||||
Logout
|
||||
$vmr.bus[0].mono = 1
|
||||
$vmr.bus[0].mono
|
||||
$vmr.bus[0].mono = 0
|
||||
$vmr.bus[0].mono
|
||||
|
||||
$vmr.bus[1].gain = 3.2
|
||||
$vmr.bus[1].gain
|
||||
$vmr.bus[2].gain = -2.0
|
||||
$vmr.bus[2].gain
|
||||
|
||||
$vmr.Logout()
|
||||
}
|
||||
|
@ -62,15 +62,18 @@ Function Buttons {
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
. .\voicemeeter.ps1
|
||||
|
||||
Login
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$button = Buttons
|
||||
$vmr.Login()
|
||||
|
||||
$button[0].state = 1
|
||||
$button[0].state
|
||||
$button[0].state = 0
|
||||
$button[0].state
|
||||
$vmr.button = Buttons
|
||||
|
||||
Logout
|
||||
$vmr.button[0].state = 1
|
||||
$vmr.button[0].state
|
||||
$vmr.button[0].state = 0
|
||||
$vmr.button[0].state
|
||||
|
||||
$vmr.Logout()
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class Strip {
|
||||
Param_Set -PARAM $cmd -VALUE $set
|
||||
}
|
||||
|
||||
[int] Getter($cmd) {
|
||||
[Single] Getter($cmd) {
|
||||
return Param_Get -PARAM $cmd
|
||||
}
|
||||
|
||||
@ -150,6 +150,18 @@ class Strip {
|
||||
$this._B3 = $this.Setter($this.cmd('B3'), $arg)
|
||||
}
|
||||
)
|
||||
|
||||
hidden $_gain = $($this | Add-Member ScriptProperty 'gain' `
|
||||
{
|
||||
# get
|
||||
$this.Getter($this.cmd('gain'))
|
||||
}`
|
||||
{
|
||||
# set
|
||||
param ( [Single]$arg )
|
||||
$this._gain = $this.Setter($this.cmd('gain'), $arg)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Function Strips {
|
||||
@ -162,15 +174,22 @@ Function Strips {
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
. .\voicemeeter.ps1
|
||||
|
||||
Login
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$strip = Strips
|
||||
$vmr.Login()
|
||||
|
||||
$strip[1].A1 = 1
|
||||
$strip[1].A1
|
||||
$strip[2].A2 = 0
|
||||
$strip[2].A2
|
||||
$vmr.strip[1].A1 = 1
|
||||
$vmr.strip[1].A1
|
||||
$vmr.strip[2].A2 = 0
|
||||
$vmr.strip[2].A2
|
||||
|
||||
Logout
|
||||
|
||||
$vmr.strip[1].gain = 3.2
|
||||
$vmr.strip[1].gain
|
||||
$vmr.strip[2].gain = -2.0
|
||||
$vmr.strip[2].gain
|
||||
|
||||
$vmr.Logout()
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
. $PSScriptRoot\base.ps1
|
||||
. $PSScriptRoot\strip.ps1
|
||||
. $PSScriptRoot\bus.ps1
|
||||
. $PSScriptRoot\macrobuttons.ps1
|
||||
|
||||
class Remote {
|
||||
[String]$type
|
||||
|
Loading…
Reference in New Issue
Block a user