mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 21:30:46 +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
21
lib/base.ps1
21
lib/base.ps1
@ -51,13 +51,10 @@ Function Param_Set_Multi {
|
|||||||
[string[]]$params = ($HASH | out-string -stream) -ne '' | Select-Object -Skip 2
|
[string[]]$params = ($HASH | out-string -stream) -ne '' | Select-Object -Skip 2
|
||||||
[String]$cmd = [String]::new(512)
|
[String]$cmd = [String]::new(512)
|
||||||
ForEach ($line in $params) {
|
ForEach ($line in $params) {
|
||||||
$line = $($line -replace '\s+', ' ')
|
if($line.Trim() -Match "(^\w+)\[(\d)\].(\w+)\s+(\w+)") {
|
||||||
$line = $line.TrimEnd()
|
if($Matches[4] -eq "True") { $val = [String]1 } else { $val = [String]0 }
|
||||||
$line = $line -replace '\s', '='
|
$cmd += "$($Matches[1])[$($Matches[2])].$($Matches[3])=$val;"
|
||||||
$line = $line -replace 'True', '1'
|
}
|
||||||
$line = $line -replace 'False', '0'
|
|
||||||
|
|
||||||
$cmd += $line + ';'
|
|
||||||
}
|
}
|
||||||
[String]$cmd = $cmd.SubString(1)
|
[String]$cmd = $cmd.SubString(1)
|
||||||
|
|
||||||
@ -254,13 +251,3 @@ Function P_Dirty {
|
|||||||
Function M_Dirty {
|
Function M_Dirty {
|
||||||
[Bool][Voicemeeter.Remote]::VBVMR_MacroButton_IsDirty()
|
[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
|
$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
|
$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
|
$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