From 9430dfde990f595505468fdbe20b82b9c42f225e Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 6 Jan 2012 18:51:20 -0800 Subject: [PATCH] examples/utils.c: dummy functions if no sndfile --- examples/utils.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/examples/utils.c b/examples/utils.c index dd6f91e8..c891b159 100644 --- 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 overlap_size = 256; //512; 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 @@ parse_args (int argc, char **argv) return 0; } +#ifdef HAVE_SNDFILE + void examples_common_init (int argc, char **argv) { @@ -258,6 +265,17 @@ examples_common_init (int argc, char **argv) } +#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) @@ -273,6 +291,8 @@ examples_common_del (void) aubio_jack_t *jack_setup; #endif +#if HAVE_SNDFILE + void examples_common_process (aubio_process_func_t process_func, aubio_print_func_t print) @@ -320,6 +340,16 @@ examples_common_process (aubio_process_func_t process_func, } } +#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) { -- 2.26.2