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

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since ac7e49b was 770b9e7, checked in by Nils Philippsen <nils@tiptoe.de>, 4 years ago

Python 3: use Py_TYPE() instead of ob_type member

  • Property mode set to 100644
File size: 1.7 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#endif
14#include <numpy/arrayobject.h>
15#ifndef PY_AUBIO_MODULE_UFUNC
16#define NO_IMPORT_UFUNC
17#else
18#include <numpy/ufuncobject.h>
19#endif
20
21//#include <numpy/npy_3kcompat.h>
22
23// import aubio
24#define AUBIO_UNSTABLE 1
25#ifdef USE_LOCAL_AUBIO
26#include "aubio.h"
27#else
28#include "aubio/aubio.h"
29#endif
30
31#define Py_default_vector_length 1024
32
33#define Py_aubio_default_samplerate 44100
34
35#if HAVE_AUBIO_DOUBLE
36#error "Ouch! Python interface for aubio has not been much tested yet."
37#define AUBIO_NPY_SMPL NPY_DOUBLE
38#else
39#define AUBIO_NPY_SMPL NPY_FLOAT
40#endif
41
42// compat with Python < 2.6
43#ifndef Py_TYPE
44#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
45#endif
46
47// special python type for cvec
48typedef struct
49{
50  PyObject_HEAD
51  cvec_t * o;
52  uint_t length;
53  uint_t channels;
54} Py_cvec;
55extern PyTypeObject Py_cvecType;
56
57// defined in aubio-proxy.c
58extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
59extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self);
60
61extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self);
62extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input);
63
64extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
65extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input);
66
67// hand written wrappers
68extern PyTypeObject Py_filterType;
69
70extern PyTypeObject Py_filterbankType;
71
72extern PyTypeObject Py_fftType;
73
74extern PyTypeObject Py_pvocType;
75
76extern PyTypeObject Py_sourceType;
77
78extern PyTypeObject Py_sinkType;
Note: See TracBrowser for help on using the repository browser.