vMix Forums
»
General
»
GT
»
GT auto hide
Rank: Newbie
Groups: Registered
Joined: 1/28/2022(UTC) Posts: 5 Location: viña del mar
|
Hi, I'm using the option to add dynamic text from a source from a txt file (from Dinesat), sometimes the text file is empty, and when that happens I need to hide GT Text, is there any way to do that?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: alejandro Hi, I'm using the option to add dynamic text from a source from a txt file (from Dinesat), sometimes the text file is empty, and when that happens I need to hide GT Text, is there any way to do that? Using data sources ? empty content from the source does not update title content (old data remains visible) . Are you letting the datasource autoupdate the title or are you selecting manually ? best bet is using a script to check content of your data source file directly (from what you describe you are not using multiple rows and columns in the data source i can assume) . if txt file is empty hide title or replace text with space (not empty)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/28/2022(UTC) Posts: 5 Location: viña del mar
|
Thank you for your answer, I will try to describe and explain better. I use a "Title/XAML" input, and a "GT Title" template, for the "Headline text" I use the "Data Source" option, then in the options I have the following configuration: Datasource: Text Table:Text Column:Text Row: 1 Format: {0} In the "Manage" option, I have a txt file as "data source" (without selecting "convert rows to columns"), in the "table" option of "data source" I have "text", I attach screenshots of what is described. The context is to show in "GT Title" the name of the musical theme that is being shown, this originates from Dinesat, the problem is that this TXT file has seconds in which it is empty, that is, without text, then Dinesat writes the title again artist name and track name, the question is then, at the time it is empty, is there any way to detect that and hide the input that is visible through an overlay (fadeout for example), and when I have text is activated (fadein for example). Hope it's understandable. setting: Captura de Pantalla 2022-01-28 a la(s) 09.49.15.png (293kb) downloaded 6 time(s).with and without active text: Captura de Pantalla 2022-01-28 a la(s) 09.50.29.png (173kb) downloaded 2 time(s). Captura de Pantalla 2022-01-28 a la(s) 09.50.50.png (355kb) downloaded 0 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: alejandro Thank you for your answer, I will try to describe and explain better. I use a "Title/XAML" input, and a "GT Title" template, for the "Headline text" I use the "Data Source" option, then in the options I have the following configuration: Datasource: Text Table:Text Column:Text Row: 1 Format: {0} In the "Manage" option, I have a txt file as "data source" (without selecting "convert rows to columns"), in the "table" option of "data source" I have "text", I attach screenshots of what is described. The context is to show in "GT Title" the name of the musical theme that is being shown, this originates from Dinesat, the problem is that this TXT file has seconds in which it is empty, that is, without text, then Dinesat writes the title again artist name and track name, the question is then, at the time it is empty, is there any way to detect that and hide the input that is visible through an overlay (fadeout for example), and when I have text is activated (fadein for example). Hope it's understandable.
As pointed out before empty content from the source does not update title content (old data remains visible) . there are 2 options : either the source (data) puts a space as content instead as title does not respond to something empty or using a script to check content of your data source file directly Google example Code:Dim fi As New System.IO.FileInfo("d:/emptytest.txt")
console.writeline(fi.Length.ToString)
'So if length = 0 do your instruction
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/28/2022(UTC) Posts: 5 Location: viña del mar
|
thanks again for your answer. As you can see in the images, when the file is without text, the GT title is shown empty and does not keep the previous text. What I understand from your answer is that I have to see how to use a script to detect length=0 and with it perform an action. My knowledge is more or less basic, could you tell me where I can read and learn about what I have to do? Thanks a lot.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: alejandro thanks again for your answer. As you can see in the images, when the file is without text, the GT title is shown empty and does not keep the previous text. What I understand from your answer is that I have to see how to use a script to detect length=0 and with it perform an action. My knowledge is more or less basic, could you tell me where I can read and learn about what I have to do? Thanks a lot. Even better , probably because the file is not realy empty but contains spaces then directly reading from the title will work with a script: Code:do while True
if Input.Find("GC MUSICA").Text("Headline.Text") = "" then
API.Function("OverlayInput1Off")
end if
sleep(500)
Loop
scripting for dummies post in this forum is a good start as is research on google for vb.net The helpfiles are also helpful and some vMix videos
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/28/2022(UTC) Posts: 5 Location: viña del mar
|
Thank you very much, it works very well! I just need to activate the GC Title back. What it does now is to show it when the overlay is activated, when the script is executed it disappears if there is no text (so far so good), it would be missing in the code to add that when the text is active again, the overlay is activated, would it be something like this? but I lack the value to place in " " Code:do while True
if Input.Find("GC MUSICA").Text("Headline.Text") = "" then
API.Function("OverlayInput1Off")
if Input.Find("GC MUSICA").Text("Headline.Text") = "" then
API.Function("OverlayInput1On")
end if
sleep(500)
Loop
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
instead of checking if empty check if not equals empty ;-)
That's vb.net coding , lots to find with Google
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/28/2022(UTC) Posts: 5 Location: viña del mar
|
Thank you very much, I found the result I expected! Code:do while True
if Input.Find("GC MUSICA").Text("Headline.Text") = "" then
API.Function("OverlayInput1Off")
Elseif Input.Find("GC MUSICA").Text("Headline.Text") <> "" then
API.Function("OverlayInput1In")
end if
sleep(500)
Loop
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/23/2022(UTC) Posts: 6
Thanks: 1 times
|
This is great, and it works, but in my case only when my GT title is in the preview window, if I click on another input in the preview, it immediately stops working, when I click on the GT again it immediately works. Am I wrong somewhere or does it have to work that way?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: uncut This is great, and it works, but in my case only when my GT title is in the preview window, if I click on another input in the preview, it immediately stops working, when I click on the GT again it immediately works. Am I wrong somewhere or does it have to work that way? edit the api call to include the input used (omission will resort to what is in preview) Code:'as per example
API.Function("OverlayInput1Off",Input:="GC MUSICA")
API.Function("OverlayInput1In",Input:="GC MUSICA")
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/23/2022(UTC) Posts: 6
Thanks: 1 times
|
Thanks for the reply, I rewrote the code according to your instructions, but now it doesn't pull the GT Title. It only works when I click on Turn on Input as an Overlay, the title appears in Output and lasts for the allotted time, it shuts down, but when a new song starts it does not appear, ie. does not call the function. What am I doing wrong? Code:do while True
if Input.Find("GC MUSICA").Text("Headline.Text") = "" then
API.Function("OverlayInput1Off",Input:="GC MUSICA")
Elseif Input.Find("GC MUSICA").Text("Headline.Text") <> "" then
API.Function("OverlayInput1In",Input:="GC MUSICA")
end if
sleep(500)
Loop
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: uncut Thanks for the reply, I rewrote the code according to your instructions, but now it doesn't pull the GT Title. It only works when I click on Turn on Input as an Overlay, the title appears in Output and lasts for the allotted time, it shuts down, but when a new song starts it does not appear, ie. does not call the function.
What am I doing wrong?
What is the name of your title ? the names of the text fields ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/23/2022(UTC) Posts: 6
Thanks: 1 times
|
It worked mysteriously :), which is great! But now I have another problem, which I do not know how to solve. The title goes in order as the video / music is played in Output, it has nothing to do with the preview anymore. However, when I insert the webcam into Output, while the video / audio is still playing in the background, the title of the song appears. How do I make that title shows only when in the Output is music?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: uncut It worked mysteriously :), which is great! But now I have another problem, which I do not know how to solve. The title goes in order as the video / music is played in Output, it has nothing to do with the preview anymore. However, when I insert the webcam into Output, while the video / audio is still playing in the background, the title of the song appears. How do I make that title shows only when in the Output is music? Seems this is something totally NOT related to this original post ! Maybe started as a new post and give us more details regarding the setup and intentions etc (aka more details)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/23/2022(UTC) Posts: 6
Thanks: 1 times
|
Originally Posted by: doggy Originally Posted by: uncut It worked mysteriously :), which is great! But now I have another problem, which I do not know how to solve. The title goes in order as the video / music is played in Output, it has nothing to do with the preview anymore. However, when I insert the webcam into Output, while the video / audio is still playing in the background, the title of the song appears. How do I make that title shows only when in the Output is music? Seems this is something totally NOT related to this original post ! Maybe started as a new post and give us more details regarding the setup and intentions etc (aka more details) Its related to this, I will post pictures now, so it will be clearer?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/23/2022(UTC) Posts: 6
Thanks: 1 times
|
I have a title over the webcam, but I don't want that, and I need help to edit the existing code. I hope it's clearer now.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: uncut
I have a title over the webcam, but I don't want that, and I need help to edit the existing code. I hope it's clearer now.
Add a test (a condition) in the script to not display the title when the output is the webcam or to only do the empty test when the webcam is Not in the output
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 9/22/2020(UTC) Posts: 44 Thanks: 1 times Was thanked: 5 time(s) in 5 post(s)
|
Thank you doggy for putting us in the right direction like always, much appreciated. Here's my version, it has the difference of transitioning out. It adds a slight delay on the transition In of 1000ms. Code:Do While True
Dim titleText As String = Input.Find("TITLENAME").Text("Headline.Text")
If titleText = "" Then
API.Function("OverlayInput1Out", Input:="TITLENAME")
Sleep(1000)
Else
API.Function("OverlayInput1In", Input:="TITLENAME")
End If
Sleep(500)
Loop
|
|
|
|
vMix Forums
»
General
»
GT
»
GT auto hide
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