Ignore:
Timestamp:
Jun 22, 2016, 1:00:10 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
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.
Message:

Merge branch 'master' into notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/aubio-types.h

    r60fc05b rf264b17  
    11#include <Python.h>
    22#include <structmember.h>
     3
     4#include "aubio-generated.h"
    35
    46#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
     
    3436
    3537#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
    3739#define AUBIO_NPY_SMPL NPY_DOUBLE
     40#define AUBIO_NPY_SMPL_STR "float64"
     41#define AUBIO_NPY_SMPL_CHR "d"
    3842#else
     43// default is 32 bit precision
    3944#define AUBIO_NPY_SMPL NPY_FLOAT
     45#define AUBIO_NPY_SMPL_STR "float32"
     46#define AUBIO_NPY_SMPL_CHR "f"
    4047#endif
    4148
    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
    5054extern PyTypeObject Py_cvecType;
    5155
     56PyObject * new_py_fvec(uint_t length);
     57PyObject * new_py_cvec(uint_t length);
     58PyObject * new_py_fmat(uint_t height, uint_t length);
     59
    5260// defined in aubio-proxy.c
     61extern int PyAubio_IsValidVector (PyObject *input);
     62
    5363extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
    54 extern fvec_t *PyAubio_ArrayToCFvec (PyObject * self);
     64extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
    5565
    56 extern Py_cvec *PyAubio_CCvecToPyCvec (cvec_t * self);
    57 extern cvec_t *PyAubio_ArrayToCCvec (PyObject *input);
     66extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i);
    5867
    5968extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
    60 extern fmat_t *PyAubio_ArrayToCFmat (PyObject *input);
     69extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
    6170
    6271// hand written wrappers
Note: See TracChangeset for help on using the changeset viewer.