logo

Live Production Software Forums


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

Notification

Icon
Error

15 Pages«<7891011>»
Options
Go to last post Go to first unread
filipe.shakeit  
#161 Posted : Tuesday, November 23, 2021 8:29:48 PM(UTC)
filipe.shakeit

Rank: Member

Groups: Registered
Joined: 9/29/2021(UTC)
Posts: 11
Portugal
Location: Porto

Thanks: 3 times
this is a big help! thanks!

first get some order in your for loops (example)
Code:

for inp as Integer = 1 to 3
   for lay as Integer = 1 to 3
     Api.Function("LayerOn", Input:= inp, Value:=lay)
   next
next
doggy  
#162 Posted : Tuesday, December 7, 2021 5:57:27 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Send Email from within vMix Scripting (Gmail)

Code:

'Gmail will prevent access for your e-mail account from custom applications. 
'You need to turn on "Allow less secure apps" in your Google account.
'https://myaccount.google.com/lesssecureapps

      Try
         Dim Smtp_Server As New System.Net.Mail.SmtpClient

         Dim e_mail As New System.Net.Mail.MailMessage()
         Smtp_Server.UseDefaultCredentials = False
         Smtp_Server.Credentials = New Net.NetworkCredential("username@gmail.com", "password")
         Smtp_Server.Port = 587
         Smtp_Server.EnableSsl = True
         Smtp_Server.Host = "smtp.gmail.com"

         e_mail = New System.Net.Mail.MailMessage()
         e_mail.From = New System.Net.Mail.MailAddress("Your@mail.com", "Name")
         e_mail.To.Add("To@mail.com")
         e_mail.Subject = "From vMix Script"
         e_mail.IsBodyHtml = False
         e_mail.Body = "Test Email Send through vMix Scripting"
         Smtp_Server.Send(e_mail)
         console.writeline("Mail Sent")

      Catch error_t As Exception
         Console.WriteLine("failed to send email with the following error:")
         console.writeline(error_t.ToString)
      End Try

thanks 1 user thanked doggy for this useful post.
Roy Sinclair on 12/7/2021(UTC)
Salvatore  
#163 Posted : Thursday, December 9, 2021 10:06:47 PM(UTC)
Salvatore

Rank: Member

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

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
Hello,
i'm looking for the API Command to get the active Output2 Source.
Like this:
activeinput = (x.SelectSingleNode("//active").InnerText)
WhatIsOnPreview = (x.SelectSingleNode("//preview").InnerText)


I try "Output2" and other variables (Out2, ExternalOutput2, OutputExternal2, active2, External2) but it don't work:
activeoutput2 = (x.SelectSingleNode("//Output2").InnerText)

Set Output2 is no problem. But get out2 make me crazy.

Can someone help?
Thanks
doggy  
#164 Posted : Monday, December 13, 2021 9:48:09 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Originally Posted by: Salvatore Go to Quoted Post
Hello,
i'm looking for the API Command to get the active Output2 Source.
Like this:
activeinput = (x.SelectSingleNode("//active").InnerText)
WhatIsOnPreview = (x.SelectSingleNode("//preview").InnerText)


I try "Output2" and other variables (Out2, ExternalOutput2, OutputExternal2, active2, External2) but it don't work:
activeoutput2 = (x.SelectSingleNode("//Output2").InnerText)

Set Output2 is no problem. But get out2 make me crazy.

Can someone help?
Thanks



Nope

Not possible (you should have checked the API XML to see if it was even available!)
If you have Set it you already should know what it is and keep track of it
nowski  
#165 Posted : Wednesday, December 15, 2021 11:26:50 PM(UTC)
nowski

Rank: Advanced Member

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

Thanks: 14 times
Was thanked: 10 time(s) in 8 post(s)
I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows.
So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses.
Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.

Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it?
Roy Sinclair  
#166 Posted : Thursday, December 16, 2021 12:45:42 AM(UTC)
Roy Sinclair

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 8 time(s) in 7 post(s)
Originally Posted by: nowski Go to Quoted Post
I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows.
So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses.
Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.

Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it?



