From 1d115f4132ea6090ab7dc195782f73da3bbca72f Mon Sep 17 00:00:00 2001 From: norm Date: Fri, 4 Nov 2022 02:07:23 +0000 Subject: [PATCH] reword in readme add print obs, ws versions --- examples/obs/README.md | 5 ++++- examples/obs/Vm-Obs-Sync.ps1 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/obs/README.md b/examples/obs/README.md index 7760121..2a0cfa0 100644 --- a/examples/obs/README.md +++ b/examples/obs/README.md @@ -9,7 +9,8 @@ Demonstrates how to sync Voicemeeter states with OBS scene switches. ## Use -This example assumes your OBS connection info saved in `config.psd1`, placed next to `Vm-Obs-Sync.ps1`: +This example assumes the following: +- OBS connection info saved in `config.psd1`, placed next to `Vm-Obs-Sync.ps1`: ```psd1 @{ @@ -19,4 +20,6 @@ This example assumes your OBS connection info saved in `config.psd1`, placed nex } ``` +- OBS scenes named `START`, `BRB`, `END` and `LIVE` + Simply run the script and change current OBS scene. diff --git a/examples/obs/Vm-Obs-Sync.ps1 b/examples/obs/Vm-Obs-Sync.ps1 index 09b3541..ddb9ed7 100644 --- a/examples/obs/Vm-Obs-Sync.ps1 +++ b/examples/obs/Vm-Obs-Sync.ps1 @@ -18,7 +18,7 @@ function CurrentProgramSceneChanged($data) { "BRB" { $vmr.strip[0].gain = -8.3 } "END" { $vmr.strip[0].mono = $true } "LIVE" { $vmr.strip[0].color_x = 0.3 } - default { "Expected START, BRB, END or LIVE scene" | Write-Host } + default { "Expected START, BRB, END or LIVE scene" | Write-Warning; return } } $info[$data.SceneName] | Write-Host } @@ -33,6 +33,9 @@ function main { $vmr = Get-RemoteBasic $conn = ConnFromFile $r_client = Get-OBSRequest -hostname $conn.hostname -port $conn.port -pass $conn.password + $resp = $r_client.getVersion() + "obs version:" + $resp.obsVersion | Write-Host + "websocket version:" + $resp.obsWebSocketVersion | Write-Host $e_client = Get-OBSEvent -hostname $conn.hostname -port $conn.port -pass $conn.password $callbacks = @("CurrentProgramSceneChanged", ${function:CurrentProgramSceneChanged})