Ignore:
Timestamp:
Apr 19, 2016, 2:16:39 AM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
26eb6d0
Parents:
f50dea4
Message:

ext/: no more hell, use plain c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-phasevoc.c

    rf50dea4 r5652a8c  
    1 #include "aubiowraphell.h"
     1#include "aubio-types.h"
    22
    33static char Py_pvoc_doc[] = "pvoc object";
     
    1414
    1515
    16 //AUBIO_NEW(pvoc)
    1716static PyObject *
    1817Py_pvoc_new (PyTypeObject * type, PyObject * args, PyObject * kwds)
     
    5655  }
    5756
     57  return (PyObject *) self;
     58}
     59
     60static int
     61Py_pvoc_init (Py_pvoc * self, PyObject * args, PyObject * kwds)
     62{
     63  self->o = new_aubio_pvoc ( self->win_s, self->hop_s);
     64  if (self->o == NULL) {
     65    char_t errstr[30];
     66    sprintf(errstr, "error creating pvoc with %d, %d", self->win_s, self->hop_s);
     67    PyErr_SetString (PyExc_RuntimeError, errstr);
     68    return -1;
     69  }
     70
    5871  self->output = new_cvec(self->win_s);
    5972  self->routput = new_fvec(self->hop_s);
    6073
    61   return (PyObject *) self;
     74  return 0;
    6275}
    6376
    64 
    65 AUBIO_INIT(pvoc, self->win_s, self->hop_s)
    6677
    6778static void
     
    96107}
    97108
    98 AUBIO_MEMBERS_START(pvoc)
     109static PyMemberDef Py_pvoc_members[] = {
    99110  {"win_s", T_INT, offsetof (Py_pvoc, win_s), READONLY,
    100111    "size of the window"},
    101112  {"hop_s", T_INT, offsetof (Py_pvoc, hop_s), READONLY,
    102113    "size of the hop"},
    103 AUBIO_MEMBERS_STOP(pvoc)
     114  { NULL } // sentinel
     115};
    104116
    105117static PyObject *
     
    129141};
    130142
    131 AUBIO_TYPEOBJECT(pvoc, "aubio.pvoc")
     143PyTypeObject Py_pvocType = {
     144  PyVarObject_HEAD_INIT (NULL, 0)
     145  "aubio.pvoc",
     146  sizeof (Py_pvoc),
     147  0,
     148  (destructor) Py_pvoc_del,
     149  0,
     150  0,
     151  0,
     152  0,
     153  0,
     154  0,
     155  0,
     156  0,
     157  0,
     158  (ternaryfunc)Py_pvoc_do,
     159  0,
     160  0,
     161  0,
     162  0,
     163  Py_TPFLAGS_DEFAULT,
     164  Py_pvoc_doc,
     165  0,
     166  0,
     167  0,
     168  0,
     169  0,
     170  0,
     171  Py_pvoc_methods,
     172  Py_pvoc_members,
     173  0,
     174  0,
     175  0,
     176  0,
     177  0,
     178  0,
     179  (initproc) Py_pvoc_init,
     180  0,
     181  Py_pvoc_new,
     182};
Note: See TracChangeset for help on using the changeset viewer.