Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

1. Hi, I was inspired a long time ago by this thread and others where people installed a mini DMD screen in the apron. I always thought that was a wonderful idea. After all, you are usually looking down at the flippers and not at the DMD.

https://pinside.com/pinball/forum/topic/watch-that-dmd

VPM only renders one display. I'd actually want a mirror so that I'd have a display in the usual spot on the third monitor and one on the apron. But I don't see anyone interested in developing for this, so I have written a script using ffmpeg to capture the display, scale it down to a smaller size image and stream it through the localhost network loopback. I then use ffplay to play back the stream in a window on my apron. Actually, like the video embedded in the thread above, I'm displaying dual streams, one on each side of the apron.

As I am just capturing an area of the screen, it doesn't matter if it is a render from VPM or B2S. Most of displays are set to default dimensions and position, but not all of my installed tables are the default. I am capitalizing on the presence of a rom tag in the xml to read the precise size and position of the DMD and automatically size the playback window whether it is a regular display or one of the supersized displays like Mary Shelly's Frankenstein. B2S dimensions are read from screenres.txt.

I am using ffmpeg's built in mpeg4 codec, and latency is very low in most cases. I do have an experimental alternative in the script that uses the libx264 source which cuts latency even more but at the risk of introducing compression artifacts on playback. Right now, this is exposed by including rom names in an array at the beginning of the script. Twilight Zone and Monster Bash work very well with libx264. Jurassic Park, not so much. Serious artifacts with the stream playback. I need to do some more testing to see if more tables see a good benefit from using the libx264 codec. If so, I'll have to consider tweaking the script and adding another tag to the xml.

2. The timing was right as I was doing this at the same time I was consolidating VP executables into one system and one database as suggested by horseyhorsey here:

http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry138633

That is, it is the script that actually launches VP and it is PinballX that launches the script. Should work just fine with vpx files as long as they are assigned the correct executable in the xml.

For the script to function the xml requires two new tags:

B2S to tell whether you want to capture a B2S display or not

and exe to tell which executable to run

If no rom is entered and B2S is False then the script will simply bypass all of the streaming code

Example xml:

<game name="Big Buck Hunter FS (physmod5 version 2)">
<description>Big Buck Hunter Pro (Stern 2010)</description>
<rom>bbh_170</rom>
<manufacturer>Stern</manufacturer>
<year>2010</year>
<type>SS</type>
<hidedmd>True</hidedmd>
<hidebackglass>False</hidebackglass>
<enabled>True</enabled>
<rating>0</rating>
<B2S>False</B2S>
<exe>vpinball-pm5</exe>
</game>
<game name="BigValley_FS_B2S">
<description>Big Valley (Bally 1970)</description>
<manufacturer>Bally</manufacturer>
<year>1970</year>
<type>EM</type>
<hidedmd>True</hidedmd>
<hidebackglass>False</hidebackglass>
<enabled>True</enabled>
<rating>0</rating>
<B2S>False</B2S>
<exe>VPinball991</exe>
</game>
<game name="Black Knight 2000">
<description>Black Knight 2000 (Williams 1989)</description>
<manufacturer>Williams</manufacturer>
<year>1989</year>
<type>SS</type>
<hidedmd>True</hidedmd>
<hidebackglass>False</hidebackglass>
<enabled>True</enabled>
<rating>0</rating>
<B2S>True</B2S>
<exe>VP_physmod2</exe>
</game>
<game name="Black_Rose_LoadedWeapon">
<description>Black Rose (Bally 1992)</description>
<rom>br_l4</rom>
<manufacturer>Bally</manufacturer>
<year>1992</year>
<type>SS</type>
<hidedmd>True</hidedmd>
<hidebackglass>False</hidebackglass>
<enabled>True</enabled>
<rating>0</rating>
<B2S>False</B2S>
<exe>VPinball991</exe>
</game>

