Carny_Priest Posted February 23, 2015 Share Posted February 23, 2015 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-dmdVPM 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/#entry138633That 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 notand exe to tell which executable to runIf no rom is entered and B2S is False then the script will simply bypass all of the streaming codeExample 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 rotatesMirror1PosX 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 scriptffmpeg - use the static build here:http://ffmpeg.zeranoe.com/#NoEnv #SingleInstance force#WinActivateForce;http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry137471- Thanks horseyhorsey #Include, %A_ScriptDir%\xpath.ahkSetTitleMatchMode, 2DetectHiddenWindows, On ; User inputsPinballX_Path=c:\PinballXFFMPEG_Path=c:\FFMPEG\binNudge991=300NudgePM=75Filter="scale=iw*(1/3):-1,transpose=3"Mirror1PosX=1810Mirror1PosY=767Mirror2PosX=1810Mirror2PosY=127; array code adapted from Gilrock - http://www.gameex.info/forums/topic/15083-improved-pinball-fx2-script Thanks ; roms for lowest latency but possibly with artifactsarrayf:=["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/#entry129111databaseFile=%PinballX_Path%\Databases\Visual Pinball\Visual Pinball.xmlxpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodesexe:= 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, TablePathStringReplace, XTablePath, TablePath, \Tables RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_widthRegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_heightRegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_xRegRead, XDMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_yDMD_width:=XDMD_width-3DMD_height:=XDMD_height+3DMD_Y:=XDMD_Y-2 If B2S=True{FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8FileReadLine, XDMD_height, %TablePath%\ScreenRes.txt, 9FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10FileReadLine, XDMD_Y, %TablePath%\ScreenRes.txt, 11DMD_height:=XDMD_height+6DMD_X:=BG_width+XDMD_X ;Reference to Top Left of Playfield screenDMD_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:=NumDenom1:=DenomScale:=Num1/Denom1}BOX1_width:=Floor(DMD_width*Scale+23*2)BOX1_height:=Floor(DMD_height*Scale+4*2)BOX2_width:=BOX1_width-23BOX2_height:=BOX1_height-5 ;Disable Aero if EnabledRegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, CompositionAero=%DWMComp%If Aero=1Run, sc stop uxsms ;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\VPMSettings.xml" ; Mirror and flip DMD for apronIf DMD_width>0{Loop % arrayf.MaxIndex(){l_table = % arrayf[A_Index]if( "X" l_table = "X" rom ){streamx264=1break}}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,, HideRun, %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,, HideRun, %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, 1000Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:1234?listen,, HideRun, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:5678?listen,, Hidecheckwindowagain1:IfWinExist, udp://localhost:1234?listenWinMove, udp://localhost:1234?listen,, %Mirror1PosX%, %Mirror1PosY%elseGoto, checkwindowagain1checkwindowagain2:IfWinExist, udp://localhost:5678?listenWinMove, udp://localhost:5678?listen,, %Mirror2PosX%, %Mirror2PosY%elseGoto, checkwindowagain2} Run, %XTablePath%\%exe%.exe -play "%TablePath%\%Table%"WinWaitActive, ahk_class VPPlayerSleep, 1000WinSet, AlwaysOnTop,, udp://localhost:1234?listenWinSet, AlwaysOnTop,, udp://localhost:5678?listenIf DMD_width>0{; draw a black border to hide the window borders for the mirror Gui +LastFound +AlwaysOnTop -Caption +ToolWindowGui, Color, 000000WinSet, 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-23Gui, Show, W%BOX1_height% H%BOX1_width% X%Mirror1PosX% Y%Mirror1PosY% NoActivate Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindowGui, 2: Color, 000000WinSet, 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-23Gui, 2: Show, W%BOX1_height% H%BOX1_width% X%Mirror2PosX% Y%Mirror2PosY% NoActivate} checkVPPlayer:IfWinNotExist, ahk_class VPPlayer{Process, Close, CaptFantastic_FS_B2S.exeRun, taskkill /IM ffplay.exeRun, taskkill /IM ffmpeg.exe /F;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\4KSettings.xml";Enable Aero if Enabled at the start of script executionIf Aero=1Run, sc start uxsms}else{Sleep, 1000Goto, checkVPPlayer} ExitApp #IfWinActive ahk_class VPPlayer ; Interlock SwitchJoy7::Send {End}SetTimer, WaitForJoy7, 10return WaitForJoy7:if GetKeyState("Joy7")returnSend {End}SetTimer, WaitForJoy7, offreturn ; Exit TableJoy8:: Send {q} #IfWinActive 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. 2 Link to comment Share on other sites More sharing options...
horseyhorsey Posted February 23, 2015 Share Posted February 23, 2015 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? Link to comment Share on other sites More sharing options...
Carny_Priest Posted February 23, 2015 Author Share Posted February 23, 2015 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. Link to comment Share on other sites More sharing options...
horseyhorsey Posted February 23, 2015 Share Posted February 23, 2015 I'll give it a shot tomorow. Let you know. Link to comment Share on other sites More sharing options...
Carny_Priest Posted February 23, 2015 Author Share Posted February 23, 2015 Ok. I'll have an update a little later that is compatible with the new AlternateExe xml tag introduced in 1.96. Otherwise, it will run the same way. Link to comment Share on other sites More sharing options...
horseyhorsey Posted February 24, 2015 Share Posted February 24, 2015 Lol, better late than never Tom! Although you could've just left the tag as just <exe> to save me 5 minutes. Link to comment Share on other sites More sharing options...
Carny_Priest Posted February 24, 2015 Author Share Posted February 24, 2015 Sadly, I'm not able to get the mirroring to happily co-exist with the new multi exe launcher. So it is back to the published script and the custom exe tag for me. Link to comment Share on other sites More sharing options...
Carny_Priest Posted March 7, 2015 Author Share Posted March 7, 2015 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;http://www.gameex.info/forums/topic/14632-multiple-exe-for-vp/#entry137471- Thanks horseyhorsey#Include, %A_ScriptDir%\xpath.ahkSetTitleMatchMode, 2DetectHiddenWindows, On ; User inputsPinballX_Path=c:\PinballXFFMPEG_Path=c:\FFMPEG\binNudge991=300NudgePM=75Filter="scale=iw*(1/3):-1,transpose=3"Mirror1PosX=1810Mirror1PosY=767Mirror2PosX=1810Mirror2PosY=127; array code adapted from Gilrock - http://www.gameex.info/forums/topic/15083-improved-pinball-fx2-script Thanks ; roms for lowest latency but possibly with artifactsarrayf:=["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/#entry129111databaseFile=%PinballX_Path%\Databases\Visual Pinball\Visual Pinball.xmlxpath_load(dbXML, databaseFile ) ; need to read the existing xml otherwise xpath deletes all existing nodesexe:= 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, TablePathStringReplace, XTablePath, TablePath, \Tables RegRead, XDMD_width, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_widthRegRead, XDMD_height, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_heightRegRead, DMD_X, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_xRegRead, XDMD_Y, HKCU, Software\Freeware\Visual PinMame\%rom%, dmd_pos_yDMD_width:=XDMD_width-3DMD_height:=XDMD_height+3DMD_Y:=XDMD_Y-2; HardcodeIf rom=simpprty{DMD_width:=768DMD_height:=300DMD_X:=3840DMD_Y:=123} If rom=ripleys{DMD_width:=768DMD_height:=300DMD_X:=3840DMD_Y:=123} If rom=wpt_140a{DMD_width:=768DMD_height:=300DMD_X:=3840DMD_Y:=123} If rom=taf_l7{DMD_width:=768DMD_height:=244DMD_X:=3840DMD_Y:=198} If B2S=True{FileReadLine, BG_width, %TablePath%\ScreenRes.txt, 3FileReadLine, DMD_width, %TablePath%\ScreenRes.txt, 8FileReadLine, XDMD_height, %TablePath%\ScreenRes.txt, 9FileReadLine, XDMD_X, %TablePath%\ScreenRes.txt, 10FileReadLine, XDMD_Y, %TablePath%\ScreenRes.txt, 11DMD_height:=XDMD_height+6DMD_X:=BG_width+XDMD_X ;Reference to Top Left of Playfield screenDMD_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:=NumDenom1:=DenomScale:=Num1/Denom1}BOX1_width:=Floor(DMD_width*Scale+23*2)BOX1_height:=Floor(DMD_height*Scale+4*2)BOX2_width:=BOX1_width-23BOX2_height:=BOX1_height-5 ;Disable Aero if EnabledRegRead, DWMComp, HKCU, Software\Microsoft\Windows\DWM, CompositionAero=%DWMComp%If Aero=1Run, sc stop uxsms ;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\VPMSettings.xml" ; Mirror and flip DMD for apronIf DMD_width>0{Loop % arrayf.MaxIndex(){l_table = % arrayf[A_Index]if( "X" l_table = "X" rom ){streamx264=1break}}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,, HideRun, %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,, HideRun, %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, 1000Run, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:1234?listen,, HideRun, %FFMPEG_Path%\ffplay -an -sn -i -fflags nobuffer udp://localhost:5678?listen,, HideLoop, 2{checkwindowagain1:IfWinExist, udp://localhost:1234?listenWinMove, udp://localhost:1234?listen,, %Mirror1PosX%, %Mirror1PosY%ElseGoto, checkwindowagain1}Loop, 2{checkwindowagain2:IfWinExist, udp://localhost:5678?listenWinMove, udp://localhost:5678?listen,, %Mirror2PosX%, %Mirror2PosY%ElseGoto, checkwindowagain2}} Run, %XTablePath%\%exe%.exe -play "%TablePath%\%Table%"WinWaitActive, ahk_class VPPlayerSleep, 1000WinSet, AlwaysOnTop,, udp://localhost:1234?listenWinSet, AlwaysOnTop,, udp://localhost:5678?listenIf DMD_width>0{; draw a black border to hide the window borders for the mirror Gui +LastFound +AlwaysOnTop -Caption +ToolWindowGui, Color, 000000WinSet, 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-23Gui, Show, W%BOX1_height% H%BOX1_width% X%Mirror1PosX% Y%Mirror1PosY% NoActivate Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindowGui, 2: Color, 000000WinSet, 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-23Gui, 2: Show, W%BOX1_height% H%BOX1_width% X%Mirror2PosX% Y%Mirror2PosY% NoActivate} checkVPPlayer:IfWinNotExist, Visual Pinball{Run, taskkill /IM ffplay.exeRun, taskkill /IM ffmpeg.exe /F;Run, dc2.exe -configure="%A_ScriptDir%\dc2config\4KSettings.xml";Enable Aero if Enabled at the start of script executionIf Aero=1Run, sc start uxsms}else{Sleep, 1000Goto, checkVPPlayer} ExitApp ; CloseVP from FPLaunchCloseVP:;toLog("CloseVP Called");Hotkey, %exitScriptKey%, OffGoSub 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 VPinballWinMinimize, ahk_class VPinballWinClose, ahk_class VPinballWinWaitClose 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 ExitScriptreturn rosveClose:;toLog("rosveClose Called"); rosve; --------------------------------------------------------------; --- Close the animated backglass -----------------------; --------------------------------------------------------------; b2s close bug fixStringRight, ending, XTable, 3if (ending = "B2S"){WinKill, Form1}return #IfWinActive ahk_class VPPlayer ; Interlock SwitchJoy7::Send {End}SetTimer, WaitForJoy7, 10Return WaitForJoy7:if GetKeyState("Joy7")returnSend {End}SetTimer, WaitForJoy7, offReturn ; Exit TableJoy8:: Gosub CloseVPReturn #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.mp4Funhouse, a B2S:https://dl.dropboxusercontent.com/u/45430846/PinXPost20150306/fh.mp4and The Addams Family, a combination of DMD and B2S (for the THING lights):https://dl.dropboxusercontent.com/u/45430846/taf.mp4 1 Link to comment Share on other sites More sharing options...
tthurman Posted March 8, 2015 Share Posted March 8, 2015 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. Link to comment Share on other sites More sharing options...
Carny_Priest Posted March 8, 2015 Author Share Posted March 8, 2015 Yes, they are windows. I've updated that last link for TAF. Link to comment Share on other sites More sharing options...
tthurman Posted March 8, 2015 Share Posted March 8, 2015 Cool, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts