Changes in python/ext/aubio-types.h [b0fbd88:410a157]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/aubio-types.h
rb0fbd88 r410a157 1 1 #include <Python.h> 2 2 #include <structmember.h> 3 4 #include "aubio-generated.h" 3 5 4 6 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION … … 26 28 #include "aubio.h" 27 29 #else 28 #include "aubio/aubio.h"30 #include <aubio/aubio.h> 29 31 #endif 30 32 … … 34 36 35 37 #if HAVE_AUBIO_DOUBLE 36 #error "Ouch! Python interface for aubio has not been much tested yet." 38 // 64 bit precision with HAVE_AUBIO_DOUBLE=1 37 39 #define AUBIO_NPY_SMPL NPY_DOUBLE 40 #define AUBIO_NPY_SMPL_STR "float64" 41 #define AUBIO_NPY_SMPL_CHR "d" 38 42 #else 43 // default is 32 bit precision 39 44 #define AUBIO_NPY_SMPL NPY_FLOAT 45 #define AUBIO_NPY_SMPL_STR "float32" 46 #define AUBIO_NPY_SMPL_CHR "f" 40 47 #endif 41 48 42 // special python type for cvec 43 typedef struct 44 { 45 PyObject_HEAD 46 cvec_t * o; 47 uint_t length; 48 uint_t channels; 49 } Py_cvec; 49 #ifndef PATH_MAX 50 #ifdef MAX_PATH 51 #define PATH_MAX MAX_PATH 52 #else 53 #define PATH_MAX 1024 54 #endif 55 #endif 56 57 // compat with Python < 2.6 58 #ifndef Py_TYPE 59 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) 60 #endif 61 50 62 extern PyTypeObject Py_cvecType; 51 63 64 PyObject * new_py_fvec(uint_t length); 65 PyObject * new_py_cvec(uint_t length); 66 PyObject * new_py_fmat(uint_t height, uint_t length); 67 52 68 // defined in aubio-proxy.c 69 extern int PyAubio_IsValidVector (PyObject *input); 70 53 71 extern PyObject *PyAubio_CFvecToArray (fvec_t * self); 54 extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self);72 extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out); 55 73 56 extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self); 57 extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input); 74 extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i); 58 75 59 76 extern PyObject *PyAubio_CFmatToArray (fmat_t * self); 60 extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input);77 extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out); 61 78 62 79 // hand written wrappers
Note: See TracChangeset
for help on using the changeset viewer.