Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,318  Location: Belgium Thanks: 299 times Was thanked: 977 time(s) in 810 post(s)
|
Display remaining time of a list playout on a title ( for shits and giggles) in response to https://forums.vmix.com/...ing-countdown#post116907Code:'Get the total duration of a List script by Doggy
'assuming the first item in that list is selected !!!
'playout is set to Auto Next and Auto First !!!
'Things that ight offset the time between countdown and play are transitions used for the list
Dim listInput as integer = 3 'input number of list
Dim titleInp as integer = 5 'input number of title
Dim textIndex as Integer = 0 ' textfield to set countdown
' Takes a while to Process , depending on number of items in the list !!
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(API.XML())
Dim nodeList As XmlNodeList = x.SelectNodes("//list/item")
dim count as integer = nodeList.count()
dim selected as string
dim duration as integer
' if first item is not selected add a routine here to do so
' skip to each item in list to get the duration and tally up
for i as integer = 0 to count-1
x.loadxml(API.XML())
nodeList = x.SelectNodes("//list/item")
duration += x.SelectSingleNode("//input[@number='3']/@duration").Value
API.Function("NextItem", Input:=3)
sleep(300)
next
' Convert ms the time
Dim ts as Timespan= TimeSpan.FromMilliseconds(duration )
Sleep(300)
'Optional
'setting countdown and starting list playback and Countdown
API.Function("StopCountDown", Input:=titleInp ,SelectedIndex:=textIndex )
sleep(100)
API.Function("SetCountDown", Input:=titleInp ,SelectedIndex:=textIndex ,Value:= ts.ToString("hh\:mm\:ss"))
API.Function("ListPlayout",Input:=listInput)
sleep(500) 'adjusting for function calls time
Api.Function("StartCountdown",Input:=titleInp )
API.Function("OverlayInput1In",Input:=titleInp )
'Can add triggers on CountdownCompleted to remove overlay and make a transition
|
 1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/2/2025(UTC) Posts: 1  Location: Kuala Lumpur
|
hi guys, i have a problem with my scripting, i wish to get my recording status for my following action, for instance, when i toggle my script, if recording status is active i would like to have my title transition out and stop my recording, whereby if recording was not active upon toggling the script i would like to have my recording active and transition in for my title, is it possible?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,318  Location: Belgium Thanks: 299 times Was thanked: 977 time(s) in 810 post(s)
|
Originally Posted by: NicholasLowFK  hi guys, i have a problem with my scripting, i wish to get my recording status for my following action, for instance, when i toggle my script, if recording status is active i would like to have my title transition out and stop my recording, whereby if recording was not active upon toggling the script i would like to have my recording active and transition in for my title, is it possible? Sure it can , what have you tried so far (can post it here) ? (as there are meny examples in this thread) https://forums.vmix.com/...ng-for-Dummies#post71124
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,318  Location: Belgium Thanks: 299 times Was thanked: 977 time(s) in 810 post(s)
|
Duration, position and time remaining of current playing clip of List Code:' timeleft clip in list
dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim pos as decimal=0
dim dur as decimal =0
dim Timeleft as decimal = 0
do while true
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
activeinput = (x.SelectSingleNode("//active").InnerText)
if activeinput = "3" ' the # of list input
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)/1000
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)/1000
if decimal.TryParse(duration ,dur) then
dur = Math.Truncate(dur)
end if
if decimal.TryParse(position ,pos) then
pos = Math.Truncate(pos)
end if
Timeleft = Math.Truncate(dur - pos)
' display in title input 4 first Textfield duration/position/time remaining
API.Function("SetText",Input:="4",SelectedIndex:="0",Value:=dur.tostring() & " / " & pos.tostring() & " / " & Timeleft.tostring())
end if
sleep(100)
loop
|
|
|
|
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