source: examples/utils.h @ 06cf47d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 06cf47d was dff2ded, checked in by Paul Brossier <piem@piem.org>, 8 years ago

examples/utils.h: remove stdarg.h, getopt.h moved to parse_args.h, protect include with #ifdef HAVE_

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
3
4  This file is part of aubio.
5
6  aubio is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10
11  aubio is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15
16  You should have received a copy of the GNU General Public License
17  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#include <aubio.h>
22
23#include "config.h"
24
25#ifdef HAVE_STDIO_H
26#include <stdio.h>              // for fprintf
27#endif
28#ifdef HAVE_STDLIB_H
29#include <stdlib.h>             // for exit
30#endif
31#ifdef HAVE_UNISTD_H
32#include <unistd.h>             // for access
33#endif
34#ifdef HAVE_MATH_H
35#include <math.h>               // for isfinite
36#endif
37#ifdef HAVE_STRING_H
38#include <string.h>             // for strcmp
39#endif
40
41#ifdef HAVE_C99_VARARGS_MACROS
42#ifdef HAVE_DEBUG
43#define debug(...)                fprintf (stderr, __VA_ARGS__)
44#else
45#define debug(...)
46#endif
47#define verbmsg(...)              if (verbose) fprintf (stderr, __VA_ARGS__)
48#define errmsg(...)               fprintf (stderr, __VA_ARGS__)
49#define outmsg(...)               fprintf (stdout, __VA_ARGS__)
50#else
51#ifdef HAVE_DEBUG
52#define debug(...)                fprintf (stderr, format , **args)
53#else
54#define debug(...)
55#endif
56#define verbmsg(format, args...)  if (verbose) fprintf(stderr, format , ##args)
57#define errmsg(format, args...)   fprintf(stderr, format , ##args)
58#define outmsg(format, args...)   fprintf(stdout, format , ##args)
59#endif
60
61typedef void (aubio_print_func_t) (void);
62void send_noteon (int pitch, int velo);
63
64/** common process function */
65typedef int (*aubio_process_func_t) (fvec_t * input, fvec_t * output);
66
67void process_block (fvec_t *ibuf, fvec_t *obuf);
68void process_print (void);
69
70void print_time (uint_t samples);
Note: See TracBrowser for help on using the repository browser.