logo

Live Production Software Forums


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

Notification

Icon
Error

Options
Go to last post Go to first unread
fideba  
#1 Posted : Tuesday, July 26, 2022 6:58:11 PM(UTC)
fideba

Rank: Member

Groups: Registered
Joined: 11/5/2021(UTC)
Posts: 16
Belgium

Thanks: 2 times
Hi,

I have a Title input with about 100 presets.
I want to create a shortcut, that moves each time to the next preset. That works fine. However, I want to detect that, if a preset contains "(N)", that preset shouldn't be selected, but instead, it should jump to the next preset (I'll use that to, in that case, move to the next slide on another input).
That detection seems to fail. Instead of moving to the next preset, it does display the "(N)", and on the next time I press the shortcut, it skips the next preset. I've been programming for a very long time (clearly not in vmix :-)), but this one puzzles me.

So in this code, I basically move to the next preset (based on the content on DynamicValue1. If it's (N), then I skip one further.

Code:
Dim VmixXML as new system.xml.xmldocument
Dim Dynamic1Val as Integer= 1

VmixXML.loadxml(API.XML)
dim title_text as string
Dim title_input_no as integer = 2

dim Dynamic1Node As XmlNode = VmixXML.selectSingleNode("/vmix/dynamic/value1")
Dynamic1Val = Dynamic1Node.InnerText
Dynamic1Val+=1 
API.Function("SetDynamicValue1", Value:=Dynamic1Val)
API.Function("SelectTitlePreset",Input:="Subtitles",Value:=Dynamic1Val)

title_text=""
title_text = (VmixXML.SelectSingleNode("//inputs//input[" & title_input_no & "]//text[1]").InnerText)

if title_text="(N)" then
    Dynamic1Val+=1 
    API.Function("SetDynamicValue1", Value:=Dynamic1Val)
    API.Function("SelectTitlePreset",Input:="Subtitles",Value:=Dynamic1Val)
end if


I'm overlooking something... :-). Any ideas ?
doggy  
#2 Posted : Tuesday, July 26, 2022 7:44:46 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Might be easier/more efficient to work with datasources instead of presets especially with that many data rows :-)

before being abe to evaluate the data has to go to the title first ( selected )
an easier way to check on content of a data field ( textblock) is using the scripting function = Input.Find("Titlename").Text("TextBlockName.Text") as such no neeed to read the API XML
When using a data source instead just select the next row . No need for using Dynamic values

Personally i prefer to have textfields that have to be avaluated in a hidden textblock
thanks 1 user thanked doggy for this useful post.
fideba on 7/27/2022(UTC)
fideba  
#3 Posted : Wednesday, July 27, 2022 6:26:44 PM(UTC)
fideba

Rank: Member

Groups: Registered
Joined: 11/5/2021(UTC)
Posts: 16
Belgium

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Might be easier/more efficient to work with datasources instead of presets especially with that many data rows :-)

before being abe to evaluate the data has to go to the title first ( selected )
an easier way to check on content of a data field ( textblock) is using the scripting function = Input.Find("Titlename").Text("TextBlockName.Text") as such no neeed to read the API XML
When using a data source instead just select the next row . No need for using Dynamic values

Personally i prefer to have textfields that have to be avaluated in a hidden textblock


using input.find magically solved my issue, thanks a lot, it was driving my crazy !
Now that it works, I will try it to switch to a datasource, as you suggested, I've indeed noticed that using a large list of presets considerably slows things down.

Thanks a lot !!

Filip
fideba  
#4 Posted : Wednesday, July 27, 2022 11:57:24 PM(UTC)
fideba

Rank: Member

Groups: Registered
Joined: 11/5/2021(UTC)
Posts: 16
Belgium

Thanks: 2 times
Originally Posted by: fideba Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Might be easier/more efficient to work with datasources instead of presets especially with that many data rows :-)

before being abe to evaluate the data has to go to the title first ( selected )
an easier way to check on content of a data field ( textblock) is using the scripting function = Input.Find("Titlename").Text("TextBlockName.Text") as such no neeed to read the API XML
When using a data source instead just select the next row . No need for using Dynamic values

Personally i prefer to have textfields that have to be avaluated in a hidden textblock


using input.find magically solved my issue, thanks a lot, it was driving my crazy !
Now that it works, I will try it to switch to a datasource, as you suggested, I've indeed noticed that using a large list of presets considerably slows things down.

Thanks a lot !!

Filip


And suddenly, life became much more simpler :-)

Code:
API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")

dim title_text as string
title_text=Input.Find("TitleTest").Text("Headline.Text")

if title_text="(N)" then
    API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")
    API.Function("NextItem",Input:="Slides1")

end if

Thanks again for your help !
doggy  
#5 Posted : Thursday, July 28, 2022 12:49:14 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Sorry couldn't resist ;-)

Code:
API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")

if Input.Find("TitleTest").Text("Headline.Text") ="(N)" then
    API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")
    API.Function("NextItem",Input:="Slides1")
end if
fideba  
#6 Posted : Thursday, July 28, 2022 2:18:50 AM(UTC)
fideba

Rank: Member

Groups: Registered
Joined: 11/5/2021(UTC)
Posts: 16
Belgium

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post
Sorry couldn't resist ;-)

Code:
API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")

if Input.Find("TitleTest").Text("Headline.Text") ="(N)" then
    API.Function("DataSourceNextRow",Value:="Speech1,Sheet1")
    API.Function("NextItem",Input:="Slides1")
end if


loool, we saved another few bytes ;-)
Users browsing this topic
Guest (2)
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.