source: python/ext/aubio-types.h @ 164980f

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 164980f was 164980f, checked in by Paul Brossier <piem@piem.org>, 8 years ago

python/: move source files to ext/

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#include "Python.h"
2#include <structmember.h>
3
4//#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
5
6// define numpy unique symbols for aubio
7#define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
8#define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
9
10// only import array and ufunc from main module
11#ifndef PY_AUBIO_MODULE_MAIN
12#define NO_IMPORT_ARRAY
13#define NO_IMPORT_UFUNC
14#endif
15
16// import aubio
17#include <numpy/ndarraytypes.h>
18#include <numpy/ufuncobject.h>
19#include <numpy/npy_3kcompat.h>
20
21#define AUBIO_UNSTABLE 1
22#include <aubio.h>
23
24#define Py_default_vector_length 1024
25
26#define Py_aubio_default_samplerate 44100
27
28#if HAVE_AUBIO_DOUBLE
29#error "Ouch! Python interface for aubio has not been much tested yet."
30#define AUBIO_NPY_SMPL NPY_DOUBLE
31#else
32#define AUBIO_NPY_SMPL NPY_FLOAT
33#endif
34
35// special python type for cvec
36typedef struct
37{
38  PyObject_HEAD
39  cvec_t * o;
40  uint_t length;
41  uint_t channels;
42} Py_cvec;
43extern PyTypeObject Py_cvecType;
44
45// defined in aubio-proxy.c
46extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
47extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self);
48
49extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self);
50extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input);
51
52extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
53extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input);
54
55// hand written wrappers
56extern PyTypeObject Py_filterType;
57
58extern PyTypeObject Py_filterbankType;
59
60extern PyTypeObject Py_fftType;
61
62extern PyTypeObject Py_pvocType;
63
Note: See TracBrowser for help on using the repository browser.