logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<1516171819>»
Options
Go to last post Go to first unread
doggy  
#321 Posted : Friday, December 16, 2022 6:37:34 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: mirrormatt86 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
'Is a input Running or on Pause retrieved from the API xml
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim StateOf = (x.SelectSingleNode("//input[@type='Replay']/@state").Value)
'or
dim StateOf = (x.SelectSingleNode("//input[@number='10']/@state").Value)
Console.WriteLine(StateOf)


so this results in an error. Great scripting "for dummies"


And maybe you could explain when and what error you are getting and what your goal is ?
mirrormatt86  
#322 Posted : Saturday, December 17, 2022 12:59:38 PM(UTC)
mirrormatt86

Rank: Member

Groups: Registered
Joined: 12/13/2022(UTC)
Posts: 15
Australia

Originally Posted by: doggy Go to Quoted Post
Originally Posted by: mirrormatt86 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
'Is a input Running or on Pause retrieved from the API xml
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim StateOf = (x.SelectSingleNode("//input[@type='Replay']/@state").Value)
'or
dim StateOf = (x.SelectSingleNode("//input[@number='10']/@state").Value)
Console.WriteLine(StateOf)


so this results in an error. Great scripting "for dummies"


And maybe you could explain when and what error you are getting and what your goal is ?


Didn’t see this. Don’t have notifications on. Am in the middle of the Australian outback.

If you copy that script in to your vMix you’ll see that it returns either an invalid argument or an undefined error.
doggy  
#323 Posted : Saturday, December 17, 2022 7:15:04 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: mirrormatt86 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: mirrormatt86 Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
'Is a input Running or on Pause retrieved from the API xml
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim StateOf = (x.SelectSingleNode("//input[@type='Replay']/@state").Value)
'or
dim StateOf = (x.SelectSingleNode("//input[@number='10']/@state").Value)
Console.WriteLine(StateOf)


so this results in an error. Great scripting "for dummies"


And maybe you could explain when and what error you are getting and what your goal is ?


Didn’t see this. Don’t have notifications on. Am in the middle of the Australian outback.

If you copy that script in to your vMix you’ll see that it returns either an invalid argument or an undefined error.


You are right, my appologies for not explaining that snippits of code a lot of times do not apply to ones own setup correctly.
- do you have a replay input or an input # 10 in your setup?
- twice doing a "dim StatOff .." like here is wrong. Pik one or the other line of code ( or comment one out like the word "or" is)
- its an example of how one can retrieve a status by refering by the input number or by the type of an input here (see diff in specifying) . Should have specified if one wanted a state of both such inputs one should/could use another variable name
- those are examples , often even not the only way to achieve something by code
- good catch, thank you
ferex.media  
#324 Posted : Sunday, January 15, 2023 3:28:10 AM(UTC)
ferex.media

Rank: Newbie

Groups: Registered
Joined: 1/14/2023(UTC)
Posts: 6
Man
Kazakhstan
Location: Astana

Thanks: 2 times
Hello !
I try to find a way for Add audio file as new input ( mp3 ) , but get file path from selected row of DataSource ( Excel table ) .
My problem is how to get file path from DataSource.

Please Help )))
doggy  
#325 Posted : Sunday, January 15, 2023 3:44:23 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: ferex.media Go to Quoted Post
Hello !
I try to find a way for Add audio file as new input ( mp3 ) , but get file path from selected row of DataSource ( Excel table ) .
My problem is how to get file path from DataSource.

Please Help )))


Link the datasource to a (visually unused) title field
read the content of the title field (the filepath)
perfrom the function to load as input the gathered filepath
ferex.media  
#326 Posted : Sunday, January 15, 2023 4:25:32 AM(UTC)
ferex.media

Rank: Newbie

Groups: Registered
Joined: 1/14/2023(UTC)
Posts: 6
Man
Kazakhstan
Location: Astana

Thanks: 2 times
Originally Posted by: doggy Go to Quoted Post


Link the datasource to a (visually unused) title field
read the content of the title field (the filepath)
perfrom the function to load as input the gathered filepath


