graveman-cvs
[Top][All Lists]
Advanced

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

[Graveman-cvs] Changes to graveman/current/src/sox.c


From: sylvain cresto
Subject: [Graveman-cvs] Changes to graveman/current/src/sox.c
Date: Sat, 12 Feb 2005 11:23:15 -0500

Index: graveman/current/src/sox.c
diff -u graveman/current/src/sox.c:1.8 graveman/current/src/sox.c:1.9
--- graveman/current/src/sox.c:1.8      Fri Feb 11 01:06:23 2005
+++ graveman/current/src/sox.c  Sat Feb 12 16:22:47 2005
@@ -28,8 +28,40 @@
 #define SOX_FILE_NOT_FOUND "No such file or directory"
 #define SOX_FAILED_READING "Failed reading"
 
+#define SOX_MP3 "mp3"
+#define SOX_OGG "vorbis"
+
+gboolean GsupportMp3 = FALSE;
+gboolean GsupportOgg = FALSE;
+
 /* communication avec sox */
 
+/* verification que sox ai bien le support ogg et mp3 */
+gboolean check_sox()
+{
+  gchar *Lsox = conf_get_string("sox");
+  gchar *Lcommandline, *Lerr = NULL;
+  gboolean Lstatus;
+  gint Lexit = 0;
+
+  GsupportMp3 = FALSE;
+  GsupportOgg = FALSE;
+
+  if (!Lsox || !*Lsox) return FALSE;
+
+  Lcommandline = g_strdup_printf("%s -help", conf_get_string("sox"));
+  Lstatus = g_spawn_command_line_sync(Lcommandline, NULL, &Lerr, &Lexit, NULL);
+  g_free(Lcommandline);
+
+  GsupportMp3 = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_MP3))));
+  GsupportOgg = (Lstatus == TRUE && Lerr && ((strstr(Lerr, SOX_OGG))));
+  
+  g_free(Lerr);
+
+  return Lstatus;
+}
+
+
 /* transformation fichier son vers piste audio */
 
 /* pour le moment on ne fais pas grand chose dans le callback ...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]