Showing the changes to python (2 of 2 files). Show all
Unified · Split
| @@ -1,13 +1,27 @@ | |||
| 1 | #include <Python.h> | 1 | #include "Python.h" |
| 2 | #include <structmember.h> | 2 | #include <structmember.h> |
| 3 | #define NO_IMPORT_ARRAY | 3 | |
| 4 | //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION | 4 | //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION |
| 5 | #include <numpy/arrayobject.h> | 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 | |||
| 6 | #define AUBIO_UNSTABLE 1 | 21 | #define AUBIO_UNSTABLE 1 |
| 7 | #include <aubio.h> | 22 | #include <aubio.h> |
| 8 | 23 | ||
| 9 | #define Py_default_vector_length 1024 | 24 | #define Py_default_vector_length 1024 |
| 10 | #define Py_default_vector_height 1 | ||
| 11 | 25 | ||
| 12 | #define Py_aubio_default_samplerate 44100 | 26 | #define Py_aubio_default_samplerate 44100 |
| 13 | 27 | ||
| @@ -1,8 +1,4 @@ | |||
| 1 | #include <Python.h> | 1 | #define PY_AUBIO_MODULE_MAIN |
| 2 | #define PY_ARRAY_UNIQUE_SYMBOL PyArray_API | ||
| 3 | //#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION | ||
| 4 | #include <numpy/arrayobject.h> | ||
| 5 | |||
| 6 | #include "aubio-types.h" | 2 | #include "aubio-types.h" |
| 7 | #include "generated/aubio-generated.h" | 3 | #include "generated/aubio-generated.h" |
| 8 | 4 | ||
| @@ -246,6 +242,7 @@ init_aubio (void) · 237 unmodified lines | |||
| 246 | PyObject *m; | 242 | PyObject *m; |
| 247 | int err; | 243 | int err; |
| 248 | 244 | ||
| 245 | // fvec is defined in __init__.py | ||
| 249 | if ( (PyType_Ready (&Py_cvecType) < 0) | 246 | if ( (PyType_Ready (&Py_cvecType) < 0) |
| 250 | || (PyType_Ready (&Py_filterType) < 0) | 247 | || (PyType_Ready (&Py_filterType) < 0) |
| 251 | || (PyType_Ready (&Py_filterbankType) < 0) | 248 | || (PyType_Ready (&Py_filterbankType) < 0) |
| @@ -281,6 +278,6 @@ init_aubio (void) · 29 unmodified lines | |||
| 281 | Py_INCREF (&Py_pvocType); | 278 | Py_INCREF (&Py_pvocType); |
| 282 | PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType); | 279 | PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType); |
| 283 | 280 | ||
| 284 | // generated objects | 281 | // add generated objects |
| 285 | add_generated_objects(m); | 282 | add_generated_objects(m); |
| 286 | } | 283 | } |