How can I correctly read the content ? What command do it right. Also I think I need to assign this value to a any variable ?

doggy  
#327 Posted : Sunday, January 15, 2023 4:32:23 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: ferex.media Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post


Link the datasource to a (visually unused) title field
read the content of the title field (the filepath)
perfrom the function to load as input the gathered filepath


How can I correctly read the content ? What command do it right. Also I think I need to assign this value to a any variable ?



There are multiple examples on how to read from title and put results in a variable in this specific about scripting thread (17 pages) you posted this question in
Good idea is to read thorugh this whole post/thread to learn about scripting
thanks 1 user thanked doggy for this useful post.
ferex.media on 1/15/2023(UTC)
ferex.media  
#328 Posted : Sunday, January 15, 2023 5:34:50 PM(UTC)
ferex.media

Rank: Newbie

Groups: Registered
Joined: 1/14/2023(UTC)
Posts: 6
Man
Kazakhstan
Location: Astana

Thanks: 2 times
Script for get filepath from DataSource and Add that file as new Input and rename it.

dim track as string = Input.Find("TRACK").Text("Headline.Text")
console.writeline(track)
API.Function("AddInput",Value:="AudioFile|"&track)

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

dim nodeList as XmlNodeList = x.GetElementsByTagName("input")
dim inputNumber as string
for each node as XmlElement In nodeList
inputNumber = node.GetAttribute("number")
next
console.Writeline("Last Input : " & inputNumber)
API.Function("SetInputName",Input:=inputNumber,Value:="MUSIC " & inputNumber)
API.Function("SetText",Input:="TRACK",SelectedIndex:="1" ,Value:="MUSIC " & inputNumber)


Great Thank for doggy !!!
ferex.media  
#329 Posted : Wednesday, January 18, 2023 8:40:42 AM(UTC)
ferex.media

Rank: Newbie

Groups: Registered
Joined: 1/14/2023(UTC)
Posts: 6
Man
Kazakhstan
Location: Astana

Thanks: 2 times
Can I get the current number of raw of DataSource?


For create script - next player
ferex.media  
#330 Posted : Wednesday, January 18, 2023 5:09:09 PM(UTC)
ferex.media

Rank: Newbie

Groups: Registered
Joined: 1/14/2023(UTC)
Posts: 6
Man
Kazakhstan
Location: Astana

Thanks: 2 times
How do You thing - Can I load API.XML file of other VMIX at the same network ?
doggy  
#331 Posted : Wednesday, January 18, 2023 8:03:09 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: ferex.media Go to Quoted Post
How do You thing - Can I load API.XML file of other VMIX at the same network ?


refer to the correct IP of the machine
doggy  
#332 Posted : Wednesday, January 18, 2023 8:07:23 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: ferex.media Go to Quoted Post
Can I get the current number of raw of DataSource?