3. The rest are features I carried over from my previous scripts. VPinball991 and VP_Physmod2 share a registry and so I have to change nudge settings if I switch from one to another. Kill a persistent B2S exe for Captain Fantastic that fails to close in the usual manner. Maps my exit table button and has my coin door simulate the behavior of a real door for those tables that support a Coin Door open switch.

User inputs are at the top of the script:

Filter is the parameter that ffmpeg uses to scale down and rotate the display as needed:

Enter the scale down factor in the parentheses. It can be a fraction or a decimal value.

Ex:

I use a custom resolution for my third screen that is 768x432 and the DMD default size is 768x192. I scale this down by three (in other words, a factor of 1/3) so that it will be around 256x64 when I play it back on my apron.

I have a p2k-style cabinet where the DMD is vertically flipped. 'transpose=3' flips the image again and rotates. Users who don't flip the original image will probably want 'transpose=2' which only rotates

Mirror1PosX and Mirror1PosY are the coordinates for the playback window of stream 1 (left side of apron)

Mirror2PosX and Mirror2PosY are the coordinates for the playback window of stream 2 (right side of apron)

The frame of reference is based on the standard configuration where the playfield screen is 1920x1080 resolution and is in landscape orientation with the user standing at the left side of the cab.

Here's the script:

requires xpath.ahk - a link is commented in the script

ffmpeg - use the static build here:

http://ffmpeg.zeranoe.com/

