shithub: aubio

Download patch

ref: 9430dfde990f595505468fdbe20b82b9c42f225e
parent: 1081580aa62623a53e31fd4673989b143c52c62d
author: Paul Brossier <piem@piem.org>
date: Fri Jan 6 13:51:20 EST 2012

examples/utils.c: dummy functions if no sndfile

--- a/examples/utils.c
+++ b/examples/utils.c
@@ -18,7 +18,7 @@
 
 */
 
-/** 
+/**
 
   This file includes some tools common to all examples. Code specific to the
   algorithm performed by each program should go in the source file of that
@@ -63,8 +63,13 @@
 uint_t samplerate = 44100;
 
 
+#ifdef HAVE_SNDFILE
 aubio_sndfile_t *file = NULL;
 aubio_sndfile_t *fileout = NULL;
+#else
+void *file = NULL;
+void *fileout = NULL;
+#endif
 
 fvec_t *ibuf;
 fvec_t *obuf;
@@ -196,6 +201,8 @@
   return 0;
 }
 
+#ifdef HAVE_SNDFILE
+
 void
 examples_common_init (int argc, char **argv)
 {
@@ -258,8 +265,19 @@
 
 }
 
+#else /* HAVE_SNDFILE */
 
 void
+examples_common_init (int argc, char **argv)
+{
+  outmsg ("Error, compiled without sndfile, nothing to do for now!\n");
+}
+
+
+#endif /* HAVE_SNDFILE */
+
+
+void
 examples_common_del (void)
 {
   uint_t i;
@@ -273,6 +291,8 @@
 aubio_jack_t *jack_setup;
 #endif
 
+#if HAVE_SNDFILE
+
 void
 examples_common_process (aubio_process_func_t process_func,
     aubio_print_func_t print)
@@ -319,6 +339,16 @@
 
   }
 }
+
+#else /* HAVE_SNDFILE */
+
+void
+examples_common_process (aubio_process_func_t process_func,
+    aubio_print_func_t print)
+{
+}
+
+#endif /* HAVE_SNDFILE */
 
 void
 flush_process (aubio_process_func_t process_func, aubio_print_func_t print)