auto login added, tests updated to take $true, $false

Added $this.Login() into Remote constructor to automatically log user in.

Updated test codes accordingly.

Boolean params take $true and $false

Updated readme to reflect changes.
This commit is contained in:
Onyx and Iris
2021-04-29 00:48:16 +01:00
parent ffc46fae94
commit 8a3b8da635
8 changed files with 199 additions and 243 deletions

View File

@@ -21,11 +21,9 @@ class Strip {
hidden $_mono = $($this | Add-Member ScriptProperty 'mono' `
{
# get
$this.Getter($this.cmd('Mono'))
}`
{
# set
param ( [Single]$arg )
$this._mono = $this.Setter($this.cmd('Mono'), $arg)
}
@@ -33,11 +31,9 @@ class Strip {
hidden $_solo = $($this | Add-Member ScriptProperty 'solo' `
{
# get
$this.Getter($this.cmd('Solo'))
}`
{
# set
param ( [Single]$arg )
$this._solo = $this.Setter($this.cmd('Solo'), $arg)
}
@@ -45,11 +41,9 @@ class Strip {
hidden $_mute = $($this | Add-Member ScriptProperty 'mute' `
{
# get
$this.Getter($this.cmd('Mute'))
}`
{
# set
param ( [Single]$arg )
$this._mute = $this.Setter($this.cmd('Mute'), $arg)
}
@@ -57,11 +51,9 @@ class Strip {
hidden $_A1 = $($this | Add-Member ScriptProperty 'A1' `
{
# get
$this.Getter($this.cmd('A1'))
}`
{
# set
param ( [Single]$arg )
$this._A1 = $this.Setter($this.cmd('A1'), $arg)
}
@@ -69,11 +61,9 @@ class Strip {
hidden $_A2 = $($this | Add-Member ScriptProperty 'A2' `
{
# get
$this.Getter($this.cmd('A2'))
}`
{
# set
param ( [Single]$arg )
$this._A2 = $this.Setter($this.cmd('A2'), $arg)
}
@@ -81,11 +71,9 @@ class Strip {
hidden $_A3 = $($this | Add-Member ScriptProperty 'A3' `
{
# get
$this.Getter($this.cmd('A3'))
}`
{
# set
param ( [Single]$arg )
$this._A3 = $this.Setter($this.cmd('A3'), $arg)
}
@@ -93,11 +81,9 @@ class Strip {
hidden $_A4 = $($this | Add-Member ScriptProperty 'A4' `
{
# get
$this.Getter($this.cmd('A4'))
}`
{
# set
param ( [Single]$arg )
$this._A4 = $this.Setter($this.cmd('A4'), $arg)
}
@@ -105,11 +91,9 @@ class Strip {
hidden $_A5 = $($this | Add-Member ScriptProperty 'A5' `
{
# get
$this.Getter($this.cmd('A5'))
}`
{
# set
param ( [Single]$arg )
$this._A5 = $this.Setter($this.cmd('A5'), $arg)
}
@@ -117,11 +101,9 @@ class Strip {
hidden $_B1 = $($this | Add-Member ScriptProperty 'B1' `
{
# get
$this.Getter($this.cmd('B1'))
}`
{
# set
param ( [Single]$arg )
$this._B1 = $this.Setter($this.cmd('B1'), $arg)
}
@@ -129,11 +111,9 @@ class Strip {
hidden $_B2 = $($this | Add-Member ScriptProperty 'B2' `
{
# get
$this.Getter($this.cmd('B2'))
}`
{
# set
param ( [Single]$arg )
$this._B2 = $this.Setter($this.cmd('B2'), $arg)
}
@@ -141,11 +121,9 @@ class Strip {
hidden $_B3 = $($this | Add-Member ScriptProperty 'B3' `
{
# get
$this.Getter($this.cmd('B3'))
}`
{
# set
param ( [Single]$arg )
$this._B3 = $this.Setter($this.cmd('B3'), $arg)
}
@@ -153,11 +131,9 @@ class Strip {
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)
}
@@ -175,21 +151,19 @@ Function Strips {
if ($MyInvocation.InvocationName -ne '.')
{
. .\voicemeeter.ps1
try {
$vmr = [Remote]::new('potato')
$vmr = [Remote]::new('potato')
$vmr.Login()
$vmr.strip[1].A1 = 1
$vmr.strip[1].A1
$vmr.strip[2].A2 = 0
$vmr.strip[2].A2
$vmr.strip[1].A1 = $true
$vmr.strip[1].A1
$vmr.strip[2].A2 = $false
$vmr.strip[2].A2
$vmr.strip[1].gain = 3.2
$vmr.strip[1].gain
$vmr.strip[2].gain = -2.0
$vmr.strip[2].gain
$vmr.Logout()
$vmr.strip[1].gain = 3.2
$vmr.strip[1].gain
$vmr.strip[2].gain = -2.0
$vmr.strip[2].gain
}
finally { $vmr.Logout() }
}