#NoEnv
#SingleInstance force
#WinActivateForce
#Include, %A_ScriptDir%\xpath.ahk
SetTitleMatchMode, 2
DetectHiddenWindows, On
; User inputs
PinballX_Path=c:\PinballX
FFMPEG_Path=c:\FFMPEG\bin
Nudge991=300
NudgePM=75
Filter="scale=iw*(1/3):-1,transpose=3"
Mirror1PosX=1810
Mirror1PosY=767
Mirror2PosX=1810
Mirror2PosY=127
; roms for lowest latency but possibly with artifacts
arrayf:=["mb_106b", "tz_92"]
Table=%1% ;Table filename
SplitPath, Table,,,, XTable,
; Read description tag from xml - Thanks horseyhorsey - http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry129111
databaseFile=%PinballX_Path%\Databases\Visual Pinball\Visual Pinball.xml
xpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodes
exe:= XPath(dbXML, "/menu/game[@name= . XTable . ]/exe/text()")
rom:= XPath(dbXML, "/menu/game[@name= . XTable . ]/rom/text()")
B2S:= XPath(dbXML, "/menu/game[@name= . XTable . ]/B2S/text()")
If exe=VPinball991
{
RegWrite, REG_DWORD,HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainY, %Nudge991%
RegWrite, REG_DWORD,HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainX, %Nudge991%
}
If exe=VP_physmod2
{
RegWrite, REG_DWORD, HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainY, %NudgePM%
RegWrite, REG_DWORD, HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainX, %NudgePM%
}
IniRead, TablePath, %PinballX_Path%\Config\PinballX.ini, VisualPinball, TablePath
StringReplace, XTablePath, TablePath, \Tables
RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_width
RegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_height
RegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_x
RegRead, XDMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_y
DMD_width:=XDMD_width-3
DMD_height:=XDMD_height+3
DMD_Y:=XDMD_Y-2
If B2S=True
{
FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3
FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8
FileReadLine, XDMD_height, %TablePath%\ScreenRes.txt, 9
FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10
FileReadLine, XDMD_Y, %TablePath%\ScreenRes.txt, 11
DMD_height:=XDMD_height+6
DMD_X:=BG_width+XDMD_X ;Reference to Top Left of Playfield screen
DMD_Y:=XDMD_Y-2
}
StringGetPos, pos, Filter, )
Scale:=SubStr(Filter, 12, pos-11)
StringGetPos, pos1, Scale, /
If ErrorLevel=0
{
Num:=SubStr(Scale, 1, pos1)
Denom:=SubStr(Scale, pos1+2)
Num1:=Num
Denom1:=Denom
Scale:=Num1/Denom1
}
BOX1_width:=Floor(DMD_width*Scale+23*2)
BOX1_height:=Floor(DMD_height*Scale+4*2)
BOX2_width:=BOX1_width-23
BOX2_height:=BOX1_height-5
;Disable Aero if Enabled
RegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, Composition
Aero=%DWMComp%
If Aero=1
Run, sc stop uxsms
;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\VPMSettings.xml"
; Mirror and flip DMD for apron
If DMD_width>0
{
Loop % arrayf.MaxIndex()
{
l_table = % arrayf[A_Index]
if( "X" l_table = "X" rom )
{
streamx264=1
break
}
}
If streamx264=1
{
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v libx264 -preset ultrafast -tune zerolatency -qp 0 -f mpegts -threads 8 udp://localhost:1234,, Hide
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v libx264 -preset ultrafast -tune zerolatency -qp 0 -f mpegts -threads 8 udp://localhost:5678,, Hide
}
else
{
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,, Hide
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:5678,, Hide
}
Sleep, 1000
Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:1234?listen,, Hide
Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:5678?listen,, Hide
checkwindowagain1:
IfWinExist, udp://localhost:1234?listen
WinMove, udp://localhost:1234?listen,, %Mirror1PosX%, %Mirror1PosY%
else
Goto, checkwindowagain1
checkwindowagain2:
IfWinExist, udp://localhost:5678?listen
WinMove, udp://localhost:5678?listen,, %Mirror2PosX%, %Mirror2PosY%
else
Goto, checkwindowagain2
}
Run, %XTablePath%\%exe%.exe -play "%TablePath%\%Table%"
WinWaitActive, ahk_class VPPlayer
Sleep, 1000
WinSet, AlwaysOnTop,, udp://localhost:1234?listen
WinSet, AlwaysOnTop,, udp://localhost:5678?listen
If DMD_width>0
{
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 %BOX1_height%-0 %BOX1_height%-%BOX1_width% 0-%BOX1_width% 0-0 4-23 %BOX2_height%-23 %BOX2_height%-%BOX2_width% 4-%BOX2_width% 4-23
Gui, Show, W%BOX1_height% H%BOX1_width% X%Mirror1PosX% Y%Mirror1PosY% NoActivate
Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, 2: Color, 000000
WinSet, Region, 0-0 %BOX1_height%-0 %BOX1_height%-%BOX1_width% 0-%BOX1_width% 0-0 4-23 %BOX2_height%-23 %BOX2_height%-%BOX2_width% 4-%BOX2_width% 4-23
Gui, 2: Show, W%BOX1_height% H%BOX1_width% X%Mirror2PosX% Y%Mirror2PosY% NoActivate
}
checkVPPlayer:
IfWinNotExist, ahk_class VPPlayer
{
Process, Close, CaptFantastic_FS_B2S.exe
Run, taskkill /IM ffplay.exe
Run, taskkill /IM ffmpeg.exe /F
;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\4KSettings.xml"
;Enable Aero if Enabled at the start of script execution
If Aero=1
Run, sc start uxsms
}
else
{
Sleep, 1000
Goto, checkVPPlayer
}
ExitApp
#IfWinActive ahk_class VPPlayer
; Interlock Switch
Joy7::
Send {End}
SetTimer, WaitForJoy7, 10
return
WaitForJoy7:
if GetKeyState("Joy7")
return
Send {End}
SetTimer, WaitForJoy7, off
return
; Exit Table
Joy8:: Send {q}
#IfWinActive

VPSettings.png
My specs - Intel i5 3570k, 8Gb RAM, GTX660 - runs dual streams well. Might be struggling a bit with Mary Shelley's Frankenstein where having a supersize display means a substantially larger area to capture.
My test bed - a notebook with an NVidia Quadro with 1 Gb VRAM struggled with this but I always have a huge number of windows open.
  • Like 2