What API are you using to access your datasource and what sort of datasource are you accessing? Without that basic information we have nowhere to start in providing advice.
doggy  
#167 Posted : Thursday, December 16, 2021 1:37:54 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Originally Posted by: nowski Go to Quoted Post
I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows.
So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses.
Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.

Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it?


can't unless you script and keep track of your row somehow yourself (dynamic values could be of help to save it as a variable) .
for jumping 10 rows at once one can use a little for next loop in a script

Building an external app that reads and displays your datasource files in a table would give you full control and allow you to keep track of the currently selected row (vb.net) and use httprequests to send the selected data to your title and such
nowski  
#168 Posted : Friday, December 17, 2021 3:28:50 AM(UTC)
nowski

Rank: Advanced Member

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

Thanks: 14 times
Was thanked: 10 time(s) in 8 post(s)
Thanks chaps, I'm using Google Sheets - which are proving to be very useful all round. Dont like the idea of external apps and whatnot, sounds like I might be stuck wth a few button presses.

But as an aside, I already use a Sheet. scripting (thanks to Doggy) and variables to drive the whole show. I just edit a sheet with all the notes and links etc and that drives it all.
Data: topic title, external link, any notes (not seen) and any videos I need to cue up are shown in the preview window, then when I start the topic, url gets posted to Youtube chat, also to a text file with record time, which makes it very easy to spit out the youtube chapter markers - saves at least one play though after the event to chapterize it.

From this show https://youtu.be/zc5CiHdMZwA

Capture.PNG (1,074kb) downloaded 6 time(s).
doggy  
#169 Posted : Wednesday, December 29, 2021 11:42:19 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Ability to indicate on a StreamDeck a status within your script or from multiple shortcut.

If you have some free DynamicInputs to use:

