aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kodi.xcodeproj/project.pbxproj19
-rw-r--r--Makefile.in1
-rw-r--r--project/VS2010Express/XBMC.vcxproj153
-rw-r--r--project/VS2010Express/XBMC.vcxproj.filters23
-rw-r--r--xbmc/XBApplicationEx.cpp61
-rw-r--r--xbmc/main/Makefile.in3
-rw-r--r--xbmc/main/main.cpp8
-rw-r--r--xbmc/main/posix/MessagePrinter.cpp51
-rw-r--r--xbmc/main/posix/MessagePrinter.h53
-rw-r--r--xbmc/main/win32/MessagePrinter.cpp51
-rw-r--r--xbmc/main/win32/MessagePrinter.h53
-rw-r--r--xbmc/main/win32/WinMain.cpp126
-rw-r--r--xbmc/win32/XBMC_PC.cpp255
-rw-r--r--xbmc/xbmc.cpp49
14 files changed, 530 insertions, 376 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj
index 8a73565654..58dec6a8c7 100644
--- a/Kodi.xcodeproj/project.pbxproj
+++ b/Kodi.xcodeproj/project.pbxproj
@@ -160,6 +160,9 @@
395897151AAD94F00033D27C /* KeyboardLayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395897131AAD94F00033D27C /* KeyboardLayoutManager.cpp */; };
395897161AAD94F00033D27C /* KeyboardLayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395897131AAD94F00033D27C /* KeyboardLayoutManager.cpp */; };
395897171AAD94F00033D27C /* KeyboardLayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395897131AAD94F00033D27C /* KeyboardLayoutManager.cpp */; };
+ 395938771AC310B00053A590 /* MessagePrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395938751AC310B00053A590 /* MessagePrinter.cpp */; };
+ 395938781AC310B00053A590 /* MessagePrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395938751AC310B00053A590 /* MessagePrinter.cpp */; };
+ 395938791AC310B00053A590 /* MessagePrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395938751AC310B00053A590 /* MessagePrinter.cpp */; };
395C29BC1A94733100EBC7AD /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395C29BA1A94733100EBC7AD /* Key.cpp */; };
395C29BD1A94733100EBC7AD /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395C29BA1A94733100EBC7AD /* Key.cpp */; };
395C29BE1A94733100EBC7AD /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395C29BA1A94733100EBC7AD /* Key.cpp */; };
@@ -3521,6 +3524,8 @@
395897131AAD94F00033D27C /* KeyboardLayoutManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardLayoutManager.cpp; sourceTree = "<group>"; };
395897141AAD94F00033D27C /* KeyboardLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyboardLayoutManager.h; sourceTree = "<group>"; };
395938731AC28F5A0053A590 /* EmbeddedArt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmbeddedArt.h; sourceTree = "<group>"; };
+ 395938751AC310B00053A590 /* MessagePrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessagePrinter.cpp; sourceTree = "<group>"; };
+ 395938761AC310B00053A590 /* MessagePrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessagePrinter.h; sourceTree = "<group>"; };
395C29BA1A94733100EBC7AD /* Key.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Key.cpp; sourceTree = "<group>"; };
395C29BB1A94733100EBC7AD /* Key.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Key.h; sourceTree = "<group>"; };
395C29BF1A98A0A000EBC7AD /* Webinterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Webinterface.cpp; sourceTree = "<group>"; };
@@ -6262,6 +6267,16 @@
path = pthreads;
sourceTree = "<group>";
};
+ 395938741AC310B00053A590 /* posix */ = {
+ isa = PBXGroup;
+ children = (
+ 395938751AC310B00053A590 /* MessagePrinter.cpp */,
+ 395938761AC310B00053A590 /* MessagePrinter.h */,
+ );
+ name = posix;
+ path = main/posix;
+ sourceTree = "<group>";
+ };
395C29C81A98A11B00EBC7AD /* wsgi */ = {
isa = PBXGroup;
children = (
@@ -6841,6 +6856,7 @@
isa = PBXGroup;
children = (
DFB15B1F15F8FB8100CDF0DE /* osx */,
+ 395938741AC310B00053A590 /* posix */,
552A226815F7E14B0015C0D0 /* main.cpp */,
);
name = main;
@@ -10564,6 +10580,7 @@
18B7C7CE1294222E009E7A26 /* GUIListLabel.cpp in Sources */,
18B7C7CF1294222E009E7A26 /* GUIMessage.cpp in Sources */,
18B7C7D01294222E009E7A26 /* GUIMoverControl.cpp in Sources */,
+ 395938771AC310B00053A590 /* MessagePrinter.cpp in Sources */,
18B7C7D11294222E009E7A26 /* GUIMultiImage.cpp in Sources */,
18B7C7D21294222E009E7A26 /* GUIMultiSelectText.cpp in Sources */,
18B7C7D31294222E009E7A26 /* GUIPanelContainer.cpp in Sources */,
@@ -11184,6 +11201,7 @@
DFF0F14417528350002DA3A4 /* AEPackIEC61937.cpp in Sources */,
DFF0F14617528350002DA3A4 /* AEStreamInfo.cpp in Sources */,
DFF0F14717528350002DA3A4 /* AEUtil.cpp in Sources */,
+ 395938791AC310B00053A590 /* MessagePrinter.cpp in Sources */,
42DAC1701A6E789E0066B4C8 /* PVRActionListener.cpp in Sources */,
DFF0F14917528350002DA3A4 /* AEFactory.cpp in Sources */,
DFF0F14A17528350002DA3A4 /* EmuFileWrapper.cpp in Sources */,
@@ -12739,6 +12757,7 @@
E49913E6174E5F8D00741B6D /* PlayListXML.cpp in Sources */,
E49913E7174E5F8D00741B6D /* SmartPlayList.cpp in Sources */,
E49913E8174E5F9900741B6D /* CocoaPowerSyscall.cpp in Sources */,
+ 395938781AC310B00053A590 /* MessagePrinter.cpp in Sources */,
E49913E9174E5F9900741B6D /* DPMSSupport.cpp in Sources */,
E49913EA174E5F9900741B6D /* PowerManager.cpp in Sources */,
E49913EB174E5FB000741B6D /* GUIDialogLockSettings.cpp in Sources */,
diff --git a/Makefile.in b/Makefile.in
index 123e6b246a..21fa4e146d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -54,6 +54,7 @@ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
xbmc/interfaces/json-rpc/json-rpc.a \
xbmc/linux/linux.a \
xbmc/listproviders/listproviders.a \
+ xbmc/main/main.a \
xbmc/media/media.a \
xbmc/music/dialogs/musicdialogs.a \
xbmc/music/infoscanner/musicscanner.a \
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 5e48e520a4..4c61fd4c97 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -595,6 +595,13 @@
<ClCompile Include="..\..\xbmc\listproviders\IListProvider.cpp" />
<ClCompile Include="..\..\xbmc\listproviders\DirectoryProvider.cpp" />
<ClCompile Include="..\..\xbmc\listproviders\StaticProvider.cpp" />
+ <ClCompile Include="..\..\xbmc\main\main.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\main\win32\MessagePrinter.cpp" />
+ <ClCompile Include="..\..\xbmc\main\win32\WinMain.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
<ClCompile Include="..\..\xbmc\MediaSource.cpp" />
<ClCompile Include="..\..\xbmc\media\MediaType.cpp" />
<ClCompile Include="..\..\xbmc\music\Album.cpp" />
@@ -985,6 +992,7 @@
<ClInclude Include="..\..\xbmc\interfaces\python\PyContext.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\PythonInvoker.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\pythreadstate.h" />
+ <ClInclude Include="..\..\xbmc\main\win32\MessagePrinter.h" />
<ClInclude Include="..\..\xbmc\media\MediaType.h" />
<ClInclude Include="..\..\xbmc\music\CueInfoLoader.h" />
<ClInclude Include="..\..\xbmc\music\EmbeddedArt.h" />
@@ -1503,9 +1511,6 @@
<ClCompile Include="..\..\xbmc\win32\Win32DelayedDllLoad.cpp" />
<ClCompile Include="..\..\xbmc\win32\WIN32Util.cpp" />
<ClCompile Include="..\..\xbmc\win32\WindowHelper.cpp" />
- <ClCompile Include="..\..\xbmc\win32\XBMC_PC.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">true</ExcludedFromBuild>
- </ClCompile>
<ClCompile Include="..\..\xbmc\cores\DummyVideoPlayer.cpp" />
<ClCompile Include="..\..\xbmc\cores\dvdplayer\DVDAudio.cpp" />
<ClCompile Include="..\..\xbmc\cores\dvdplayer\DVDClock.cpp" />
@@ -1673,11 +1678,7 @@
<ClCompile Include="..\..\xbmc\windows\GUIWindowWeather.cpp" />
<ClCompile Include="..\..\xbmc\XBApplicationEx.cpp" />
<ClCompile Include="..\..\xbmc\XBDateTime.cpp" />
- <ClCompile Include="..\..\xbmc\xbmc.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- </ClCompile>
+ <ClCompile Include="..\..\xbmc\xbmc.cpp" />
<ClCompile Include="..\..\xbmc\XbmcContext.cpp" />
</ItemGroup>
<ItemGroup>
@@ -2553,15 +2554,24 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">true</ExcludedFromBuild>
- <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></EntryPointName>
- <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ShaderModel>
- <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></EntryPointName>
- <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ShaderModel>
- <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></EntryPointName>
- <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ShaderModel>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </EntryPointName>
+ <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ShaderModel>
+ <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </EntryPointName>
+ <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ShaderModel>
+ <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </EntryPointName>
+ <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ShaderModel>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
</FxCompile>
<FxCompile Include="..\..\system\shaders\guishader_checkerboard_left.hlsl">
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PS</EntryPointName>
@@ -2570,9 +2580,12 @@
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
@@ -2592,15 +2605,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2616,15 +2632,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2640,15 +2659,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2664,15 +2686,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2688,15 +2713,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2712,15 +2740,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2736,15 +2767,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2760,15 +2794,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2784,15 +2821,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2808,15 +2848,18 @@
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">PS</EntryPointName>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">false</EnableDebuggingInformation>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Pixel</ShaderType>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
<HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shaders\%(Filename).h</HeaderFileOutput>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Filename)</VariableName>
@@ -2836,11 +2879,13 @@
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0_level_9_1</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">VS</EntryPointName>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">Vertex</ShaderType>
-
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">4.0_level_9_1</ShaderModel>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"></ObjectFileOutput>
- <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'"></ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ </ObjectFileOutput>
+ <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
+ </ObjectFileOutput>
<DisableOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableOptimizations>
<EnableDebuggingInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EnableDebuggingInformation>
<VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Filename)</VariableName>
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index 9cef833d6a..eb3d565e97 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -346,6 +346,12 @@
<Filter Include="network\dacp">
<UniqueIdentifier>{33ec4ead-1923-47c2-8a7f-44561adaebf3}</UniqueIdentifier>
</Filter>
+ <Filter Include="main">
+ <UniqueIdentifier>{e8f91abe-5d75-4a38-b576-8d971f5fa64b}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="main\win32">
+ <UniqueIdentifier>{b2cf6073-0796-485b-a2f8-0b54851262b3}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\xbmc\win32\pch.cpp">
@@ -360,9 +366,6 @@
<ClCompile Include="..\..\xbmc\win32\WindowHelper.cpp">
<Filter>win32</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\win32\XBMC_PC.cpp">
- <Filter>win32</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\cores\DummyVideoPlayer.cpp">
<Filter>cores</Filter>
</ClCompile>
@@ -3099,6 +3102,15 @@
<ClCompile Include="..\..\xbmc\pictures\PictureScalingAlgorithm.cpp">
<Filter>pictures</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\main\main.cpp">
+ <Filter>main</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\main\win32\WinMain.cpp">
+ <Filter>main\win32</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\main\win32\MessagePrinter.cpp">
+ <Filter>main\win32</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xbmc\win32\pch.h">
@@ -5935,7 +5947,7 @@
<ClInclude Include="..\..\xbmc\addons\LanguageResource.h">
<Filter>addons</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\addons\UISoundsResource.h">
+ <ClInclude Include="..\..\xbmc\addons\UISoundsResource.h">
<Filter>addons</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\filesystem\ResourceFile.h">
@@ -5992,6 +6004,9 @@
<ClInclude Include="..\..\xbmc\pictures\PictureScalingAlgorithm.h">
<Filter>pictures</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\main\win32\MessagePrinter.h">
+ <Filter>main\win32</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
diff --git a/xbmc/XBApplicationEx.cpp b/xbmc/XBApplicationEx.cpp
index ad6a145b12..048a6c134f 100644
--- a/xbmc/XBApplicationEx.cpp
+++ b/xbmc/XBApplicationEx.cpp
@@ -82,13 +82,6 @@ INT CXBApplicationEx::Run()
unsigned int frameTime = 0;
const unsigned int noRenderFrameTime = 15; // Simulates ~66fps
-#ifdef XBMC_TRACK_EXCEPTIONS
- BYTE processExceptionCount = 0;
- BYTE frameMoveExceptionCount = 0;
- BYTE renderExceptionCount = 0;
- const BYTE MAX_EXCEPTION_COUNT = 10;
-#endif
-
// Run xbmc
while (!m_bStop)
{
@@ -106,30 +99,17 @@ INT CXBApplicationEx::Run()
Process();
//reset exception count
#ifdef XBMC_TRACK_EXCEPTIONS
- processExceptionCount = 0;
}
catch (const XbmcCommons::UncheckedException &e)
{
e.LogThrowMessage("CApplication::Process()");
- processExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (processExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
- throw;
- }
+ throw;
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::Process()");
- processExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (processExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::Process(), too many exceptions");
- throw;
- }
+ throw;
}
#endif
// Frame move the scene
@@ -140,30 +120,16 @@ INT CXBApplicationEx::Run()
if (!m_bStop) FrameMove(true, m_renderGUI);
//reset exception count
#ifdef XBMC_TRACK_EXCEPTIONS
- frameMoveExceptionCount = 0;
-
}
catch (const XbmcCommons::UncheckedException &e)
{
e.LogThrowMessage("CApplication::FrameMove()");
- frameMoveExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
- throw;
- }
+ throw;
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::FrameMove()");
- frameMoveExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (frameMoveExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::FrameMove(), too many exceptions");
- throw;
- }
+ throw;
}
#endif
@@ -180,31 +146,16 @@ INT CXBApplicationEx::Run()
Sleep(noRenderFrameTime - frameTime);
}
#ifdef XBMC_TRACK_EXCEPTIONS
- //reset exception count
- renderExceptionCount = 0;
-
}
catch (const XbmcCommons::UncheckedException &e)
{
e.LogThrowMessage("CApplication::Render()");
- renderExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (renderExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
- throw;
- }
+ throw;
}
catch (...)
{
CLog::Log(LOGERROR, "exception in CApplication::Render()");
- renderExceptionCount++;
- //MAX_EXCEPTION_COUNT exceptions in a row? -> bail out
- if (renderExceptionCount > MAX_EXCEPTION_COUNT)
- {
- CLog::Log(LOGERROR, "CApplication::Render(), too many exceptions");
- throw;
- }
+ throw;
}
#endif
} // while (!m_bStop)
diff --git a/xbmc/main/Makefile.in b/xbmc/main/Makefile.in
index 2072a7fb46..33eb70a914 100644
--- a/xbmc/main/Makefile.in
+++ b/xbmc/main/Makefile.in
@@ -1,6 +1,7 @@
-.SUFFIXES : .m .mm
+.SUFFIXES : .m .mm .cpp
SRCS = main.cpp
+SRCS += posix/MessagePrinter.cpp
ifeq ($(findstring osx,@ARCH@),osx)
SRCS += osx/SDLMain.mm
diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp
index 87fe2fd4c5..01027f8107 100644
--- a/xbmc/main/main.cpp
+++ b/xbmc/main/main.cpp
@@ -42,6 +42,9 @@
#endif
#include "XbmcContext.h"
+#ifdef __cplusplus
+extern "C"
+#endif
int main(int argc, char* argv[])
{
// set up some xbmc specific relationships
@@ -70,9 +73,8 @@ int main(int argc, char* argv[])
setlocale(LC_NUMERIC, "C");
g_advancedSettings.Initialize();
-#ifndef TARGET_WINDOWS
CAppParamParser appParamParser;
- appParamParser.Parse((const char **)argv, argc);
-#endif
+ appParamParser.Parse(const_cast<const char**>(argv), argc);
+
return XBMC_Run(renderGUI);
}
diff --git a/xbmc/main/posix/MessagePrinter.cpp b/xbmc/main/posix/MessagePrinter.cpp
new file mode 100644
index 0000000000..64dc15519d
--- /dev/null
+++ b/xbmc/main/posix/MessagePrinter.cpp
@@ -0,0 +1,51 @@
+/*
+* Copyright (C) 2005-2015 Team XBMC
+* http://xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, see
+* <http://www.gnu.org/licenses/>.
+*
+*/
+
+#include "MessagePrinter.h"
+#include "CompileInfo.h"
+
+#include <stdio.h>
+
+void CMessagePrinter::DisplayMessage(const std::string& message)
+{
+ fprintf(stdout, "%s\n", message.c_str());
+}
+
+void CMessagePrinter::DisplayWarning(const std::string& warning)
+{
+ fprintf(stderr, "%s\n", warning.c_str());
+}
+
+void CMessagePrinter::DisplayError(const std::string& error)
+{
+ fprintf(stderr,"%s\n", error.c_str());
+}
+
+void CMessagePrinter::DisplayHelpMessage(const std::vector<std::pair<std::string, std::string>>& help)
+{
+ //very crude implementation, pretty it up when possible
+ std::string message;
+ for (const auto& line : help)
+ {
+ message.append(line.first + "\t" + line.second + "\n");
+ }
+
+ fprintf(stdout, "%s\n", message.c_str());
+} \ No newline at end of file
diff --git a/xbmc/main/posix/MessagePrinter.h b/xbmc/main/posix/MessagePrinter.h
new file mode 100644
index 0000000000..c04e97957b
--- /dev/null
+++ b/xbmc/main/posix/MessagePrinter.h
@@ -0,0 +1,53 @@
+/*
+* Copyright (C) 2005-2015 Team XBMC
+* http://xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, see
+* <http://www.gnu.org/licenses/>.
+*
+*/
+
+#include <string>
+#include <vector>
+#include <utility>
+
+class CMessagePrinter
+{
+public:
+
+ /*! \brief Display a normal message to the user during startup
+ *
+ * \param[in] message message to display
+ */
+ static void DisplayMessage(const std::string& message);
+
+ /*! \brief Display a warning message to the user during startup
+ *
+ * \param[in] warning warning to display
+ */
+ static void DisplayWarning(const std::string& warning);
+
+ /*! \brief Display an error message to the user during startup
+ *
+ * \param[in] error error to display
+ */
+ static void DisplayError(const std::string& error);
+
+ /*! \brief Display the help message with command line options available
+ *
+ * \param[in] help List of commands and explanations,
+ help.push_back(std::make_pair("--help", "this displays the help))
+ */
+ static void DisplayHelpMessage(const std::vector<std::pair<std::string, std::string>>& help);
+}; \ No newline at end of file
diff --git a/xbmc/main/win32/MessagePrinter.cpp b/xbmc/main/win32/MessagePrinter.cpp
new file mode 100644
index 0000000000..d6bd07bccb
--- /dev/null
+++ b/xbmc/main/win32/MessagePrinter.cpp
@@ -0,0 +1,51 @@
+/*
+* Copyright (C) 2005-2015 Team XBMC
+* http://xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, see
+* <http://www.gnu.org/licenses/>.
+*
+*/
+
+#include "MessagePrinter.h"
+#include "CompileInfo.h"
+
+#include <windows.h>
+
+void CMessagePrinter::DisplayMessage(const std::string& message)
+{
+ MessageBox(NULL, message.c_str(), CCompileInfo::GetAppName(), MB_OK | MB_ICONINFORMATION);
+}
+
+void CMessagePrinter::DisplayWarning(const std::string& warning)
+{
+ MessageBox(NULL, warning.c_str(), CCompileInfo::GetAppName(), MB_OK | MB_ICONWARNING);
+}
+
+void CMessagePrinter::DisplayError(const std::string& error)
+{
+ MessageBox(NULL, error.c_str(), CCompileInfo::GetAppName(), MB_OK | MB_ICONERROR);
+}
+
+void CMessagePrinter::DisplayHelpMessage(const std::vector<std::pair<std::string, std::string>>& help)
+{
+ //very crude implementation, pretty it up when possible
+ std::string message;
+ for (const auto& line : help)
+ {
+ message.append(line.first + "\t" + line.second + "\r\n");
+ }
+
+ MessageBox(NULL, message.c_str(), CCompileInfo::GetAppName(), MB_OK | MB_ICONINFORMATION);
+} \ No newline at end of file
diff --git a/xbmc/main/win32/MessagePrinter.h b/xbmc/main/win32/MessagePrinter.h
new file mode 100644
index 0000000000..c04e97957b
--- /dev/null
+++ b/xbmc/main/win32/MessagePrinter.h
@@ -0,0 +1,53 @@
+/*
+* Copyright (C) 2005-2015 Team XBMC
+* http://xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, see
+* <http://www.gnu.org/licenses/>.
+*
+*/
+
+#include <string>
+#include <vector>
+#include <utility>
+
+class CMessagePrinter
+{
+public:
+
+ /*! \brief Display a normal message to the user during startup
+ *
+ * \param[in] message message to display
+ */
+ static void DisplayMessage(const std::string& message);
+
+ /*! \brief Display a warning message to the user during startup
+ *
+ * \param[in] warning warning to display
+ */
+ static void DisplayWarning(const std::string& warning);
+
+ /*! \brief Display an error message to the user during startup
+ *
+ * \param[in] error error to display
+ */
+ static void DisplayError(const std::string& error);
+
+ /*! \brief Display the help message with command line options available
+ *
+ * \param[in] help List of commands and explanations,
+ help.push_back(std::make_pair("--help", "this displays the help))
+ */
+ static void DisplayHelpMessage(const std::vector<std::pair<std::string, std::string>>& help);
+}; \ No newline at end of file
diff --git a/xbmc/main/win32/WinMain.cpp b/xbmc/main/win32/WinMain.cpp
new file mode 100644
index 0000000000..af96ac7386
--- /dev/null
+++ b/xbmc/main/win32/WinMain.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "CompileInfo.h"
+#include "threads/Thread.h"
+#include "threads/platform/win/Win32Exception.h"
+#include "utils/CPUInfo.h"
+#include "xbmc.h"
+
+#include <dbghelp.h>
+#include <shellapi.h>
+
+
+extern "C" int main(int argc, char* argv[]);
+
+// Minidump creation function
+LONG WINAPI CreateMiniDump(EXCEPTION_POINTERS* pEp)
+{
+ win32_exception::write_stacktrace(pEp);
+ win32_exception::write_minidump(pEp);
+ return pEp->ExceptionRecord->ExceptionCode;;
+}
+
+//-----------------------------------------------------------------------------
+// Name: WinMain()
+// Desc: The application's entry point
+//-----------------------------------------------------------------------------
+INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR commandLine, INT)
+{
+
+ // Initializes CreateMiniDump to handle exceptions.
+ char ver[100];
+ if (strlen(CCompileInfo::GetSuffix()) > 0)
+ sprintf_s(ver, "%d.%d-%s Git:%s", CCompileInfo::GetMajor(),
+ CCompileInfo::GetMinor(), CCompileInfo::GetSuffix(), CCompileInfo::GetSCMID());
+ else
+ sprintf_s(ver, "%d.%d Git:%s", CCompileInfo::GetMajor(),
+ CCompileInfo::GetMinor(), CCompileInfo::GetSCMID());
+
+ win32_exception::set_version(std::string(ver));
+ SetUnhandledExceptionFilter(CreateMiniDump);
+
+ // check if Kodi is already running
+ std::string appName = CCompileInfo::GetAppName();
+ CreateMutex(nullptr, FALSE, (appName + " Media Center").c_str());
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ HWND hwnd = FindWindow(appName.c_str(), appName.c_str());
+ if (hwnd != NULL)
+ {
+ // switch to the running instance
+ ShowWindow(hwnd, SW_RESTORE);
+ SetForegroundWindow(hwnd);
+ }
+ return 0;
+ }
+
+ if ((g_cpuInfo.GetCPUFeatures() & CPU_FEATURE_SSE2) == 0)
+ {
+ MessageBox(NULL, "No SSE2 support detected", (appName + ": Fatal Error").c_str(), MB_OK | MB_ICONERROR);
+ return 0;
+ }
+
+ //Initialize COM
+ CoInitializeEx(nullptr, COINIT_MULTITHREADED);
+
+
+ int argc;
+ LPWSTR* argvW = CommandLineToArgvW(GetCommandLineW(), &argc);
+
+ char** argv = new char*[argc];
+
+ for (int i = 0; i < argc; ++i)
+ {
+ int size = WideCharToMultiByte(CP_UTF8, 0, argvW[i], -1, nullptr, 0, nullptr, nullptr);
+ if (size > 0)
+ {
+ argv[i] = new char[size];
+ int result = WideCharToMultiByte(CP_UTF8, 0, argvW[i], -1, argv[i], size, nullptr, nullptr);
+ }
+ }
+
+ // Initialise Winsock
+ WSADATA wd;
+ WSAStartup(MAKEWORD(2, 2), &wd);
+
+ // use 1 ms timer precision - like SDL initialization used to do
+ timeBeginPeriod(1);
+
+#ifndef _DEBUG
+ // we don't want to see the "no disc in drive" windows message box
+ SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
+#endif
+
+ // Create and run the app
+ int status = main(argc, argv);
+
+ for (int i = 0; i < argc; ++i)
+ delete[] argv[i];
+ delete[] argv;
+
+ // clear previously set timer resolution
+ timeEndPeriod(1);
+
+ WSACleanup();
+ CoUninitialize();
+
+ return status;
+}
diff --git a/xbmc/win32/XBMC_PC.cpp b/xbmc/win32/XBMC_PC.cpp
deleted file mode 100644
index 3f3fed3150..0000000000
--- a/xbmc/win32/XBMC_PC.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "AppParamParser.h"
-#include "settings/AdvancedSettings.h"
-#include "utils/CharsetConverter.h"
-#include "utils/log.h"
-#include "utils/SystemInfo.h"
-#include "threads/platform/win/Win32Exception.h"
-#include "shellapi.h"
-#include "Application.h"
-#include "XbmcContext.h"
-#include "utils/CPUInfo.h"
-#include "utils/Environment.h"
-#include <mmdeviceapi.h>
-#include "win32/IMMNotificationClient.h"
-
-#ifndef _DEBUG
-#define XBMC_TRACK_EXCEPTIONS
-#endif
-
-// Minidump creation function
-LONG WINAPI CreateMiniDump( EXCEPTION_POINTERS* pEp )
-{
- win32_exception::write_stacktrace(pEp);
- win32_exception::write_minidump(pEp);
- return pEp->ExceptionRecord->ExceptionCode;;
-}
-
-//-----------------------------------------------------------------------------
-// Name: WinMain()
-// Desc: The application's entry point
-//-----------------------------------------------------------------------------
-INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR commandLine, INT )
-{
- // set up some xbmc specific relationships
- XBMC::Context context;
-
- // this fixes crash if OPENSSL_CONF is set to existed openssl.cfg
- // need to set it as soon as possible
- CEnvironment::unsetenv("OPENSSL_CONF");
-
- //this can't be set from CAdvancedSettings::Initialize() because it will overwrite
- //the loglevel set with the --debug flag
-#ifdef _DEBUG
- g_advancedSettings.m_logLevel = LOG_LEVEL_DEBUG;
- g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG;
-#else
- g_advancedSettings.m_logLevel = LOG_LEVEL_NORMAL;
- g_advancedSettings.m_logLevelHint = LOG_LEVEL_NORMAL;
-#endif
- CLog::SetLogLevel(g_advancedSettings.m_logLevel);
-
- // Initializes CreateMiniDump to handle exceptions.
- win32_exception::set_version(CSysInfo::GetVersion());
- SetUnhandledExceptionFilter( CreateMiniDump );
-
- // check if Kodi is already running
- std::string appName = CSysInfo::GetAppName();
- CreateMutex(NULL, FALSE, (appName + " Media Center").c_str());
- if(GetLastError() == ERROR_ALREADY_EXISTS)
- {
- HWND m_hwnd = FindWindow(appName.c_str(), appName.c_str());
- if(m_hwnd != NULL)
- {
- // switch to the running instance
- ShowWindow(m_hwnd,SW_RESTORE);
- SetForegroundWindow(m_hwnd);
- }
- return 0;
- }
-
-#ifndef HAS_DX
- if(CWIN32Util::GetDesktopColorDepth() < 32)
- {
- //FIXME: replace it by a SDL window for all ports
- MessageBox(NULL, "Desktop Color Depth isn't 32Bit", (appName + ": Fatal Error").c_str(), MB_OK|MB_ICONERROR);
- return 0;
- }
-#endif
-
- if((g_cpuInfo.GetCPUFeatures() & CPU_FEATURE_SSE2) == 0)
- {
- MessageBox(NULL, "No SSE2 support detected", (appName + ": Fatal Error").c_str(), MB_OK|MB_ICONERROR);
- return 0;
- }
-
- //Initialize COM
- CoInitializeEx(NULL, COINIT_MULTITHREADED);
-
- // Handle numeric values using the default/POSIX standard
- setlocale(LC_NUMERIC, "C");
-
- // If the command line passed to WinMain, commandLine, is not "" we need
- // to process the command line arguments.
- // Note that commandLine does not include the program name and can be
- // equal to "" if no arguments were supplied. By contrast GetCommandLineW()
- // does include the program name and is never equal to "".
- g_advancedSettings.Initialize();
- if (strlen(commandLine) != 0)
- {
- int argc;
- LPWSTR* argvW = CommandLineToArgvW(GetCommandLineW(), &argc);
-
- std::vector<std::string> strargvA;
- strargvA.resize(argc);
- const char** argv = (const char**) LocalAlloc(LMEM_FIXED, argc*sizeof(char*));
- if (!argv)
- return 20;
- for (int i = 0; i < argc; i++)
- {
- g_charsetConverter.wToUTF8(argvW[i], strargvA[i]);
- argv[i] = strargvA[i].c_str();
- }
-
- // Parse the arguments
- CAppParamParser appParamParser;
- appParamParser.Parse(argv, argc);
-
- // Clean up the storage we've used
- LocalFree(argvW);
- LocalFree(argv);
- }
-
- // Initialise Winsock
- WSADATA wd;
- WSAStartup(MAKEWORD(2,2), &wd);
-
- // use 1 ms timer precision - like SDL initialization used to do
- timeBeginPeriod(1);
-
-#ifdef XBMC_TRACK_EXCEPTIONS
- try
- {
-#endif
- // Create and run the app
- if(!g_application.Create())
- {
- MessageBox(NULL, "ERROR: Unable to create application. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#ifdef XBMC_TRACK_EXCEPTIONS
- }
- catch (const XbmcCommons::UncheckedException &e)
- {
- e.LogThrowMessage("CApplication::Create()");
- MessageBox(NULL, "ERROR: Unable to create application. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "exception in CApplication::Create()");
- MessageBox(NULL, "ERROR: Unable to create application. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#endif
-
-#ifndef _DEBUG
- // we don't want to see the "no disc in drive" windows message box
- SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
-#endif
-
-#ifdef XBMC_TRACK_EXCEPTIONS
- try
- {
-#endif
- if (!g_application.CreateGUI())
- {
- MessageBox(NULL, "ERROR: Unable to create GUI. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#ifdef XBMC_TRACK_EXCEPTIONS
- }
- catch (const XbmcCommons::UncheckedException &e)
- {
- e.LogThrowMessage("CApplication::CreateGUI()");
- MessageBox(NULL, "ERROR: Unable to create GUI. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "exception in CApplication::CreateGUI()");
- MessageBox(NULL, "ERROR: Unable to create GUI. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#endif
-
-#ifdef XBMC_TRACK_EXCEPTIONS
- try
- {
-#endif
- if (!g_application.Initialize())
- {
- MessageBox(NULL, "ERROR: Unable to Initialize. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#ifdef XBMC_TRACK_EXCEPTIONS
- }
- catch (const XbmcCommons::UncheckedException &e)
- {
- e.LogThrowMessage("CApplication::Initialize()");
- MessageBox(NULL, "ERROR: Unable to Initialize. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "exception in CApplication::Initialize()");
- MessageBox(NULL, "ERROR: Unable to Initialize. Exiting.", (appName + ": Error").c_str(), MB_OK|MB_ICONERROR);
- return 1;
- }
-#endif
-
- IMMDeviceEnumerator *pEnumerator = NULL;
- CMMNotificationClient cMMNC;
- HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator);
- if(SUCCEEDED(hr))
- {
- pEnumerator->RegisterEndpointNotificationCallback(&cMMNC);
- SAFE_RELEASE(pEnumerator);
- }
-
- g_application.Run();
-
- // clear previously set timer resolution
- timeEndPeriod(1);
-
- // the end
- hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator);
- if(SUCCEEDED(hr))
- {
- pEnumerator->UnregisterEndpointNotificationCallback(&cMMNC);
- SAFE_RELEASE(pEnumerator);
- }
- WSACleanup();
- CoUninitialize();
-
- return 0;
-}
diff --git a/xbmc/xbmc.cpp b/xbmc/xbmc.cpp
index 57d2158685..366e4b5357 100644
--- a/xbmc/xbmc.cpp
+++ b/xbmc/xbmc.cpp
@@ -30,6 +30,16 @@
#include "client/linux/handler/exception_handler.h"
#endif
+#ifdef TARGET_WINDOWS
+#include <mmdeviceapi.h>
+#include "win32/IMMNotificationClient.h"
+#include "main/win32/MessagePrinter.h"
+#endif
+
+#if !defined(TARGET_WINDOWS)
+#include "main/posix/MessagePrinter.h"
+#endif
+
extern "C" int XBMC_Run(bool renderGUI)
{
int status = -1;
@@ -48,7 +58,7 @@ extern "C" int XBMC_Run(bool renderGUI)
if (!g_application.Create())
{
- fprintf(stderr, "ERROR: Unable to create application. Exiting\n");
+ CMessagePrinter::DisplayError("ERROR: Unable to create application. Exiting");
return status;
}
@@ -72,25 +82,56 @@ extern "C" int XBMC_Run(bool renderGUI)
if (renderGUI && !g_application.CreateGUI())
{
- fprintf(stderr, "ERROR: Unable to create GUI. Exiting\n");
+ CMessagePrinter::DisplayError("ERROR: Unable to create GUI. Exiting");
return status;
}
if (!g_application.Initialize())
{
- fprintf(stderr, "ERROR: Unable to Initialize. Exiting\n");
+ CMessagePrinter::DisplayError("ERROR: Unable to Initialize. Exiting");
return status;
}
+#ifdef TARGET_WINDOWS
+ IMMDeviceEnumerator *pEnumerator = nullptr;
+ CMMNotificationClient cMMNC;
+ HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator,
+ reinterpret_cast<void**>(&pEnumerator));
+ if (SUCCEEDED(hr))
+ {
+ pEnumerator->RegisterEndpointNotificationCallback(&cMMNC);
+ SAFE_RELEASE(pEnumerator);
+ }
+#endif
+
try
{
status = g_application.Run();
}
+#ifdef TARGET_WINDOWS
+ catch (const XbmcCommons::UncheckedException &e)
+ {
+ e.LogThrowMessage("CApplication::Create()");
+ CMessagePrinter::DisplayError("ERROR: Exception caught on main loop. Exiting");
+ status = -1;
+ }
+#endif
catch(...)
{
- fprintf(stderr, "ERROR: Exception caught on main loop. Exiting\n");
+ CMessagePrinter::DisplayError("ERROR: Exception caught on main loop. Exiting");
status = -1;
}
+#ifdef TARGET_WINDOWS
+ // the end
+ hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator,
+ reinterpret_cast<void**>(&pEnumerator));
+ if (SUCCEEDED(hr))
+ {
+ pEnumerator->UnregisterEndpointNotificationCallback(&cMMNC);
+ SAFE_RELEASE(pEnumerator);
+ }
+#endif
+
#ifdef TARGET_RASPBERRY_PI
g_RBP.Deinitialize();
#endif