Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Concat string AND variables in one string (can use + sign too but not adviced)
|
|
|
|
Rank: Member
Groups: Registered
Joined: 10/13/2020(UTC) Posts: 14 Location: Annandale Thanks: 1 times
|
I tried this but it didn't work I must be doing something wrong. I added the code and gave it to correct name Originally Posted by: timobr Thanks guys, I found the Timecode Reader a bit buggy and needed to be opened in sequence and kept failing switching between videos. vMix Input Progress Monitor App looks promising but doesn't have a simple time remaining as an output. Finally figured out how to get this script working which was posted elsewhere: Originally Posted by: Xtreemtec Media So based on 2 programs above from Doggy, I made a Video player time left title display that you can add on top of the Clock source by using the Multiview to stack upon. While the code is not 100% perfect yet and only displays MM;SS But it gives you some idea and it's workable. Till 60 seconds it's green, Turns then orange, and the last 10 seconds it's red. Code:' Checking time left of active running video and display this as an title.
' and do some stuff at certain time remaining
dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 10 '10 seconds before end
dim triggerduration as integer = 2000 'fade duration, could be different than trigger
do while true
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)
Timeleft= Double.Parse(duration)-Double.Parse(position)
Timeleft = Timeleft / 100
dim Timingleft as integer = CInt(Timeleft)
Timingleft = Timingleft / 10
dim Minutes as integer = Timingleft \ 60
dim Seconds as integer = Timingleft Mod 60
'used at debugging stage
' console.writeline(Timingleft)
' console.writeline(Seconds)
dim ThisTime as string
ThisTime = Minutes.ToString("00") + ":" + Seconds.ToString("00")
if Timingleft < 60
'put a response in a title and change color accordingly
API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=Timingleft) ' Value:=":", Value:=Seconds)
if Timingleft < 30
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="red")
else
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="orange")
end if
else
API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=ThisTime)
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="green")
end if
sleep(50)
Loop
Thanks doggy, never wanted to be 'that guy' that can't search the forum first. I did a bunch of google and YouTube searching before I came to the forums and couldn't find anything other than video countdowns.
|
|
|
|
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