source: python/ext/aubio-types.h @ befee7a

feature/crepe_org
Last change on this file since befee7a was 7703f2a, checked in by Paul Brossier <piem@piem.org>, 6 years ago

[py] include docstrings for generated classes

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[ff74460]1#include <Python.h>
[ae6e15c]2#include <structmember.h>
[7a6521d]3
[7703f2a]4#include "aubio-docstrings.h"
[a89ed31]5#include "aubio-generated.h"
6
[b0fbd88]7#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
[7a6521d]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
[ad5203c]16#endif
17#include <numpy/arrayobject.h>
18#ifndef PY_AUBIO_MODULE_UFUNC
[7a6521d]19#define NO_IMPORT_UFUNC
[ad5203c]20#else
21#include <numpy/ufuncobject.h>
[7a6521d]22#endif
23
[ad5203c]24//#include <numpy/npy_3kcompat.h>
[7a6521d]25
[a315be7]26// import aubio
[7db3477]27#define AUBIO_UNSTABLE 1
[223e2fe]28#ifdef USE_LOCAL_AUBIO
[ad5203c]29#include "aubio.h"
[41399bd]30#else
[911bea80]31#include <aubio/aubio.h>
[41399bd]32#endif
[ae6e15c]33
[96fe713]34#define Py_default_vector_length 1024
[9b23eb31]35
[2f9af5d]36#define Py_aubio_default_samplerate 44100
[352fd5f]37
[615ac7d]38#if HAVE_AUBIO_DOUBLE
[e99242a]39// 64 bit precision with HAVE_AUBIO_DOUBLE=1
[615ac7d]40#define AUBIO_NPY_SMPL NPY_DOUBLE
[c6388f4]41#define AUBIO_NPY_SMPL_STR "float64"
42#define AUBIO_NPY_SMPL_CHR "d"
[352fd5f]43#else
[e99242a]44// default is 32 bit precision
[615ac7d]45#define AUBIO_NPY_SMPL NPY_FLOAT
[c6388f4]46#define AUBIO_NPY_SMPL_STR "float32"
47#define AUBIO_NPY_SMPL_CHR "f"
[352fd5f]48#endif
49
[410a157]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
[770b9e7]58// compat with Python < 2.6
59#ifndef Py_TYPE
60#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
61#endif
62
[b6230d8]63extern PyTypeObject Py_cvecType;
[9b23eb31]64
[ede5d38]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
[03c3450]69// defined in aubio-proxy.c
[b6230d8]70extern int PyAubio_IsValidVector (PyObject *input);
[34d0c25]71
[b6230d8]72extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
73extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
[03c3450]74
[b6230d8]75extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i);
[03c3450]76
[b6230d8]77extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
78extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
[03c3450]79
80// hand written wrappers
[b6230d8]81extern PyTypeObject Py_filterType;
[9b23eb31]82
[b6230d8]83extern PyTypeObject Py_filterbankType;
[352fd5f]84
[b6230d8]85extern PyTypeObject Py_fftType;
[615ac7d]86
[b6230d8]87extern PyTypeObject Py_pvocType;
[03c3450]88
[b6230d8]89extern PyTypeObject Py_sourceType;
[d27634d]90
[b6230d8]91extern PyTypeObject Py_sinkType;
Note: See TracBrowser for help on using the repository browser.