Changeset 5652a8c for python/ext/py-phasevoc.c
- Timestamp:
- Apr 19, 2016, 2:16:39 AM (8 years ago)
- 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:
- 26eb6d0
- Parents:
- f50dea4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-phasevoc.c
rf50dea4 r5652a8c 1 #include "aubio wraphell.h"1 #include "aubio-types.h" 2 2 3 3 static char Py_pvoc_doc[] = "pvoc object"; … … 14 14 15 15 16 //AUBIO_NEW(pvoc)17 16 static PyObject * 18 17 Py_pvoc_new (PyTypeObject * type, PyObject * args, PyObject * kwds) … … 56 55 } 57 56 57 return (PyObject *) self; 58 } 59 60 static int 61 Py_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 58 71 self->output = new_cvec(self->win_s); 59 72 self->routput = new_fvec(self->hop_s); 60 73 61 return (PyObject *) self;74 return 0; 62 75 } 63 76 64 65 AUBIO_INIT(pvoc, self->win_s, self->hop_s)66 77 67 78 static void … … 96 107 } 97 108 98 AUBIO_MEMBERS_START(pvoc) 109 static PyMemberDef Py_pvoc_members[] = { 99 110 {"win_s", T_INT, offsetof (Py_pvoc, win_s), READONLY, 100 111 "size of the window"}, 101 112 {"hop_s", T_INT, offsetof (Py_pvoc, hop_s), READONLY, 102 113 "size of the hop"}, 103 AUBIO_MEMBERS_STOP(pvoc) 114 { NULL } // sentinel 115 }; 104 116 105 117 static PyObject * … … 129 141 }; 130 142 131 AUBIO_TYPEOBJECT(pvoc, "aubio.pvoc") 143 PyTypeObject 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.