Posted

Nice, sounds good. WIll have to try it with the Evil Dead displays, I can duplicate them, but it's too much really, this sounds like it take a bit of the grief away from that. Plus when I run that game in cabinet view I have the display bigger than a Sega DMD.

Looks like a lot in there specific to your setup. PBW, nudge changes etc.

Process, Close, CaptFantastic_FS_B2S.exe

?

Posted

Yeah, this is basically my working cab script. I mention in the write-up that I consolidated features that I was using in my various VP scripts. I run four executables: VP10beta, 991, physmod2, and physmod5. And I previously had a script for each one. This is because I run VP with a custom resolution for the third screen. I did comment out the lines that switch display resolutions. The other bits are fairly safe to either run or comment out if need be.

I tried to generalize a bit based on my particular setup for ease of use, but I can't say I tested what the output looks like for any other setup. Too many possibilities. But if others are interested in giving it a try, we can continue making some improvements.

  • 2 weeks later...
Posted

Update:

1. Using PinballX to exit would often cause VP to throw out memory exception errors. I copied over the CloseVP subroutine from FPLaunch and assigned it as a hotkey to by exit button. Now everything exits cleanly.

2. Sometimes one or the other stream playback windows would activate but would not get moved to the apron. I moved the checkwindow and move subroutine within a loop. Takes a little longer to load the table but the playback windows now appear much more reliably where I instructed.

3. There are some examples of customization added to the script. There are a set of tables, those with secondary playfield displays like Ripley's Believe or Not, Simpson's Pinball Party, and World Poker Tour, where the DMD is squashed a bit because VPinMAME is taking up some of the usual space to render the secondary playfield display. For these I wind up turning on DirectDraw and increasing the height of the display manually to at least make it look less squashed and more like the correct aspect ratio. I allow some overscanning of the image in order to retain an edge-to-edge width on my third monitor. The problem is that because of the overscanning the registry values are out of range for the desktop and causes ffmpeg to crash. For these tables, I just hard-coded the position and dimensions that I want ffmpeg to capture.

Again, the script has two streaming algorithms that you can try:

1. The default mpeg4 codec doesn't produce compression artifacts.

2. The xlib264 is faster and may reduce latency and it may be able to successfully stream a larger image where the buffer for the default mpeg4 fills up too fast and causes ffmpeg to crash.

Try both and go with which ever one works. Frankenstein has one of the SEGA supersize displays and it is just large enough to crash under the mpeg4 codec but works just fine and without compression artifacts with xlib264.

Latest script:

