Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Jaa_Han The only bit that's missing is dealing with an expandable list-array. On the official docs.microsoft.com I found this (would be the ideal solution for my approach): Code:Dim salmons As New List(Of String)
salmons.Add("chinook")
salmons.Add("coho")
salmons.Add("pink")
salmons.Add("sockeye")
And lots of people online using the same structure. But I couldn't get it to work in vMix. It always "errors" trying to save the script. Is this even supported in vMix-Scripting? Check the note on the page where you got the example from Code:Dim salmons As New System.Collections.Generic.List(Of String)
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/16/2019(UTC) Posts: 4
|
Hello, first of all, sorry for my English; I write from Argentina and languages are not my forte. I hope you can understand me. I write for the following:
Is there a way to turn on an overlay when a title contains a specific word, and when the same title contains another specific word, the overlay turns off?
I have this scenario:
-A preset with three inputs (there may be more, but they are irrelevant):
*A NDI screen capture. *A video (whose input is named "Artistic") *A XAML or Gtzip title (AnimatedHD.xaml, let's say).
-The title is fed by a Data Source that collects a .txt file generated by a radio automator. This software overwrites the content of the text file as it plays materials (audio or video) randomly. That is, it is not possible to know when a certain material will be executed.
-The automator takes files from a database integrated by audios and videos. Some videos and audios will contain, in their titles, two specific words that do not exist, I suppose, in any known language or dialect and, therefore, unrepeatable: "pfazerexyw" and "rwerxvb" (some audios will contain one of the "words" and some videos the remaining).
Being more clear, the format of the titles will be this:
The Beattles - Yesterday - pfazerexyw.wav Led Zeppelin - Stairway to Heaven - pfazerexyw.wav or Bad Religion -Suffer - rwerxvb.mp4 Millencolin - Not Your Savior - rwerxvb.mp4
What I want to achieve is that when the "Headline.Text" line of the AnimatedHD.xaml title contains the word "pfazerexyw", the video named "Artistic" is activated in overlay 3, and when it contains the word "rwerxvb" the overlay 3 turns off. In this way, when the radio automator plays audio-only files, in vMix an animated video will be activated in overlay and, when the automator plays .mp4 files, the overlay will be turned off, leaving visible the NDI capture (corresponding to the automator's video player). In both cases, in case it is not clear, by the inclusion of a specific word in the XAML or Gtzip title text.
I've done an extensive search in the forum and vb.net sites over the last four weeks, but haven't found anything to guide me; bah, honestly, I have understood less than a quarter of the things. I am not a programmer, but a 2D animator who collaborates with a community radio.
Maybe this is easy for those who have coding knowledge and I will appreciate if you can help me. If not, we will discard the idea due to lack of expertise.
Regards.
PS: I apologize again. This time for the extension of the text. PS 2: Apologies also if this is not the place for this query.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/16/2019(UTC) Posts: 4
|
Hello, Doggy, thank you very much for the quick response and, above all, for taking the time to do it so early there in Belgium. I solved it a moment ago and I came to say it. I had seen the post you mention and couldn't get it to work in my case (I should have written it in my previous post as well). The resolution was pretty stupid. I needed to place a "contains". Being that way: Quote: if Input.Find("AnimatedHD.xaml").Text("Headline.Text").contains("pfazerexyw")
if Input.Find("AnimatedHD.xaml").Text("Headline.Text").contains("rwerxvb")
I repeat: thank you very much for your help.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/16/2022(UTC) Posts: 3 Location: Lincolnshire
|
I've currently adopted the below to show Streaming status. Please can someone advise how I can reference the individual Streams ie channel1, channel2, channel3
Originally Posted by: doggy Not limited for checking recording status ;-) Code:' Checking recording status from the API xml (127.0.0.1:8088/API)
' and display in a Title Input
dim isrecording as string = ""
'lets keep checking
do while true
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
'are we recording?
isrecording = (x.SelectSingleNode("//recording").InnerText)
'used at debugging stage
console.writeline(isrecording)
'put a response in a title and change color accordingly
if isrecording = true
API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:="RECORDING in PROGRESS")
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="red")
else
API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:="ALL CLEAR")
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="green")
end if
sleep(500)
loop
am sure it can be improved
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Noaksey I've currently adopted the below to show Streaming status. Please can someone advise how I can reference the individual Streams ie channel1, channel2, channel3
If you have adopted the script it shoul be isstreaming = (x.SelectSingleNode("//streaming").InnerText) to check if one is streaming to get the individual channels the streaming line in the API XML will contain which channels are true whne the streams are started
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Originally Posted by: doggy Originally Posted by: Jeffry_Ghost Hello guys,
Is there anyway how to start transition in/out of GT title. I tried " API.Function("TransitionIn",Input:=2)"
Code:API.Function("TitleBeginAnimation",Input:=2,Value:="TransitionIn")
Code:API.Function("TitleBeginAnimation",Input:=2,Value:="TransitionOut")
THANK YOU a lot. This is exactly what i need. As I can see I just used wrong syntax Thanks a lot again
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Hello again
I'm might be blind or just not able to google it. But how to write into script that I want to run other scripts? Is it even possible or should I need to write commands into one script.
THX in advantage
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Jeffry_Ghost Hello again
I'm might be blind or just not able to google it. But how to write into script that I want to run other scripts? Is it even possible or should I need to write commands into one script.
THX in advantage Have you checked the "shortcut function reference" ? Also in the helpfiles: 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 While you can start another script (with the "ScriptStart" function ) from within a running scritp you cannot use it as a sub or function !
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/9/2017(UTC) Posts: 36 Location: Jeffry_Ghost Thanks: 10 times Was thanked: 2 time(s) in 2 post(s)
|
Originally Posted by: doggy Originally Posted by: Jeffry_Ghost Hello again
I'm might be blind or just not able to google it. But how to write into script that I want to run other scripts? Is it even possible or should I need to write commands into one script.
THX in advantage Have you checked the "shortcut function reference" ? Also in the helpfiles: 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 While you can start another script (with the "ScriptStart" function ) from within a running scritp you cannot use it as a sub or function ! Well I am just too stupid in morning. After your advice I read everything again and get coffe. After that I found solution and it is so easy. here is what I wanted and it's working Function=ScriptStart&Value=NAMEofSCRIPTThank you again Doggy for pointing me in the right direction, I am new to programming and self-taught
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Problem with leading and trailing zeros display when using numbers from CSV datasource (or others) in a titleput them in a hidden text field & Format them to the visible one ;-) Things will look nicer too Code:'Read the data from the title connected to the datasource
dim StringVal as string = Input.Find("Title 0- The Classic Blue.gtzip").Text("Headline.Text")
dim decimalVar as decimal = Decimal.Parse(StringVal)
'format the number display
dim ConvResult as string = String.Format("{0:00.00}", decimalVar )
'Write result to the title
API.Function("SetText",Input:="Title 0- The Classic Blue.gtzip",SelectedName:="Description.Text" ,Value:=ConvResult)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: doggy Problem with leading and trailing zeros display when using numbers from CSV datasource (or others) in a titleput them in a hidden text field & Format them to the visible one ;-) Things will look nicer too Code:'Read the data from the title connected to the datasource
dim StringVal as string = Input.Find("Title 0- The Classic Blue.gtzip").Text("Headline.Text")
dim decimalVar as decimal = Decimal.Parse(StringVal)
'format the number display
dim ConvResult as string = String.Format("{0:00.00}", decimalVar )
'Write result to the title
API.Function("SetText",Input:="Title 0- The Classic Blue.gtzip",SelectedName:="Description.Text" ,Value:=ConvResult)
Shorter but not as clear: Code:'Read the data from the title connected to the datasource, parse and then format
dim StringVal as string = String.Format("{0:00.00}", Decimal.Parse(Input.Find("Title 0- The Classic Blue.gtzip").Text("Headline.Text")))
'Write result to the title
API.Function("SetText",Input:="Title 0- The Classic Blue.gtzip",SelectedName:="Description.Text" ,Value:=ConvResult)
Good though for keeping scripts shorter
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 497 Location: athens Thanks: 121 times Was thanked: 70 time(s) in 66 post(s)
|
Hello. Im trying to make a script that will take from a folder the last created folder in which i will have photos and 1.Add this folder as photos input in vmix 2.change transition time to 10 seconds 3.Put this new photos input as layer in another input, which input will allready exist in vmix I know how to do this if i have predefined names for example "photos1" but if i dont know the name of folder dont know how to do it I tried to edit the script "Add last recording to vMix as an input" as my needs,but no luck Can anyone help me please?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nikosman88 Hello. Im trying to make a script that will take from a folder the last created folder in which i will have photos and 1.Add this folder as photos input in vmix 2.change transition time to 10 seconds 3.Put this new photos input as layer in another input, which input will allready exist in vmix I know how to do this if i have predefined names for example "photos1" but if i dont know the name of folder dont know how to do it I tried to edit the script "Add last recording to vMix as an input" as my needs,but no luck Can anyone help me please?
in short you want to find a folder who you don't know the name of but that was the last created one inside another folder (no need for the other info here)? loop through all the folders(directories) in your "base" folder and check for the creation date that is the most recent : Directory.GetCreationTime(Folder)
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 497 Location: athens Thanks: 121 times Was thanked: 70 time(s) in 66 post(s)
|
Doggy thank you i will try to do this. The situation is not that i dont know the folder name because i set the name. Many times during the show the presenter or co-presenter will send me a link from a site with photos to download or photos in messenger/viber etc to pass in the show and then if we are in a multiview layer i have also to take this new input and send it to a position in multiview layers. And this has to be done as fast as possible because the show is live I have a base folder where i make folders and inside them i save photos and then input them in vmix. The folder name is usually a name that describe the photos i store there. For example "aeroplanes". Without scripting i have to go add-->input-->photos-->find folder too much time The best alternative i have found so far is to store photos in prenamed folders etc "photos1","photos2", and give shortcuts for each of them. This is better than the "whole manual" procedure but i see that i need sometimes photos1,photos2,photos3 and in the middle of the show i cant remember everytime which folder of the photo folders is empty and store there the new photos.So again i loose precious time Thats why i need something to get in vmix the last created folder and then somehow send this last input in the layer i want. i think this i can do it, the problem is that i cant take the folder in vmix
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nikosman88 I have a base folder
Thats why i need something to get in vmix the last created folder and then somehow send this last input in the layer i want. i think this i can do it,
Same answer as before be it for folder or file search (inside a base folder) , when found perform the function to load the file as an input and then to the a layer specified (Those functions are same as there are shorcut functions) or anything else you want to do with it Quote:the problem is that i cant take the folder in vmix What?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 497 Location: athens Thanks: 121 times Was thanked: 70 time(s) in 66 post(s)
|
Im sorry about this. My english is not very good and i am using words that we use in greek language. I mean i dont know how tell to the script to input the folder in vmix. Im trying to understand how to combine the command you told me in the script ""Add last recording to vMix as an input" but no success for now.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nikosman88 Im sorry about this. My english is not very good and i am using words that we use in greek language. I mean i dont know how tell to the script to input the folder in vmix. Im trying to understand how to combine the command you told me in the script ""Add last recording to vMix as an input" but no success for now. understand the difference in language but i assume you also have a different name for folder, file and input ? So are you trying to get a (the last) folder (as list or image folder) into vMix or a (the last) file in that folder ? There is the function "AddInput" (see shortcuts) to use after you located the right folder/file first Seeing your question is in this thread (instead of a seperate one ) I also assume you have read through the other post to gain insight into vMix (vb.net) scripting and the use of its available functions foldersearch.jpg (49kb) downloaded 1 time(s).
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 497 Location: athens Thanks: 121 times Was thanked: 70 time(s) in 66 post(s)
|
Thank you very very much.It work excellent!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nikosman88 Thank you very very much.It work excellent! Good, but would be appreciated if previous question was answered for future reference
|
|
|
|
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close