Mercurial > hg > audiodb
comparison bindings/python/pyadbmodule.c @ 749:dd4b9fec8d85
added support for timesData
author | mas01mc |
---|---|
date | Wed, 24 Nov 2010 13:50:05 +0000 |
parents | e5f96902afaf |
children | d93292ae7c1b |
comparison
equal
deleted
inserted
replaced
748:e5f96902afaf | 749:dd4b9fec8d85 |
---|---|
206 if (!PyArray_ISFLOAT(times)){ | 206 if (!PyArray_ISFLOAT(times)){ |
207 PyErr_SetString(PyExc_TypeError, "times numpy array, if given, must contain floats or doubles"); | 207 PyErr_SetString(PyExc_TypeError, "times numpy array, if given, must contain floats or doubles"); |
208 return NULL; | 208 return NULL; |
209 } | 209 } |
210 // times = (PyArrayObject *)PyCObject_AsVoidPtr(incomingTime); | 210 // times = (PyArrayObject *)PyCObject_AsVoidPtr(incomingTime); |
211 if (PyArray_NDIM(times) != 1 || PyArray_DIMS(times)[0] == (nVect*2)){ | 211 if (PyArray_NDIM(times) != 1 || PyArray_DIMS(times)[0] != (nVect*2)){ |
212 PyErr_SetString(PyExc_ValueError, "times, if given must be a 1d numpy array with shape = (numVectors,)"); | 212 PyErr_SetString(PyExc_ValueError, "times, if given must be a 1d numpy array with shape = (numVectors*2,)"); |
213 return NULL; | 213 return NULL; |
214 } | 214 } |
215 } | 215 } |
216 current_db = (adb_t *)PyCObject_AsVoidPtr(incoming); | 216 current_db = (adb_t *)PyCObject_AsVoidPtr(incoming); |
217 status = (adb_status_t *)malloc(sizeof(adb_status_t)); | 217 status = (adb_status_t *)malloc(sizeof(adb_status_t)); |