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
kjones9999  
#1 Posted : Monday, September 14, 2015 11:10:20 AM(UTC)
kjones9999

Rank: Advanced Member

Groups: Registered
Joined: 8/20/2014(UTC)
Posts: 388

Thanks: 29 times
Was thanked: 80 time(s) in 51 post(s)
Great product!

I don't think this exists now.

Could you add the capability to call an http:// Api string from a shortcut?
madness  
#2 Posted : Monday, September 14, 2015 12:33:00 PM(UTC)
madness

Rank: Advanced Member

Groups: Registered
Joined: 4/16/2013(UTC)
Posts: 406
Man
Location: Iowa

Thanks: 281 times
Was thanked: 32 time(s) in 29 post(s)
You can do that now if you want to work around it.
You can send commands via AutoHotKey, and assign the shortcut to the AutoHotKey script.
madness  
#3 Posted : Monday, September 14, 2015 1:54:48 PM(UTC)
madness

Rank: Advanced Member

Groups: Registered
Joined: 4/16/2013(UTC)
Posts: 406
Man
Location: Iowa

Thanks: 281 times
Was thanked: 32 time(s) in 29 post(s)
I found an old scoreboard script I put together that uses an actual AutoHotKey GUI, that with each update, sends info to vMix through the web API.

Quote:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance, Force
In := 1
; * Gui >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GUI, Font, Segue UI s12 wBold
Menu, SettingsMenu, Add, Assign &Input Ctrl+I, Menu_AssignInput ; See remarks below about Ctrl+O.
Menu, SettingsMenu, Add, E&xit, Exit
Menu, MenuBar, Add, &Settings, :SettingsMenu ; Attach the two sub-menus that were created above.
GUI, Menu, MenuBar
GUI, Add, Text, x20 y20 w440 +Center,
GUI, Add, Edit, x20 y20 w440 vTitle +Center, Title
GUI, Add, Text, x20 y60 w220 +Center,
GUI, Add, Edit, x20 y60 w205 +Center, Home Team
GUI, Add, Text, x240 y60 w220 +Center,
GUI, Add, Edit, x255 y60 w205 +Center, Away Team
GUI, Add, Button, x225 y59 h30 w30 gTitleUpdate, ^
GUI, Add, Text, x20 y95 w440 +Center, ::::::::::Scores::::::::::
GUI, Font, Segue UI s20 wBold
GUI, Add, Edit, x20 y120 w210 +Center +Number gHomeUpdate, 0
GUI, Add, Edit, x250 y120 w210 +Center +Number gAwayUpdate, 0

GUI, Add, Button, x90 y160 h30 w30 gDecHome, -
GUI, Add, Button, x120 y160 h30 w30 gIncHome, +

GUI, Add, Button, x330 y160 h30 w30 gDecAway, -
GUI, Add, Button, x360 y160 h30 w30 gIncAway, +
GUI, Show, x272 y166 h200 w480, vMix Transition Demo
; -* End Gui <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Gosub Menu_AssignInput
Gosub HomeUpdate
Gosub AwayUpdate
GuiControl, Focus, Edit1
Return

Menu_AssignInput: ; * Input
^I::
inputs :=
GUI, Input:Font, Segue UI s10 wBold
loop,100
inputs := inputs . "|" . A_Index
Inputs := "Active|Preview" . inputs
GUI,Input:-SysMenu
GUI, Input:Add, Text, x20 y23 w310 , vMix Input to be used as Scoreboard output:
GUI, Input:Add, Combobox, x20 y50 w100 h30 R10 vIn, %inputs%
Gui, Input:Add, Button, gSubmitInput w310 h50,OK
Gui, Input:Show, w350 h150, Scoreboard Input
Return ; -*
SubmitInput: ; *
Gui, Input:Submit, NoHide
If not In
Return
Gui, Input:Destroy
If (In == "Active")
In := -1
If (In == "Preview")
In := 0
;msgbox %In%
Return ; -*
TitleUpdate: ; *
GuiControlGet, EditTitle, , Edit1,
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=Title&Value=%EditTitle%
URL2Var(Url)
GuiControl, Hide, Edit1
GuiControl, , Static1,%EditTitle%
GuiControlGet, EditHome, , Edit2,
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=HomeTitle&Value=%EditHome%
URL2Var(Url)
GuiControl, Hide, Edit2
GuiControl, , Static2,%EditHome%
GuiControlGet, EditAway, , Edit3,
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=AwayTitle&Value=%EditAway%
URL2Var(Url)
GuiControl, Hide, Edit3
GuiControl, , Static3,%EditAway%
GuiControl, Hide, Button1
Return ; -*
HomeUpdate: ; *
GuiControl, Disable, Edit4
GuiControlGet, HomeScore, , Edit4,
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=HomeScore&Value=%HomeScore%
URL2Var(Url)
GuiControl, Enable, Edit4
GuiControl, Focus, Edit4
Return ; -*
AwayUpdate: ; *
GuiControl, Disable, Edit5
GuiControlGet, AwayScore, , Edit5,
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=AwayScore&Value=%AwayScore%
URL2Var(Url)
GuiControl, Enable, Edit5
GuiControl, Focus, Edit5
Return ; -*

