[mistelix] Better reporting on requirements missing



commit 1c12fb8beaa683aee2efb126fa4e96b6ac7a0e17
Author: Jordi Mas <jmas softcatala org>
Date:   Fri May 8 19:02:37 2009 +0200

    Better reporting on requirements missing
---
 src/core/Dependencies.cs |   90 +++++++++++++++++++++++++++++++++------------
 1 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/src/core/Dependencies.cs b/src/core/Dependencies.cs
index 7b83e3c..992d1ca 100644
--- a/src/core/Dependencies.cs
+++ b/src/core/Dependencies.cs
@@ -144,38 +144,24 @@ namespace Mistelix.Core
 					}
 				}
 			}
-	
-			DependencyList.Add (new Dependency (used [(int) Codecs.MPEG2VIDEO], founds [(int) Codecs.MPEG2VIDEO],
-				Catalog.GetString ("Missing ffmpeg2video codec.  Make sure that you have downloaded a gst-ffmpeg library from www.mistelix.org. Many distributions do not include MPEG2 encoding capabilities with the gst-ffmpeg version that package.")));
-
-			DependencyList.Add (new Dependency (used [(int) Codecs.FFMUX_DVD], founds [(int) Codecs.FFMUX_DVD],
-				Catalog.GetString ("Missing ffmux_dvd muxer. Make sure that you have downloaded a gst-ffmpeg library from www.mistelix.org. The standard GStreamer plug-in does not exposes the DVD muxer.")));
-
-			DependencyList.Add (new Dependency (used [(int) Codecs.MISTELIXVIDEOSRC], founds [(int) Codecs.MISTELIXVIDEOSRC],
-				Catalog.GetString ("Missing mistelixvideosrc plug-in. This GStreamer plug-in is provided as part of Mistelix application. Mistelix is probably not installed correctly.")));
 
-			DependencyList.Add (new Dependency (used [(int) Codecs.THEORAENC], founds [(int) Codecs.THEORAENC],
-				Catalog.GetString ("Missing Theora codec. You need to install GStreamer Base Plugins.")));
-
-			DependencyList.Add (new Dependency (used [(int) Codecs.OGGMUX], founds [(int) Codecs.OGGMUX],
-				Catalog.GetString ("Missing ogg muxer. You need to install GStreamer Base Plugins.")));
+			DependencyList.Add (new Dependency (Catalog.GetString ("Mistelix GStreamer plugin"), founds [(int) Codecs.MISTELIXVIDEOSRC],
+				Catalog.GetString ("Missing mistelixvideosrc plug-in. This GStreamer plug-in is provided as part of Mistelix application. Mistelix is not installed correctly.")));
 
-			DependencyList.Add (new Dependency (used [(int) Codecs.VORBISENC], founds [(int) Codecs.VORBISENC],
-				Catalog.GetString ("Missing Vorbis audio encoder. You need to install GStreamer Base Plugins.")));
+			CheckTheora (used, founds);
+			CheckFmpeg (used, founds);
 	
-			DependencyList.Add (new Dependency (used [(int) Codecs.FLUMP3DEC], founds [(int) Codecs.FLUMP3DEC],
-				Catalog.GetString ("Missing MP3 audio decoder. You need to install  Fluendo MP3 decoder GStreamer plugin.")));
+			DependencyList.Add (new Dependency (Catalog.GetString ("MP3 audio decoder"), founds [(int) Codecs.FLUMP3DEC],
+				Catalog.GetString ("Missing MP3 audio decoder. You need to install Fluendo MP3 decoder GStreamer plugin to enable MP3 import audio capabilities.")));
 
 			// Check for applications
 			bool dvdauthor, spumux;
 	
 			dvdauthor = CheckApp ("dvdauthor");
-			DependencyList.Add (new Dependency ("dvdauthor", dvdauthor,
-				Catalog.GetString ("Install dvdauthor package from your Linux distribution application manager.")));
-
 			spumux = CheckApp ("spumux");