No (would need to handle your datasource externally coded

Quote:

For create script - next player


please read the documentation "Shortcut Function Reference"
DataSourceNextRow
mirrormatt86  
#333 Posted : Wednesday, January 18, 2023 8:53:34 PM(UTC)
mirrormatt86

Rank: Member

Groups: Registered
Joined: 12/13/2022(UTC)
Posts: 15
Australia

Code:

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

'set the name of your list
dim SI = (x.SelectSingleNode("//input[@shortTitle='Wowsers']/@selectedIndex").Value)

'set the numbers of your list items and decide what to do
If SI = "14" Then
API.Function("Selectindex", Value:="1", Input:="Wowsers")
ElseIf SI < 14 Then
API.Function("NextItem", Input:="1")
End if


Only works if 'Wowsers' is the first item in the preset.
(Put any source in front of it and it does not work, does not error out)
nikosman88  
#334 Posted : Wednesday, January 18, 2023 9:54:34 PM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 474
Greece
Location: athens

Thanks: 118 times
Was thanked: 68 time(s) in 64 post(s)
Originally Posted by: mirrormatt86 Go to Quoted Post
Code:

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

'set the name of your list
dim SI = (x.SelectSingleNode("//input[@shortTitle='Wowsers']/@selectedIndex").Value)

'set the numbers of your list items and decide what to do
If SI = "14" Then
API.Function("Selectindex", Value:="1", Input:="Wowsers")
ElseIf SI < 14 Then
API.Function("NextItem", Input:="1")
End if


Only works if 'Wowsers' is the first item in the preset.
(Put any source in front of it and it does not work, does not error out)


"NextItem", Input:="1" -->try to change also this value either to name you give or input number of list
Black Dog  
#335 Posted : Thursday, January 19, 2023 3:24:19 AM(UTC)
Black Dog

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Location: Moscow

Thanks: 3 times
Hello!
Is it possible to get a state on\off layer-N of input-N?
In xml i see only key of some input in layer but i dont know state of layer.
doggy  
#336 Posted : Thursday, January 19, 2023 3:56:10 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Hello!
Is it possible to get a state on\off layer-N of input-N?
In xml i see only key of some input in layer but i dont know state of layer.


Can find that state in the Last.vmix preset file (maybe in named preset file also) . Mind you this Last.vmix preset file autoupdates only every minute
Black Dog  
#337 Posted : Saturday, January 21, 2023 11:59:10 PM(UTC)
Black Dog

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Location: Moscow

Thanks: 3 times
Thanks, Doggy!
That states for all inputs must be in preset if preset is stored and last preset. But to get one is hard from preset.
I have two ways to get one, but those are not good ideas, I think other ways are.

1) input
Layer1 -on
Layer2-none
Layer3-off
Layer4-none
After changing state of each layer change a name input as state layer On-1, Off-0, None-3
Rename input - 1303
I can’t use input by name, I can use it only by key. I have to give the name for input manually the first time and this is not quite right. All scripts change state layers must rename inputs.

2) In other way write states to a file. Make file and write state layers by all scripts which can change state layers.
Should write inputs manually the first time.
doggy  
#338 Posted : Sunday, January 22, 2023 12:42:44 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 953 time(s) in 788 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Thanks, Doggy!
That states for all inputs must be in preset if preset is stored and last preset. But to get one is hard from preset.


Not really , they are xml files (some items are strings that contain xml code of thei own-) )
Salvatore  
#339 Posted : Monday, January 23, 2023 4:02:19 AM(UTC)
Salvatore

Rank: Advanced Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 72
Italy

Thanks: 8 times
Was thanked: 9 time(s) in 7 post(s)
Originally Posted by: Black Dog Go to Quoted Post
Hello!
Is it possible to get a state on\off layer-N of input-N?
In xml i see only key of some input in layer but i dont know state of layer.


maybe this workaround will help.
Instead of switch the layer on/off you can change the Layer Input to "none" (with shortcuts) and then check the status with a script.

somethings like:

Code:
dim Input1Layer1on as string = ""
dim Input1Layer1on_exists as string = "yes"
try
Input1Layer1on = (x.SelectSingleNode("//input[@number='"& Input1name &"']/overlay[@index='0']/@key").value)
Catch ex as Exception
Input1Layer1on_exists = "no"
end try

if Input1Layer1on_exists = "yes" then...do something crazy

thanks 1 user thanked Salvatore for this useful post.
Black Dog on 1/23/2023(UTC)
Black Dog  
#340 Posted : Monday, January 23, 2023 7:49:08 PM(UTC)
Black Dog

Rank: Newbie

Groups: Registered
Joined: 4/7/2021(UTC)
Posts: 5
Location: Moscow

Thanks: 3 times
Thanks, Salvatore!
All layers turn On. Then "OFF" as "Set_Layer_NONE" and "ON" as Set_Layer_SomeInput. That is good idea.
Well, I need to rewrite all the scripts (((( with new idea.

Sorry, in code - Input_number as Numder or Input_name as Title. Somebody can copy code and VB_Try hides typing error )))
Originally Posted by: Salvatore Go to Quoted Post

Code:

Input1Layer1on = (x.SelectSingleNode("//input[@number='"& Input1name &"']/overlay[@index='0']/@key").value)
Users browsing this topic
Guest
26 Pages«<1516171819>»
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.