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 Bus {
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 Bus {
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)
}
@@ -45,11 +41,9 @@ class Bus {
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)
}
@@ -67,20 +61,18 @@ Function Buses {
if ($MyInvocation.InvocationName -ne '.')
{
. .\voicemeeter.ps1
try {
$vmr = [Remote]::new('potato')
$vmr = [Remote]::new('potato')
$vmr.bus[0].mono = $true
$vmr.bus[0].mono
$vmr.bus[0].mono = $false
$vmr.bus[0].mono
$vmr.Login()
$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()
$vmr.bus[1].gain = 3.2
$vmr.bus[1].gain
$vmr.bus[2].gain = -2.0
$vmr.bus[2].gain
}
finally { $vmr.Logout() }
}