mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 13:20:47 +00:00
add regex to base, remove tests from modules
Parse multi set params using regex Remove tests from each module
This commit is contained in:
parent
2f1508e8f1
commit
63a56c7a72
23
lib/base.ps1
23
lib/base.ps1
@ -51,13 +51,10 @@ Function Param_Set_Multi {
|
||||
[string[]]$params = ($HASH | out-string -stream) -ne '' | Select-Object -Skip 2
|
||||
[String]$cmd = [String]::new(512)
|
||||
ForEach ($line in $params) {
|
||||
$line = $($line -replace '\s+', ' ')
|
||||
$line = $line.TrimEnd()
|
||||
$line = $line -replace '\s', '='
|
||||
$line = $line -replace 'True', '1'
|
||||
$line = $line -replace 'False', '0'
|
||||
|
||||
$cmd += $line + ';'
|
||||
if($line.Trim() -Match "(^\w+)\[(\d)\].(\w+)\s+(\w+)") {
|
||||
if($Matches[4] -eq "True") { $val = [String]1 } else { $val = [String]0 }
|
||||
$cmd += "$($Matches[1])[$($Matches[2])].$($Matches[3])=$val;"
|
||||
}
|
||||
}
|
||||
[String]$cmd = $cmd.SubString(1)
|
||||
|
||||
@ -212,7 +209,7 @@ Function Login {
|
||||
'basic' { $vbtype = 1; Break}
|
||||
'banana' { $vbtype = 2; Break}
|
||||
'potato' { $vbtype = 3; Break}
|
||||
Default { throw [LoginError]::new('Unknown Voicemeeter type') }
|
||||
Default { throw [LoginError]::new('Unknown Voicemeeter type') }
|
||||
}
|
||||
|
||||
$retval = [Int][Voicemeeter.Remote]::VBVMR_RunVoicemeeter([Int64]$vbtype)
|
||||
@ -254,13 +251,3 @@ Function P_Dirty {
|
||||
Function M_Dirty {
|
||||
[Bool][Voicemeeter.Remote]::VBVMR_MacroButton_IsDirty()
|
||||
}
|
||||
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
Login
|
||||
|
||||
Param_Set -PARAM 'garbagevalue' -Value $true
|
||||
|
||||
Logout
|
||||
}
|
||||
|
19
lib/bus.ps1
19
lib/bus.ps1
@ -57,22 +57,3 @@ Function Buses {
|
||||
}
|
||||
$bus
|
||||
}
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
. .\voicemeeter.ps1
|
||||
try {
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$vmr.bus[0].mono = $true
|
||||
$vmr.bus[0].mono
|
||||
$vmr.bus[0].mono = $false
|
||||
$vmr.bus[0].mono
|
||||
|
||||
$vmr.bus[1].gain = 3.2
|
||||
$vmr.bus[1].gain
|
||||
$vmr.bus[2].gain = -2.0
|
||||
$vmr.bus[2].gain
|
||||
}
|
||||
finally { $vmr.Logout() }
|
||||
}
|
||||
|
@ -59,17 +59,3 @@ Function Buttons {
|
||||
}
|
||||
$button
|
||||
}
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
. .\voicemeeter.ps1
|
||||
try {
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$vmr.button[0].state = $true
|
||||
$vmr.button[0].state
|
||||
$vmr.button[0].state = $false
|
||||
$vmr.button[0].state
|
||||
}
|
||||
finally { $vmr.Logout() }
|
||||
}
|
||||
|
@ -177,23 +177,3 @@ Function Strips {
|
||||
}
|
||||
$strip
|
||||
}
|
||||
|
||||
if ($MyInvocation.InvocationName -ne '.')
|
||||
{
|
||||
. .\voicemeeter.ps1
|
||||
try {
|
||||
$vmr = [Remote]::new('potato')
|
||||
|
||||
$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
|
||||
}
|
||||
finally { $vmr.Logout() }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user