From c04d250d409e9c178a9f56bdeae3536189266976 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 25 Dec 2009 04:44:06 +0100 Subject: [PATCH] py-phasevoc.c: use new proxy functions --- interfaces/python/py-phasevoc.c | 34 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/interfaces/python/py-phasevoc.c b/interfaces/python/py-phasevoc.c index 24be3121..6767e921 100644 --- a/interfaces/python/py-phasevoc.c +++ b/interfaces/python/py-phasevoc.c @@ -55,31 +55,27 @@ AUBIO_INIT(pvoc, self->win_s, self->hop_s) AUBIO_DEL(pvoc) static PyObject * -Py_pvoc_do(PyObject * self, PyObject * args) +Py_pvoc_do(Py_pvoc * self, PyObject * args) { PyObject *input; - Py_fvec *vec; - Py_cvec *output; + fvec_t *vec; + cvec_t *output; if (!PyArg_ParseTuple (args, "O", &input)) { return NULL; } - vec = PyAubio_ArrayToFvec (input); + vec = PyAubio_ArrayToCFvec (input); if (vec == NULL) { return NULL; } - output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); - output->length = ((Py_pvoc *) self)->win_s; - output->o = new_cvec(((Py_pvoc *) self)->win_s); + output = new_cvec(self->win_s); // compute the function - aubio_pvoc_do (((Py_pvoc *)self)->o, vec->o, output->o); - Py_INCREF(output); - return (PyObject *)output; - //return (PyObject *)PyAubio_CvecToArray(output); + aubio_pvoc_do (self->o, vec, output); + return (PyObject *)PyAubio_CCvecToPyCvec(output); } AUBIO_MEMBERS_START(pvoc) @@ -90,29 +86,27 @@ AUBIO_MEMBERS_START(pvoc) AUBIO_MEMBERS_STOP(pvoc) static PyObject * -Py_pvoc_rdo(PyObject * self, PyObject * args) +Py_pvoc_rdo(Py_pvoc * self, PyObject * args) { PyObject *input; - Py_cvec *vec; - Py_fvec *output; + cvec_t *vec; + fvec_t *output; if (!PyArg_ParseTuple (args, "O", &input)) { return NULL; } - vec = PyAubio_ArrayToCvec (input); + vec = PyAubio_ArrayToCCvec (input); if (vec == NULL) { return NULL; } - output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType); - output->length = ((Py_pvoc *) self)->hop_s; - output->o = new_fvec(output->length); + output = new_fvec(self->hop_s); // compute the function - aubio_pvoc_rdo (((Py_pvoc *)self)->o, vec->o, output->o); - return (PyObject *)PyAubio_FvecToArray(output); + aubio_pvoc_rdo (self->o, vec, output); + return (PyObject *)PyAubio_CFvecToArray(output); } static PyMethodDef Py_pvoc_methods[] = { -- 2.26.2