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
alejandro  
#1 Posted : Friday, January 28, 2022 11:54:03 AM(UTC)
alejandro

Rank: Newbie

Groups: Registered
Joined: 1/28/2022(UTC)
Posts: 5
Chile
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?
doggy  
#2 Posted : Friday, January 28, 2022 6:53:04 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: alejandro Go to Quoted Post
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)
alejandro  
#3 Posted : Friday, January 28, 2022 10:54:22 PM(UTC)
alejandro

Rank: Newbie

Groups: Registered
Joined: 1/28/2022(UTC)
Posts: 5
Chile
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).
doggy  
#4 Posted : Friday, January 28, 2022 11:23:36 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: alejandro Go to Quoted Post
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
alejandro  
#5 Posted : Saturday, January 29, 2022 12:00:08 AM(UTC)
alejandro

Rank: Newbie

Groups: Registered
Joined: 1/28/2022(UTC)
Posts: 5
Chile
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.
doggy  
#6 Posted : Saturday, January 29, 2022 3:43:31 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: alejandro Go to Quoted Post
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

alejandro  
#7 Posted : Tuesday, February 1, 2022 4:28:08 AM(UTC)
alejandro

Rank: Newbie

Groups: Registered
Joined: 1/28/2022(UTC)
Posts: 5
Chile
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
doggy  
#8 Posted : Tuesday, February 1, 2022 4:32:11 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,243
Belgium
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
alejandro  
#9 Posted : Wednesday, February 2, 2022 4:36:40 AM(UTC)
alejandro

Rank: Newbie

Groups: Registered
Joined: 1/28/2022(UTC)
Posts: 5
Chile
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
uncut  
#10 Posted : Monday, March 14, 2022 7:41:21 AM(UTC)
uncut

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?
doggy  
#11 Posted : Monday, March 14, 2022 12:46:14 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: uncut Go to Quoted Post
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")
thanks 1 user thanked doggy for this useful post.
uncut on 3/21/2022(UTC)
uncut  
#12 Posted : Tuesday, March 15, 2022 5:30:23 AM(UTC)
uncut

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


doggy  
#13 Posted : Tuesday, March 15, 2022 12:08:33 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: uncut Go to Quoted Post
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 ?
uncut  
#14 Posted : Thursday, March 17, 2022 4:48:52 AM(UTC)
uncut

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?
doggy  
#15 Posted : Thursday, March 17, 2022 4:56:22 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: uncut Go to Quoted Post
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)
uncut  
#16 Posted : Thursday, March 17, 2022 5:08:01 AM(UTC)
uncut

Rank: Newbie

Groups: Registered
Joined: 2/23/2022(UTC)
Posts: 6

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: uncut Go to Quoted Post
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?
uncut  
#17 Posted : Thursday, March 17, 2022 5:24:11 AM(UTC)
uncut

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.
doggy  
#18 Posted : Thursday, March 17, 2022 12:15:03 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: uncut Go to Quoted Post


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
Howlswolf  
#19 Posted : Wednesday, June 14, 2023 9:46:34 PM(UTC)
Howlswolf

Rank: Advanced Member

Groups: Registered
Joined: 9/22/2020(UTC)
Posts: 44
Canada

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


Users browsing this topic
Guest (4)
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.