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/10/16 06:56] – [Fetches the color of a shape from a GTtitle and then performs an action based on the color] 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 507: | Line 526: | ||
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. | 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 {{ :: | 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 | ||
+ | |||
+ | ' | ||
+ | 'API.Function(" | ||
+ | |||
+ | |||
+ | if colorValue | ||
+ | 'do something | ||
+ | API.Function(" | ||
+ | else | ||
+ | 'do something other | ||
+ | API.Function("SetText", | ||
+ | end if | ||
+ | sleep(1000) 'waits 1 second to loop | ||
+ | loop | ||
</ | </ | ||
- | via HTTP API | + | |
- | < | + | |
scripting_examples.1697432209.txt.gz · Last modified: 2023/10/20 19:45 (external edit)