logo

Live Production Software Forums


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

Notification

Icon
Error

2 Pages<12
Options
Go to last post Go to first unread
doggy  
#21 Posted : Wednesday, May 26, 2021 3:25:34 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
Concat string AND variables in one string (can use + sign too but not adviced)
Trilback  
#22 Posted : Monday, January 30, 2023 12:24:43 PM(UTC)
Trilback

Rank: Member

Groups: Registered
Joined: 10/13/2020(UTC)
Posts: 14
United States
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 Go to Quoted Post
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 Go to Quoted Post
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.


Users browsing this topic
Guest
2 Pages<12
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.