Created
October 14, 2018 07:24
-
-
Save imorrish/0eac59207b95dbe7187ef57e358b2ef5 to your computer and use it in GitHub Desktop.
Revisions
-
imorrish created this gist
Oct 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ $monitor=3 #ATEM input to trigger play and stop function ConnectToATEM() { Try{ $ATEMipAddress = (Get-ItemProperty -path 'HKCU:\Software\Blackmagic Design\ATEM Software Control').ipAddress $DocumentsPath = [Environment]::GetFolderPath("MyDocuments") + '\windowspowershell\SwitcherLib.dll' add-type -path $DocumentsPath $Global:atem = New-Object SwitcherLib.Switcher($ATEMipAddress) $atem.Connect() } catch{ write-host "Can't connect to ATEM on $($ATEMipAddrss)." Write-Host "ATEM controle software must be installed and have connected to switcher at least one time" exit } } ConnectToATEM $me=$atem.GetMEs() $Global:me1=$me[0] $Global:Program = $me1.program do{ [Int32]$CurrentProgram = $Global:me1.Program # | get-member if($Global:Program -ne $CurrentProgram){ if($CurrentProgram -eq $monitor){ #Play write-host "Play" } elseif($Global:Program -eq $monitor){ #Stop write-host "Stop" } $Global:Program = $CurrentProgram } start-sleep -Milliseconds 10 }while($true)