Changeset f264b17 for python/ext/aubio-types.h
- Timestamp:
- Jun 22, 2016, 1:00:10 PM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 4b9443c4
- Parents:
- 60fc05b (diff), 6769586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/aubio-types.h
r60fc05b rf264b17 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 … … 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 // compat with Python < 2.6 50 #ifndef Py_TYPE 51 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) 52 #endif 53 50 54 extern PyTypeObject Py_cvecType; 51 55 56 PyObject * new_py_fvec(uint_t length); 57 PyObject * new_py_cvec(uint_t length); 58 PyObject * new_py_fmat(uint_t height, uint_t length); 59 52 60 // defined in aubio-proxy.c 61 extern int PyAubio_IsValidVector (PyObject *input); 62 53 63 extern PyObject *PyAubio_CFvecToArray (fvec_t * self); 54 extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self);64 extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out); 55 65 56 extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self); 57 extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input); 66 extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i); 58 67 59 68 extern PyObject *PyAubio_CFmatToArray (fmat_t * self); 60 extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input);69 extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out); 61 70 62 71 // hand written wrappers
Note: See TracChangeset
for help on using the changeset viewer.