source:
python/ext/aubio-types.h
@
ad5203c
Last change on this file since ad5203c was ad5203c, checked in by , 11 years ago | |
---|---|
|
|
File size: 1.5 KB |
Rev | Line | |
---|---|---|
[7a6521d] | 1 | #include "Python.h" |
[ae6e15c] | 2 | #include <structmember.h> |
[7a6521d] | 3 | |
[cd6fc5a] | 4 | //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION |
[7a6521d] | 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 | |
[ad5203c] | 13 | #endif |
14 | #include <numpy/arrayobject.h> | |
15 | #ifndef PY_AUBIO_MODULE_UFUNC | |
[7a6521d] | 16 | #define NO_IMPORT_UFUNC |
[ad5203c] | 17 | #else |
18 | #include <numpy/ufuncobject.h> | |
[7a6521d] | 19 | #endif |
20 | ||
21 | // import aubio | |
[ad5203c] | 22 | //#include <numpy/npy_3kcompat.h> |
[7a6521d] | 23 | |
[7db3477] | 24 | #define AUBIO_UNSTABLE 1 |
[ad5203c] | 25 | #include "aubio.h" |
[ae6e15c] | 26 | |
[96fe713] | 27 | #define Py_default_vector_length 1024 |
[9b23eb31] | 28 | |
29 | #define Py_aubio_default_samplerate 44100 | |
[352fd5f] | 30 | |
[615ac7d] | 31 | #if HAVE_AUBIO_DOUBLE |
32 | #error "Ouch! Python interface for aubio has not been much tested yet." | |
33 | #define AUBIO_NPY_SMPL NPY_DOUBLE | |
[352fd5f] | 34 | #else |
[615ac7d] | 35 | #define AUBIO_NPY_SMPL NPY_FLOAT |
[352fd5f] | 36 | #endif |
37 | ||
[03c3450] | 38 | // special python type for cvec |
[96fe713] | 39 | typedef struct |
40 | { | |
41 | PyObject_HEAD | |
[615ac7d] | 42 | cvec_t * o; |
43 | uint_t length; | |
44 | uint_t channels; | |
45 | } Py_cvec; | |
[9b23eb31] | 46 | extern PyTypeObject Py_cvecType; |
47 | ||
[03c3450] | 48 | // defined in aubio-proxy.c |
49 | extern PyObject *PyAubio_CFvecToArray (fvec_t * self); | |
50 | extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self); | |
51 | ||
52 | extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self); | |
53 | extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input); | |
54 | ||
55 | extern PyObject *PyAubio_CFmatToArray (fmat_t * self); | |
56 | extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input); | |
57 | ||
58 | // hand written wrappers | |
[9b23eb31] | 59 | extern PyTypeObject Py_filterType; |
60 | ||
[615ac7d] | 61 | extern PyTypeObject Py_filterbankType; |
[352fd5f] | 62 | |
[615ac7d] | 63 | extern PyTypeObject Py_fftType; |
64 | ||
65 | extern PyTypeObject Py_pvocType; | |
[03c3450] | 66 |
Note: See TracBrowser
for help on using the repository browser.