-			DependencyList.Add (new Dependency ("spumux", spumux,
-				Catalog.GetString ("Install dvdauthor from your Linux distribution application manager. Spumux is included with dvdauthor package")));
+
+			DependencyList.Add (new Dependency (Catalog.GetString ("dvdauthor package"), (dvdauthor && spumux == true),
+				Catalog.GetString ("Install dvdauthor package from your Linux distribution application manager.")));
 
 			// DVD Authoring support
 			if (founds [(int) Codecs.FFMUX_DVD] && 
@@ -188,7 +174,7 @@ namespace Mistelix.Core
 			}
 
 
-			// Spumux Author support
+			// Theora support
 			if (founds [(int) Codecs.THEORAENC] && 
 				founds [(int) Codecs.OGGMUX] && 
 				founds [(int) Codecs.MISTELIXVIDEOSRC])
@@ -197,6 +183,62 @@ namespace Mistelix.Core
 			}
 		}
 
+		void CheckFmpeg (string [] used, bool [] founds)
+		{
+			string str, codec_name;
+			bool all, none;
+	
+			str = Catalog.GetString ("Missing {0}. You need to install GStreamer FFmpeg Plug-ins package.");
+
+			all = founds [(int) Codecs.MPEG2VIDEO] && founds [(int) Codecs.FFMUX_DVD];
+			none = founds [(int) Codecs.MPEG2VIDEO] == false && founds [(int) Codecs.FFMUX_DVD] == false;
+
+			// If all the codecs are present or missing give a single message
+			if (all || none) {
+				codec_name = Catalog.GetString ("FFmpeg codecs");
+				DependencyList.Add (new Dependency (codec_name, all == true, String.Format (str, codec_name)));
+				return;
+			}
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.MPEG2VIDEO], founds [(int) Codecs.MPEG2VIDEO],
+				Catalog.GetString ("Missing ffmpeg2video codec. Many distributions do not expose MPEG2 encoding capabilities in their GStreamer FFmpeg Plug-ins package. Visit 'http://www.mistelix.org/Download' for instructions on how to fix this.")));
+
+			DependencyList.Add (new Dependency (used [(int) Codecs.FFMUX_DVD], founds [(int) Codecs.FFMUX_DVD],
+				Catalog.GetString ("Missing ffmux_dvd muxer. Probably you have an old version of GStreamer plug-in that does not exposes the DVD muxer.")));
+		}
+
+		void CheckTheora (string [] used, bool [] founds)
+		{
+			string str, codec_name;
+			bool all, none;
+	
+			str = Catalog.GetString ("Missing {0}. You need to install GStreamer Base Plugins package.");
+
+			all = founds [(int) Codecs.THEORAENC] && founds [(int) Codecs.OGGMUX] && founds [(int) Codecs.VORBISENC];
+			none = founds [(int) Codecs.THEORAENC] == false && founds [(int) Codecs.OGGMUX] == false && founds [(int) Codecs.VORBISENC] == false;
+
+			// If all the codecs are present or missing give a single message
+			if (all || none) {
+				codec_name = Catalog.GetString ("Theora/Vorbis codecs");
+				DependencyList.Add (new Dependency (codec_name, all == true, String.Format (str, codec_name)));
+				return;
+			}
+		
+			// Go into detail
+			codec_name = Catalog.GetString ("Theora video codec");
+			DependencyList.Add (new Dependency (used [(int) Codecs.THEORAENC], founds [(int) Codecs.THEORAENC],
+				String.Format (str, codec_name)));
+
+			codec_name = Catalog.GetString ("ogg muxer");
+			DependencyList.Add (new Dependency (used [(int) Codecs.OGGMUX], founds [(int) Codecs.OGGMUX],
+				String.Format (str, codec_name)));
+
+			codec_name = Catalog.GetString ("Vorbis audio encoder");
+			DependencyList.Add (new Dependency (used [(int) Codecs.VORBISENC], founds [(int) Codecs.VORBISENC],
+				String.Format (str, codec_name)));
+		}
+
+
 		bool CheckApp (string application)
 		{
 			bool app_exists = false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]