logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<89101112>»
Options
Go to last post Go to first unread
Chris Daum  
#181 Posted : Friday, January 14, 2022 2:57:25 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
For meterF1 returns a Value of something like 0.043xy you can not define it as Integer.
Best you declare a string variable. You could use a double Variable but probably must get rid of the dot

The conditional statement will work with a string as well.

If Value does no deliver a return use .InnerText instead

And.... you have to set "CR1 Mic" as [@title='Mic whatever']

And...... if you load VmixXML you can not refer to "x".SelectSingleNode

And........ the meterF1 will as long as earth moves never show a value of >100 (if, it would be heard at least to Saturn, or even Pluto)

And........... get rid of the Else if Value declaration, only use else. Your computer will know what to do

thanks 1 user thanked Chris Daum for this useful post.
josh_5tool on 1/14/2022(UTC)
RSB  
#182 Posted : Friday, January 14, 2022 3:08:50 AM(UTC)
RSB

Rank: Newbie

Groups: Registered
Joined: 5/30/2020(UTC)
Posts: 7
United Kingdom
Location: Rugby

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Just a quick question//

Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?

I couldn't find any info in the documentation and it errors if i try and make one.

Thanks in advance.
doggy  
#183 Posted : Friday, January 14, 2022 3:15:24 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: RSB Go to Quoted Post
Just a quick question//

Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?

I couldn't find any info in the documentation and it errors if i try and make one.

Thanks in advance.


From the help files :
vMix Scripting supports the majority of VB.NET 2.0 code that will work within a single sub or function.
This means that custom classes and structures are not supported, however you can use the vast majority of the built in base classes in the .NET framework

thanks 1 user thanked doggy for this useful post.
RSB on 1/14/2022(UTC)
doggy  
#184 Posted : Friday, January 14, 2022 3:19:01 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Chris Daum Go to Quoted Post

And........ the meterF1 will as long as earth moves never show a value of >100 (if, it would be heard at least to Saturn, or even Pluto)


WHAT !? could not hear lol ;-)
Chris Daum  
#185 Posted : Friday, January 14, 2022 3:20:10 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
Originally Posted by: RSB Go to Quoted Post
Just a quick question//

Can i presume we can't make vb functions because of the use of the word "Function" within the different scripting options?

I couldn't find any info in the documentation and it errors if i try and make one.

Thanks in advance.


vMix Scripting is not an IDE.

So you dont´t have the structure features like using visual studio.

If you want to use the functionalities that VS does deliver
you could write a Visual Basic Script or App
and control vMix via web api, like doggy apart from many other things shows at the beginning of this topic.

I mean looking at it a bit closer,
if you do something like
read the api
get the value "xy"
if value "xy" is whatever then
"do what you want"

is in the end more or less a function, although it does not return a value
so...
Roy Sinclair  
#186 Posted : Friday, January 14, 2022 3:41:31 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: josh_5tool Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post

Something is wrong with your vMix instalation

Version ? license type ?

Uh oh! We're running 24.0.0.72 on a Pro license. Haven't had any issues with scripting previously.

There are a few other identical VMix machines around the office that I'll test the script on today!


Actually there's another glaring error in the line: x.SelectSingleNode

Where did "x" come from? That should be VmixXML not "x".
thanks 2 users thanked Roy Sinclair for this useful post.
doggy on 1/14/2022(UTC), josh_5tool on 1/14/2022(UTC)
doggy  
#187 Posted : Friday, January 14, 2022 3:45:53 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Roy Sinclair Go to Quoted Post

Actually there's another glaring error in the line: x.SelectSingleNode

Where did "x" come from? That should be VmixXML not "x".


In fact that is the one causing that specific error :-)

thanks 1 user thanked doggy for this useful post.
josh_5tool on 1/14/2022(UTC)
josh_5tool  
#188 Posted : Friday, January 14, 2022 5:16:12 AM(UTC)
josh_5tool

Rank: Newbie

Groups: Registered
Joined: 8/18/2021(UTC)
Posts: 8
United States
Location: Boston

Thanks: 5 times
Thanks so much Chris and Doggy! I've been able to cobble together a script that works for what I was trying to do. I sincerely appreciate it!
gefiltafish  
#189 Posted : Tuesday, January 18, 2022 12:07:13 AM(UTC)
gefiltafish

Rank: Advanced Member

Groups: Registered
Joined: 12/5/2017(UTC)
Posts: 37
Location: Zagreb

