logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

26 Pages«<2223242526>
Options
Go to last post Go to first unread
doggy  
#461 Posted : Tuesday, November 21, 2023 5:40:21 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: Salvatore Go to Quoted Post
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
Salvatore  
#462 Posted : Tuesday, November 21, 2023 6:26:11 AM(UTC)
Salvatore

Rank: Advanced Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 72
Italy

Thanks: 8 times
Was thanked: 9 time(s) in 7 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salvatore Go to Quoted Post
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
doggy  
#463 Posted : Tuesday, November 21, 2023 7:04:40 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: Salvatore Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Salvatore Go to Quoted Post
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
nikosman88  
#464 Posted : Wednesday, November 22, 2023 10:37:46 PM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
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.
doggy  
#465 Posted : Wednesday, November 22, 2023 10:55:57 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
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.

nikosman88  
#466 Posted : Wednesday, November 22, 2023 11:20:27 PM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
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

doggy  
#467 Posted : Thursday, November 23, 2023 3:02:27 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: nikosman88 Go to Quoted Post

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
nikosman88  
#468 Posted : Thursday, November 23, 2023 3:21:55 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post

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
doggy  
#469 Posted : Thursday, November 23, 2023 8:33:58 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: nikosman88 Go to Quoted Post



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
thanks 1 user thanked doggy for this useful post.
nikosman88 on 11/24/2023(UTC)
nikosman88  
#470 Posted : Friday, November 24, 2023 12:02:57 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post



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!
randigusti  
#471 Posted : Saturday, December 2, 2023 8:15:35 AM(UTC)
randigusti

Rank: Newbie

Groups: Registered
Joined: 12/2/2023(UTC)
Posts: 4
Indonesia
Location: Jakarta

Hello , can you help me with this situation :
if countdown on the gt 10 second left then the color change
nikosman88  
#472 Posted : Saturday, December 2, 2023 9:12:27 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: randigusti Go to Quoted Post
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
doggy  
#473 Posted : Saturday, December 2, 2023 9:14:29 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: randigusti Go to Quoted Post
Hello , can you help me with this situation :
if countdown on the gt 10 second left then the color change


Why post same question in 2 different posts ?

What have you been able to figure out seeing you posted in this thread after reading through it ?

Have you tried a search ?

https://forums.vmix.com/...ock-for-events#post83255

https://forums.vmix.com/...ng-for-Dummies#post99770
randigusti  
#474 Posted : Sunday, December 3, 2023 4:35:33 AM(UTC)
randigusti

Rank: Newbie

Groups: Registered
Joined: 12/2/2023(UTC)
Posts: 4
Indonesia
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
nikosman88  
#475 Posted : Sunday, December 3, 2023 7:18:20 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 482
Greece
Location: athens

Thanks: 120 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: randigusti Go to Quoted Post
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
doggy  
#476 Posted : Monday, January 15, 2024 1:43:16 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 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
thanks 1 user thanked doggy for this useful post.
dmwkr on 1/16/2024(UTC)
bd9565  
#477 Posted : Saturday, January 20, 2024 10:01:42 PM(UTC)
bd9565

Rank: Newbie

Groups: Registered
Joined: 10/19/2020(UTC)
Posts: 3
Russian Federation

Thanks: 1 times
Dear guys.
How can I suspend / hibernate / shutdown my Windows10 PC with the vMix script ?
doggy  
#478 Posted : Sunday, January 21, 2024 12:56:20 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: bd9565 Go to Quoted Post
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
bd9565  
#479 Posted : Sunday, January 21, 2024 3:16:31 AM(UTC)
bd9565

Rank: Newbie

Groups: Registered
Joined: 10/19/2020(UTC)
Posts: 3
Russian Federation

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
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") 
doggy  
#480 Posted : Sunday, January 21, 2024 3:24:18 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,202
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
Originally Posted by: bd9565 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
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")
thanks 1 user thanked doggy for this useful post.
bd9565 on 1/21/2024(UTC)
Users browsing this topic
26 Pages«<2223242526>
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.