DecHome: ; *
GuiControlGet, HomeScore, , Edit4,
HomeScore := HomeScore - 1
GuiControl, , Edit4,%HomeScore%
Return ; -*
IncHome: ; *
GuiControlGet, HomeScore, , Edit4,
HomeScore := HomeScore + 1
GuiControl, , Edit4,%HomeScore%
Return ; -*
DecAway:
GuiControlGet, AwayScore, , Edit5,
AwayScore := AwayScore - 1
GuiControl, , Edit5,%AwayScore%
Return
IncAway:
GuiControlGet, AwayScore, , Edit5,
AwayScore := AwayScore + 1
GuiControl, , Edit5,%AwayScore%
Return

Exit: ; *
ExitApp
Return ; -*
URL2Var(URL) { ; *
ComObjError(0)
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", URL)
WebRequest.Send()
Return WebRequest.ResponseText()
, ComObjError(0)
} ; -*


Try this...
Install AutoHotKey if not already.
Create a new AHK script, and paste the above code as it's content and save on your desktop.
Double click the newly created script to run it, and it will display the GUI.
Open one of the default scoreboards, return to the gui, and change the score values to see them change in vMix.
That of course is it will work if you have the correct web Controller port settings. Mine is 8088 as shown in the script. I used the Local host IP address that will work as long as the gui is on the same machine as vmix.

At a bare minimum, you could use this...
Quote:

Input=1
HomeScore=7
Url = http://127.0.0.1:8088/api/?Function=SetText&Input=%Input%&SelectedName=HomeScore&Value=%HomeScore%
URL2Var(Url)
Return

URL2Var(URL) {
ComObjError(0)
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", URL)
WebRequest.Send()
Return WebRequest.ResponseText()
, ComObjError(0)
}

When you double click the script with this code, it will change the home score to 7 no matter what it was previously.
madness  
#4 Posted : Monday, September 14, 2015 2:16:19 PM(UTC)
madness

Rank: Advanced Member

Groups: Registered
Joined: 4/16/2013(UTC)
Posts: 406
Man
Location: Iowa

Thanks: 281 times
Was thanked: 32 time(s) in 29 post(s)
One more example.
This one will take over the M key however, so you want to kill it after playing with it.

when you press the M key, it will cause vMix to "merge between the preview and active panes.

Quote:
#Persistent ; Keeps script running in taskbar
return ; Forces script to wait for an action to occur

m:: ; You pressed the "M" key
Url = http://127.0.0.1:8088/api/?Function=Merge
URL2Var(Url) ; send the URL above to the function below
Return ; end of the M key function

URL2Var(URL) { ; This delivers the URL over the web to vMix
ComObjError(0)
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", URL)
WebRequest.Send()
Return WebRequest.ResponseText()
, ComObjError(0)
}
thanks 1 user thanked madness for this useful post.
JW on 11/8/2020(UTC)
kjones9999  
#5 Posted : Sunday, September 20, 2015 9:24:49 PM(UTC)
kjones9999

Rank: Advanced Member

Groups: Registered
Joined: 8/20/2014(UTC)
Posts: 388

Thanks: 29 times
Was thanked: 80 time(s) in 51 post(s)
Very helpful and educational. Thanks!
Users browsing this topic
Guest
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.