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/wav.c


From: sylvain cresto
Subject: [Graveman-cvs] Changes to graveman/current/src/wav.c
Date: Wed, 02 Mar 2005 19:36:15 -0500

Index: graveman/current/src/wav.c
diff -u graveman/current/src/wav.c:1.3 graveman/current/src/wav.c:1.4
--- graveman/current/src/wav.c:1.3      Sat Feb 12 16:41:07 2005
+++ graveman/current/src/wav.c  Thu Mar  3 00:35:47 2005
@@ -44,9 +44,9 @@
 } T_WAV_format;
 
 /* retourne la duree d'un fichier wav */
-gboolean getWavInfo(gchar *Apath, guint32 *Alength, GError **Aerror)
+gboolean getWavInfo(gchar *Afilename, guint32 *Alength, GError **Aerror)
 {
-  FILE *Lfic = fopen(Apath, "rb");
+  FILE *Lfic = fopen(Afilename, "rb");
   guint32 LSEC;
   guint32 Ltaille;
 /*  gulong Lmin, Lsec; */
@@ -56,14 +56,14 @@
 
   if (!Lfic) {
     g_set_error(Aerror, G_FILE_ERROR, g_file_error_from_errno(errno), 
"%s:%s\n%s",
-         _("Cannot read file"), Apath, strerror(errno));
+         _("Cannot read file"), Afilename, strerror(errno));
     return FALSE;
   }
 
   /* lecture entete fichier wav */
   if (fread(&Lheader, sizeof(Lheader), 1, Lfic) != 1) {
     fclose(Lfic);
-    g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_INAPPROPRIATE_DATA, _("%s is not 
a valid .wav file !"), Apath);
+    g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_INAPPROPRIATE_DATA, _("%s is not 
a valid .wav file !"), Afilename);
     return FALSE;
   }
   fclose(Lfic);
@@ -71,7 +71,7 @@
   /* verirication validite de l'entete, a savoir que le champ riff contiene 
bien RIFF et qu'il
    * y a bien le type WAVEfmt dans wave */
   if (memcmp(Lheader.riff, "RIFF", 4) || memcmp(Lheader.wave, "WAVEfmt ", 8)) {
-    g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_INAPPROPRIATE_DATA, _("%s is not 
a valid .wav file !"), Apath);
+    g_set_error(Aerror, GRAVEMAN_ERROR, _ERR_INAPPROPRIATE_DATA, _("%s is not 
a valid .wav file !"), Afilename);
     return FALSE;
   }
 
@@ -80,12 +80,6 @@
   if (!(Ltaille = Lheader.file_length / LSEC)) Ltaille = 1;
 
   *(Alength) = Ltaille;
-    //(guint32)Ltaille / 60;
-  
-/*  Lmin = (gulong)Ltaille / 60;
-  Lsec = (gulong)Ltaille - Lmin * 60;
-
-  *(Alength) = g_strdup_printf("%02ld:%02ld", Lmin, Lsec);*/
 
   return TRUE;
 }




reply via email to

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