mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-06-09 18:00:23 +01:00
run through formatter
This commit is contained in:
parent
2d6437d37b
commit
0f68a2373d
@ -1,7 +1,7 @@
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[switch]$interactive,
|
||||
[String]$kind = "banana",
|
||||
[String]$kind = 'banana',
|
||||
[String[]]$script = @()
|
||||
)
|
||||
|
||||
@ -20,20 +20,20 @@ function get-value {
|
||||
|
||||
function msgHandler {
|
||||
param([object]$vmr, [string]$line)
|
||||
$line + " passed to handler" | Write-Debug
|
||||
if ($line[0] -eq "!") {
|
||||
"Toggling " + $line.substring(1) | Write-Debug
|
||||
$line + ' passed to handler' | Write-Debug
|
||||
if ($line[0] -eq '!') {
|
||||
'Toggling ' + $line.substring(1) | Write-Debug
|
||||
$retval = get-value -vmr $vmr -line $line.substring(1)
|
||||
$vmr.Setter($line.substring(1), 1 - $retval)
|
||||
}
|
||||
elseif ($line.Contains("=")) {
|
||||
elseif ($line.Contains('=')) {
|
||||
"Setting $line" | Write-Debug
|
||||
$vmr.SendText($line)
|
||||
}
|
||||
else {
|
||||
"Getting $line" | Write-Debug
|
||||
$retval = get-value -vmr $vmr -line $line
|
||||
$line + " = " + $retval | Write-Host
|
||||
$line + ' = ' + $retval | Write-Host
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ function main {
|
||||
$vmr = Connect-Voicemeeter -Kind $kind
|
||||
|
||||
if ($interactive) {
|
||||
"Press <Enter> to exit" | Write-Host
|
||||
'Press <Enter> to exit' | Write-Host
|
||||
read-hostuntilempty -vmr $vmr
|
||||
return
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ param()
|
||||
Import-Module ..\..\lib\Voicemeeter.psm1
|
||||
|
||||
try {
|
||||
$vmr = Connect-Voicemeeter -Kind "potato"
|
||||
$vmr = Connect-Voicemeeter -Kind 'potato'
|
||||
|
||||
$buses = @($vmr.bus[1], $vmr.bus[2], $vmr.bus[4], $vmr.bus[6])
|
||||
"Buses in selection: $($buses)"
|
||||
$unmutedIndex = $null
|
||||
|
||||
# 1)
|
||||
"Cycling through bus selection to check for first unmuted Bus..." | Write-Host
|
||||
'Cycling through bus selection to check for first unmuted Bus...' | Write-Host
|
||||
foreach ($bus in $buses) {
|
||||
# 2)
|
||||
if (-not $bus.mute) {
|
||||
|
@ -6,28 +6,28 @@ Import-Module obs-powershell
|
||||
|
||||
function CurrentProgramSceneChanged {
|
||||
param([System.Object]$data)
|
||||
Write-Host "Switched to scene", $data.sceneName
|
||||
Write-Host 'Switched to scene', $data.sceneName
|
||||
|
||||
switch ($data.sceneName) {
|
||||
"START" {
|
||||
'START' {
|
||||
$vmr.strip[0].mute = !$vmr.strip[0].mute
|
||||
}
|
||||
"BRB" {
|
||||
'BRB' {
|
||||
$vmr.strip[0].gain = -8.3
|
||||
}
|
||||
"END" {
|
||||
'END' {
|
||||
$vmr.strip[0].mono = $true
|
||||
}
|
||||
"LIVE" {
|
||||
'LIVE' {
|
||||
$vmr.strip[0].color_x = 0.3
|
||||
}
|
||||
default { "Expected START, BRB, END or LIVE scene" | Write-Warning; return }
|
||||
default { 'Expected START, BRB, END or LIVE scene' | Write-Warning; return }
|
||||
}
|
||||
}
|
||||
|
||||
function ExitStarted {
|
||||
param([System.Object]$data)
|
||||
"OBS shutdown has begun!" | Write-Host
|
||||
'OBS shutdown has begun!' | Write-Host
|
||||
break
|
||||
}
|
||||
|
||||
@ -38,12 +38,12 @@ function eventHandler($data) {
|
||||
}
|
||||
|
||||
function ConnFromFile {
|
||||
$configpath = Join-Path $PSScriptRoot "config.psd1"
|
||||
$configpath = Join-Path $PSScriptRoot 'config.psd1'
|
||||
return Import-PowerShellDataFile -Path $configpath
|
||||
}
|
||||
|
||||
function main {
|
||||
$vmr = Connect-Voicemeeter -Kind "basic"
|
||||
$vmr = Connect-Voicemeeter -Kind 'basic'
|
||||
|
||||
$conn = ConnFromFile
|
||||
$job = Watch-OBS -WebSocketURI "ws://$($conn.host):$($conn.port)" -WebSocketToken $conn.password
|
||||
|
Loading…
x
Reference in New Issue
Block a user