@ECHO OFF
CALL C:\LiveDigital\config.bat

SET var_xoffset=0
SET var_yoffset=0
SET var_wsize=1920
SET var_hsize=1080

IF DEFINED var_chrome (
	ECHO Chrome Variable defined
) ELSE (
	SET var_chrome=0	
)


IF %var_chrome% GTR 0 (
	TASKKILL /IM chrome.exe

	PING 127.0.0.1 -n 4 -w 500

	TASKKILL /IM chrome.exe /F

	PING 127.0.0.1 -n 4 -w 500

	CMDOW /RUN /MAX "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --incognito --autoplay-policy=no-user-gesture-required --no-user-gesture-required "https://logging.livedigital.com.au/test-pattern/"

	PING 127.0.0.1 -n 4 -w 500
) ELSE (
	TASKKILL /IM firefox.exe

	PING 127.0.0.1 -n 4 -w 500

	TASKKILL /IM firefox.exe /F

	PING 127.0.0.1 -n 4 -w 500

	CMDOW /RUN /MAX "C:\Program Files\Mozilla Firefox\firefox.exe" -no-remote -P instance0 "https://logging.livedigital.com.au/test-pattern/"

	PING 127.0.0.1 -n 4 -w 500
	
	CD C:\LiveDigital
	
	START /B C:\LiveDigital\adjust.bat
)