Hi everyone,
I am just new to this forum and I hope that some experienced scripting users can help me with a problem I am not able to solve.
I found in VMix-Wiki a very interesting solution to realize a quadsplitt tallylight.
It uses a gtzip template as an overlay to a multiviewer quadsplitt and a script to change text and colour of the overlay, depending on which input is active.
This works pretty good but only with inputs which are directly switched to the main output.
I would like to extend the capability to inputs which are used as an overlay source on the main output.
I am a scripting beginner and tried the whole day to find a solution without any success.
Here is the script, which is doing well with the directly switched input:
do while true
Dim doc As New XmlDocument()
doc.LoadXml(API.Xml)
Dim root As XmlNode = doc.DocumentElement
Dim node As XmlNode = root.SelectSingleNode("/vmix/active")
Dim inputNumber as Integer = node.InnerXml
If inputNumber = 1 Then
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOL.Text") = "Kamera 1 ONAIR"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOR.Text") = "Kamera 2"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUL.Text") = "Kamera 3"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUR.Text") = "PGM K1"
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG1.Text",Value:="red")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG2.Text",Value:="black")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG3.Text",Value:="black")
'API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG4.Text",Value:="black")
end if
If inputNumber = 2 Then
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOL.Text") = "Kamera 1"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOR.Text") = "Kamera 2 ONAIR"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUL.Text") = "Kamera 3"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUR.Text") = "PGM K2"
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG1.Text",Value:="black")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG2.Text",Value:="red")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG3.Text",Value:="black")
'API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG4.Text",Value:="black")
end if
If inputNumber = 3 Then
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOL.Text") = "Kamera 1"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextOR.Text") = "Kamera 2"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUL.Text") = "Kamera 3 ONAIR"
Input.Find("Quadsplitt_Rotlicht.gtzip").Text("TextUR.Text") = "PGM K3"
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG1.Text",Value:="black")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG2.Text",Value:="black")
API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG3.Text",Value:="red")
'API.Function("SetTextColour",Input:="Quadsplitt_Rotlicht.gtzip",SelectedName:="HG4.Text",Value:="black")
end if
sleep (200)
loop
For input e.g. 26 the corresponding node in the vmix API XML-File is
<active>26</active>
for the same input on lets say overlay 1 it is:
<overlays>
<overlay number="1">26</overlay>
<overlay number="2"/>
<overlay number="3"/>
<overlay number="4"/>
<overlay number="5"/>
<overlay number="6"/>
<overlay number="7"/>
<overlay number="8"/>
Is there any good idea how to change the script to meet the overlay needs?
I do not know whether it is possible within one script for active and overlay or whether it is easier to have two ore more scripts or whether it is possible at all.
Any help is very appreciated.