x jhsrennie:
Hi, I'm one of the users that actually doesn't have a dedicated PC and I use my work PC for XBMC but not at the same time.
The main problem with this setup is
launching XBMC in full screen in the second display. Of course, you can configure XBMC to be in this display and everytime it will try to start on it.
But I like the idea of having two shortcuts for launch XBMC in my desktop and to launch XBMC using the second display (TV @ FullHD) so I'm trying to reproduce my old setup with WMC.
As far I know, the actual setting is configured in
guisettings.xml (settings > videoscreen > screen) so I've searched the way for changing this value before starting XMBC.
Here is the code (I'm using XBMC in portable mode):
Code:
@ECHO OFF
SETLOCAL
SET XML=.\portable_data\userdata\guisettings.xml
SET EXE=.\XBMC.exe
IF "%1"=="0" GOTO WINDOWED
IF "%1"=="1" GOTO DESKTOP
IF "%1"=="2" GOTO EXTENDED
GOTO PARAMS
:WINDOWED
SET SCREEN=-1
SET SCREENMODE=WINDOW
CALL :CHANGE
GOTO RUNXBC
:DESKTOP
SET SCREEN=-1
SET SCREENMODE=DESKTOP
CALL :CHANGE
GOTO RUNXBC
:EXTENDED
SET SCREEN=1
SET SCREENMODE=10192001080059.94006
CALL :CHANGE
GOTO RUNXBC
:CHANGE
if exist %XML% (
ECHO * Configuring XBMC with these settings:
ECHO SCREEN = %SCREEN%
ECHO MODE = %SCREENMODE%
ECHO * Changing %XML% file ...
setxml.exe %XML% @//settings/videoscreen/screen %SCREEN% /display:none
setxml.exe %XML% @//settings/videoscreen/screenmode %SCREENMODE% /display:none
ECHO * Changing XML format (no XML version, Unix)
tail +2 %XML% > guisettings.tail
dos2unix -q guisettings.tail
move /y guisettings.tail %XML% > nul
)
GOTO :EOF
:RUNXBC
IF EXIST %EXE% START %EXE% -p
GOTO END
:PARAMS
ECHO %~n0 {option}
ECHO.
ECHO 0 = Windowed
ECHO 1 = Desktop
ECHO 2 = Extended
:END
ENDLOCAL
Note: I've used some external tools (SET2XML, UNIX2DOS and TAIL). Here are the links:
http://dos2unix.sourceforge.net/ and
http://www.noeld.com/programs.asp?cat=dev#setxml. I don't remember from where I've downloaded tail.exe but is a common Unix tool for Windows.
Please, if some is an expert in PowerShell, probably he could create an script like that for changing this value in the XML file and then launch XBMC (probably, he won't need to use these external tools). An idea here
http://powershell.com/cs/blogs/tobias/ar...-data.aspx.
By the way,
whats the meaning of SCREENMODE 10192001080059.94006?. I've found the values in my script by looking at the guisettings.xml file after changing to the desired value.
Any better script for lauching XBMC in different displays would be very appreciated.
Thanks.