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
tk421  
#1 Posted : Monday, January 10, 2022 7:54:57 PM(UTC)
tk421

Rank: Member

Groups: Registered
Joined: 5/8/2021(UTC)
Posts: 11
Canada
Location: Burnaby

Thanks: 1 times
Was thanked: 11 time(s) in 3 post(s)
Is there a way to return multiple variables from one XPATH request via the TCP API? I would like to return all attributes from a specific input.
doggy  
#2 Posted : Tuesday, January 11, 2022 12:41:10 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: tk421 Go to Quoted Post
Is there a way to return multiple variables from one XPATH request via the TCP API? I would like to return all attributes from a specific input.


https://www.w3schools.com/xml/xpath_intro.asp
tk421  
#3 Posted : Tuesday, January 11, 2022 12:51:21 AM(UTC)
tk421

Rank: Member

Groups: Registered
Joined: 5/8/2021(UTC)
Posts: 11
Canada
Location: Burnaby

Thanks: 1 times
Was thanked: 11 time(s) in 3 post(s)
Right. So, would the request be
/vmix/inputs/input1/attributes::*
? I have tried a few commands that seemed as though they should return multiple values but I can only get 1 value returned per request. My issues could also be a node socket issue. This is my first experience with XPATH, thanks for the help.
doggy  
#4 Posted : Tuesday, January 11, 2022 1:30:30 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: tk421 Go to Quoted Post
Right. So, would the request be
/vmix/inputs/input1/attributes::*
? I have tried a few commands that seemed as though they should return multiple values but I can only get 1 value returned per request. My issues could also be a node socket issue. This is my first experience with XPATH, thanks for the help.


Could you be more specific pls. What exactly do you want to retrieve , why with one request , .... more info is always helpful to get proper answers

try /vmix/inputs/input[1]
tk421  
#5 Posted : Tuesday, January 11, 2022 5:38:03 PM(UTC)
tk421

Rank: Member

Groups: Registered
Joined: 5/8/2021(UTC)
Posts: 11
Canada
Location: Burnaby

Thanks: 1 times
Was thanked: 11 time(s) in 3 post(s)
I would like to retrieve the full list of attributes for a specific input node, ex:

<input key="cf0d1391-5d9b-40c8-a3f7-32687e05e249" number="1" type="GT" title="Text Middle Centre.gtzip" shortTitle="Text Middle Centre.gtzip" state="Running" position="0" duration="0" loop="False" selectedIndex="0">

Which I would assume would look something like this

key="cf0d1391-5d9b-40c8-a3f7-32687e05e249"
number="1"
type="GT"
title="Text Middle Centre.gtzip"
shortTitle="Text Middle Centre.gtzip"
state="Running"
position="0"
duration="0"
loop="False"
selectedIndex="0"

What I'm actually trying to return is the key, position, and duration of a specific input. Because of the async/listener design of the socket connection, the call does not actually return anything, rather a separate listener is triggered with response data from vmix. It would make things much easier if there was some form of id/key in that response. If request A is made and then B is made immediately after, there is the (slight) possibility of that response B returns before response A...correct? Is there another method of consuming TCP APIs without using sockets?

I have tried /vmix/inputs/input[1], which returns the inner text, title, of the node. Also, thank you for your help doggy
tk421  
#6 Posted : Tuesday, January 11, 2022 8:13:43 PM(UTC)
tk421

Rank: Member

Groups: Registered
Joined: 5/8/2021(UTC)
Posts: 11
Canada
Location: Burnaby

Thanks: 1 times
Was thanked: 11 time(s) in 3 post(s)
My suspicion is the response function from vmix will not multiple return values.

XMLTEXT /vmix/inputs/input[1]/attribute::*

=> Returns the key only, which is the first listed attribute in the node

XMLTEXT /vmix/inputs/input[1]/@key | /vmix/inputs/input[1]/@duration

=> Also returns the key only
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.