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
NSCPro  
#1 Posted : Thursday, December 7, 2023 4:02:27 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

Hi.

How to make a script that works like this: if data changes in the Data Source JSON file, 1 row in both columns, run the graphic, it should be in front for 20 seconds and the graphic disappears, and every time like this.

Thank you for all your help :)
doggy  
#2 Posted : Thursday, December 7, 2023 4:25:45 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: NSCPro Go to Quoted Post
Hi.

How to make a script that works like this: if data changes in the Data Source JSON file, 1 row in both columns, run the graphic, it should be in front for 20 seconds and the graphic disappears, and every time like this.

Thank you for all your help :)


One can actually "program" the animation for that within a GT title itself (fixed delay time)
else
plenty of script examples (scripting for dummies post) on how to read title content (change) of a textblock and do some action (titleBeginAnimation) based on that
NSCPro  
#3 Posted : Thursday, December 7, 2023 4:45:58 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

I don’t find where i get correct code..if JSON data change automatically start title graphics
doggy  
#4 Posted : Thursday, December 7, 2023 5:05:26 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: NSCPro Go to Quoted Post
I don’t find where i get correct code..if JSON data change automatically start title graphics


if one uses a datasource ( be it json, xml, csv, ....) it is to link it to a title , one reads the content within the title and checks for a change there (script)

same principle example here (reading through the API XML or using the input.find() function for title textblock content

https://forums.vmix.com/...ng-for-Dummies#post71124

https://forums.vmix.com/...ng-for-Dummies#post80518

Can not expect to find an exact match for a personal goal but post contains some "tools/examples" to start from for creating your own "How to make a script that works like ... "
NSCPro  
#5 Posted : Thursday, December 7, 2023 5:21:38 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

I make change in code. Overlay coming in and show Artist name and coming out too, but if song changes in JSON file. Graphics not comes up again. What i do wrong in this code


'Kena Raadio Data Source

dim Titlename as string = "TrackInfo"
dim DataTableName as string = "Kena Raadio"
dim oldartistname as string = "0"
dim PAUSE As integer = 20000

dim ArtistName as string = ""


' put title in overlay 3
API.Function("OverlayInput3In",Input:=Titlename)
Sleep(500)

API.Function("DataSourceSelectRow",Value:=DataTableName & ",0")

Do While True
ArtistName = Input.Find("Titlename").Text("ArtistName.text")

If not ArtistName = oldartistname
API.Function("OverlayInput3In", Input:="3")
API.Function("SetText",Input:=Titlename,SelectedName:=ArtistName & ".Text",Value:="")
sleep(PAUSE)
API.Function("OverlayInput3Out")
oldartistname = ArtistName
end if
Sleep(500)
Loop
Roy Sinclair  
#6 Posted : Thursday, December 7, 2023 11:51:38 AM(UTC)
Roy Sinclair

Rank: Advanced Member

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

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: NSCPro Go to Quoted Post
I make change in code. Overlay coming in and show Artist name and coming out too, but if song changes in JSON file. Graphics not comes up again. What i do wrong in this code
...



Try:
Code:

'Kena Raadio Data Source

dim Titlename as string = "TrackInfo"
dim DataTableName as string = "Kena Raadio"
dim oldartistname as string = "0"
dim PAUSE As integer = 20000

dim ArtistName as string = ""


' put title in overlay 3
API.Function("OverlayInput3In",Input:=Titlename)

Do While True
      API.Function("DataSourceSelectRow",Value:=DataTableName & ",0")
      ArtistName = Input.Find("Titlename").Text("ArtistName.text")
 
      If not ArtistName = oldartistname
            API.Function("SetText",Input:=Titlename,SelectedName:=ArtistName & ".Text",Value:="")
            API.Function("OverlayInput3In", Input:="3")
            sleep(PAUSE)
            API.Function("OverlayInput3Out")
            oldartistname = ArtistName
      end if
Sleep(1000)
Loop

NSCPro  
#7 Posted : Friday, December 8, 2023 2:59:23 AM(UTC)
NSCPro

Rank: Advanced Member

Groups: Registered
Joined: 9/27/2019(UTC)
Posts: 48
Estonia
Location: Kuressaare

This doesn’t work..I don’t know how this must be work :(

If I add this line only in code

Code:

dim Titlename as string = "TrackInfo"
dim DataTableName as string = "Kena Raadio"

dim ArtistName as string = ""

ArtistName = Input.Find("Titlename").Text("ArtistName.text")
Console.WriteLine(ArtistName)



Console show nothing, but must be show data
doggy  
#8 Posted : Friday, December 8, 2023 3:26:31 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: NSCPro Go to Quoted Post
This doesn’t work..I don’t know how this must be work :(

If I add this line only in code

Code:

dim Titlename as string = "TrackInfo"
dim DataTableName as string = "Kena Raadio"

dim ArtistName as string = ""

ArtistName = Input.Find("Titlename").Text("ArtistName.text")
Console.WriteLine(ArtistName)



Console show nothing, but must be show data



are those the correct names for your datasource, titlename and textblock names ?

Code:
'Kena Raadio Data Source

dim Titlename as string = "TrackInfo"
dim DataTableName as string = "Kena Raadio"
dim oldartistname as string = "0"
dim PAUSE As integer = 20000

dim ArtistName as string = ""

Do While True  
      ArtistName = Input.Find(Titlename).Text("ArtistName.text")
 
      If not ArtistName = oldartistname
            API.Function("OverlayInput3In", Input:=Titlename)
            sleep(PAUSE)
            API.Function("OverlayInput3Out")
            oldartistname = ArtistName
      end if
Sleep(1000)
Loop


or just build it into a title , no script needed

Screenshot 2023-12-06 192851.jpg (172kb) downloaded 6 time(s).


ovonder  
#9 Posted : Monday, December 11, 2023 10:33:46 PM(UTC)
ovonder

Rank: Advanced Member

Groups: Registered
Joined: 11/19/2015(UTC)
Posts: 30
Man
Location: Netherlands

Thanks: 1 times
Was thanked: 3 time(s) in 3 post(s)
Cool, didn't this was possible.
I was able to recreate your example. As soon as i change the title via webinterface, the title is activated.
Let' see if uploading an example is possible:

Autotransition on change title.gtzip (8kb) downloaded 8 time(s).
Users browsing this topic
Guest (2)
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.