This file contains 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 characters
' Ejemplo de uso: | |
API.Function("SetDynamicValue1", Value:="datos") | |
API.Function("SetDynamicValue2", Value:="{""persona"":{""nombre"":""Juan"",""edad"":30}}") | |
API.Function("ScriptStart", Value:="jSON2XML") | |
Luego, para leer el resultado: | |
Dim xml As String = API.XML() | |
Dim doc As New Xml.XmlDocument() | |
doc.LoadXml(xml) | |
Dim nodo As Xml.XmlNode = doc.SelectSingleNode("//dynamic/value[@key='DynamicValue2']") | |
Dim valor As String = If(nodo IsNot Nothing, nodo.InnerText, "No encontrado") |
This file contains 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 characters
Dim xmlDoc As New XmlDocument | |
xmlDoc.LoadXML(API.XML()) | |
Dim inputName As String = "List" | |
Dim musicPath As String = String.Empty | |
musicPath = "D:\UniverFlix\@Common\Audios" | |
'musicPath = IO.Path.GetDirectoryName(xmlDoc.SelectSingleNode("/vmix/preset").InnerXml) & "\Audios" | |
Dim inputNode As Xml.XmlNode = xmlDoc.SelectSingleNode("/vmix/inputs/input[@shortTitle='" & inputName & "']") | |
If inputNode IsNot Nothing Then | |
Dim state As String = inputNode.Attributes("state").Value | |
Dim files() As String = IO.Directory.GetFiles(musicPath, "*.mp3") |
This file contains 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 characters
'Cómo se utiliza el código | |
'How to use the code | |
' | |
'Label: Temperature | |
'Dim strTemp As String = String.Format("{0:0.0}", Microsoft.VisualBasic.Val(xmlDoc.SelectSingleNode("/current/temperature").Attributes("value").Value)) | |
'API.Function("SetText", Input:="My input", Value:=strTemp, SelectedName:="myTitle.Text") | |
' | |
'This command changes the background image: | |
'Dim strImage As String = "http://openweathermap.org/img/wn/" & xmlDoc.SelectSingleNode("/current/weather").Attributes("icon").Value & ".png" | |
'API.Function("SetImage", Input:="My input", Value:= strImage) |