Last active
March 11, 2025 01:06
-
-
Save SysProfile/13431cbf447f9c5e6ef59219f9821775 to your computer and use it in GitHub Desktop.
Automatically reload vMix song list from a folder
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") | |
If files.Length > 0 Then | |
If state = "Running" Then | |
API.Function("Pause", Input:=inputName) | |
End If | |
API.Function("ListRemoveAll", Input:=inputName) | |
For Each file As String In files | |
API.Function("ListAdd", Input:=inputName, Value:=file) | |
Next | |
API.Function("ListShuffle", Input:=inputName) | |
API.Function("NextItem", Input:=inputName) | |
If state = "Running" Then | |
API.Function("Play", Input:=inputName) | |
End If | |
End If | |
Else | |
Console.WriteLine("No se encontró el input.") | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment