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
Chris Daum  
#1 Posted : Friday, June 4, 2021 5:22:14 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)
Hi Champs,

once again Lumberjack scripting is in charge... :-)

I understood (thanks to one of doggy´s great examples)
I can define several values in a dynamic value,
save it and use it during my vmix project.

I´m regularely working with several Callers and have scripted
a "Talk Back", "Hold" and "Show" preset for each incoming call.

The idea is for the talk back preset to set "AudioBusOff" on busses d&e&f&g
for these are my active sending busses via Dante and I do not want to send
an audio feed to the sound desk while maybe another (in program) call is using
one of those busses.

And for this defining one dynamic value for further use to all other calls

Code:
API.Function("SetDynamicValue1",Value:="{m}&{a}")

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)

dim MyVals() as string = MyValues.Split(",")

For i As Integer = 0 To MyVals.Length - 1
api.function("AudioBusOff", input:= 1, value:= "MyVals(i)")
Next

This does only affect bus m (the "{}" use was just another try on search for the correct syntax...)
any hint to the correct syntax for controlling multiple audio busses via one dynamic value?
doggy  
#2 Posted : Friday, June 4, 2021 4:19:13 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 283 times
Was thanked: 916 time(s) in 755 post(s)
Throwing something at the wall and see what sticks in not the way ;-)

spot the difference



Code:
API.Function("SetDynamicValue1",Value:="value1,value2,value3,value4")

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

dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)

dim MyVals() as string = MyValues.Split(",")

For i As Integer = 0 To MyVals.Length - 1
Console.WriteLine(MyVals(i))
Next


Code:
API.Function("SetDynamicValue1",Value:="value1,value2,value3,value4")

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

dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)

Console.WriteLine(MyValues)




usefull post

https://forums.vmix.com/...udio-busses-but-not-MAIN
Chris Daum  
#3 Posted : Friday, June 4, 2021 9:07:51 PM(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)
Hi doggy,

thanks for your reply
may look a bit like thrown to the wall :-), wasn´t the plan
and I guess I understand what it does
Made a little clean up and chopped it into pieces
Code:
API.Function("SetDynamicValue1",Value:="d,e,f,g")

feeds the dynamic value with "content" (more or less define a variable)

Code:
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)

reads out the "content" of dynamic value 1 to variable "MyValues" from xml api

Code:
dim MyVals() as string = MyValues.Split(",")

splits the content to a variable array MyVals()
resulting in (schematic)
MyVals(0) = d
MyVals(1) = e
MyVals(2) = f
MyVals(3) = g

Code:
For i As Integer = 0 To MyVals.Length - 1

as there are four "variables" (d,e,f,g) defined this defines the variable array to "MyVals(3)" (see above)

______________________________________________________________________________________________
so, now what it should but doesn´t do
Code:
 
api.function("AudioBusOff", input:= 1, value:= "MyVals(i)")
Next

that is, switch audio busses d&e&f&g off for Input 1
But as far as I read there seems to be no way for switching more than one bus per input in one stroke.
Cause the idea is to use "MyVals(i)" on the other call inputs as well

Chris Daum  
#4 Posted : Saturday, June 5, 2021 12:03:34 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)
guess my "imagination" of what a dynamic value does went the wrong way...
doggy  
#5 Posted : Saturday, June 5, 2021 1:26:56 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 283 times
Was thanked: 916 time(s) in 755 post(s)
Originally Posted by: Chris Daum Go to Quoted Post
guess my "imagination" of what a dynamic value does went the wrong way...


Nothing wrong with your imagination as long as you write the function correctly ;-)

yours not working
Code:
api.function("AudioBusOff", input:= 1, value:= "MyVals(i)")


Mine working
Code:
api.function("AudioBusOff", Input:= "1", value:= MyVals(i))
thanks 1 user thanked doggy for this useful post.
Chris Daum on 6/5/2021(UTC)
Chris Daum  
#6 Posted : Saturday, June 5, 2021 2:49:34 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)
doggy, what can I say?? I am stunned. I never before saw the input number as digit in "" in an api command ...
but...

here the complete script yet without Headset definitions.
One might say it looks damn complicated, but I love it!

and... until now I never saw a faster, easier way to fill a variable array in VB.net
although I have to admit I am not very far in my studies
Is there any limit in the number of values you can safe as dynamic value?

Code:
'1 Definition Variablen
Dim xml as string = API.XML()
Dim x as new system.xml.xmldocument
Dim C1Key as String = ""
Dim SendBusses as String = ""

'7 Definition Dyn Value ("Sendebusse")
api.function("SetDynamicValue1", Value:="d,e,f,g")

'10 Laden XML
x.load("http://127.0.0.1:8088/api")

'13 Auslesen Input Key Call 1& "Sendebusse"
C1Key = (x.SelectSingleNode("//input[1]/@key").InnerText)
SendBusses = (x.SelectSingleNode("//dynamic/value1").InnerText)

'17 Erstellen Variablen Array
Dim SdBs() as String = SendBusses.Split(",")

'20 Audio Bus Set Up Talk Back Call 1
api.function("SoloOn", Input:= C1Key)
api.function("AudioOn", Input:= C1Key)
for i as Integer = 0 to 3
api.function("AudioBusOff", input:= C1Key, Value:= SdBs(i))
next
matkeane  
#7 Posted : Sunday, June 6, 2021 9:46:53 PM(UTC)
matkeane

Rank: Advanced Member

Groups: Registered
Joined: 10/6/2020(UTC)
Posts: 98
France

Was thanked: 21 time(s) in 21 post(s)
Just wanted to say that this is a really useful post by the two of you. I'm definitely going to try and replace my 48+ shortcuts that manage talkback busses for 8 calls with this !
Chris Daum  
#8 Posted : Sunday, June 6, 2021 10:42:31 PM(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)
thanks, and as mentioned I haven’t found a better
and faster way in VB.net to create a variable array

I am working in command lists and a lot of other
stuff where arrays can be extremely useful!!
Users browsing this topic
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.