Thanks: 8 times
heyo! I have a curiosity question:

I'm using a script that changes the position of input on Y, on my PC (lets call it PC1) and on the other PC (PC2) in the production. Both PCs have vMix 24.0.0.72 4k, and are uptodate.
Until today it worked with this code:

Dim gdrive as integer = Convert.toInt32(Input.Find("gdrive_count").Text("Message"))
Dim layer as integer = Convert.toInt32(Input.Find("gdrive_count").Text("Title"))

If gdrive = 2
API.Function("SetPanY",Input:="test",Value:=-0.295)
Dim PanY As String = "http://192.168.2.225:8088/API/?Function=SetPanY&input=test1&Value=-0.295"
Dim webClient As New System.Net.WebClient
Dim result2 As String = webClient.DownloadString(PanY)
End If


Today, instead of changing the Y axis of test input on PC1 to -0.295, it changes it to -295, which vMix naturally cannot do, so my input goes out of the screen. On PC2 everything is ok. But if I change the script to:

If gdrive = 2
Dim PanY1 As String = "http://127.0.0.1:8088/API/?Function=SetPanY&input=test&Value=-0.295"
Dim PanY2 As String = "http://192.168.2.225:8088/API/?Function=SetPanY&input=test1&Value=-0.295"
Dim webClient As New System.Net.WebClient
Dim result1 As String = webClient.DownloadString(PanY1)
Dim result2 As String = webClient.DownloadString(PanY2)
End If

It works as intended, as it worked until today.

Does anybody know why does this occur?
cutter07  
#190 Posted : Wednesday, January 19, 2022 7:52:04 AM(UTC)
cutter07

Rank: Advanced Member

Groups: Registered
Joined: 6/2/2012(UTC)
Posts: 103
Man
Location: Germany

Thanks: 13 times
Was thanked: 10 time(s) in 9 post(s)
Try replacing the dot with comma: -0.295 after 0,295
Maybe Windows is set differently
Roy Sinclair  
#191 Posted : Wednesday, January 19, 2022 8:07:50 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: cutter07 Go to Quoted Post
Try replacing the dot with comma: -0.295 after 0,295
Maybe Windows is set differently


Ah yes, if someone changed the locale of the PC then the punctuation for numbers could have been changed.
thanks 1 user thanked Roy Sinclair for this useful post.
gefiltafish on 1/20/2022(UTC)
gefiltafish  
#192 Posted : Thursday, January 20, 2022 7:09:43 AM(UTC)
gefiltafish

Rank: Advanced Member

Groups: Registered
Joined: 12/5/2017(UTC)
Posts: 37
Location: Zagreb

Thanks: 8 times
Originally Posted by: Roy Sinclair Go to Quoted Post
Originally Posted by: cutter07 Go to Quoted Post
Try replacing the dot with comma: -0.295 after 0,295
Maybe Windows is set differently


Ah yes, if someone changed the locale of the PC then the punctuation for numbers could have been changed.


ah, yes, somebody was playing with my PC, and changed my regional formatting ...

Thanks guys, for the help!
nowski  
#193 Posted : Thursday, January 27, 2022 10:26:27 PM(UTC)
nowski

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2017(UTC)
Posts: 135
Location: UK

Thanks: 15 times
Was thanked: 11 time(s) in 9 post(s)
I'm looking for a strategy to change the text colour in a Host UI (see Pic)

27-01-22_12-28-35_snap.jpg (220kb) downloaded 2 time(s).

The screen will display the currently selected topic (from a datasource row)
And also a list of available topics (8 text fields, with row1=text1, row2=text2 etc)
I want to highlight current topic selected in the available topics list - by setting the text colour - which I know I can do via a shortcut.
I guess my question is, how do I do that?
Assuming some scripting involved (what is the current row, set avialable topic row text colour = X, all the others to y )
Is that the right approach?

And how would I get the current datasource row?

Thanks
doggy  
#194 Posted : Thursday, January 27, 2022 11:11:14 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: nowski Go to Quoted Post



by using the SetTextColour shortcut function
One for each text another sortcut

Quote:
Assuming some scripting involved (what is the current row, set avialable topic row text colour = X, all the others to y )
Is that the right approach?

And how would I get the current datasource row?

one can not get the current row number but you can pecify the number

and use that to change that numbers text
one could play with the index number within a script too ( retrieve the text name related to that index number from the API XML for the setcolor function)

