vMix Forums
»
General
»
General Discussion
»
Lumberjack Scripting once again
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
I admit it... I´m lost without you... Code: Dim In1 As String = ""
Dim InN1 As String = ""
Dim x As New XmlDocument()
x.Load("http://192.168.178.158:8088/api")
Dim nodes As XmlNodeList = x.DocumentElement.SelectNodes("/vmix/inputs/input[2]")
For Each node As XmlNode In nodes
In1 = x.SelectSingleNode("//overlay[4]/@key").InnerText
Next
Dim nodes2 As XmlNodeList = x.DocumentElement.SelectNodes("/vmix/inputs")
For Each node As XmlNode In nodes2
InN1 = x.SelectSingleNode("//input[@key 'In1']/@number").InnerText
Next
Purpose is to generate a "Red Light" frame in a custom Multi View (Blank with defined MV layout) independant of which Input is set in the different Multi View Previews. That for I first get the input key of the used MV overlay check, works then to compare with "SelectSingleNode("//active").InnerText" I need the input number, or am I wrong... When I use the key directly e.g. 6a971275-a9...aso I easily get the corresponding number... The rest is clear and working (RL indicating active input in multi view preview)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/31/2020(UTC) Posts: 144 Thanks: 2 times Was thanked: 28 time(s) in 28 post(s)
|
Code: Dim In1 As String = ""
Dim InN1 As String = ""
Dim x As New XmlDocument()
x.Load("http://192.168.178.158:8088/api")
Dim nodes As XmlNodeList = x.DocumentElement.SelectNodes("/vmix/inputs/input[2]")
For Each node As XmlNode In nodes
In1 = x.SelectSingleNode("//overlay[4]/@key").InnerText
Next
Dim nodes2 As XmlNodeList = x.DocumentElement.SelectNodes("/vmix/inputs")
For Each node As XmlNode In nodes2
InN1 = x.SelectSingleNode("//input[@key 'In1']/@number").InnerText
Next
This node selection and "for each" loop aren't doing anything. They can be omitted. Also, you probably shouldn't use a subscript of 4, but rather search for the overlay with the attribute "number" equal to 4. Then your last line, trying to select the input, you want to use the number attribute, not the key attribute, like: Code: Dim In1 As String = ""
Dim InN1 As String = ""
Dim x As New XmlDocument()
x.Load("http://192.168.178.158:8088/api")
In1 = x.SelectSingleNode("/vmix/overlays/overlay[@number='4']").InnerText
InN1 = x.SelectSingleNode($"/vmix/inputs/input[@number='{In1}']").InnerText
The dollar sign at the start of the string tells the interpreter to replace variables in {} brackets with their actual value. So that cleans up your existing code. I wasn't able to understand exactly what you're trying to do. But I hope this helps you in the right direction.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 10/31/2020(UTC) Posts: 144 Thanks: 2 times Was thanked: 28 time(s) in 28 post(s)
|
Originally Posted by: Chris Daum then to compare with "SelectSingleNode("//active").InnerText" I need the input number, or am I wrong... When I use the key directly e.g. 6a971275-a9...aso I easily get the corresponding number... Yes, the contents of the "active" element is the input number. If you want to select that input, you would do something along the lines of: Code: Dim active as String = x.SelectSingleNode("/vmix/active").InnerText
Dim activeInput as XmlNode = x.SelectSingleNode($"/vmix/inputs/input[@number='{active}']")
|
1 user thanked kross for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
Thanks Kross, I had to do some little adjustments: Code:In1 = x.SelectSingleNode("//overlay[4]/@key").InnerText
InN1 = x.SelectSingleNode($"//input[@key='{In1}']/@number").InnerText
active = x.SelectSingleNode("//active").InnerText
but your hint with the "String Announcement" and syntax solved the issue. With the gathered info I can control the "redlight" in the MV Overlay (GTZIP Title) you rock!!
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Lumberjack Scripting once again
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close