- Have a StreamDeck button with the vMix plugin
- Set a DynamicInputx with a value between 1 and number of inputs you have from within your script or by means of the shortcuts.
- Create an activator on Event DynamicInputx and use the input as number you want respond to.
(Don't use input numbers you use for other activators ;-) )
- Repeat previous point to create as many colors you want based on specific values used to show on the same button.

- Use imagination for use
thanks 1 user thanked doggy for this useful post.
cutter07 on 4/26/2022(UTC)
QuintvK  
#170 Posted : Thursday, January 6, 2022 6:10:31 PM(UTC)
QuintvK

Rank: Newbie

Groups: Registered
Joined: 8/2/2021(UTC)
Posts: 8
Netherlands
Location: Utrecht

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
First of all, thanks for everybody posting in this topic! It got me started exploring the scripting possibilities in vmix.
With the help of some scripts here I came up with my first script. We have a pc in the office running a small show, with an introduction video to vmixcall and how we use it.
We send out vmixcall login's to guests prior to their event so they can get a feel for what they are up to on the day of production.
To check who logged in at what time, we're using this script:

Code:
 
'gets name of callers and stores it in file named Caller_Log.txt

 'Fill in complete path to folder, end with \
dim FILEPATH as string = "C:\User\Example\Folder\"
dim FILENAME as string = "Caller_Log.txt"

' Leave the rest untouched

dim FILE as string = FILEPATH & FILENAME

dim callers() as string = {"caller1","caller2","caller3","caller4"}
dim nodes() as string = {"//input[@number=1]", "//input[@number=2]", "//input[@number=3]", "//input[@number=4]"}

dim i as integer = 0

do while true
	dim xml as string = API.XML()
	dim x as new system.xml.xmldocument
	x.loadxml(xml)
	do while i < 4
		dim node as string = nodes(i)
		dim caller as string = callers(i)
		dim name as string = (x.SelectSingleNode(node)).InnerText
		If name <> caller:
			Dim callerid As string = (i+1).ToString()
			Dim timeStamp As DateTime = DateTime.Now
    		Dim callertxt as string = "- New caller at ID" & " " & callerid & " - "& name
    		Dim writenew as string = timestamp & " " & callertxt
			System.IO.File.AppendAllText(FILE, writenew + Environment.NewLine)
			Console.writeline(writenew)
			callers(i) = name
		End If
	i = i+1
	loop
	
i = 0
sleep(1000)
loop
thanks 1 user thanked QuintvK for this useful post.
doggy on 1/6/2022(UTC)
josh_5tool  
#171 Posted : Tuesday, January 11, 2022 7:35:00 AM(UTC)
josh_5tool

Rank: Newbie

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

Thanks: 5 times
Hi Scripters,

I'm looking to mock up (what I think is) a fairly basic function via VB.net script.

What I want the script to do:
When [Mic1 Audio is On], set DynamicVal4 to 100
When [Mic1 Audio is Off], set DynamicVal4 to 0.

Right now I'm having trouble finding the right syntax for "When Mic1 Audio is On."

The basic idea would look something like this:
Quote:
dim Mic1State as String = (x.SelectSingleNode("//input[@title='Mic1']/@audio").Value)
If Mic1State = 1 then
API.Function("SetDynamicValue4", Value:="100")

Else if Mic1State = 0 then
API.Function("SetDynamicValue4", Value:="0")


What am I missing? What's the right lookup and values for the On/Off state of an audio input in VMix?
Chris Daum  
#172 Posted : Tuesday, January 11, 2022 9:27:06 AM(UTC)
Chris Daum

Rank: Advanced Member

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

Thanks: 12 times
Was thanked: 9 time(s) in 9 post(s)
reading out the API is the right direction.
But you should get the meterF1 or meterF2 Value.

If Mic is off the meter value is definitely 0
If on you will have at least some noise at a value above 0

so
Dim IsMicOn = (x.SelectSingleNode("//input[@title=Mic2]/@meterF1").Value)

then your path
If IsMicOn = 0 ....
If IsMicOn > 0 .....
thanks 1 user thanked Chris Daum for this useful post.
josh_5tool on 1/12/2022(UTC)
nowski  
#173 Posted : Thursday, January 13, 2022 10:08:09 PM(UTC)
nowski

Rank: Advanced Member

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

Thanks: 14 times
Was thanked: 10 time(s) in 8 post(s)
I am working on a hack to show which layers are active on a given input - a 2 box.
I currently use two rows of a an APK mini to select the inputs for L and R layers for a 2 box pip - this works fine, though there is no mechanism for retuning active layer to the APK via an activator.
So I figured I could use two unuse AudioBusses - top row would set busD to active for that selected input BusE for the bottom row.
This works, but I would need seven shortcuts for each button - one to turn on the bus and foive to turn off the bus for the ones not currently selected so I can have visual feedback on the buttons.

This seems very cumbersome, so I am thinking scripting would be the way to go, though not sure of the strategy to persue.
Can i query the XML to return a list or array of inuts 1-6 audiobusses states, then flip them depending on the current button press?

Quote:
(x.SelectSingleNode("//input[@number='1,2,3,4,5,6']/@audiobusses").Value)
- eg select multiple inputs at once
or do I need to goe through each one and add it to some kind of list then set the vaules based on whatever logic I want?
EG: If input 1 is assiged to busD deaasign all other inputs from busD

Just looking for a bit of guidance - thanks


doggy  
#174 Posted : Thursday, January 13, 2022 10:28:29 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Originally Posted by: nowski Go to Quoted Post
I am working on a hack to show which layers are active on a given input - a 2 box.


Confused, if an input has multiple layers aren't they all active (shown) ?

Quote:
I currently use two rows of a an APK mini to select the inputs for L and R layers for a 2 box pip - this works fine, though there is no mechanism for retuning active layer to the APK via an activator.


SO i guess you want to know which other input is displayed in one of the layers ?

one has to read the key contained in the layer(s) which refers to the key of the input used

Quote:
So I figured I could use two unuse AudioBusses - top row would set busD to active for that selected input BusE for the bottom row.
This works, but I would need seven shortcuts for each button - one to turn on the bus and foive to turn off the bus for the ones not currently selected so I can have visual feedback on the buttons.

This seems very cumbersome, so I am thinking scripting would be the way to go, though not sure of the strategy to persue.
Can i query the XML to return a list or array of inuts 1-6 audiobusses states, then flip them depending on the current button press?

(x.SelectSingleNode("//input[@number='1,2,3,4,5,6']/@audiobusses").Value) - eg select multiple inputs at once
or do I need to goe through each one and add it to some kind of list then set the vaules based on whatever logic I want?
EG: If input 1 is assiged to busD deaasign all other inputs from busD

Just looking for a bit of guidance - thanks


and can get the layernumber and or input number too from the API XML

Post 169 might be of use too
nowski  
#175 Posted : Thursday, January 13, 2022 11:21:33 PM(UTC)
nowski

Rank: Advanced Member

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

Thanks: 14 times
Was thanked: 10 time(s) in 8 post(s)
Thanks Doggy, I figured out the fast and dirty way to do it is to run a script on Note On that turns off all BusD or E then turn on Bus D or E on note off.
Script then runs:
Note On Runs:
Dim i as Integer = 1


for i = 1 to 6
API.Function("AudioBusOff", i, "D")
next

Note Off runs shortcut:

Set AudioBusOn D


That way all I need as an action on each button is - run script, turn on bus.
Now I can see which are the active inputs on my multi layered PiP
Although I wi 1642080254657.jpg (666kb) downloaded 4 time(s).

I'll need to remember if I ever use Bus D or E to redo them... :-)
josh_5tool  
#176 Posted : Friday, January 14, 2022 12:35:44 AM(UTC)
josh_5tool

Rank: Newbie

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

Thanks: 5 times
Still working on my basic "audio on/off checker" script. Thanks to Chris Daum for the advice but I am running into this error message. What's wrong with line 4?? The name of the input I am trying to read is "CR1 Mic".
help.png (21kb) downloaded 4 time(s).
doggy  
#177 Posted : Friday, January 14, 2022 2:40:18 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
.....[@title='CR1 Mic']/@...
thanks 1 user thanked doggy for this useful post.
josh_5tool on 1/14/2022(UTC)
josh_5tool  
#178 Posted : Friday, January 14, 2022 2:49:21 AM(UTC)
josh_5tool

Rank: Newbie

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

Thanks: 5 times
Originally Posted by: doggy Go to Quoted Post
.....[@title='CR1 Mic']/@...


Oof! Thanks doggy. Added apostrophes but still returning the same error message. What else am I missing?

Error message:
BC30009: Reference required to assembly 'DirectShowLib-2005, Version=2.1.0.0, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f' containing the implemented interface 'DirectShowLib.IVMRImagePresenter9'. Add one to your project.
doggy  
#179 Posted : Friday, January 14, 2022 2:51:20 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,212
Belgium
Location: Belgium

Thanks: 243 times
Was thanked: 757 time(s) in 617 post(s)
Originally Posted by: josh_5tool Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
.....[@title='CR1 Mic']/@...


Oof! Thanks doggy. Added apostrophes but still returning the same error message. What else am I missing?

Error message:
BC30009: Reference required to assembly 'DirectShowLib-2005, Version=2.1.0.0, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f' containing the implemented interface 'DirectShowLib.IVMRImagePresenter9'. Add one to your project.


Something is wrong with your vMix instalation

Version ? license type ?
josh_5tool  
#180 Posted : Friday, January 14, 2022 2:55:30 AM(UTC)
josh_5tool

Rank: Newbie

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

Thanks: 5 times
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!
Users browsing this topic
15 Pages«<7891011>»
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.