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) |
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
DROP FUNCTION IF EXISTS SECONDS_BETWEEN_TIMESTAMP; | |
DELIMITER $$ | |
CREATE FUNCTION `SECONDS_BETWEEN_TIMESTAMP`(START_TIMESTAMP TIMESTAMP, END_TIMESTAMP TIMESTAMP, RETURN_RESULT VARCHAR (20)) RETURNS BIGINT(20) CHARSET utf8 | |
READS SQL DATA | |
DETERMINISTIC | |
BEGIN | |
DECLARE TOTAL_SECS INTEGER; | |
DECLARE START_DATE DATE; | |
DECLARE END_DATE DATE; | |
DECLARE TOTAL_DAY_SAT INTEGER; |
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
DROP FUNCTION IF EXISTS BIG_SEC_TO_TIME_WITH_DAY; | |
DELIMITER $$ | |
CREATE FUNCTION BIG_SEC_TO_TIME_WITH_DAY(SECS BIGINT, SHOWDAYS BOOLEAN) | |
RETURNS TEXT | |
READS SQL DATA | |
DETERMINISTIC | |
BEGIN | |
/* Basically you can send the seconds (beyond the limit of the SEC_TO_TIME() function) and you decide if it is expressed only in hours or days. */ | |
DECLARE DAYS TEXT; | |
DECLARE HOURS TEXT; |