scripting_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting_examples [2023/06/18 21:55] – [gets Audio Titelname from a INPUT (Musictitle)] peteraellig | scripting_examples [2023/11/15 16:59] (current) – [turns off all SOLOs] peteraellig | ||
---|---|---|---|
Line 237: | Line 237: | ||
API.Function(" | API.Function(" | ||
Next</ | Next</ | ||
+ | |||
+ | |||
+ | ===== turns off all SOLOs ===== | ||
+ | < | ||
+ | Dim busValues As String() = {" | ||
+ | For Each value As String In busValues | ||
+ | API.Function(" | ||
+ | Next | ||
+ | |||
+ | ' | ||
+ | Dim xmlDoc As New XmlDocument() | ||
+ | Dim i as integer | ||
+ | xmlDoc.LoadXml(API.Xml) | ||
+ | Dim inputNodes As XmlNodeList = xmlDoc.SelectNodes("/ | ||
+ | Dim inputCount As Integer = inputNodes.Count | ||
+ | for i = 1 to inputcount | ||
+ | API.Function(" | ||
+ | Next | ||
+ | </ | ||
===== gets Audio Titelname from a INPUT (Musictitle) ===== | ===== gets Audio Titelname from a INPUT (Musictitle) ===== | ||
Line 502: | Line 521: | ||
via HTTP API | via HTTP API | ||
< | < | ||
+ | |||
+ | ===== Fetches the color of a shape from a GTtitle and then performs an action based on the color ===== | ||
+ | |||
+ | This is a script that shows how to read the color of a shape from a title and then perform an action based on the color. The script must be started and runs in the background as a loop. | ||
+ | the title used in the example can be downloaded {{ :: | ||
+ | {{: | ||
+ | |||
+ | gets the color value of a shape in a gtzip-title: | ||
+ | {{: | ||
+ | and writes the value in the Text.Text field\\ | ||
+ | {{: | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | 'load the XML data from vMix | ||
+ | dim xml as string = API.XML() | ||
+ | dim x as new system.xml.xmldocument | ||
+ | x.loadxml(xml) | ||
+ | |||
+ | ' define title and text field for searching color | ||
+ | Dim TITLE As String = " | ||
+ | Dim SHAPE As String = " | ||
+ | Dim TEXTFIELD as string =" | ||
+ | |||
+ | ' | ||
+ | Dim xpath As String = "// | ||
+ | |||
+ | ' select color element using the XPath | ||
+ | Dim colorNode As System.Xml.XmlNode = x.SelectSingleNode(xpath) | ||
+ | |||
+ | ' get color value from shape | ||
+ | Dim colorValue As String = colorNode.InnerText | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | |||
+ | |||
+ | if colorValue = "# | ||
+ | 'do something | ||
+ | API.Function(" | ||
+ | else | ||
+ | 'do something other | ||
+ | API.Function(" | ||
+ | end if | ||
+ | sleep(1000) 'waits 1 second to loop | ||
+ | loop | ||
+ | </ | ||
scripting_examples.1687118148.txt.gz · Last modified: 2023/10/20 19:45 (external edit)