source: python/ext/aubio-types.h @ a89ed31

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

python/setup.py: add command 'generate' with option '--enable-double'

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#include <Python.h>
2#include <structmember.h>
3
4#include "aubio-generated.h"
5
6#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
7
8// define numpy unique symbols for aubio
9#define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
10#define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
11
12// only import array and ufunc from main module
13#ifndef PY_AUBIO_MODULE_MAIN
14#define NO_IMPORT_ARRAY
15#endif
16#include <numpy/arrayobject.h>
17#ifndef PY_AUBIO_MODULE_UFUNC
18#define NO_IMPORT_UFUNC
19#else
20#include <numpy/ufuncobject.h>
21#endif
22
23//#include <numpy/npy_3kcompat.h>
24
25// import aubio
26#define AUBIO_UNSTABLE 1
27#ifdef USE_LOCAL_AUBIO
28#include "aubio.h"
29#else
30#include "aubio/aubio.h"
31#endif
32
33#define Py_default_vector_length 1024
34
35#define Py_aubio_default_samplerate 44100
36
37#if HAVE_AUBIO_DOUBLE
38#warning "double mode needs love"
39#define AUBIO_NPY_SMPL NPY_DOUBLE
40#define AUBIO_NPY_SMPL_STR "float64"
41#define AUBIO_NPY_SMPL_CHR "d"
42#else
43#define AUBIO_NPY_SMPL NPY_FLOAT
44#define AUBIO_NPY_SMPL_STR "float32"
45#define AUBIO_NPY_SMPL_CHR "f"
46#endif
47
48// compat with Python < 2.6
49#ifndef Py_TYPE
50#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
51#endif
52
53// special python type for cvec
54typedef struct
55{
56  PyObject_HEAD
57  cvec_t * o;
58  uint_t length;
59} Py_cvec;
60extern PyTypeObject Py_cvecType;
61
62// defined in aubio-proxy.c
63extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
64extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
65
66extern PyObject * PyAubio_CCvecToPyCvec (cvec_t * self, Py_cvec *out);
67extern int PyAubio_ArrayToCCvec (PyObject *input, cvec_t *i);
68
69extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
70extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
71
72// hand written wrappers
73extern PyTypeObject Py_filterType;
74
75extern PyTypeObject Py_filterbankType;
76
77extern PyTypeObject Py_fftType;
78
79extern PyTypeObject Py_pvocType;
80
81extern PyTypeObject Py_sourceType;
82
83extern PyTypeObject Py_sinkType;
Note: See TracBrowser for help on using the repository browser.