From cf0fd9dbedcf53adc244020b4a67e952a012ee27 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Mon, 29 Apr 2013 01:53:40 +0200 Subject: [PATCH] Better error handling Some small trys to fix gstreamer debug not running in win xp --- GstreamerHelper/GstreamerHelper.vcxproj | 9 +++++---- Vocaluxe/Lib/Sound/CGstreamerAudio.cs | 4 ++-- Vocaluxe/Program.cs | 6 ++++-- VocaluxeLib/VocaluxeLib.csproj | 14 +++++++------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/GstreamerHelper/GstreamerHelper.vcxproj b/GstreamerHelper/GstreamerHelper.vcxproj index 2395a8ba..d6ef40c8 100644 --- a/GstreamerHelper/GstreamerHelper.vcxproj +++ b/GstreamerHelper/GstreamerHelper.vcxproj @@ -67,11 +67,12 @@ - true + + bin\$(Configuration).$(Platform)\ $(MSBuildProjectDirectory)\x86\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x86\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x86\include\glib-2.0;$(MSBuildProjectDirectory)\x86\include;$(IncludePath) $(MSBuildProjectDirectory)\x86\lib;$(LibraryPath) - false + true obj\$(Configuration).$(Platform)\ @@ -152,7 +153,7 @@ Windows - true + false true true gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies) @@ -179,7 +180,7 @@ Windows - true + false true true gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies) diff --git a/Vocaluxe/Lib/Sound/CGstreamerAudio.cs b/Vocaluxe/Lib/Sound/CGstreamerAudio.cs index 496e49a0..998bdbde 100644 --- a/Vocaluxe/Lib/Sound/CGstreamerAudio.cs +++ b/Vocaluxe/Lib/Sound/CGstreamerAudio.cs @@ -26,10 +26,10 @@ namespace Vocaluxe.Lib.Sound class CGstreamerAudio : IPlayback { //static float LastPosition; - private CGstreamerAudioWrapper.LogCallback _LogCallback; + private readonly CGstreamerAudioWrapper.LogCallback _LogCallback; #region log - private void _LogHandler(string text) + private static void _LogHandler(string text) { CLog.LogError(text); } diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index 04c0b881..75845cb1 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -202,9 +202,9 @@ namespace Vocaluxe catch (Exception e) { MessageBox.Show("Error on start up: " + e.Message + e.StackTrace); - CLog.LogError("Error on start up: " + e.Message + e.StackTrace); + CLog.LogError("Error on start up: " + e); + _SplashScreen.Close(); _CloseProgram(); - Environment.Exit(Environment.ExitCode); } Application.DoEvents(); @@ -229,6 +229,7 @@ namespace Vocaluxe CWebcam.Close(); } catch (Exception) {} + Environment.Exit(Environment.ExitCode); } [HandleProcessCorruptedStateExceptions] @@ -243,6 +244,7 @@ namespace Vocaluxe catch {} MessageBox.Show("Unhandled exception: " + e.Message + stackTrace); CLog.LogError("Unhandled exception: " + e.Message + stackTrace); + _CloseProgram(); } private static Assembly _AssemblyResolver(Object sender, ResolveEventArgs args) diff --git a/VocaluxeLib/VocaluxeLib.csproj b/VocaluxeLib/VocaluxeLib.csproj index 51e14f87..93b1517f 100644 --- a/VocaluxeLib/VocaluxeLib.csproj +++ b/VocaluxeLib/VocaluxeLib.csproj @@ -29,7 +29,7 @@ AnyCPU none true - ..\Output\ + bin\ prompt 4 false @@ -41,7 +41,7 @@ true full false - ..\Output\ + bin\ TRACE;DEBUG;WIN prompt 4 @@ -52,7 +52,7 @@ AnyCPU none true - ..\Output\ + bin\ prompt 4 false @@ -64,7 +64,7 @@ true full false - ..\Output\ + bin\ TRACE;DEBUG;LINUX prompt 4 @@ -74,7 +74,7 @@ AnyCPU none true - ..\Output\ + bin\ prompt 4 false @@ -86,7 +86,7 @@ true full false - ..\Output\ + bin\ TRACE;DEBUG;LINUX prompt 4 @@ -96,7 +96,7 @@ AnyCPU none true - ..\Output\ + bin\ prompt 4 false