Could have shortcuts setting the index number and let a script do the color change based on that and reset the other colors to the original ones ( would be # buttons for the indexes and one to call the script ) in one script

Coold also adjust the title and have the topics doubled up ( a series with base colors and a series with the highlight colors on top of them and with the use of pages select a page which hides or unhides the selection color ones (one page per topic )


topic color.png (51kb) downloaded 3 time(s).
nowski  
#195 Posted : Thursday, January 27, 2022 11:47:38 PM(UTC)
nowski

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2017(UTC)
Posts: 135
Location: UK

Thanks: 15 times
Was thanked: 11 time(s) in 9 post(s)
I figured something out actually. (sometimes it just helps to write things down!)
First I set all the text to white:

Quote:
for i = 1 to 9
API.Function("SetTextColour",Input:="host_screen.gtzip",SelectedName:="List"+ i.toString +".Text",Value:="white")

next


then I pull a value from the Datasource which I set in the Sheet which is row
Quote:
Dim row as String =Input.Find("host_screen.gtzip").Text("row.Text")


Then I set the colour of the text:
Quote:
API.Function("SetTextColour",Input:="host_screen.gtzip",SelectedName:="List"+ row.toString +".Text",Value:="pink")


Almost works - just got to futz with the logic of the row numbers
nowski  
#196 Posted : Thursday, January 27, 2022 11:48:43 PM(UTC)
nowski

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2017(UTC)
Posts: 135
Location: UK

Thanks: 15 times
Was thanked: 11 time(s) in 9 post(s)
Thanks Doggy, thats an approach I will also try. Might well work better
SAJlAMAHDPA  
#197 Posted : Friday, January 28, 2022 12:03:36 AM(UTC)
SAJlAMAHDPA

Rank: Newbie

Groups: Registered
Joined: 12/6/2021(UTC)
Posts: 1

Good Day!
I often use various scripts to work in vmix, it makes the job easier .
The other day i saw on the internet how someone made an additional program for mix . I also had idea to transfer my scripts separately to the program, but then a problem arose. I succeeded in extracting information from vmix using api.xml, but i dont know how to change api.xml vmix. Does anyone have an idea how to do this?
Maybe there is an api.xml file in the vmix folders?

My example code to get information:
Dim url as string = "http://192.168.1.129:8089/api"
Dim x as new system.xml.xmldocument
x.Load(url)
dim a =x.SelectSingleNode("//input[@number='1'/text[@index = '0']").InnerText
Console.writeline(a)

To change the text field in the scripts, i used API.Function,and if we have a link "http://192.168.1.129:8089/api" instead of api.xml, then how to change the content?
doggy  
#198 Posted : Friday, January 28, 2022 2:03:53 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: SAJlAMAHDPA Go to Quoted Post
Good Day!
I often use various scripts to work in vmix, it makes the job easier .
The other day i saw on the internet how someone made an additional program for mix . I also had idea to transfer my scripts separately to the program, but then a problem arose. I succeeded in extracting information from vmix using api.xml, but i dont know how to change api.xml vmix. Does anyone have an idea how to do this?
Maybe there is an api.xml file in the vmix folders?

My example code to get information:
Dim url as string = "http://192.168.1.129:8089/api"
Dim x as new system.xml.xmldocument
x.Load(url)
dim a =x.SelectSingleNode("//input[@number='1'/text[@index = '0']").InnerText
Console.writeline(a)

To change the text field in the scripts, i used API.Function,and if we have a link "http://192.168.1.129:8089/api" instead of api.xml, then how to change the content?


By doing a httprequest
Have you checked page 1 of this post ?
endiaer  
#199 Posted : Friday, January 28, 2022 8:08:32 PM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Hello doggy

I need Help for a syntax to do something when an audio meter of a live input (from sound card) reaches certain level. I am sorry, I am new to script. thank you, much appreciated.
doggy  
#200 Posted : Friday, January 28, 2022 9:04:24 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: endiaer Go to Quoted Post
Hello doggy

I need Help for a syntax to do something when an audio meter of a live input (from sound card) reaches certain level. I am sorry, I am new to script. thank you, much appreciated.


Have you checked the input Trigger section for OnAudioMeter? ( no scripting needed there )

else you will need to retrieve it from the API XML ( many examples in this post on how to retrieve similar information )

here is also a hint ( also this post ) https://forums.vmix.com/...ng-for-Dummies#post98785

The "doing something" is a very broad concept ;-)
Users browsing this topic
Guest (3)
26 Pages«<89101112>»
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.