Changeset 5652a8c
- Timestamp:
- Apr 19, 2016, 2:16:39 AM (9 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
- Location:
- python/ext
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-fft.c
rf50dea4 r5652a8c 1 #include "aubio wraphell.h"1 #include "aubio-types.h" 2 2 3 3 static char Py_fft_doc[] = "fft object"; … … 12 12 } Py_fft; 13 13 14 //AUBIO_NEW(fft)15 14 static PyObject * 16 15 Py_fft_new (PyTypeObject * type, PyObject * args, PyObject * kwds) … … 90 89 } 91 90 92 AUBIO_MEMBERS_START(fft) 91 static PyMemberDef Py_fft_members[] = { 93 92 {"win_s", T_INT, offsetof (Py_fft, win_s), READONLY, 94 93 "size of the window"}, 95 AUBIO_MEMBERS_STOP(fft) 94 {NULL} 95 }; 96 96 97 97 static PyObject * … … 122 122 }; 123 123 124 AUBIO_TYPEOBJECT(fft, "aubio.fft") 124 PyTypeObject Py_fftType = { 125 PyVarObject_HEAD_INIT (NULL, 0) 126 "aubio.fft", 127 sizeof (Py_fft), 128 0, 129 (destructor) Py_fft_del, 130 0, 131 0, 132 0, 133 0, 134 0, 135 0, 136 0, 137 0, 138 0, 139 (ternaryfunc)Py_fft_do, 140 0, 141 0, 142 0, 143 0, 144 Py_TPFLAGS_DEFAULT, 145 Py_fft_doc, 146 0, 147 0, 148 0, 149 0, 150 0, 151 0, 152 Py_fft_methods, 153 Py_fft_members, 154 0, 155 0, 156 0, 157 0, 158 0, 159 0, 160 (initproc) Py_fft_init, 161 0, 162 Py_fft_new, 163 }; -
python/ext/py-filterbank.c
rf50dea4 r5652a8c 1 #include "aubio wraphell.h"1 #include "aubio-types.h" 2 2 3 3 static char Py_filterbank_doc[] = "filterbank object"; … … 12 12 } Py_filterbank; 13 13 14 //AUBIO_NEW(filterbank)15 14 static PyObject * 16 15 Py_filterbank_new (PyTypeObject * type, PyObject * args, PyObject * kwds) … … 97 96 } 98 97 99 AUBIO_MEMBERS_START(filterbank) 98 static PyMemberDef Py_filterbank_members[] = { 100 99 {"win_s", T_INT, offsetof (Py_filterbank, win_s), READONLY, 101 100 "size of the window"}, 102 101 {"n_filters", T_INT, offsetof (Py_filterbank, n_filters), READONLY, 103 102 "number of filters"}, 104 AUBIO_MEMBERS_STOP(filterbank) 103 {NULL} /* sentinel */ 104 }; 105 105 106 106 static PyObject * … … 204 204 }; 205 205 206 AUBIO_TYPEOBJECT(filterbank, "aubio.filterbank") 206 PyTypeObject Py_filterbankType = { 207 PyVarObject_HEAD_INIT (NULL, 0) 208 "aubio.filterbank", 209 sizeof (Py_filterbank), 210 0, 211 (destructor) Py_filterbank_del, 212 0, 213 0, 214 0, 215 0, 216 0, 217 0, 218 0, 219 0, 220 0, 221 (ternaryfunc)Py_filterbank_do, 222 0, 223 0, 224 0, 225 0, 226 Py_TPFLAGS_DEFAULT, 227 Py_filterbank_doc, 228 0, 229 0, 230 0, 231 0, 232 0, 233 0, 234 Py_filterbank_methods, 235 Py_filterbank_members, 236 0, 237 0, 238 0, 239 0, 240 0, 241 0, 242 (initproc) Py_filterbank_init, 243 0, 244 Py_filterbank_new, 245 }; -
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 }; -
python/ext/py-sink.c
rf50dea4 r5652a8c 1 #include "aubio wraphell.h"1 #include "aubio-types.h" 2 2 3 3 typedef struct … … 125 125 } 126 126 127 AUBIO_DEL(sink) 127 static void 128 Py_sink_del (Py_sink *self, PyObject *unused) 129 { 130 del_aubio_sink(self->o); 131 Py_TYPE(self)->tp_free((PyObject *) self); 132 } 128 133 129 134 /* function Py_sink_do */ … … 194 199 } 195 200 196 AUBIO_MEMBERS_START(sink) 201 static PyMemberDef Py_sink_members[] = { 197 202 {"uri", T_STRING, offsetof (Py_sink, uri), READONLY, 198 203 "path at which the sink was created"}, … … 201 206 {"channels", T_INT, offsetof (Py_sink, channels), READONLY, 202 207 "number of channels with which the sink was created"}, 203 AUBIO_MEMBERS_STOP(sink) 208 { NULL } // sentinel 209 }; 204 210 205 211 static PyObject * … … 217 223 }; 218 224 219 AUBIO_TYPEOBJECT(sink, "aubio.sink") 225 PyTypeObject Py_sinkType = { 226 PyVarObject_HEAD_INIT (NULL, 0) 227 "aubio.sink", 228 sizeof (Py_sink), 229 0, 230 (destructor) Py_sink_del, 231 0, 232 0, 233 0, 234 0, 235 0, 236 0, 237 0, 238 0, 239 0, 240 (ternaryfunc)Py_sink_do, 241 0, 242 0, 243 0, 244 0, 245 Py_TPFLAGS_DEFAULT, 246 Py_sink_doc, 247 0, 248 0, 249 0, 250 0, 251 0, 252 0, 253 Py_sink_methods, 254 Py_sink_members, 255 0, 256 0, 257 0, 258 0, 259 0, 260 0, 261 (initproc) Py_sink_init, 262 0, 263 Py_sink_new, 264 }; -
python/ext/py-source.c
rf50dea4 r5652a8c 1 #include "aubio wraphell.h"1 #include "aubio-types.h" 2 2 3 3 typedef struct … … 218 218 } 219 219 220 AUBIO_MEMBERS_START(source) 220 static PyMemberDef Py_source_members[] = { 221 221 {"uri", T_STRING, offsetof (Py_source, uri), READONLY, 222 222 "path at which the source was created"}, … … 227 227 {"hop_size", T_INT, offsetof (Py_source, hop_size), READONLY, 228 228 "number of consecutive frames that will be read at each do or do_multi call"}, 229 AUBIO_MEMBERS_STOP(source) 230 229 { NULL } // sentinel 230 }; 231 231 232 232 static PyObject * … … 286 286 }; 287 287 288 AUBIO_TYPEOBJECT(source, "aubio.source") 288 PyTypeObject Py_sourceType = { 289 PyVarObject_HEAD_INIT (NULL, 0) 290 "aubio.source", 291 sizeof (Py_source), 292 0, 293 (destructor) Py_source_del, 294 0, 295 0, 296 0, 297 0, 298 0, 299 0, 300 0, 301 0, 302 0, 303 (ternaryfunc)Py_source_do, 304 0, 305 0, 306 0, 307 0, 308 Py_TPFLAGS_DEFAULT, 309 Py_source_doc, 310 0, 311 0, 312 0, 313 0, 314 0, 315 0, 316 Py_source_methods, 317 Py_source_members, 318 0, 319 0, 320 0, 321 0, 322 0, 323 0, 324 (initproc) Py_source_init, 325 0, 326 Py_source_new, 327 };
Note: See TracChangeset
for help on using the changeset viewer.