#NoEnv
#SingleInstance force
#Include, %A_ScriptDir%\xpath.ahk
SetTitleMatchMode, 2
DetectHiddenWindows, On
; User inputs
PinballX_Path=c:\PinballX
FFMPEG_Path=c:\FFMPEG\bin
Nudge991=300
NudgePM=75
Filter="scale=iw*(1/3):-1,transpose=3"
Mirror1PosX=1810
Mirror1PosY=767
Mirror2PosX=1810
Mirror2PosY=127
; roms for lowest latency but possibly with artifacts
arrayf:=["mb_106b", "tz_92", "taf_l7", "frankst"]
Table=%1% ;Table filename
SplitPath, Table,,,, XTable,
; Read description tag from xml - Thanks horseyhorsey - http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry129111
databaseFile=%PinballX_Path%\Databases\Visual Pinball\Visual Pinball.xml
xpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodes
exe:= XPath(dbXML, "/menu/game[@name= . XTable . ]/exe/text()")
rom:= XPath(dbXML, "/menu/game[@name= . XTable . ]/rom/text()")
B2S:= XPath(dbXML, "/menu/game[@name= . XTable . ]/B2S/text()")
If exe=VPinball991
{
RegWrite, REG_DWORD,HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainY, %Nudge991%
RegWrite, REG_DWORD,HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainX, %Nudge991%
}
If exe=VP_physmod2
{
RegWrite, REG_DWORD, HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainY, %NudgePM%
RegWrite, REG_DWORD, HKCU, Software\Visual Pinball\DX9\Player, PBWAccelGainX, %NudgePM%
}
IniRead, TablePath, %PinballX_Path%\Config\PinballX.ini, VisualPinball, TablePath
StringReplace, XTablePath, TablePath, \Tables
RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_width
RegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_height
RegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_x
RegRead, XDMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_y
DMD_width:=XDMD_width-3
DMD_height:=XDMD_height+3
DMD_Y:=XDMD_Y-2
; Hardcode
If rom=simpprty
{
DMD_width:=768
DMD_height:=300
DMD_X:=3840
DMD_Y:=123
}
If rom=ripleys
{
DMD_width:=768
DMD_height:=300
DMD_X:=3840
DMD_Y:=123
}
If rom=wpt_140a
{
DMD_width:=768
DMD_height:=300
DMD_X:=3840
DMD_Y:=123
}
If rom=taf_l7
{
DMD_width:=768
DMD_height:=244
DMD_X:=3840
DMD_Y:=198
}
If B2S=True
{
FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3
FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8
FileReadLine, XDMD_height, %TablePath%\ScreenRes.txt, 9
FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10
FileReadLine, XDMD_Y, %TablePath%\ScreenRes.txt, 11
DMD_height:=XDMD_height+6
DMD_X:=BG_width+XDMD_X ;Reference to Top Left of Playfield screen
DMD_Y:=XDMD_Y-2
}
StringGetPos, pos, Filter, )
Scale:=SubStr(Filter, 12, pos-11)
StringGetPos, pos1, Scale, /
If ErrorLevel=0
{
Num:=SubStr(Scale, 1, pos1)
Denom:=SubStr(Scale, pos1+2)
Num1:=Num
Denom1:=Denom
Scale:=Num1/Denom1
}
BOX1_width:=Floor(DMD_width*Scale+23*2)
BOX1_height:=Floor(DMD_height*Scale+4*2)
BOX2_width:=BOX1_width-23
BOX2_height:=BOX1_height-5
;Disable Aero if Enabled
RegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, Composition
Aero=%DWMComp%
If Aero=1
Run, sc stop uxsms
;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\VPMSettings.xml"
; Mirror and flip DMD for apron
If DMD_width>0
{
Loop % arrayf.MaxIndex()
{
l_table = % arrayf[A_Index]
if( "X" l_table = "X" rom )
{
streamx264=1
break
}
}
If streamx264=1
{
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v libx264 -preset ultrafast -tune zerolatency -qp 0 -f mpegts -threads 8 udp://localhost:1234,, Hide
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v libx264 -preset ultrafast -tune zerolatency -qp 0 -f mpegts -threads 8 udp://localhost:5678,, Hide
}
Else
{
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,, Hide
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 150 -offset_x %DMD_X% -offset_y %DMD_Y% -video_size %DMD_width%x%DMD_height% -i desktop -vf %Filter% -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:5678,, Hide
}
Sleep, 1000
Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:1234?listen,, Hide
Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:5678?listen,, Hide
Loop, 2
{
checkwindowagain1:
IfWinExist, udp://localhost:1234?listen
WinMove, udp://localhost:1234?listen,, %Mirror1PosX%, %Mirror1PosY%
Else
Goto, checkwindowagain1
}
Loop, 2
{
checkwindowagain2:
IfWinExist, udp://localhost:5678?listen
WinMove, udp://localhost:5678?listen,, %Mirror2PosX%, %Mirror2PosY%
Else
Goto, checkwindowagain2
}
}
Run, %XTablePath%\%exe%.exe -play "%TablePath%\%Table%"
WinWaitActive, ahk_class VPPlayer
Sleep, 1000
WinSet, AlwaysOnTop,, udp://localhost:1234?listen
WinSet, AlwaysOnTop,, udp://localhost:5678?listen
If DMD_width>0
{
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 %BOX1_height%-0 %BOX1_height%-%BOX1_width% 0-%BOX1_width% 0-0 4-23 %BOX2_height%-23 %BOX2_height%-%BOX2_width% 4-%BOX2_width% 4-23
Gui, Show, W%BOX1_height% H%BOX1_width% X%Mirror1PosX% Y%Mirror1PosY% NoActivate
Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, 2: Color, 000000
WinSet, Region, 0-0 %BOX1_height%-0 %BOX1_height%-%BOX1_width% 0-%BOX1_width% 0-0 4-23 %BOX2_height%-23 %BOX2_height%-%BOX2_width% 4-%BOX2_width% 4-23
Gui, 2: Show, W%BOX1_height% H%BOX1_width% X%Mirror2PosX% Y%Mirror2PosY% NoActivate
}
checkVPPlayer:
IfWinNotExist, Visual Pinball
{
Run, taskkill /IM ffplay.exe
Run, taskkill /IM ffmpeg.exe /F
;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\4KSettings.xml"
;Enable Aero if Enabled at the start of script execution
If Aero=1
Run, sc start uxsms
}
else
{
Sleep, 1000
Goto, checkVPPlayer
}
ExitApp
; CloseVP from FPLaunch
CloseVP:
;toLog("CloseVP Called")
;Hotkey, %exitScriptKey%, Off
GoSub rosveClose
;GoSub bigbossClose ; change loops completely, put all data in xml !!! too slow
;Visual Pinball must be closed this way instead of killing process
;or it wil not save your last game information.i.e score/credtis
;DetectHiddenWindows on ;Or next line will not work
;Loop, 4
;Gui, %A_Index%: Destroy
;This line fixes where the VP Window flashes real quick
;when closing the window for a cleaner exit
; win hide removed cause vp should be minimized, not hidden
;WinHide, ahk_class VPinball
;WinShow, ahk_class VPinball
WinMinimize, ahk_class VPinball
WinClose, ahk_class VPinball
WinWaitClose ahk_class VPinball
; bigbossclose won't get executed cause main thread will exit
;GoSub bigbossClose
; there's no need for exitscript cause main thread will do it
;Goto ExitScript
return
rosveClose:
;toLog("rosveClose Called")
; rosve
; --------------------------------------------------------------
; --- Close the animated backglass -----------------------
; --------------------------------------------------------------
; b2s close bug fix
StringRight, ending, XTable, 3
if (ending = "B2S")
{
WinKill, Form1
}
return
#IfWinActive ahk_class VPPlayer
; Interlock Switch
Joy7::
Send {End}
SetTimer, WaitForJoy7, 10
Return
WaitForJoy7:
if GetKeyState("Joy7")
return
Send {End}
SetTimer, WaitForJoy7, off
Return
; Exit Table
Joy8::
Gosub CloseVP
Return
#IfWinActive

Here's some crappy phone videos showing the streaming in action on my P2k style cab -

Monster Bash, a DMD:

https://dl.dropboxusercontent.com/u/45430846/PinXPost20150306/mb.mp4

Funhouse, a B2S:

https://dl.dropboxusercontent.com/u/45430846/PinXPost20150306/fh.mp4

and The Addams Family, a combination of DMD and B2S (for the THING lights):

https://dl.dropboxusercontent.com/u/45430846/taf.mp4

  • Like 1
Posted

That is sweet!

So these apron DMD's are just windowed areas on your playfield screen, and not two dedicated mini screens? Clearly a newbie question, but I lack any type of experience with pincab's, and I am trying to learn from what you guys are doing.

Your last link is broke BTW.

Guest
This topic is now closed to further replies.
×
×
  • Create New...