Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: Salvatore Hy guys, It is possible to change a Text value by Looking for name and Not for the Index nr? Code:API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectedIndex:="0", Value:="00:05")
Something like: API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", Selectet Name:="countdown1.Text", Value:="00:05") Yes / see post #5 // you answered your own question
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/15/2021(UTC) Posts: 72 Thanks: 8 times Was thanked: 9 time(s) in 7 post(s)
|
Originally Posted by: doggy Originally Posted by: Salvatore Hy guys, It is possible to change a Text value by Looking for name and Not for the Index nr? Code:API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectedIndex:="0", Value:="00:05")
Something like: API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectetName:="countdown1.Text", Value:="00:05") Yes / see post #5 // you answered your own question unfortunately this doesn't work. That's why I asked You mean to change the Countdown selected by Name the API.Function is „SetText… and Not ChangeCountdown"… I give it a try
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: Salvatore Originally Posted by: doggy Originally Posted by: Salvatore Hy guys, It is possible to change a Text value by Looking for name and Not for the Index nr? Code:API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectedIndex:="0", Value:="00:05")
Something like: API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectetName:="countdown1.Text", Value:="00:05") Yes / see post #5 // you answered your own question unfortunately this doesn't work. That's why I asked You mean to change the Countdown selected by Name the API.Function is „SetText… and Not ChangeCountdown"… I give it a try ChangeCountdown changes the time when its allready running and time is in the HH:mm:ss format Also check spelling (SelectedName with a d) a good idea is to verify a function by use of its shortcut The question was in regards to be able to use the slectedName not in regards to a countdown which has multiple functions to control it (change,se, start , pause etc SetText is the most basic function to populate a title field and is NOT related to a countdown
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: doggy Originally Posted by: nikosman88 Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167 the script is this for example for overlay1 channel Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you get the Input's innertext matching the number Code:'X is the variable holding the input number
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
maybe im stupid but i cant manage how to do it.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: nikosman88 Originally Posted by: doggy Originally Posted by: nikosman88 Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167 the script is this for example for overlay1 channel Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you get the Input's innertext matching the number Code:'X is the variable holding the input number
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
maybe im stupid but i cant manage how to do it. What is the issue? Chatgpt not giving an answer? OP asked to retrieve the name op an input that is refered to by the number retrieved from the overlay given from the api xml.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: doggy Originally Posted by: nikosman88 Originally Posted by: doggy Originally Posted by: nikosman88 Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167 the script is this for example for overlay1 channel Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you get the Input's innertext matching the number Code:'X is the variable holding the input number
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
maybe im stupid but i cant manage how to do it. What is the issue? Chatgpt not giving an answer? OP asked to retrieve the name op an input that is refered to by the number retrieved from the overlay given from the api xml. The issue is that i cant understand the message error it gives to me. it says operator "is not defined for types 'string' and 'system.xml.xmlDocument'. Chatgpt give some answers that in theory may work but unfortunatelly doesnt know the limitations that vmix script vb.net console have that not recognise correct that functions that exist in vb.net like end sub and etc.. So i hope that vmix in version 28+ will include and support 100% full vb.net support so people that are really dummies like me,will do the job via the new technology if they try
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: nikosman88 The issue is that i cant understand the message error it gives to me. it says operator "is not defined for types 'string' and 'system.xml.xmlDocument'. Chatgpt give some answers that in theory may work but unfortunatelly doesnt know the limitations that vmix script vb.net console have that not recognise correct that functions that exist in vb.net like end sub and etc.. So i hope that vmix in version 28+ will include and support 100% full vb.net support so people that are really dummies like me,will do the job via the new technology if they try
showing the code might help us figure it out keep in mind that when trying to read the API XML and the data searching for is empty a script will throw an error. One should take that in account within a script to catch this to avoid the script crashing. If one wants to take full advantage of vb.net better create scripts outside of vMix (using visual studio) .This will allow you to create functions and subs. Vmix dosnt allow subs etc , see helpfiles Doubt highly vMix will ever make a visual studio substitude
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: doggy Originally Posted by: nikosman88 The issue is that i cant understand the message error it gives to me. it says operator "is not defined for types 'string' and 'system.xml.xmlDocument'. Chatgpt give some answers that in theory may work but unfortunatelly doesnt know the limitations that vmix script vb.net console have that not recognise correct that functions that exist in vb.net like end sub and etc.. So i hope that vmix in version 28+ will include and support 100% full vb.net support so people that are really dummies like me,will do the job via the new technology if they try
showing the code might help us figure it out keep in mind that when trying to read the API XML and the data searching for is empty a script will throw an error. One should take that in account within a script to catch this to avoid the script crashing. If one wants to take full advantage of vb.net better create scripts outside of vMix (using visual studio) .This will allow you to create functions and subs. Vmix dosnt allow subs etc , see helpfiles Doubt highly vMix will ever make a visual studio substitude Code:
''''''''''''''''
' Script von Mats Julian Steffens
' www.lvstrm.de
''''''''''''''''
'
' Log everything you are playing
'
''''''''''''''''
dim dateinamealt as string = ""
do
dim datum as string
datum = DateTime.Now.ToString("yyMMdd")
dim filename as string
filename="C:\vMix overlay\overlay1\"+datum+"-vmixlog.txt" 'Where to save the file
If (Not System.IO.File.Exists(filename)) Then
My.Computer.FileSystem.WriteAllText(filename, " ", True)
End If
''''''''''''''''
dim timestamp as string
timestamp = DateTime.Now.ToString("dd/MM/yy HH:mm:ss")
dim xml as string = API.XML()
dim ovl1input as string = ""
dim x as new system.xml.xmldocument
x.loadxml(xml)
ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
dim dateiname as string = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
if (ovl1input = nothing)
'we don't have 2 PIP overlays, no point in continuing then
end if
dim inputnamelaenge as string
If (ovl1input = dateiname) Then
inputnamelaenge = 0
Else
inputnamelaenge = ovl1input.Length()+3
End If
dim inputString as string
'Datei schreiben
If (dateinamealt <> dateiname) Then
inputString = timestamp + " " + dateiname.Substring(inputnamelaenge) + Environment.NewLine
Console.WriteLine(inputString)
My.Computer.FileSystem.WriteAllText(filename, inputString, True)
dateinamealt = dateiname
End If
sleep(1000)
loop
i know that i must somehow assign the X to take dynamically the name of the input but dont understand how to do this
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: nikosman88 Code:ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
dim dateiname as string = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
i know that i must somehow assign the X to take dynamically the name of the input but dont understand how to do this A good idea is to learn some basics about vb.net (or any language) and the use of variables instead of relying on chatgpt or willy nilly throwing something into existing copied code line 1 and 2 above do exactly the same thing : putting the inputnumber used as overlay in a (different) variable As mentioned before "' X is the variable holding the input number" and you are using a different variable (ovl1input and dateiname , but have not define X) So need to replace the variable reference (X) to yours in the example code Code:ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
Dim name as string = x.SelectSingleNode("//input[@number=" & ovl1input & "]/@title").InnerText
console.writeline(name )
Mind the little addition/correction by the added /@title Also there is no error trapping (Try..Catch) included hence when calling this and there is no overlay active you will get an error/script crash Also a good idea to check returns is to display the results in the console for instant debugging
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: doggy Originally Posted by: nikosman88 Code:ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
dim dateiname as string = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
i know that i must somehow assign the X to take dynamically the name of the input but dont understand how to do this A good idea is to learn some basics about vb.net (or any language) and the use of variables instead of relying on chatgpt or willy nilly throwing something into existing copied code line 1 and 2 above do exactly the same thing : putting the inputnumber used as overlay in a (different) variable As mentioned before "' X is the variable holding the input number" and you are using a different variable (ovl1input and dateiname , but have not define X) So need to replace the variable reference (X) to yours in the example code Code:ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
Dim name as string = x.SelectSingleNode("//input[@number=" & ovl1input & "]/@title").InnerText
console.writeline(name )
Mind the little addition/correction by the added /@title Also there is no error trapping (Try..Catch) included hence when calling this and there is no overlay active you will get an error/script crash Also a good idea to check returns is to display the results in the console for instant debugging Thank you very much. It work perfect. Yes it crash when there is no overlay but i can very easy workaround over it. Yes you`re right about learning the basics of a language but this seems to me, like a mountain even higher from everest! Google of course has all the needed info but someone needs years to read all that info. AI is not the solution for everything and if you see my posts here in forum. i never throw an AI answer without a bit of explain or without having it try first myself. Anyway thank you again, you saved me another one time!
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/2/2023(UTC) Posts: 4 Location: Jakarta
|
Hello , can you help me with this situation : if countdown on the gt 10 second left then the color change
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: randigusti Hello , can you help me with this situation : if countdown on the gt 10 second left then the color change Hi you made double post. Personally i give you possible answers in the other thread you made
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/2/2023(UTC) Posts: 4 Location: Jakarta
|
Hello sorry before i double my question , i dont know i send double. And i have try to searc but cant find it. But your answer help me , thankyou for that. Now i have new case , hope you can help me.
My situasion like this : I have video input , how i change the video input by directory ? Example i have video input with this directory “C:/Videos/map.mp4” can you help me to change the video input with just change the “map.mp4” on the directory so i have many videos in “C:/Videos/“ i want to call the video on that directory alternately with just one input on vmix. but i change the directory through excel or google sheet or notepad or other beginner editor text. Sorry if my english not good
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 520 Location: athens Thanks: 125 times Was thanked: 71 time(s) in 67 post(s)
|
Originally Posted by: randigusti Hello sorry before i double my question , i dont know i send double. And i have try to searc but cant find it. But your answer help me , thankyou for that. Now i have new case , hope you can help me.
My situasion like this : I have video input , how i change the video input by directory ? Example i have video input with this directory “C:/Videos/map.mp4” can you help me to change the video input with just change the “map.mp4” on the directory so i have many videos in “C:/Videos/“ i want to call the video on that directory alternately with just one input on vmix. but i change the directory through excel or google sheet or notepad or other beginner editor text. Sorry if my english not good Hello. Vmix cannot change "on the fly" a input. Yes there is in the input settings in the up right corner the button "change" but this work only manual way. Something in an auto way that vmix api commands support is add a video input or remove an existing video input. With this in mind yes it is possible to do what you need if you know how to do it. Some steps you may possible have to follow 1. Make a new title as vmix input and link to it the datasource that will have the path of the videos or any other info that needs 2.Make a script that will read the info from the title and when the text changes (according to what you select in datasource manager) will do a search in the c:\videos folder and it will send the command to add the new name video input and remove if need the old one In this thread you will find some other examples to start. In theory is something like this. In practice if you never make script again and you need it quickly, you need to study a lot or pray a guru-expert guy of this thread will give you the whole solution Or the most simple way make a list input,put there all your videos,disable the auto-next if not need and do from there the whole play-pause
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Countdown to date and time with auto reset/advance Countdown to date and time with optional function(s) trigger resetting it to next date/time interval . example: every seven days at same time Code:Dim enddate As DateTime = DateTime.Parse("2024-1-21 10:30:00")
Dim startdate As DateTime
Dim ts As TimeSpan
Dim count as string
Do while true
startdate = DateTime.Parse(Date.Now)
ts = enddate.Subtract(startdate)
if enddate >= startdate
count=CStr((ts.Days) & " days " & CStr(ts.Hours)) & " Hrs, " & CStr(ts.Minutes) & " mins, " & CStr(ts.Seconds) & " secs"
API.Function("SetText",Input:="9",SelectedName:="Headline.Text",Value:=count)
'console.writeline(count)
sleep(1000)
else
' any function acting as trigger when countdown is finished
' and resetting countdown
enddate=enddate.AddDays(7)
end if
Loop
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/19/2020(UTC) Posts: 3 Thanks: 1 times
|
Dear guys. How can I suspend / hibernate / shutdown my Windows10 PC with the vMix script ?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: bd9565 Dear guys. How can I suspend / hibernate / shutdown my Windows10 PC with the vMix script ? Not sure if this for serious useage or to "prank" a system but google can give you the answer (hence i dont post the code just yet) Hint: vb.net shutdown windows
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/19/2020(UTC) Posts: 3 Thanks: 1 times
|
Originally Posted by: doggy Hint: vb.net shutdown windows Thank you. It's not a prunk. I really need to suspend PC at the end of night stream. I found the solution Code: Process.Start("c:\windows\system32\rundll32.exe", "powrprof.dll,SetSuspendState")
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,230 Location: Belgium Thanks: 293 times Was thanked: 956 time(s) in 791 post(s)
|
Originally Posted by: bd9565 Originally Posted by: doggy Hint: vb.net shutdown windows Thank you. It's not a prunk. I really need to suspend PC at the end of night stream. I found the solution Code: Process.Start("c:\windows\system32\rundll32.exe", "powrprof.dll,SetSuspendState")
well this works for shutting down (change value of 00 for time delay) . it calls shutdown.exe Code:Process.Start("shutdown", "-s -f -t 00")
|
1 user thanked doggy for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close