source: python/ext/aubio-types.h

Last change on this file was 7703f2a, checked in by Paul Brossier <piem@piem.org>, 2 years ago

[py] include docstrings for generated classes

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#include <Python.h>
2#include <structmember.h>
3
4#include "aubio-docstrings.h"
5#include "aubio-generated.h"
6
7#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
8
9// define numpy unique symbols for aubio
10#define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
11#define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
12
13// only import array and ufunc from main module
14#ifndef PY_AUBIO_MODULE_MAIN
15#define NO_IMPORT_ARRAY
16#endif
17#include <numpy/arrayobject.h>
18#ifndef PY_AUBIO_MODULE_UFUNC
19#define NO_IMPORT_UFUNC
20#else
21#include <numpy/ufuncobject.h>
22#endif
23
24//#include <numpy/npy_3kcompat.h>
25
26// import aubio
27#define AUBIO_UNSTABLE 1
28#ifdef USE_LOCAL_AUBIO
29#include "aubio.h"
30#else
31#include <aubio/aubio.h>
32#endif
33
34#define Py_default_vector_length 1024
35
36#define Py_aubio_default_samplerate 44100
37
38#if HAVE_AUBIO_DOUBLE
39// 64 bit precision with HAVE_AUBIO_DOUBLE=1
40#define AUBIO_NPY_SMPL NPY_DOUBLE
41#define AUBIO_NPY_SMPL_STR "float64"
42#define AUBIO_NPY_SMPL_CHR "d"
43#else
44// default is 32 bit precision
45#define AUBIO_NPY_SMPL NPY_FLOAT
46#define AUBIO_NPY_SMPL_STR "float32"
47#define AUBIO_NPY_SMPL_CHR "f"
48#endif
49
50#ifndef PATH_MAX
51#ifdef MAX_PATH
52#define PATH_MAX MAX_PATH
53#else
54#define PATH_MAX 1024
55#endif
56#endif
57
58// compat with Python < 2.6
59#ifndef Py_TYPE
60#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
61#endif
62
63extern PyTypeObject Py_cvecType;
64
65PyObject * new_py_fvec(uint_t length);
66PyObject * new_py_cvec(uint_t length);
67PyObject * new_py_fmat(uint_t height, uint_t length);
68
69// defined in aubio-proxy.c
70extern int PyAubio_IsValidVector (PyObject *input);
71
72extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
73extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
74
75extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i);
76
77extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
78extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
79
80// hand written wrappers
81extern PyTypeObject Py_filterType;
82
83extern PyTypeObject Py_filterbankType;
84
85extern PyTypeObject Py_fftType;
86
87extern PyTypeObject Py_pvocType;
88
89extern PyTypeObject Py_sourceType;
90
91extern PyTypeObject Py_sinkType;
Note: See TracBrowser for help on using the repository browser.