diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0222082 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +ENV/ +scikits.audiolab.egg-info/ +pip-wheel-metadata/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4b01c9b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +language: python + +cache: + directories: + - $HOME/.cache/pip + +matrix: + include: + - name: "Python 2.7 on Xenial" + python: 2.7 + dist: xenial + addons: + apt: + packages: + - libsndfile1-dev + - libasound2-dev + - name: "Python 2.7 on macOS" + os: osx + osx_image: xcode10.2 + language: shell # 'language: python' causes errors on Travis CI macOS + addons: + homebrew: + packages: + - libsndfile + before_script: + - pip install pytest + before_cache: + - brew cleanup + cache: + directories: + - $HOME/Library/Caches/Homebrew + + +install: + - pip install -e . +script: + - pytest \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 2bf2f07..dbf4561 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include COPYING.txt include NEWS include Changelog include common.py +include pyproject.toml include setup.py include scikits/audiolab/test_data/original.aif include scikits/audiolab/test_data/test.aiff @@ -22,7 +23,4 @@ recursive-include docs/src/examples *py # Cython files include scikits/audiolab/pysndfile/_sndfile.pyx include scikits/audiolab/soundio/macosx/macosx_backend.pyx -include scikits/audiolab/soundio/alsa/_alsa_backend.pyx -include scikits/audiolab/pysndfile/_sndfile.c -include scikits/audiolab/soundio/macosx/macosx_backend.c -include scikits/audiolab/soundio/alsa/_alsa_backend.c +include scikits/audiolab/soundio/alsa/_alsa_backend.pyx \ No newline at end of file diff --git a/README.txt b/README.md similarity index 77% rename from README.txt rename to README.md index 918c643..1034497 100644 --- a/README.txt +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.com/palfrey/audiolab.svg?branch=master)](https://travis-ci.com/palfrey/audiolab) ![PyPI](https://img.shields.io/pypi/v/scikits.audiolab) + Audiolab is a python package for audio file IO using numpy arrays. It supports many different audio formats, including wav, aiff, au, flac, ogg, htk. It can also be used for sound output to audio device (Mac OS X and Linux only). diff --git a/audiolab/.gitignore b/audiolab/.gitignore new file mode 100644 index 0000000..23919f5 --- /dev/null +++ b/audiolab/.gitignore @@ -0,0 +1,2 @@ +info.py +version.py \ No newline at end of file diff --git a/audiolab/pysndfile/.gitignore b/audiolab/pysndfile/.gitignore new file mode 100644 index 0000000..d6ab86f --- /dev/null +++ b/audiolab/pysndfile/.gitignore @@ -0,0 +1,2 @@ +_sndfile.c +_sndfile.so \ No newline at end of file diff --git a/audiolab/pysndfile/_sndfile.c b/audiolab/pysndfile/_sndfile.c deleted file mode 100644 index 3655256..0000000 --- a/audiolab/pysndfile/_sndfile.c +++ /dev/null @@ -1,11805 +0,0 @@ -/* Generated by Cython 0.10.2 on Sun Dec 14 17:23:18 2008 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_LOCK 0x0002 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif -#else - #define _USE_MATH_DEFINES -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__scikits__audiolab__pysndfile___sndfile -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "sndfile.h" - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x); -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); - -#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x); -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x); -static INLINE char __pyx_PyInt_char(PyObject* x); -static INLINE short __pyx_PyInt_short(PyObject* x); -static INLINE int __pyx_PyInt_int(PyObject* x); -static INLINE long __pyx_PyInt_long(PyObject* x); -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x); -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x); -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x); -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x); -static INLINE long double __pyx_PyInt_long_double(PyObject* x); -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - -static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { - PyObject *r; - if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned)) - r = PySequence_GetItem(o, i); - else { - PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); - if (!j) - return 0; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - } - return r; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/ -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/ -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/ -static const char* __Pyx_DescribeTokenInFormatString(const char* ts); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ - -static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); -static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else -#define __Pyx_GetBuffer PyObject_GetBuffer -#define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - -Py_ssize_t __Pyx_zeros[] = {0, 0}; -Py_ssize_t __Pyx_minusones[] = {-1, -1}; - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ - } - else { - PyObject *r, *m; - m = PyObject_GetAttrString(L, "append"); - if (!m) return NULL; - r = PyObject_CallFunctionObjArgs(m, x, NULL); - Py_DECREF(m); - return r; - } -} - -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":384 - * return majors - * - * cdef class Sndfile: # <<<<<<<<<<<<<< - * """\ - * Sndfile is the core class to read/write audio files. Once an instance is - */ - -struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile { - PyObject_HEAD - struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_vtab; - SNDFILE *hdl; - PyObject *filename; - int fd; - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *_format; - int _mode; - SF_INFO _sfinfo; -}; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":130 - * return int(major), int(minor), int(micro), prerelease - * - * cdef class Format: # <<<<<<<<<<<<<< - * """\ - * This class represents an audio file format. It knows about audio file - */ - -struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format { - PyObject_HEAD - struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_vtab; - SF_INFO _sf_info; - int _format_raw_int; - PyObject *_type; - PyObject *_encoding; - PyObject *_endianness; - PyObject *_format_str; - PyObject *_encoding_str; - PyObject *_endian_str; -}; - - -struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format { - int (*format_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *); - int (*file_format_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *); - int (*encoding_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *); - int (*endianness_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *); - int (*_is_equal)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *, struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *); -}; -static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format; - - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":384 - * return majors - * - * cdef class Sndfile: # <<<<<<<<<<<<<< - * """\ - * Sndfile is the core class to read/write audio files. Once an instance is - */ - -struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile { - PyObject *(*_close)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *); - sf_count_t (*_get_nframes)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *); - PyObject *(*read_frames_double)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t); - PyObject *(*read_frames_float)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t); - PyObject *(*read_frames_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t); - PyObject *(*read_frames_short)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, sf_count_t); - sf_count_t (*write_frames_double)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t); - sf_count_t (*write_frames_float)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t); - sf_count_t (*write_frames_int)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t); - sf_count_t (*write_frames_short)(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *, PyArrayObject *, sf_count_t); -}; -static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile; -/* Module declarations from python_buffer */ - -/* Module declarations from stdlib */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *); /*proto*/ -/* Module declarations from scikits.audiolab.pysndfile.sndfile */ - -/* Module declarations from scikits.audiolab.pysndfile._sndfile */ - -static PyTypeObject *__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format = 0; -static PyTypeObject *__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = 0; -static PyObject *__pyx_k_92; -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(int); /*proto*/ -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(void); /*proto*/ -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(int); /*proto*/ - - -/* Implementation of scikits.audiolab.pysndfile._sndfile */ -static char __pyx_k_23[] = "File format (wav, etc...)."; -static char __pyx_k_24[] = "File encoding (pcm16, etc...)."; -static char __pyx_k_25[] = "File endianness (file, little, etc...)."; -static char __pyx_k_26[] = "File format description: the full description from sndfile."; -static char __pyx_k_27[] = "File encoding description: the full description from sndfile."; -static char __pyx_k_28[] = "Number of frames of the file."; -static char __pyx_k_29[] = "Sampling rate (in Hz)."; -static char __pyx_k_30[] = "Number of channels."; -static char __pyx_k_31[] = "Format instance attached to the Sndfile instance."; -static PyObject *__pyx_int_0x0060; -static PyObject *__pyx_int_0x170000; -static PyObject *__pyx_int_0x180000; -static PyObject *__pyx_int_0x190000; -static PyObject *__pyx_int_0x200000; -static PyObject *__pyx_int_0x210000; -static PyObject *__pyx_int_0x220000; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_1; -static char __pyx_k___init__[] = "__init__"; -static PyObject *__pyx_kp___init__; -static char __pyx_k___copy__[] = "__copy__"; -static PyObject *__pyx_kp___copy__; -static char __pyx_k___deepcopy__[] = "__deepcopy__"; -static PyObject *__pyx_kp___deepcopy__; -static char __pyx_k___richcmp__[] = "__richcmp__"; -static PyObject *__pyx_kp___richcmp__; -static char __pyx_k___str__[] = "__str__"; -static PyObject *__pyx_kp___str__; -static char __pyx_k___repr__[] = "__repr__"; -static PyObject *__pyx_kp___repr__; -static char __pyx_k___dealloc__[] = "__dealloc__"; -static PyObject *__pyx_kp___dealloc__; -static char __pyx_k_close[] = "close"; -static PyObject *__pyx_kp_close; -static char __pyx_k_sync[] = "sync"; -static PyObject *__pyx_kp_sync; -static char __pyx_k_read_frames[] = "read_frames"; -static PyObject *__pyx_kp_read_frames; -static char __pyx_k_write_frames[] = "write_frames"; -static PyObject *__pyx_kp_write_frames; -static char __pyx_k_seek[] = "seek"; -static PyObject *__pyx_kp_seek; -static char __pyx_k_type[] = "type"; -static PyObject *__pyx_kp_type; -static char __pyx_k_encoding[] = "encoding"; -static PyObject *__pyx_kp_encoding; -static char __pyx_k_endianness[] = "endianness"; -static PyObject *__pyx_kp_endianness; -static char __pyx_k_self[] = "self"; -static PyObject *__pyx_kp_self; -static char __pyx_k_other[] = "other"; -static PyObject *__pyx_kp_other; -static char __pyx_k_op[] = "op"; -static PyObject *__pyx_kp_op; -static char __pyx_k_major[] = "major"; -static PyObject *__pyx_kp_major; -static char __pyx_k_filename[] = "filename"; -static PyObject *__pyx_kp_filename; -static char __pyx_k_mode[] = "mode"; -static PyObject *__pyx_kp_mode; -static char __pyx_k_format[] = "format"; -static PyObject *__pyx_kp_format; -static char __pyx_k_channels[] = "channels"; -static PyObject *__pyx_kp_channels; -static char __pyx_k_samplerate[] = "samplerate"; -static PyObject *__pyx_kp_samplerate; -static char __pyx_k_nframes[] = "nframes"; -static PyObject *__pyx_kp_nframes; -static char __pyx_k_dtype[] = "dtype"; -static PyObject *__pyx_kp_dtype; -static char __pyx_k_input[] = "input"; -static PyObject *__pyx_kp_input; -static char __pyx_k_offset[] = "offset"; -static PyObject *__pyx_kp_offset; -static char __pyx_k_whence[] = "whence"; -static PyObject *__pyx_kp_whence; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k_warnings[] = "warnings"; -static PyObject *__pyx_kp_warnings; -static char __pyx_k_copy[] = "copy"; -static PyObject *__pyx_kp_copy; -static char __pyx_k_32[] = "pcms8"; -static PyObject *__pyx_kp_32; -static char __pyx_k_33[] = "pcm16"; -static PyObject *__pyx_kp_33; -static char __pyx_k_34[] = "pcm24"; -static PyObject *__pyx_kp_34; -static char __pyx_k_35[] = "pcm32"; -static PyObject *__pyx_kp_35; -static char __pyx_k_36[] = "pcmu8"; -static PyObject *__pyx_kp_36; -static char __pyx_k_37[] = "float32"; -static PyObject *__pyx_kp_37; -static char __pyx_k_38[] = "float64"; -static PyObject *__pyx_kp_38; -static char __pyx_k_39[] = "ulaw"; -static PyObject *__pyx_kp_39; -static char __pyx_k_40[] = "alaw"; -static PyObject *__pyx_kp_40; -static char __pyx_k_41[] = "ima_adpcm"; -static PyObject *__pyx_kp_41; -static char __pyx_k_42[] = "ms_adpcm"; -static PyObject *__pyx_kp_42; -static char __pyx_k_43[] = "gsm610"; -static PyObject *__pyx_kp_43; -static char __pyx_k_44[] = "vox_adpcm"; -static PyObject *__pyx_kp_44; -static char __pyx_k_45[] = "g721_32"; -static PyObject *__pyx_kp_45; -static char __pyx_k_46[] = "g723_24"; -static PyObject *__pyx_kp_46; -static char __pyx_k_47[] = "g723_40"; -static PyObject *__pyx_kp_47; -static char __pyx_k_48[] = "dww12"; -static PyObject *__pyx_kp_48; -static char __pyx_k_49[] = "dww16"; -static PyObject *__pyx_kp_49; -static char __pyx_k_50[] = "dww24"; -static PyObject *__pyx_kp_50; -static char __pyx_k_51[] = "dwwN"; -static PyObject *__pyx_kp_51; -static char __pyx_k_52[] = "dpcm8"; -static PyObject *__pyx_kp_52; -static char __pyx_k_53[] = "dpcm16"; -static PyObject *__pyx_kp_53; -static char __pyx_k__SNDFILE_ENCODING[] = "_SNDFILE_ENCODING"; -static PyObject *__pyx_kp__SNDFILE_ENCODING; -static char __pyx_k_54[] = "wav"; -static PyObject *__pyx_kp_54; -static char __pyx_k_55[] = "aiff"; -static PyObject *__pyx_kp_55; -static char __pyx_k_56[] = "au"; -static PyObject *__pyx_kp_56; -static char __pyx_k_57[] = "raw"; -static PyObject *__pyx_kp_57; -static char __pyx_k_58[] = "paf"; -static PyObject *__pyx_kp_58; -static char __pyx_k_59[] = "svx"; -static PyObject *__pyx_kp_59; -static char __pyx_k_60[] = "nist"; -static PyObject *__pyx_kp_60; -static char __pyx_k_61[] = "voc"; -static PyObject *__pyx_kp_61; -static char __pyx_k_62[] = "ircam"; -static PyObject *__pyx_kp_62; -static char __pyx_k_63[] = "wav64"; -static PyObject *__pyx_kp_63; -static char __pyx_k_64[] = "mat4"; -static PyObject *__pyx_kp_64; -static char __pyx_k_65[] = "mat5"; -static PyObject *__pyx_kp_65; -static char __pyx_k_66[] = "pvf"; -static PyObject *__pyx_kp_66; -static char __pyx_k_67[] = "xi"; -static PyObject *__pyx_kp_67; -static char __pyx_k_68[] = "htk"; -static PyObject *__pyx_kp_68; -static char __pyx_k_69[] = "sds"; -static PyObject *__pyx_kp_69; -static char __pyx_k_70[] = "avr"; -static PyObject *__pyx_kp_70; -static char __pyx_k_71[] = "wavex"; -static PyObject *__pyx_kp_71; -static char __pyx_k_72[] = "sd2"; -static PyObject *__pyx_kp_72; -static char __pyx_k_73[] = "_SNDFILE_FILE_FORMAT"; -static PyObject *__pyx_kp_73; -static char __pyx_k_74[] = "vorbis"; -static PyObject *__pyx_kp_74; -static char __pyx_k_75[] = "flac"; -static PyObject *__pyx_kp_75; -static char __pyx_k_76[] = "caf"; -static PyObject *__pyx_kp_76; -static char __pyx_k_77[] = "wve"; -static PyObject *__pyx_kp_77; -static char __pyx_k_78[] = "ogg"; -static PyObject *__pyx_kp_78; -static char __pyx_k_79[] = "mpc2k"; -static PyObject *__pyx_kp_79; -static char __pyx_k_80[] = "rf64"; -static PyObject *__pyx_kp_80; -static char __pyx_k_81[] = "file"; -static PyObject *__pyx_kp_81; -static char __pyx_k_82[] = "little"; -static PyObject *__pyx_kp_82; -static char __pyx_k_83[] = "big"; -static PyObject *__pyx_kp_83; -static char __pyx_k_84[] = "cpu"; -static PyObject *__pyx_kp_84; -static char __pyx_k__SNDFILE_ENDIAN[] = "_SNDFILE_ENDIAN"; -static PyObject *__pyx_kp__SNDFILE_ENDIAN; -static char __pyx_k_85[] = "_ENUM_TO_STR_ENCODING"; -static PyObject *__pyx_kp_85; -static char __pyx_k_j[] = "j"; -static PyObject *__pyx_kp_j; -static char __pyx_k_i[] = "i"; -static PyObject *__pyx_kp_i; -static char __pyx_k_items[] = "items"; -static PyObject *__pyx_kp_items; -static char __pyx_k_86[] = "_ENUM_TO_STR_FILE_FORMAT"; -static PyObject *__pyx_kp_86; -static char __pyx_k__ENUM_TO_STR_ENDIAN[] = "_ENUM_TO_STR_ENDIAN"; -static PyObject *__pyx_kp__ENUM_TO_STR_ENDIAN; -static char __pyx_k_87[] = "wav"; -static PyObject *__pyx_kp_87; -static char __pyx_k_88[] = "pcm16"; -static PyObject *__pyx_kp_88; -static char __pyx_k_89[] = "file"; -static PyObject *__pyx_kp_89; -static char __pyx_k_90[] = "r"; -static PyObject *__pyx_kp_90; -static char __pyx_k_91[] = "float64"; -static PyObject *__pyx_kp_91; -static char __pyx_k_93[] = "rw"; -static PyObject *__pyx_kp_93; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static PyObject *__pyx_kp_RuntimeError; -static char __pyx_k_split[] = "split"; -static PyObject *__pyx_kp_split; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_97[] = "pre"; -static PyObject *__pyx_kp_97; -static char __pyx_k_KeyError[] = "KeyError"; -static PyObject *__pyx_kp_KeyError; -static char __pyx_k___class__[] = "__class__"; -static PyObject *__pyx_kp___class__; -static char __pyx_k_NotImplementedError[] = "NotImplementedError"; -static PyObject *__pyx_kp_NotImplementedError; -static char __pyx_k_TypeError[] = "TypeError"; -static PyObject *__pyx_kp_TypeError; -static char __pyx_k_join[] = "join"; -static PyObject *__pyx_kp_join; -static char __pyx_k_has_key[] = "has_key"; -static PyObject *__pyx_kp_has_key; -static char __pyx_k_warn[] = "warn"; -static PyObject *__pyx_kp_warn; -static char __pyx_k_append[] = "append"; -static PyObject *__pyx_kp_append; -static char __pyx_k_115[] = "r"; -static PyObject *__pyx_kp_115; -static char __pyx_k_116[] = "w"; -static PyObject *__pyx_kp_116; -static char __pyx_k_118[] = "rw"; -static PyObject *__pyx_kp_118; -static char __pyx_k_121[] = "r"; -static PyObject *__pyx_kp_121; -static char __pyx_k_IOError[] = "IOError"; -static PyObject *__pyx_kp_IOError; -static char __pyx_k_129[] = "r"; -static PyObject *__pyx_kp_129; -static char __pyx_k_file_format[] = "file_format"; -static PyObject *__pyx_kp_file_format; -static char __pyx_k_144[] = "float32"; -static PyObject *__pyx_kp_144; -static char __pyx_k_145[] = "int32"; -static PyObject *__pyx_kp_145; -static char __pyx_k_146[] = "int16"; -static PyObject *__pyx_kp_146; -static char __pyx_k_shape[] = "shape"; -static PyObject *__pyx_kp_shape; -static char __pyx_k_empty[] = "empty"; -static PyObject *__pyx_kp_empty; -static char __pyx_k_order[] = "order"; -static PyObject *__pyx_kp_order; -static char __pyx_k_148[] = "C"; -static PyObject *__pyx_kp_148; -static char __pyx_k_150[] = "F"; -static PyObject *__pyx_kp_150; -static char __pyx_k_int[] = "int"; -static PyObject *__pyx_kp_int; -static char __pyx_k_152[] = "F"; -static PyObject *__pyx_kp_152; -static char __pyx_k_short[] = "short"; -static PyObject *__pyx_kp_short; -static char __pyx_k_154[] = "F"; -static PyObject *__pyx_kp_154; -static char __pyx_k_size[] = "size"; -static PyObject *__pyx_kp_size; -static char __pyx_k_require[] = "require"; -static PyObject *__pyx_kp_require; -static char __pyx_k_requirements[] = "requirements"; -static PyObject *__pyx_kp_requirements; -static char __pyx_k_158[] = "C"; -static PyObject *__pyx_kp_158; -static char __pyx_k_Exception[] = "Exception"; -static PyObject *__pyx_kp_Exception; -static char __pyx_k_161[] = "rw"; -static PyObject *__pyx_kp_161; -static char __pyx_k_162[] = "r"; -static PyObject *__pyx_kp_162; -static char __pyx_k_163[] = "w"; -static PyObject *__pyx_kp_163; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_IOError; -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_kp_94; -static PyObject *__pyx_kp_95; -static PyObject *__pyx_kp_96; -static char __pyx_k_94[] = "Error while getting version of libsndfile"; -static char __pyx_k_95[] = "-"; -static char __pyx_k_96[] = "."; -static PyObject *__pyx_kp_98; -static PyObject *__pyx_kp_99; -static PyObject *__pyx_kp_100; -static PyObject *__pyx_kp_101; -static PyObject *__pyx_kp_102; -static PyObject *__pyx_kp_103; -static PyObject *__pyx_kp_104; -static PyObject *__pyx_kp_105; -static char __pyx_k_98[] = "file format %s not recognized"; -static char __pyx_k_99[] = "endianness %s not recognized"; -static char __pyx_k_100[] = "encoding %s not recognized"; -static char __pyx_k_101[] = "The combination (type=%s|encoding=%s|endianness=%s) you requested is not supported. You can use available_formats and available_encodings functions to query which formats and encodings are available."; -static char __pyx_k_102[] = "Could not get format string for format %d, "; -static char __pyx_k_103[] = "please report thisproblem to the maintainer"; -static char __pyx_k_104[] = "Could not get format string for format %d, "; -static char __pyx_k_105[] = "please report thisproblem to the maintainer"; -static PyObject *__pyx_kp_106; -static PyObject *__pyx_kp_107; -static PyObject *__pyx_kp_108; -static PyObject *__pyx_kp_109; -static char __pyx_k_106[] = "Major Format: %s"; -static char __pyx_k_107[] = "Encoding Format: %s"; -static char __pyx_k_108[] = "Endianness: %s"; -static char __pyx_k_109[] = "\n"; -static PyObject *__pyx_kp_110; -static char __pyx_k_110[] = "Format %#10x supported by libsndfile but not yet supported by audiolab"; -static PyObject *__pyx_kp_111; -static PyObject *__pyx_kp_112; -static char __pyx_k_111[] = "Unknown file format %s"; -static char __pyx_k_112[] = "Encoding %#10x supported by libsndfile but not yet supported by audiolab"; -static PyObject *__pyx_kp_113; -static char __pyx_k_113[] = "Error while calling sf_command"; -static PyObject *__pyx_kp_114; -static char __pyx_k_114[] = "Error while calling sf_command"; -static PyObject *__pyx_kp_117; -static PyObject *__pyx_kp_119; -static PyObject *__pyx_kp_120; -static PyObject *__pyx_kp_122; -static PyObject *__pyx_kp_123; -static PyObject *__pyx_kp_124; -static PyObject *__pyx_kp_125; -static PyObject *__pyx_kp_126; -static PyObject *__pyx_kp_127; -static PyObject *__pyx_kp_128; -static char __pyx_k_117[] = "For write mode, you should providea format argument !"; -static char __pyx_k_119[] = "For write mode, you should providea format argument !"; -static char __pyx_k_120[] = "mode %s not recognized"; -static char __pyx_k_122[] = "Bad value of samplerate (%d) or channels (%d)"; -static char __pyx_k_123[] = "Bad format specification: check arguments."; -static char __pyx_k_124[] = ""; -static char __pyx_k_125[] = "error while opening file %s\n\t-> "; -static char __pyx_k_126[] = "error while opening file descriptor %d\n\t->"; -static char __pyx_k_127[] = "\n(Check that the mode argument passed to sndfile is the same than the one used\nwhen getting the file descriptor, eg do not pass 'r' to sndfile if you\npassed 'write' to the method you used to get the file descriptor. If you are on\nwin32, you are out of luck, because its implementation of POSIX open is\nbroken)"; -static char __pyx_k_128[] = "error while opening %s\n\t->%s"; -static PyObject *__pyx_kp_130; -static char __pyx_k_130[] = "Sorry, getting the current number offrames in write modes is not supported yet"; -static PyObject *__pyx_kp_131; -static PyObject *__pyx_kp_132; -static PyObject *__pyx_kp_133; -static PyObject *__pyx_kp_134; -static PyObject *__pyx_kp_135; -static PyObject *__pyx_kp_136; -static PyObject *__pyx_kp_137; -static PyObject *__pyx_kp_138; -static PyObject *__pyx_kp_139; -static PyObject *__pyx_kp_140; -static PyObject *__pyx_kp_141; -static PyObject *__pyx_kp_142; -static char __pyx_k_131[] = "----------------------------------------"; -static char __pyx_k_132[] = "File : %d (opened by file descriptor)"; -static char __pyx_k_133[] = "File : %s"; -static char __pyx_k_134[] = "Channels : %d"; -static char __pyx_k_135[] = "Sample rate : %d"; -static char __pyx_k_136[] = "Frames : %d"; -static char __pyx_k_137[] = "Raw Format : %#010x"; -static char __pyx_k_138[] = "File format : %s"; -static char __pyx_k_139[] = "Encoding : %s"; -static char __pyx_k_140[] = "Endianness : %s"; -static char __pyx_k_141[] = "Seekable : %s\n"; -static char __pyx_k_142[] = "\n"; -static PyObject *__pyx_kp_143; -static PyObject *__pyx_kp_147; -static char __pyx_k_143[] = "number of frames has to be >= 0 (was %d)"; -static char __pyx_k_147[] = "Sorry, dtype %s not supported"; -static PyObject *__pyx_kp_149; -static char __pyx_k_149[] = "Asked %d frames, read %d"; -static PyObject *__pyx_kp_151; -static char __pyx_k_151[] = "Asked %d frames, read %d"; -static PyObject *__pyx_kp_153; -static char __pyx_k_153[] = "Asked %d frames, read %d"; -static PyObject *__pyx_kp_155; -static char __pyx_k_155[] = "Asked %d frames, read %d"; -static PyObject *__pyx_kp_156; -static PyObject *__pyx_kp_157; -static PyObject *__pyx_kp_159; -static PyObject *__pyx_kp_160; -static char __pyx_k_156[] = "Expect array of rank 2, got %d"; -static char __pyx_k_157[] = "Expected %d channels, got %d"; -static char __pyx_k_159[] = "type of input &s not understood"; -static char __pyx_k_160[] = "write %d frames, expected to write %d"; -static PyObject *__pyx_kp_164; -static PyObject *__pyx_kp_165; -static char __pyx_k_164[] = "mode should be one of 'r', 'w' or 'rw' only"; -static char __pyx_k_165[] = "Error while seeking, libsndfile error is %s"; -static PyObject *__pyx_kp_166; -static char __pyx_k_166[] = "Inconsistent format: this is a bug"; -static char __pyx_k___getbuffer__[] = "__getbuffer__"; -static PyObject *__pyx_kp___getbuffer__; -static char __pyx_k___releasebuffer__[] = "__releasebuffer__"; -static PyObject *__pyx_kp___releasebuffer__; -static char __pyx_k_info[] = "info"; -static PyObject *__pyx_kp_info; -static char __pyx_k_flags[] = "flags"; -static PyObject *__pyx_kp_flags; -static char __pyx_k_itervalues[] = "itervalues"; -static PyObject *__pyx_kp_itervalues; -static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_20; -static char __pyx_k_1[] = "ndarray is not C contiguous"; -static char __pyx_k_2[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_3[] = "b"; -static char __pyx_k_4[] = "B"; -static char __pyx_k_5[] = "h"; -static char __pyx_k_6[] = "H"; -static char __pyx_k_7[] = "i"; -static char __pyx_k_8[] = "I"; -static char __pyx_k_9[] = "l"; -static char __pyx_k_10[] = "L"; -static char __pyx_k_11[] = "q"; -static char __pyx_k_12[] = "Q"; -static char __pyx_k_13[] = "f"; -static char __pyx_k_14[] = "d"; -static char __pyx_k_15[] = "g"; -static char __pyx_k_16[] = "Zf"; -static char __pyx_k_17[] = "Zd"; -static char __pyx_k_18[] = "Zg"; -static char __pyx_k_19[] = "O"; -static char __pyx_k_20[] = "unknown dtype code in numpy.pxd (%d)"; -static PyObject *__pyx_kp_21; -static PyObject *__pyx_kp_22; -static char __pyx_k_21[] = "Format string allocated too short."; -static char __pyx_k_22[] = "unknown dtype code in numpy.pxd (%d)"; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":106 - * dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()]) - * - * def sndfile_version(): # <<<<<<<<<<<<<< - * """Return version of sndfile.""" - * cdef int st - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version(PyObject *__pyx_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version[] = "sndfile_version()\nReturn version of sndfile."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version(PyObject *__pyx_self, PyObject *unused) { - int __pyx_v_st; - char __pyx_v_buff[128]; - PyObject *__pyx_v_ver; - PyObject *__pyx_v_version; - PyObject *__pyx_v_prerelease; - PyObject *__pyx_v_major; - PyObject *__pyx_v_minor; - PyObject *__pyx_v_micro; - PyObject *__pyx_v_e; - PyObject *__pyx_v_i; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - PyObject *__pyx_7 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __pyx_self = __pyx_self; - __pyx_v_ver = Py_None; Py_INCREF(Py_None); - __pyx_v_version = Py_None; Py_INCREF(Py_None); - __pyx_v_prerelease = Py_None; Py_INCREF(Py_None); - __pyx_v_major = Py_None; Py_INCREF(Py_None); - __pyx_v_minor = Py_None; Py_INCREF(Py_None); - __pyx_v_micro = Py_None; Py_INCREF(Py_None); - __pyx_v_e = Py_None; Py_INCREF(Py_None); - __pyx_v_i = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":111 - * cdef char buff[128] - * - * st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff)) # <<<<<<<<<<<<<< - * if st < 1: - * raise RuntimeError("Error while getting version of libsndfile") - */ - __pyx_v_st = sf_command(NULL, SFC_GET_LIB_VERSION, __pyx_v_buff, (sizeof(__pyx_v_buff))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":112 - * - * st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff)) - * if st < 1: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while getting version of libsndfile") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (__pyx_v_st < 1); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":113 - * st = sf_command(NULL, SFC_GET_LIB_VERSION, buff, sizeof(buff)) - * if st < 1: - * raise RuntimeError("Error while getting version of libsndfile") # <<<<<<<<<<<<<< - * - * ver = PyString_FromStringAndSize(buff, stdlib.strlen(buff)) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_94); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_94); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":115 - * raise RuntimeError("Error while getting version of libsndfile") - * - * ver = PyString_FromStringAndSize(buff, stdlib.strlen(buff)) # <<<<<<<<<<<<<< - * - * # Get major, minor and micro from version - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_buff, strlen(__pyx_v_buff)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_ver); - __pyx_v_ver = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":119 - * # Get major, minor and micro from version - * # Template: libsndfile-X.X.XpreX with preX being optional - * version = ver.split('-')[1] # <<<<<<<<<<<<<< - * prerelease = 0 - * major, minor, micro = [i for i in version.split('.')] - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_ver, __pyx_kp_split); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_95); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_95); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - Py_DECREF(__pyx_v_version); - __pyx_v_version = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":120 - * # Template: libsndfile-X.X.XpreX with preX being optional - * version = ver.split('-')[1] - * prerelease = 0 # <<<<<<<<<<<<<< - * major, minor, micro = [i for i in version.split('.')] - * try: - */ - Py_INCREF(__pyx_int_0); - Py_DECREF(__pyx_v_prerelease); - __pyx_v_prerelease = __pyx_int_0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":121 - * version = ver.split('-')[1] - * prerelease = 0 - * major, minor, micro = [i for i in version.split('.')] # <<<<<<<<<<<<<< - * try: - * micro = int(micro) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_1 = PyObject_GetAttr(__pyx_v_version, __pyx_kp_split); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_96); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_96); - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; Py_INCREF(__pyx_t_3); - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - for (;;) { - /* __pyx_t_5 allocated */ - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); Py_INCREF(__pyx_t_5); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); Py_INCREF(__pyx_t_5); __pyx_t_4++; - } else { - __pyx_t_5 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_5) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - Py_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - __pyx_2 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_v_i); if (unlikely(__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - /* __pyx_t_4 released */ - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (PyTuple_CheckExact(((PyObject *)__pyx_t_2)) && PyTuple_GET_SIZE(((PyObject *)__pyx_t_2)) == 3) { - PyObject* tuple = ((PyObject *)__pyx_t_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_3); - __pyx_4 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_4); - __pyx_5 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_5); - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(__pyx_v_major); - __pyx_v_major = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_minor); - __pyx_v_minor = __pyx_4; - __pyx_4 = 0; - Py_DECREF(__pyx_v_micro); - __pyx_v_micro = __pyx_5; - __pyx_5 = 0; - } else { - __pyx_1 = PyObject_GetIter(((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_v_major); - __pyx_v_major = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_minor); - __pyx_v_minor = __pyx_4; - __pyx_4 = 0; - Py_DECREF(__pyx_v_micro); - __pyx_v_micro = __pyx_5; - __pyx_5 = 0; - } - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":122 - * prerelease = 0 - * major, minor, micro = [i for i in version.split('.')] - * try: # <<<<<<<<<<<<<< - * micro = int(micro) - * except ValueError,e: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":123 - * major, minor, micro = [i for i in version.split('.')] - * try: - * micro = int(micro) # <<<<<<<<<<<<<< - * except ValueError,e: - * #print "micro is " + str(micro) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - Py_INCREF(__pyx_v_micro); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_micro); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - Py_DECREF(__pyx_v_micro); - __pyx_v_micro = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L12_try; - __pyx_L8_error:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - Py_XDECREF(__pyx_3); __pyx_3 = 0; - Py_XDECREF(__pyx_4); __pyx_4 = 0; - Py_XDECREF(__pyx_5); __pyx_5 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":124 - * try: - * micro = int(micro) - * except ValueError,e: # <<<<<<<<<<<<<< - * #print "micro is " + str(micro) - * micro, prerelease = micro.split('pre') - */ - __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_ValueError); - if (__pyx_2) { - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.sndfile_version"); - if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - Py_INCREF(__pyx_3); - Py_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_3; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":126 - * except ValueError,e: - * #print "micro is " + str(micro) - * micro, prerelease = micro.split('pre') # <<<<<<<<<<<<<< - * - * return int(major), int(minor), int(micro), prerelease - */ - __pyx_5 = PyObject_GetAttr(__pyx_v_micro, __pyx_kp_split); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - Py_INCREF(__pyx_kp_97); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_97); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (PyTuple_CheckExact(__pyx_t_2) && PyTuple_GET_SIZE(__pyx_t_2) == 2) { - PyObject* tuple = __pyx_t_2; - __pyx_6 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_6); - __pyx_7 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_7); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - Py_DECREF(__pyx_v_micro); - __pyx_v_micro = __pyx_6; - __pyx_6 = 0; - Py_DECREF(__pyx_v_prerelease); - __pyx_v_prerelease = __pyx_7; - __pyx_7 = 0; - } else { - __pyx_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_6 = __Pyx_UnpackItem(__pyx_5, 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - __pyx_7 = __Pyx_UnpackItem(__pyx_5, 1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_v_micro); - __pyx_v_micro = __pyx_6; - __pyx_6 = 0; - Py_DECREF(__pyx_v_prerelease); - __pyx_v_prerelease = __pyx_7; - __pyx_7 = 0; - } - /* __pyx_t_2 released */ - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - goto __pyx_L9_exception_handled; - } - __pyx_L10_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L9_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L12_try:; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":128 - * micro, prerelease = micro.split('pre') - * - * return int(major), int(minor), int(micro), prerelease # <<<<<<<<<<<<<< - * - * cdef class Format: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_major); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_major); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_minor); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_minor); - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_micro); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_micro); - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6); - Py_INCREF(__pyx_v_prerelease); - PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_prerelease); - __pyx_t_3 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_5 released */ - /* __pyx_t_6 released */ - __pyx_r = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); - Py_XDECREF(__pyx_7); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - Py_XDECREF(__pyx_t_5); - Py_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.sndfile_version"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_ver); - Py_DECREF(__pyx_v_version); - Py_DECREF(__pyx_v_prerelease); - Py_DECREF(__pyx_v_major); - Py_DECREF(__pyx_v_minor); - Py_DECREF(__pyx_v_micro); - Py_DECREF(__pyx_v_e); - Py_DECREF(__pyx_v_i); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":158 - * cdef object _type, _encoding, _endianness - * cdef object _format_str, _encoding_str, _endian_str - * def __init__(self, type = 'wav', encoding = 'pcm16', endianness = 'file'): # <<<<<<<<<<<<<< - * cdef int format, ctype, cencoding, cendian, st - * cdef SF_FORMAT_INFO format_info - */ - -static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_type = 0; - PyObject *__pyx_v_encoding = 0; - PyObject *__pyx_v_endianness = 0; - int __pyx_v_format; - int __pyx_v_ctype; - int __pyx_v_cencoding; - int __pyx_v_cendian; - int __pyx_v_st; - SF_FORMAT_INFO __pyx_v_format_info; - PyObject *__pyx_v_e; - PyObject *__pyx_v_ret; - PyObject *__pyx_v_msg; - int __pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_3; - PyObject *__pyx_4 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_type,&__pyx_kp_encoding,&__pyx_kp_endianness,0}; - __pyx_v_type = __pyx_kp_87; - __pyx_v_encoding = __pyx_kp_88; - __pyx_v_endianness = __pyx_kp_89; - if (unlikely(__pyx_kwds)) { - PyObject* values[3] = {0,0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_type = values[0]; - } - if (values[1]) { - __pyx_v_encoding = values[1]; - } - if (values[2]) { - __pyx_v_endianness = values[2]; - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_endianness = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: __pyx_v_encoding = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__init__"); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_v_e = Py_None; Py_INCREF(Py_None); - __pyx_v_ret = Py_None; Py_INCREF(Py_None); - __pyx_v_msg = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":163 - * - * # Keep the arguments - * self._type = type # <<<<<<<<<<<<<< - * self._encoding = encoding - * self._endianness = endianness - */ - Py_INCREF(__pyx_v_type); - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type = __pyx_v_type; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":164 - * # Keep the arguments - * self._type = type - * self._encoding = encoding # <<<<<<<<<<<<<< - * self._endianness = endianness - * - */ - Py_INCREF(__pyx_v_encoding); - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding = __pyx_v_encoding; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":165 - * self._type = type - * self._encoding = encoding - * self._endianness = endianness # <<<<<<<<<<<<<< - * - * # Get the internal values which corresponds to the values libsndfile - */ - Py_INCREF(__pyx_v_endianness); - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness = __pyx_v_endianness; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":169 - * # Get the internal values which corresponds to the values libsndfile - * # can understand - * try: # <<<<<<<<<<<<<< - * ctype = _SNDFILE_FILE_FORMAT[type] - * except KeyError, e: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":170 - * # can understand - * try: - * ctype = _SNDFILE_FILE_FORMAT[type] # <<<<<<<<<<<<<< - * except KeyError, e: - * raise ValueError("file format %s not recognized" % type) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L6_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_ctype = __pyx_t_1; - /* __pyx_t_1 released */ - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L10_try; - __pyx_L6_error:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":171 - * try: - * ctype = _SNDFILE_FILE_FORMAT[type] - * except KeyError, e: # <<<<<<<<<<<<<< - * raise ValueError("file format %s not recognized" % type) - * - */ - __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_3) { - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - Py_INCREF(__pyx_2); - Py_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_2; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":172 - * ctype = _SNDFILE_FILE_FORMAT[type] - * except KeyError, e: - * raise ValueError("file format %s not recognized" % type) # <<<<<<<<<<<<<< - * - * try: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_98, __pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - goto __pyx_L7_exception_handled; - } - __pyx_L8_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L7_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L10_try:; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":174 - * raise ValueError("file format %s not recognized" % type) - * - * try: # <<<<<<<<<<<<<< - * cendian = _SNDFILE_ENDIAN[endianness] - * except KeyError, e: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":175 - * - * try: - * cendian = _SNDFILE_ENDIAN[endianness] # <<<<<<<<<<<<<< - * except KeyError, e: - * raise ValueError("endianness %s not recognized" % endianness) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_endianness); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_v_cendian = __pyx_t_1; - /* __pyx_t_1 released */ - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L15_try; - __pyx_L11_error:; - Py_XDECREF(__pyx_4); __pyx_4 = 0; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":176 - * try: - * cendian = _SNDFILE_ENDIAN[endianness] - * except KeyError, e: # <<<<<<<<<<<<<< - * raise ValueError("endianness %s not recognized" % endianness) - * - */ - __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_3) { - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__"); - if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - Py_INCREF(__pyx_1); - Py_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":177 - * cendian = _SNDFILE_ENDIAN[endianness] - * except KeyError, e: - * raise ValueError("endianness %s not recognized" % endianness) # <<<<<<<<<<<<<< - * - * try: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_99, __pyx_v_endianness); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - goto __pyx_L12_exception_handled; - } - __pyx_L13_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L12_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L15_try:; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":179 - * raise ValueError("endianness %s not recognized" % endianness) - * - * try: # <<<<<<<<<<<<<< - * cencoding = _SNDFILE_ENCODING[encoding] - * except KeyError, e: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":180 - * - * try: - * cencoding = _SNDFILE_ENCODING[encoding] # <<<<<<<<<<<<<< - * except KeyError, e: - * raise ValueError("encoding %s not recognized" % encoding) - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;} - __pyx_1 = PyObject_GetItem(__pyx_4, __pyx_v_encoding); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_PyInt_int(__pyx_1); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L16_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_cencoding = __pyx_t_1; - /* __pyx_t_1 released */ - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L20_try; - __pyx_L16_error:; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - Py_XDECREF(__pyx_4); __pyx_4 = 0; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":181 - * try: - * cencoding = _SNDFILE_ENCODING[encoding] - * except KeyError, e: # <<<<<<<<<<<<<< - * raise ValueError("encoding %s not recognized" % encoding) - * - */ - __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); - if (__pyx_3) { - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.__init__"); - if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} - Py_INCREF(__pyx_4); - Py_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_4; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":182 - * cencoding = _SNDFILE_ENCODING[encoding] - * except KeyError, e: - * raise ValueError("encoding %s not recognized" % encoding) # <<<<<<<<<<<<<< - * - * format = ctype | cencoding | cendian - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_100, __pyx_v_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - goto __pyx_L17_exception_handled; - } - __pyx_L18_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L17_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L20_try:; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":184 - * raise ValueError("encoding %s not recognized" % encoding) - * - * format = ctype | cencoding | cendian # <<<<<<<<<<<<<< - * - * # Now, we need to test if the combination of format, encoding and - */ - __pyx_v_format = ((__pyx_v_ctype | __pyx_v_cencoding) | __pyx_v_cendian); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":193 - * # checked against values different than 1 or 2, so giving a value of 1 - * # to channel should be ok. - * self._sf_info.channels = 1 # <<<<<<<<<<<<<< - * self._sf_info.samplerate = 8000 - * self._sf_info.format = format - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.channels = 1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":194 - * # to channel should be ok. - * self._sf_info.channels = 1 - * self._sf_info.samplerate = 8000 # <<<<<<<<<<<<<< - * self._sf_info.format = format - * - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.samplerate = 8000; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":195 - * self._sf_info.channels = 1 - * self._sf_info.samplerate = 8000 - * self._sf_info.format = format # <<<<<<<<<<<<<< - * - * ret = sf_format_check(&self._sf_info) - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info.format = __pyx_v_format; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":197 - * self._sf_info.format = format - * - * ret = sf_format_check(&self._sf_info) # <<<<<<<<<<<<<< - * if ret is not SF_TRUE: - * msg = "The combination (type=%s|encoding=%s|endianness=%s) " \ - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(sf_format_check((&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_sf_info))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_t_2; - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":198 - * - * ret = sf_format_check(&self._sf_info) - * if ret is not SF_TRUE: # <<<<<<<<<<<<<< - * msg = "The combination (type=%s|encoding=%s|endianness=%s) " \ - * "you requested is not supported. " \ - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(SF_TRUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = (__pyx_v_ret != __pyx_t_2); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":199 - * ret = sf_format_check(&self._sf_info) - * if ret is not SF_TRUE: - * msg = "The combination (type=%s|encoding=%s|endianness=%s) " \ # <<<<<<<<<<<<<< - * "you requested is not supported. " \ - * "You can use available_formats and " \ - */ - Py_INCREF(__pyx_kp_101); - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_kp_101; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":204 - * "available_encodings functions to query which formats "\ - * "and encodings are available." - * raise ValueError(msg % (type, encoding, endianness)) # <<<<<<<<<<<<<< - * - * # Get the sndfile string description of the format type - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_type); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_type); - Py_INCREF(__pyx_v_encoding); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_encoding); - Py_INCREF(__pyx_v_endianness); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_endianness); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_v_msg, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L21; - } - __pyx_L21:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":207 - * - * # Get the sndfile string description of the format type - * format_info.format = ctype # <<<<<<<<<<<<<< - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) - */ - __pyx_v_format_info.format = __pyx_v_ctype; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":209 - * format_info.format = ctype - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) # <<<<<<<<<<<<<< - * if not st == 0: - * raise RuntimeError("Could not get format string for format "\ - */ - __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_INFO, (&__pyx_v_format_info), (sizeof(__pyx_v_format_info))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":210 - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) - * if not st == 0: # <<<<<<<<<<<<<< - * raise RuntimeError("Could not get format string for format "\ - * "%d, " % format_info.format + "please report this" \ - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = (!(__pyx_v_st == 0)); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":212 - * if not st == 0: - * raise RuntimeError("Could not get format string for format "\ - * "%d, " % format_info.format + "please report this" \ # <<<<<<<<<<<<<< - * "problem to the maintainer") - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_format_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_102, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_103); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L22; - } - __pyx_L22:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":216 - * - * self._format_str = PyString_FromStringAndSize(format_info.name, - * stdlib.strlen(format_info.name)) # <<<<<<<<<<<<<< - * - * # Get the sndfile string description of the encoding type - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_format_info.name, strlen(__pyx_v_format_info.name)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":215 - * "problem to the maintainer") - * - * self._format_str = PyString_FromStringAndSize(format_info.name, # <<<<<<<<<<<<<< - * stdlib.strlen(format_info.name)) - * - */ - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":219 - * - * # Get the sndfile string description of the encoding type - * format_info.format = cencoding # <<<<<<<<<<<<<< - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) - */ - __pyx_v_format_info.format = __pyx_v_cencoding; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":221 - * format_info.format = cencoding - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) # <<<<<<<<<<<<<< - * if not st == 0: - * raise RuntimeError("Could not get format string for format "\ - */ - __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_INFO, (&__pyx_v_format_info), (sizeof(__pyx_v_format_info))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":222 - * st = sf_command(NULL, SFC_GET_FORMAT_INFO, &format_info, - * sizeof(format_info)) - * if not st == 0: # <<<<<<<<<<<<<< - * raise RuntimeError("Could not get format string for format "\ - * "%d, " % format_info.format + "please report this" \ - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = (!(__pyx_v_st == 0)); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":224 - * if not st == 0: - * raise RuntimeError("Could not get format string for format "\ - * "%d, " % format_info.format + "please report this" \ # <<<<<<<<<<<<<< - * "problem to the maintainer") - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_format_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_104, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_105); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L23; - } - __pyx_L23:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":228 - * - * self._encoding_str = PyString_FromStringAndSize(format_info.name, - * stdlib.strlen(format_info.name)) # <<<<<<<<<<<<<< - * - * self._format_raw_int = format - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_format_info.name, strlen(__pyx_v_format_info.name)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":227 - * "problem to the maintainer") - * - * self._encoding_str = PyString_FromStringAndSize(format_info.name, # <<<<<<<<<<<<<< - * stdlib.strlen(format_info.name)) - * - */ - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":230 - * stdlib.strlen(format_info.name)) - * - * self._format_raw_int = format # <<<<<<<<<<<<<< - * - * property file_format: - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_raw_int = __pyx_v_format; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__init__"); - __pyx_r = -1; - __pyx_L0:; - Py_DECREF(__pyx_v_e); - Py_DECREF(__pyx_v_ret); - Py_DECREF(__pyx_v_msg); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":234 - * property file_format: - * """File format (wav, etc...).""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._type - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":235 - * """File format (wav, etc...).""" - * def __get__(self): - * return self._type # <<<<<<<<<<<<<< - * - * property encoding: - */ - Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type); - __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_type; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":239 - * property encoding: - * """File encoding (pcm16, etc...).""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._encoding - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":240 - * """File encoding (pcm16, etc...).""" - * def __get__(self): - * return self._encoding # <<<<<<<<<<<<<< - * - * property endianness: - */ - Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding); - __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":244 - * property endianness: - * """File endianness (file, little, etc...).""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._endianness - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":245 - * """File endianness (file, little, etc...).""" - * def __get__(self): - * return self._endianness # <<<<<<<<<<<<<< - * - * property file_format_description: - */ - Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness); - __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_endianness; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":249 - * property file_format_description: - * """File format description: the full description from sndfile.""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._format_str - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":250 - * """File format description: the full description from sndfile.""" - * def __get__(self): - * return self._format_str # <<<<<<<<<<<<<< - * - * property encoding_description: - */ - Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str); - __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":254 - * property encoding_description: - * """File encoding description: the full description from sndfile.""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._encoding_str - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":255 - * """File encoding description: the full description from sndfile.""" - * def __get__(self): - * return self._encoding_str # <<<<<<<<<<<<<< - * - * cdef int format_int(self): - */ - Py_INCREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str); - __pyx_r = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":257 - * return self._encoding_str - * - * cdef int format_int(self): # <<<<<<<<<<<<<< - * """Return the full format integer (binary OR of file format, encoding - * and endianness).""" - */ - -static int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_format_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) { - int __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":260 - * """Return the full format integer (binary OR of file format, encoding - * and endianness).""" - * return self._format_raw_int # <<<<<<<<<<<<<< - * - * cdef int file_format_int(self): - */ - __pyx_r = __pyx_v_self->_format_raw_int; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":262 - * return self._format_raw_int - * - * cdef int file_format_int(self): # <<<<<<<<<<<<<< - * """Return the file format int.""" - * return self._format_raw_int & SF_FORMAT_TYPEMASK - */ - -static int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) { - int __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":264 - * cdef int file_format_int(self): - * """Return the file format int.""" - * return self._format_raw_int & SF_FORMAT_TYPEMASK # <<<<<<<<<<<<<< - * - * cdef int encoding_int(self): - */ - __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_TYPEMASK); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":266 - * return self._format_raw_int & SF_FORMAT_TYPEMASK - * - * cdef int encoding_int(self): # <<<<<<<<<<<<<< - * """Return the encoding part of the format int.""" - * return self._format_raw_int & SF_FORMAT_SUBMASK - */ - -static int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) { - int __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":268 - * cdef int encoding_int(self): - * """Return the encoding part of the format int.""" - * return self._format_raw_int & SF_FORMAT_SUBMASK # <<<<<<<<<<<<<< - * - * cdef int endianness_int(self): - */ - __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_SUBMASK); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":270 - * return self._format_raw_int & SF_FORMAT_SUBMASK - * - * cdef int endianness_int(self): # <<<<<<<<<<<<<< - * """Return the endianness part of the format int.""" - * return self._format_raw_int & SF_FORMAT_ENDMASK - */ - -static int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self) { - int __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":272 - * cdef int endianness_int(self): - * """Return the endianness part of the format int.""" - * return self._format_raw_int & SF_FORMAT_ENDMASK # <<<<<<<<<<<<<< - * - * cdef int _is_equal(self, Format other): - */ - __pyx_r = (__pyx_v_self->_format_raw_int & SF_FORMAT_ENDMASK); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":274 - * return self._format_raw_int & SF_FORMAT_ENDMASK - * - * cdef int _is_equal(self, Format other): # <<<<<<<<<<<<<< - * return self._format_raw_int == other._format_raw_int - * - */ - -static int __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format__is_equal(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_self, struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_other) { - int __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":275 - * - * cdef int _is_equal(self, Format other): - * return self._format_raw_int == other._format_raw_int # <<<<<<<<<<<<<< - * - * def __copy__(self): - */ - __pyx_r = (__pyx_v_self->_format_raw_int == __pyx_v_other->_format_raw_int); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":277 - * return self._format_raw_int == other._format_raw_int - * - * def __copy__(self): # <<<<<<<<<<<<<< - * typ, enc, endian = int_to_format(self._format_raw_int) - * return Format(typ, enc, endian) - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__[] = "Format.__copy__(self)"; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_v_typ; - PyObject *__pyx_v_enc; - PyObject *__pyx_v_endian; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __pyx_v_typ = Py_None; Py_INCREF(Py_None); - __pyx_v_enc = Py_None; Py_INCREF(Py_None); - __pyx_v_endian = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":278 - * - * def __copy__(self): - * typ, enc, endian = int_to_format(self._format_raw_int) # <<<<<<<<<<<<<< - * return Format(typ, enc, endian) - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_raw_int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyTuple_CheckExact(__pyx_t_1) && PyTuple_GET_SIZE(__pyx_t_1) == 3) { - PyObject* tuple = __pyx_t_1; - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3); - __pyx_4 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_4); - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - Py_DECREF(__pyx_v_typ); - __pyx_v_typ = __pyx_2; - __pyx_2 = 0; - Py_DECREF(__pyx_v_enc); - __pyx_v_enc = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_endian); - __pyx_v_endian = __pyx_4; - __pyx_4 = 0; - } else { - __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_v_typ); - __pyx_v_typ = __pyx_2; - __pyx_2 = 0; - Py_DECREF(__pyx_v_enc); - __pyx_v_enc = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_endian); - __pyx_v_endian = __pyx_4; - __pyx_4 = 0; - } - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":279 - * def __copy__(self): - * typ, enc, endian = int_to_format(self._format_raw_int) - * return Format(typ, enc, endian) # <<<<<<<<<<<<<< - * - * def __deepcopy__(self): - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_typ); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_typ); - Py_INCREF(__pyx_v_enc); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_enc); - Py_INCREF(__pyx_v_endian); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_endian); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__copy__"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_typ); - Py_DECREF(__pyx_v_enc); - Py_DECREF(__pyx_v_endian); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":281 - * return Format(typ, enc, endian) - * - * def __deepcopy__(self): # <<<<<<<<<<<<<< - * return self.__copy__() - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__[] = "Format.__deepcopy__(self)"; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":282 - * - * def __deepcopy__(self): - * return self.__copy__() # <<<<<<<<<<<<<< - * - * def __richcmp__(self, other, int op): - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___copy__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__deepcopy__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":284 - * return self.__copy__() - * - * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< - * if not other.__class__ == self.__class__: - * raise NotImplementedError() - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { - PyObject *__pyx_v_eq; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __pyx_v_eq = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":285 - * - * def __richcmp__(self, other, int op): - * if not other.__class__ == self.__class__: # <<<<<<<<<<<<<< - * raise NotImplementedError() - * if Format._is_equal(self, other): - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_other, __pyx_kp___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = (!__pyx_t_2); - if (__pyx_t_3) { - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":286 - * def __richcmp__(self, other, int op): - * if not other.__class__ == self.__class__: - * raise NotImplementedError() # <<<<<<<<<<<<<< - * if Format._is_equal(self, other): - * eq = True - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_Raise(__pyx_t_1, 0, 0); - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":287 - * if not other.__class__ == self.__class__: - * raise NotImplementedError() - * if Format._is_equal(self, other): # <<<<<<<<<<<<<< - * eq = True - * else: - */ - if (!(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format->_is_equal(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self), ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_other)); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":288 - * raise NotImplementedError() - * if Format._is_equal(self, other): - * eq = True # <<<<<<<<<<<<<< - * else: - * eq = False - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_eq); - __pyx_v_eq = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L6; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":290 - * eq = True - * else: - * eq = False # <<<<<<<<<<<<<< - * if op == 2: - * return eq - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_eq); - __pyx_v_eq = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":291 - * else: - * eq = False - * if op == 2: # <<<<<<<<<<<<<< - * return eq - * elif op == 3: - */ - switch (__pyx_v_op) { - case 2: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":292 - * eq = False - * if op == 2: - * return eq # <<<<<<<<<<<<<< - * elif op == 3: - * return not eq - */ - Py_INCREF(__pyx_v_eq); - __pyx_r = __pyx_v_eq; - goto __pyx_L0; - break; - case 3: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":294 - * return eq - * elif op == 3: - * return not eq # <<<<<<<<<<<<<< - * else: - * raise TypeError() - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_eq); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - break; - default: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":296 - * return not eq - * else: - * raise TypeError() # <<<<<<<<<<<<<< - * - * # Syntactic sugar - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_Raise(__pyx_t_1, 0, 0); - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__richcmp__"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_eq); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":299 - * - * # Syntactic sugar - * def __str__(self): # <<<<<<<<<<<<<< - * s = ["Major Format: %s" % self._format_str] - * s += ["Encoding Format: %s" % self._encoding_str] - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__(PyObject *__pyx_v_self) { - PyObject *__pyx_v_s; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __pyx_v_s = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":300 - * # Syntactic sugar - * def __str__(self): - * s = ["Major Format: %s" % self._format_str] # <<<<<<<<<<<<<< - * s += ["Encoding Format: %s" % self._encoding_str] - * s += ["Endianness: %s" % self.endianness] - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_106, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_format_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_v_s); - __pyx_v_s = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":301 - * def __str__(self): - * s = ["Major Format: %s" % self._format_str] - * s += ["Encoding Format: %s" % self._encoding_str] # <<<<<<<<<<<<<< - * s += ["Endianness: %s" % self.endianness] - * return "\n".join(s) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_107, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_self)->_encoding_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":302 - * s = ["Major Format: %s" % self._format_str] - * s += ["Encoding Format: %s" % self._encoding_str] - * s += ["Endianness: %s" % self.endianness] # <<<<<<<<<<<<<< - * return "\n".join(s) - * - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_endianness); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_108, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":303 - * s += ["Encoding Format: %s" % self._encoding_str] - * s += ["Endianness: %s" % self.endianness] - * return "\n".join(s) # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __pyx_2 = PyObject_GetAttr(__pyx_kp_109, __pyx_kp_join); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__str__"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_s); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":305 - * return "\n".join(s) - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return self.__str__() - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":306 - * - * def __repr__(self): - * return self.__str__() # <<<<<<<<<<<<<< - * - * def available_file_formats(): - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___str__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Format.__repr__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":308 - * return self.__str__() - * - * def available_file_formats(): # <<<<<<<<<<<<<< - * """Return lists of available file formats supported by audiolab.""" - * ret = [] - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats(PyObject *__pyx_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats[] = "available_file_formats()\nReturn lists of available file formats supported by audiolab."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats(PyObject *__pyx_self, PyObject *unused) { - PyObject *__pyx_v_ret; - PyObject *__pyx_v_i; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - __pyx_self = __pyx_self; - __pyx_v_ret = Py_None; Py_INCREF(Py_None); - __pyx_v_i = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":310 - * def available_file_formats(): - * """Return lists of available file formats supported by audiolab.""" - * ret = [] # <<<<<<<<<<<<<< - * for i in _major_formats_int(): - * # Handle the case where libsndfile supports a format we don't - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_ret); - __pyx_v_ret = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":311 - * """Return lists of available file formats supported by audiolab.""" - * ret = [] - * for i in _major_formats_int(): # <<<<<<<<<<<<<< - * # Handle the case where libsndfile supports a format we don't - * if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK): - */ - /* __pyx_t_2 allocated */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; Py_INCREF(__pyx_t_3); - } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - for (;;) { - /* __pyx_t_1 allocated */ - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_1); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_1); __pyx_t_2++; - } else { - __pyx_t_1 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - Py_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":313 - * for i in _major_formats_int(): - * # Handle the case where libsndfile supports a format we don't - * if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK): # <<<<<<<<<<<<<< - * warnings.warn("Format %#10x supported by libsndfile but not " - * "yet supported by audiolab" % - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyNumber_And(__pyx_v_i, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - /* __pyx_t_6 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":314 - * # Handle the case where libsndfile supports a format we don't - * if not _ENUM_TO_STR_FILE_FORMAT.has_key(i & SF_FORMAT_TYPEMASK): - * warnings.warn("Format %#10x supported by libsndfile but not " # <<<<<<<<<<<<<< - * "yet supported by audiolab" % - * (i & SF_FORMAT_TYPEMASK)) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_warnings); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_warn); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":316 - * warnings.warn("Format %#10x supported by libsndfile but not " - * "yet supported by audiolab" % - * (i & SF_FORMAT_TYPEMASK)) # <<<<<<<<<<<<<< - * else: - * ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK]) - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_And(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyNumber_Remainder(__pyx_kp_110, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - goto __pyx_L7; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":318 - * (i & SF_FORMAT_TYPEMASK)) - * else: - * ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK]) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyInt_FromLong(SF_FORMAT_TYPEMASK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_And(__pyx_v_i, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_t_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - } - __pyx_L7:; - } - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":319 - * else: - * ret.append(_ENUM_TO_STR_FILE_FORMAT[i & SF_FORMAT_TYPEMASK]) - * return ret # <<<<<<<<<<<<<< - * - * def available_encodings(major): - */ - Py_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_3); - Py_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.available_file_formats"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_ret); - Py_DECREF(__pyx_v_i); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":321 - * return ret - * - * def available_encodings(major): # <<<<<<<<<<<<<< - * """Return lists of available encoding for the given major format.""" - * if not _SNDFILE_FILE_FORMAT.has_key(major): - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings(PyObject *__pyx_self, PyObject *__pyx_v_major); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings[] = "available_encodings(major)\nReturn lists of available encoding for the given major format."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings(PyObject *__pyx_self, PyObject *__pyx_v_major) { - PyObject *__pyx_v_ret; - PyObject *__pyx_v_i; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __pyx_self = __pyx_self; - __pyx_v_ret = Py_None; Py_INCREF(Py_None); - __pyx_v_i = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":323 - * def available_encodings(major): - * """Return lists of available encoding for the given major format.""" - * if not _SNDFILE_FILE_FORMAT.has_key(major): # <<<<<<<<<<<<<< - * raise ValueError("Unknown file format %s" % major) - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_major); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_major); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = (!__pyx_t_3); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":324 - * """Return lists of available encoding for the given major format.""" - * if not _SNDFILE_FILE_FORMAT.has_key(major): - * raise ValueError("Unknown file format %s" % major) # <<<<<<<<<<<<<< - * - * ret = [] - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_111, __pyx_v_major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":326 - * raise ValueError("Unknown file format %s" % major) - * - * ret = [] # <<<<<<<<<<<<<< - * for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]): - * # Handle the case where libsndfile supports an encoding we don't - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_ret); - __pyx_v_ret = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":327 - * - * ret = [] - * for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]): # <<<<<<<<<<<<<< - * # Handle the case where libsndfile supports an encoding we don't - * if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK): - */ - /* __pyx_t_5 allocated */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_v_major); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_6 allocated */ - __pyx_t_6 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_6 released */ - /* __pyx_t_1 allocated */ - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_2; Py_INCREF(__pyx_t_1); - } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - for (;;) { - /* __pyx_t_2 allocated */ - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); Py_INCREF(__pyx_t_2); __pyx_t_5++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); Py_INCREF(__pyx_t_2); __pyx_t_5++; - } else { - __pyx_t_2 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - Py_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_2; - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":329 - * for i in _sub_formats_int(_SNDFILE_FILE_FORMAT[major]): - * # Handle the case where libsndfile supports an encoding we don't - * if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK): # <<<<<<<<<<<<<< - * warnings.warn("Encoding %#10x supported by libsndfile but not " - * "yet supported by audiolab" % - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_has_key); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyNumber_And(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); - __pyx_t_7 = 0; - /* __pyx_t_7 released */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* __pyx_t_7 released */ - /* __pyx_t_8 allocated */ - __pyx_t_8 = (!__pyx_t_4); - if (__pyx_t_8) { - /* __pyx_t_8 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":330 - * # Handle the case where libsndfile supports an encoding we don't - * if not _ENUM_TO_STR_ENCODING.has_key(i & SF_FORMAT_SUBMASK): - * warnings.warn("Encoding %#10x supported by libsndfile but not " # <<<<<<<<<<<<<< - * "yet supported by audiolab" % - * (i & SF_FORMAT_SUBMASK)) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_warnings); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_warn); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":332 - * warnings.warn("Encoding %#10x supported by libsndfile but not " - * "yet supported by audiolab" % - * (i & SF_FORMAT_SUBMASK)) # <<<<<<<<<<<<<< - * else: - * ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK]) - */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_And(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* __pyx_t_7 released */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyNumber_Remainder(__pyx_kp_112, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); - __pyx_t_7 = 0; - /* __pyx_t_7 released */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* __pyx_t_7 released */ - goto __pyx_L8; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":334 - * (i & SF_FORMAT_SUBMASK)) - * else: - * ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK]) # <<<<<<<<<<<<<< - * return ret - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_7 allocated */ - __pyx_t_7 = PyInt_FromLong(SF_FORMAT_SUBMASK); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_And(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* __pyx_t_7 released */ - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_t_2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_ret, __pyx_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - } - __pyx_L8:; - } - /* __pyx_t_5 released */ - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":335 - * else: - * ret.append(_ENUM_TO_STR_ENCODING[i & SF_FORMAT_SUBMASK]) - * return ret # <<<<<<<<<<<<<< - * - * cdef _sub_formats_int(int format): - */ - Py_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.available_encodings"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_ret); - Py_DECREF(__pyx_v_i); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":337 - * return ret - * - * cdef _sub_formats_int(int format): # <<<<<<<<<<<<<< - * """Return list of subtype formats given the major format. - * - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__sub_formats_int(int __pyx_v_format) { - int __pyx_v_st; - int __pyx_v_nsub; - int __pyx_v_i; - SF_FORMAT_INFO __pyx_v_info; - SF_INFO __pyx_v_sfinfo; - PyObject *__pyx_v_subs; - PyObject *__pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_v_subs = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":347 - * cdef SF_INFO sfinfo - * - * st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int)) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("Error while calling sf_command") - */ - __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, (&__pyx_v_nsub), (sizeof(int))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":348 - * - * st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int)) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while calling sf_command") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_v_st; - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":349 - * st = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &nsub, sizeof(int)) - * if st: - * raise RuntimeError("Error while calling sf_command") # <<<<<<<<<<<<<< - * - * subs = [] - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_113); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_113); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":351 - * raise RuntimeError("Error while calling sf_command") - * - * subs = [] # <<<<<<<<<<<<<< - * # Not used, but necessary to pass sfinfo to sf_format_check - * sfinfo.channels = 1 - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_subs); - __pyx_v_subs = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":353 - * subs = [] - * # Not used, but necessary to pass sfinfo to sf_format_check - * sfinfo.channels = 1 # <<<<<<<<<<<<<< - * sfinfo.samplerate = 8000 - * for i in range(nsub): - */ - __pyx_v_sfinfo.channels = 1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":354 - * # Not used, but necessary to pass sfinfo to sf_format_check - * sfinfo.channels = 1 - * sfinfo.samplerate = 8000 # <<<<<<<<<<<<<< - * for i in range(nsub): - * info.format = i - */ - __pyx_v_sfinfo.samplerate = 8000; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":355 - * sfinfo.channels = 1 - * sfinfo.samplerate = 8000 - * for i in range(nsub): # <<<<<<<<<<<<<< - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nsub; __pyx_v_i+=1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":356 - * sfinfo.samplerate = 8000 - * for i in range(nsub): - * info.format = i # <<<<<<<<<<<<<< - * sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) - * format = (format & SF_FORMAT_TYPEMASK) | info.format - */ - __pyx_v_info.format = __pyx_v_i; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":357 - * for i in range(nsub): - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) # <<<<<<<<<<<<<< - * format = (format & SF_FORMAT_TYPEMASK) | info.format - * - */ - sf_command(NULL, SFC_GET_FORMAT_SUBTYPE, (&__pyx_v_info), (sizeof(__pyx_v_info))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":358 - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) - * format = (format & SF_FORMAT_TYPEMASK) | info.format # <<<<<<<<<<<<<< - * - * sfinfo.format = format - */ - __pyx_v_format = ((__pyx_v_format & SF_FORMAT_TYPEMASK) | __pyx_v_info.format); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":360 - * format = (format & SF_FORMAT_TYPEMASK) | info.format - * - * sfinfo.format = format # <<<<<<<<<<<<<< - * if sf_format_check(&sfinfo): - * subs.append(info.format) - */ - __pyx_v_sfinfo.format = __pyx_v_format; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":361 - * - * sfinfo.format = format - * if sf_format_check(&sfinfo): # <<<<<<<<<<<<<< - * subs.append(info.format) - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = sf_format_check((&__pyx_v_sfinfo)); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":362 - * sfinfo.format = format - * if sf_format_check(&sfinfo): - * subs.append(info.format) # <<<<<<<<<<<<<< - * - * return subs - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_subs, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - goto __pyx_L6; - } - __pyx_L6:; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":364 - * subs.append(info.format) - * - * return subs # <<<<<<<<<<<<<< - * - * cdef _major_formats_int(): - */ - Py_INCREF(__pyx_v_subs); - __pyx_r = __pyx_v_subs; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile._sub_formats_int"); - __pyx_r = 0; - __pyx_L0:; - Py_DECREF(__pyx_v_subs); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":366 - * return subs - * - * cdef _major_formats_int(): # <<<<<<<<<<<<<< - * """Return list of major format *integers*.""" - * cdef int st, nmajor - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile__major_formats_int(void) { - int __pyx_v_st; - int __pyx_v_nmajor; - int __pyx_v_i; - SF_FORMAT_INFO __pyx_v_info; - PyObject *__pyx_v_majors; - PyObject *__pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __pyx_v_majors = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":372 - * cdef SF_FORMAT_INFO info - * - * st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int)) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("Error while calling sf_command") - */ - __pyx_v_st = sf_command(NULL, SFC_GET_FORMAT_MAJOR_COUNT, (&__pyx_v_nmajor), (sizeof(int))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":373 - * - * st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int)) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while calling sf_command") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __pyx_v_st; - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":374 - * st = sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &nmajor, sizeof(int)) - * if st: - * raise RuntimeError("Error while calling sf_command") # <<<<<<<<<<<<<< - * - * majors = [] - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_114); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_114); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":376 - * raise RuntimeError("Error while calling sf_command") - * - * majors = [] # <<<<<<<<<<<<<< - * for i in range(nmajor): - * info.format = i - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_majors); - __pyx_v_majors = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":377 - * - * majors = [] - * for i in range(nmajor): # <<<<<<<<<<<<<< - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nmajor; __pyx_v_i+=1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":378 - * majors = [] - * for i in range(nmajor): - * info.format = i # <<<<<<<<<<<<<< - * sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) - * majors.append(info.format) - */ - __pyx_v_info.format = __pyx_v_i; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":379 - * for i in range(nmajor): - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) # <<<<<<<<<<<<<< - * majors.append(info.format) - * - */ - sf_command(NULL, SFC_GET_FORMAT_MAJOR, (&__pyx_v_info), (sizeof(__pyx_v_info))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":380 - * info.format = i - * sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) - * majors.append(info.format) # <<<<<<<<<<<<<< - * - * return majors - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_info.format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_majors, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":382 - * majors.append(info.format) - * - * return majors # <<<<<<<<<<<<<< - * - * cdef class Sndfile: - */ - Py_INCREF(__pyx_v_majors); - __pyx_r = __pyx_v_majors; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile._major_formats_int"); - __pyx_r = 0; - __pyx_L0:; - Py_DECREF(__pyx_v_majors); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":419 - * cdef int _mode - * cdef SF_INFO _sfinfo - * def __init__(Sndfile self, filename, mode='r', Format format=None, # <<<<<<<<<<<<<< - * int channels=0, int samplerate=0): - * cdef int sfmode - */ - -static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_filename = 0; - PyObject *__pyx_v_mode = 0; - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *__pyx_v_format = 0; - int __pyx_v_channels; - int __pyx_v_samplerate; - int __pyx_v_sfmode; - PyObject *__pyx_v_msg; - PyObject *__pyx_v_type; - PyObject *__pyx_v_enc; - PyObject *__pyx_v_endian; - int __pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - char *__pyx_t_8; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_mode,&__pyx_kp_format,&__pyx_kp_channels,&__pyx_kp_samplerate,0}; - __pyx_v_mode = __pyx_kp_90; - __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None); - __pyx_v_channels = 0; - __pyx_v_samplerate = 0; - if (unlikely(__pyx_kwds)) { - PyObject* values[5] = {0,0,0,0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_filename = values[0]; - if (values[1]) { - __pyx_v_mode = values[1]; - } - if (values[2]) { - __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)values[2]); - } - if (values[3]) { - __pyx_v_channels = __pyx_PyInt_int(values[3]); if (unlikely((__pyx_v_channels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[4]) { - __pyx_v_samplerate = __pyx_PyInt_int(values[4]); if (unlikely((__pyx_v_samplerate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: __pyx_v_samplerate = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_samplerate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 4: __pyx_v_channels = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_channels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 3: __pyx_v_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)PyTuple_GET_ITEM(__pyx_args, 2)); - case 2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__init__"); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_v_msg = Py_None; Py_INCREF(Py_None); - __pyx_v_type = Py_None; Py_INCREF(Py_None); - __pyx_v_enc = Py_None; Py_INCREF(Py_None); - __pyx_v_endian = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_format), __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format, 1, "format", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":424 - * # -1 will indicate that the file has been open from filename, not from - * # file descriptor - * self.fd = -1 # <<<<<<<<<<<<<< - * - * self.hdl = NULL - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd = -1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":426 - * self.fd = -1 - * - * self.hdl = NULL # <<<<<<<<<<<<<< - * - * # Check the mode is one of the expected values - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":429 - * - * # Check the mode is one of the expected values - * if mode == 'r': # <<<<<<<<<<<<<< - * sfmode = SFM_READ - * elif mode == 'w': - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_115, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":430 - * # Check the mode is one of the expected values - * if mode == 'r': - * sfmode = SFM_READ # <<<<<<<<<<<<<< - * elif mode == 'w': - * sfmode = SFM_WRITE - */ - __pyx_v_sfmode = SFM_READ; - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":431 - * if mode == 'r': - * sfmode = SFM_READ - * elif mode == 'w': # <<<<<<<<<<<<<< - * sfmode = SFM_WRITE - * if format is None: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_116, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":432 - * sfmode = SFM_READ - * elif mode == 'w': - * sfmode = SFM_WRITE # <<<<<<<<<<<<<< - * if format is None: - * raise ValueError, \ - */ - __pyx_v_sfmode = SFM_WRITE; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":433 - * elif mode == 'w': - * sfmode = SFM_WRITE - * if format is None: # <<<<<<<<<<<<<< - * raise ValueError, \ - * "For write mode, you should provide"\ - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = (((PyObject *)__pyx_v_format) == Py_None); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":435 - * if format is None: - * raise ValueError, \ - * "For write mode, you should provide"\ # <<<<<<<<<<<<<< - * "a format argument !" - * elif mode == 'rw': - */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_117, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":437 - * "For write mode, you should provide"\ - * "a format argument !" - * elif mode == 'rw': # <<<<<<<<<<<<<< - * sfmode = SFM_RDWR - * if format is None: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_118, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":438 - * "a format argument !" - * elif mode == 'rw': - * sfmode = SFM_RDWR # <<<<<<<<<<<<<< - * if format is None: - * raise ValueError, \ - */ - __pyx_v_sfmode = SFM_RDWR; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":439 - * elif mode == 'rw': - * sfmode = SFM_RDWR - * if format is None: # <<<<<<<<<<<<<< - * raise ValueError, \ - * "For write mode, you should provide"\ - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = (((PyObject *)__pyx_v_format) == Py_None); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":441 - * if format is None: - * raise ValueError, \ - * "For write mode, you should provide"\ # <<<<<<<<<<<<<< - * "a format argument !" - * else: - */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_119, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - goto __pyx_L6; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":444 - * "a format argument !" - * else: - * raise ValueError("mode %s not recognized" % str(mode)) # <<<<<<<<<<<<<< - * - * # Fill the sfinfo struct - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_mode); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mode); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_120, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_1, 0, 0); - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":447 - * - * # Fill the sfinfo struct - * self._sfinfo.frames = 0 # <<<<<<<<<<<<<< - * self._sfinfo.channels = channels - * self._sfinfo.samplerate = samplerate - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.frames = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":448 - * # Fill the sfinfo struct - * self._sfinfo.frames = 0 - * self._sfinfo.channels = channels # <<<<<<<<<<<<<< - * self._sfinfo.samplerate = samplerate - * - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels = __pyx_v_channels; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":449 - * self._sfinfo.frames = 0 - * self._sfinfo.channels = channels - * self._sfinfo.samplerate = samplerate # <<<<<<<<<<<<<< - * - * self._sfinfo.sections = 0 - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate = __pyx_v_samplerate; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":451 - * self._sfinfo.samplerate = samplerate - * - * self._sfinfo.sections = 0 # <<<<<<<<<<<<<< - * self._sfinfo.seekable = SF_FALSE - * if mode == 'r' and format is None: - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.sections = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":452 - * - * self._sfinfo.sections = 0 - * self._sfinfo.seekable = SF_FALSE # <<<<<<<<<<<<<< - * if mode == 'r' and format is None: - * self._sfinfo.format = 0 - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.seekable = SF_FALSE; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":453 - * self._sfinfo.sections = 0 - * self._sfinfo.seekable = SF_FALSE - * if mode == 'r' and format is None: # <<<<<<<<<<<<<< - * self._sfinfo.format = 0 - * else: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_121, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_4 allocated */ - __pyx_t_4 = (((PyObject *)__pyx_v_format) == Py_None); - /* __pyx_t_5 allocated */ - __pyx_t_5 = __pyx_t_4; - /* __pyx_t_4 released */ - } else { - __pyx_t_5 = __pyx_t_2; - /* __pyx_t_2 released */ - } - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":454 - * self._sfinfo.seekable = SF_FALSE - * if mode == 'r' and format is None: - * self._sfinfo.format = 0 # <<<<<<<<<<<<<< - * else: - * # XXX: do this correctly, by using sf_check - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format = 0; - goto __pyx_L9; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":457 - * else: - * # XXX: do this correctly, by using sf_check - * if samplerate == 0 or channels == 0: # <<<<<<<<<<<<<< - * raise ValueError, \ - * "Bad value of samplerate (%d) or channels (%d)" % \ - */ - if (!(__pyx_v_samplerate == 0)) { - /* __pyx_t_5 allocated */ - __pyx_t_5 = (__pyx_v_channels == 0); - } else { - __pyx_t_5 = (__pyx_v_samplerate == 0); - } - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":460 - * raise ValueError, \ - * "Bad value of samplerate (%d) or channels (%d)" % \ - * (samplerate, channels) # <<<<<<<<<<<<<< - * self._sfinfo.format = format.format_int() - * if sf_format_check(&self._sfinfo) == SF_FALSE: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_samplerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_channels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_122, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":461 - * "Bad value of samplerate (%d) or channels (%d)" % \ - * (samplerate, channels) - * self._sfinfo.format = format.format_int() # <<<<<<<<<<<<<< - * if sf_format_check(&self._sfinfo) == SF_FALSE: - * raise ValueError("Bad format specification: check arguments.") - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_v_format->__pyx_vtab)->format_int(__pyx_v_format); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":462 - * (samplerate, channels) - * self._sfinfo.format = format.format_int() - * if sf_format_check(&self._sfinfo) == SF_FALSE: # <<<<<<<<<<<<<< - * raise ValueError("Bad format specification: check arguments.") - * - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = (sf_format_check((&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo)) == SF_FALSE); - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":463 - * self._sfinfo.format = format.format_int() - * if sf_format_check(&self._sfinfo) == SF_FALSE: - * raise ValueError("Bad format specification: check arguments.") # <<<<<<<<<<<<<< - * - * # XXX: check how cython behave with this kind of code - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_123); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_123); - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_6, 0, 0); - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; - } - __pyx_L11:; - } - __pyx_L9:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":466 - * - * # XXX: check how cython behave with this kind of code - * if isinstance(filename, int): # <<<<<<<<<<<<<< - * self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE) - * self.fd = filename - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_TypeCheck(__pyx_v_filename, ((PyTypeObject *)((PyObject*)&PyInt_Type))); - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":467 - * # XXX: check how cython behave with this kind of code - * if isinstance(filename, int): - * self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE) # <<<<<<<<<<<<<< - * self.fd = filename - * self.filename = "" - */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = __pyx_PyInt_int(__pyx_v_filename); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = sf_open_fd(__pyx_t_7, __pyx_v_sfmode, (&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo), SF_FALSE); - /* __pyx_t_7 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":468 - * if isinstance(filename, int): - * self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE) - * self.fd = filename # <<<<<<<<<<<<<< - * self.filename = "" - * else: - */ - /* __pyx_t_7 allocated */ - __pyx_t_7 = __pyx_PyInt_int(__pyx_v_filename); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd = __pyx_t_7; - /* __pyx_t_7 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":469 - * self.hdl = sf_open_fd(filename, sfmode, &self._sfinfo, SF_FALSE) - * self.fd = filename - * self.filename = "" # <<<<<<<<<<<<<< - * else: - * self.hdl = sf_open(filename, sfmode, &self._sfinfo) - */ - Py_INCREF(__pyx_kp_124); - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename = __pyx_kp_124; - goto __pyx_L12; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":471 - * self.filename = "" - * else: - * self.hdl = sf_open(filename, sfmode, &self._sfinfo) # <<<<<<<<<<<<<< - * self.filename = filename - * self._mode = sfmode - */ - /* __pyx_t_8 allocated */ - __pyx_t_8 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl = sf_open(__pyx_t_8, __pyx_v_sfmode, (&((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo)); - /* __pyx_t_8 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":472 - * else: - * self.hdl = sf_open(filename, sfmode, &self._sfinfo) - * self.filename = filename # <<<<<<<<<<<<<< - * self._mode = sfmode - * - */ - Py_INCREF(__pyx_v_filename); - Py_DECREF(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename = __pyx_v_filename; - } - __pyx_L12:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":473 - * self.hdl = sf_open(filename, sfmode, &self._sfinfo) - * self.filename = filename - * self._mode = sfmode # <<<<<<<<<<<<<< - * - * if self.hdl == NULL: - */ - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_mode = __pyx_v_sfmode; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":475 - * self._mode = sfmode - * - * if self.hdl == NULL: # <<<<<<<<<<<<<< - * if self.fd == -1: - * msg = "error while opening file %s\n\t-> " % self.filename - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl == NULL); - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":476 - * - * if self.hdl == NULL: - * if self.fd == -1: # <<<<<<<<<<<<<< - * msg = "error while opening file %s\n\t-> " % self.filename - * else: - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1); - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":477 - * if self.hdl == NULL: - * if self.fd == -1: - * msg = "error while opening file %s\n\t-> " % self.filename # <<<<<<<<<<<<<< - * else: - * msg = "error while opening file descriptor %d\n\t->" % self.fd - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyNumber_Remainder(__pyx_kp_125, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_t_6; - __pyx_t_6 = 0; - /* __pyx_t_6 released */ - goto __pyx_L14; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":479 - * msg = "error while opening file %s\n\t-> " % self.filename - * else: - * msg = "error while opening file descriptor %d\n\t->" % self.fd # <<<<<<<<<<<<<< - * msg += sf_strerror(self.hdl) - * if not self.fd == -1: - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_126, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - } - __pyx_L14:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":480 - * else: - * msg = "error while opening file descriptor %d\n\t->" % self.fd - * msg += sf_strerror(self.hdl) # <<<<<<<<<<<<<< - * if not self.fd == -1: - * msg += """ - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = __Pyx_PyBytes_FromString(sf_strerror(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":481 - * msg = "error while opening file descriptor %d\n\t->" % self.fd - * msg += sf_strerror(self.hdl) - * if not self.fd == -1: # <<<<<<<<<<<<<< - * msg += """ - * (Check that the mode argument passed to sndfile is the same than the one used - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = (!(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1)); - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":482 - * msg += sf_strerror(self.hdl) - * if not self.fd == -1: - * msg += """ # <<<<<<<<<<<<<< - * (Check that the mode argument passed to sndfile is the same than the one used - * when getting the file descriptor, eg do not pass 'r' to sndfile if you - */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_127); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_1; - __pyx_1 = 0; - goto __pyx_L15; - } - __pyx_L15:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":488 - * win32, you are out of luck, because its implementation of POSIX open is - * broken)""" - * raise IOError("error while opening %s\n\t->%s" % (filename, msg)) # <<<<<<<<<<<<<< - * - * if mode == 'r': - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_filename); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename); - Py_INCREF(__pyx_v_msg); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_msg); - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyNumber_Remainder(__pyx_kp_128, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - /* __pyx_t_6 released */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_6, 0, 0); - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":490 - * raise IOError("error while opening %s\n\t->%s" % (filename, msg)) - * - * if mode == 'r': # <<<<<<<<<<<<<< - * type, enc, endian = int_to_format(self._sfinfo.format) - * self._format = Format(type, enc, endian) - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_129, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - if (__pyx_t_5) { - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":491 - * - * if mode == 'r': - * type, enc, endian = int_to_format(self._sfinfo.format) # <<<<<<<<<<<<<< - * self._format = Format(type, enc, endian) - * else: - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyTuple_CheckExact(__pyx_t_6) && PyTuple_GET_SIZE(__pyx_t_6) == 3) { - PyObject* tuple = __pyx_t_6; - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3); - __pyx_4 = PyTuple_GET_ITEM(tuple, 2); Py_INCREF(__pyx_4); - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - Py_DECREF(__pyx_v_type); - __pyx_v_type = __pyx_2; - __pyx_2 = 0; - Py_DECREF(__pyx_v_enc); - __pyx_v_enc = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_endian); - __pyx_v_endian = __pyx_4; - __pyx_4 = 0; - } else { - __pyx_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_v_type); - __pyx_v_type = __pyx_2; - __pyx_2 = 0; - Py_DECREF(__pyx_v_enc); - __pyx_v_enc = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_v_endian); - __pyx_v_endian = __pyx_4; - __pyx_4 = 0; - } - /* __pyx_t_6 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":492 - * if mode == 'r': - * type, enc, endian = int_to_format(self._sfinfo.format) - * self._format = Format(type, enc, endian) # <<<<<<<<<<<<<< - * else: - * self._format = format - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_type); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_type); - Py_INCREF(__pyx_v_enc); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_enc); - Py_INCREF(__pyx_v_endian); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_endian); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* __pyx_t_6 released */ - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L16; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":494 - * self._format = Format(type, enc, endian) - * else: - * self._format = format # <<<<<<<<<<<<<< - * - * # XXX: Handle FLAC problem - */ - Py_INCREF(((PyObject *)__pyx_v_format)); - Py_DECREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); - ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format = __pyx_v_format; - } - __pyx_L16:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_3); - Py_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__init__"); - __pyx_r = -1; - __pyx_L0:; - Py_DECREF(__pyx_v_msg); - Py_DECREF(__pyx_v_type); - Py_DECREF(__pyx_v_enc); - Py_DECREF(__pyx_v_endian); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":498 - * # XXX: Handle FLAC problem - * - * def __dealloc__(Sndfile self): # <<<<<<<<<<<<<< - * self._close() - * - */ - -static void __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(PyObject *__pyx_v_self) { - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":499 - * - * def __dealloc__(Sndfile self): - * self._close() # <<<<<<<<<<<<<< - * - * cdef _close(Sndfile self): - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__dealloc__"); - __pyx_L0:; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":501 - * self._close() - * - * cdef _close(Sndfile self): # <<<<<<<<<<<<<< - * if self.hdl: - * sf_close(self.hdl) - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__close(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self) { - PyObject *__pyx_r; - int __pyx_t_1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":502 - * - * cdef _close(Sndfile self): - * if self.hdl: # <<<<<<<<<<<<<< - * sf_close(self.hdl) - * self.hdl = NULL - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (__pyx_v_self->hdl != 0); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":503 - * cdef _close(Sndfile self): - * if self.hdl: - * sf_close(self.hdl) # <<<<<<<<<<<<<< - * self.hdl = NULL - * - */ - sf_close(__pyx_v_self->hdl); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":504 - * if self.hdl: - * sf_close(self.hdl) - * self.hdl = NULL # <<<<<<<<<<<<<< - * - * def close(Sndfile self): - */ - __pyx_v_self->hdl = NULL; - goto __pyx_L3; - } - __pyx_L3:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":506 - * self.hdl = NULL - * - * def close(Sndfile self): # <<<<<<<<<<<<<< - * """close the file.""" - * self._close() - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close[] = "Sndfile.close(self)\nclose the file."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":508 - * def close(Sndfile self): - * """close the file.""" - * self._close() # <<<<<<<<<<<<<< - * - * def sync(Sndfile self): - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_close(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.close"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":510 - * self._close() - * - * def sync(Sndfile self): # <<<<<<<<<<<<<< - * """\ - * call the operating system's function to force the writing of all - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync[] = "Sndfile.sync(self)\n call the operating system's function to force the writing of all\n file cache buffers to disk the file.\n\n No effect if file is open as read"; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":516 - * - * No effect if file is open as read""" - * sf_write_sync(self.hdl) # <<<<<<<<<<<<<< - * - * # Functions to get informations about the file - */ - sf_write_sync(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl); - - __pyx_r = Py_None; Py_INCREF(Py_None); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":524 - * # return self.nframes - * - * cdef sf_count_t _get_nframes(self): # <<<<<<<<<<<<<< - * """ Return the number of frames of the file""" - * if self._mode == SFM_READ: - */ - -static sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__get_nframes(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self) { - sf_count_t __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":526 - * cdef sf_count_t _get_nframes(self): - * """ Return the number of frames of the file""" - * if self._mode == SFM_READ: # <<<<<<<<<<<<<< - * # XXX: is this reliable for any file (think pipe and co ?) - * return self._sfinfo.frames - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (__pyx_v_self->_mode == SFM_READ); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":528 - * if self._mode == SFM_READ: - * # XXX: is this reliable for any file (think pipe and co ?) - * return self._sfinfo.frames # <<<<<<<<<<<<<< - * - * # In write/rwrite mode, the only reliable way to get the number of - */ - __pyx_r = __pyx_v_self->_sfinfo.frames; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":532 - * # In write/rwrite mode, the only reliable way to get the number of - * # frames is to use seek. - * raise NotImplementedError("Sorry, getting the current number of" # <<<<<<<<<<<<<< - * "frames in write modes is not supported yet") - * - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_130); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_130); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("scikits.audiolab.pysndfile._sndfile.Sndfile._get_nframes"); - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":537 - * property nframes: - * """Number of frames of the file.""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._get_nframes() - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":538 - * """Number of frames of the file.""" - * def __get__(self): - * return self._get_nframes() # <<<<<<<<<<<<<< - * - * property samplerate: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->_get_nframes(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.nframes.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":542 - * property samplerate: - * """Sampling rate (in Hz).""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._sfinfo.samplerate - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":543 - * """Sampling rate (in Hz).""" - * def __get__(self): - * return self._sfinfo.samplerate # <<<<<<<<<<<<<< - * - * property channels: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.samplerate.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":547 - * property channels: - * """Number of channels.""" - * def __get__(self): # <<<<<<<<<<<<<< - * return self._sfinfo.channels - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":548 - * """Number of channels.""" - * def __get__(self): - * return self._sfinfo.channels # <<<<<<<<<<<<<< - * - * property format: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.channels.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":552 - * property format: - * """Format instance attached to the Sndfile instance.""" - * def __get__(self): # <<<<<<<<<<<<<< - * return copy.copy(self._format) - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":553 - * """Format instance attached to the Sndfile instance.""" - * def __get__(self): - * return copy.copy(self._format) # <<<<<<<<<<<<<< - * - * # Those are convenience: they can be accessed from the format object - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.format.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":558 - * # attached to the Sndfile instance. - * property file_format: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._format.file_format - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":559 - * property file_format: - * def __get__(self): - * return self._format.file_format # <<<<<<<<<<<<<< - * - * property encoding: - */ - __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_file_format); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.file_format.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":562 - * - * property encoding: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._format.encoding - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":563 - * property encoding: - * def __get__(self): - * return self._format.encoding # <<<<<<<<<<<<<< - * - * property endianness: - */ - __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_encoding); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.encoding.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":566 - * - * property endianness: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._format.endianness - * - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":567 - * property endianness: - * def __get__(self): - * return self._format.endianness # <<<<<<<<<<<<<< - * - * def __str__(Sndfile self): - */ - __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format), __pyx_kp_endianness); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.endianness.__get__"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":569 - * return self._format.endianness - * - * def __str__(Sndfile self): # <<<<<<<<<<<<<< - * repstr = ["----------------------------------------"] - * if not self.fd == -1: - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__(PyObject *__pyx_v_self) { - PyObject *__pyx_v_repstr; - PyObject *__pyx_v_seek; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __pyx_v_repstr = Py_None; Py_INCREF(Py_None); - __pyx_v_seek = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":570 - * - * def __str__(Sndfile self): - * repstr = ["----------------------------------------"] # <<<<<<<<<<<<<< - * if not self.fd == -1: - * repstr += ["File : %d (opened by file descriptor)" % self.fd] - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_131); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_131); - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":571 - * def __str__(Sndfile self): - * repstr = ["----------------------------------------"] - * if not self.fd == -1: # <<<<<<<<<<<<<< - * repstr += ["File : %d (opened by file descriptor)" % self.fd] - * else: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = (!(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd == -1)); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":572 - * repstr = ["----------------------------------------"] - * if not self.fd == -1: - * repstr += ["File : %d (opened by file descriptor)" % self.fd] # <<<<<<<<<<<<<< - * else: - * repstr += ["File : %s" % self.filename] - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_132, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - goto __pyx_L5; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":574 - * repstr += ["File : %d (opened by file descriptor)" % self.fd] - * else: - * repstr += ["File : %s" % self.filename] # <<<<<<<<<<<<<< - * repstr += ["Channels : %d" % self._sfinfo.channels] - * repstr += ["Sample rate : %d" % self._sfinfo.samplerate] - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_133, ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":575 - * else: - * repstr += ["File : %s" % self.filename] - * repstr += ["Channels : %d" % self._sfinfo.channels] # <<<<<<<<<<<<<< - * repstr += ["Sample rate : %d" % self._sfinfo.samplerate] - * repstr += ["Frames : %d" % self._sfinfo.frames] - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_134, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":576 - * repstr += ["File : %s" % self.filename] - * repstr += ["Channels : %d" % self._sfinfo.channels] - * repstr += ["Sample rate : %d" % self._sfinfo.samplerate] # <<<<<<<<<<<<<< - * repstr += ["Frames : %d" % self._sfinfo.frames] - * repstr += ["Raw Format : %#010x" % self._format.format_int()] - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.samplerate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_135, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":577 - * repstr += ["Channels : %d" % self._sfinfo.channels] - * repstr += ["Sample rate : %d" % self._sfinfo.samplerate] - * repstr += ["Frames : %d" % self._sfinfo.frames] # <<<<<<<<<<<<<< - * repstr += ["Raw Format : %#010x" % self._format.format_int()] - * repstr += ["File format : %s" % self.file_format] - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.frames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_136, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":578 - * repstr += ["Sample rate : %d" % self._sfinfo.samplerate] - * repstr += ["Frames : %d" % self._sfinfo.frames] - * repstr += ["Raw Format : %#010x" % self._format.format_int()] # <<<<<<<<<<<<<< - * repstr += ["File format : %s" % self.file_format] - * repstr += ["Encoding : %s" % self.encoding] - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format->__pyx_vtab)->format_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_format)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_137, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":579 - * repstr += ["Frames : %d" % self._sfinfo.frames] - * repstr += ["Raw Format : %#010x" % self._format.format_int()] - * repstr += ["File format : %s" % self.file_format] # <<<<<<<<<<<<<< - * repstr += ["Encoding : %s" % self.encoding] - * repstr += ["Endianness : %s" % self.endianness] - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_file_format); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_138, __pyx_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":580 - * repstr += ["Raw Format : %#010x" % self._format.format_int()] - * repstr += ["File format : %s" % self.file_format] - * repstr += ["Encoding : %s" % self.encoding] # <<<<<<<<<<<<<< - * repstr += ["Endianness : %s" % self.endianness] - * #repstr += "Sections : %d\n" % self._sfinfo.sections - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_encoding); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_139, __pyx_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_2; - __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":581 - * repstr += ["File format : %s" % self.file_format] - * repstr += ["Encoding : %s" % self.encoding] - * repstr += ["Endianness : %s" % self.endianness] # <<<<<<<<<<<<<< - * #repstr += "Sections : %d\n" % self._sfinfo.sections - * if self._sfinfo.seekable == SF_TRUE: - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_endianness); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_140, __pyx_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":583 - * repstr += ["Endianness : %s" % self.endianness] - * #repstr += "Sections : %d\n" % self._sfinfo.sections - * if self._sfinfo.seekable == SF_TRUE: # <<<<<<<<<<<<<< - * seek = True - * else: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = (((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.seekable == SF_TRUE); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":584 - * #repstr += "Sections : %d\n" % self._sfinfo.sections - * if self._sfinfo.seekable == SF_TRUE: - * seek = True # <<<<<<<<<<<<<< - * else: - * seek = False - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_seek); - __pyx_v_seek = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L6; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":586 - * seek = True - * else: - * seek = False # <<<<<<<<<<<<<< - * repstr += ["Seekable : %s\n" % seek] - * #repstr += "Duration : %s\n" % self._generate_duration_str() - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_seek); - __pyx_v_seek = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":587 - * else: - * seek = False - * repstr += ["Seekable : %s\n" % seek] # <<<<<<<<<<<<<< - * #repstr += "Duration : %s\n" % self._generate_duration_str() - * return "\n".join(repstr) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_141, __pyx_v_seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __pyx_2 = PyNumber_InPlaceAdd(__pyx_v_repstr, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_repstr); - __pyx_v_repstr = __pyx_2; - __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":589 - * repstr += ["Seekable : %s\n" % seek] - * #repstr += "Duration : %s\n" % self._generate_duration_str() - * return "\n".join(repstr) # <<<<<<<<<<<<<< - * - * def read_frames(self, sf_count_t nframes, dtype=np.float64): - */ - __pyx_1 = PyObject_GetAttr(__pyx_kp_142, __pyx_kp_join); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_repstr); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_repstr); - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.__str__"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_repstr); - Py_DECREF(__pyx_v_seek); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":591 - * return "\n".join(repstr) - * - * def read_frames(self, sf_count_t nframes, dtype=np.float64): # <<<<<<<<<<<<<< - * """\ - * Read the given number of frames and put the data into a numpy array of - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames[] = "Sndfile.read_frames(self, scikits.audiolab.pysndfile.sndfile.sf_count_t nframes, dtype=<\077\077?>)\n Read the given number of frames and put the data into a numpy array of\n the requested dtype.\n\n Parameters\n ----------\n nframes : int\n number of frames to read.\n dtype : numpy dtype\n dtype of the returned array containing read data (see note).\n\n Notes\n -----\n One column per channel.\n\n Updates the read pointer.\n\n Notes\n -----\n if float are requested when the file contains integer data, you will\n get normalized data (that is the max possible integer will be 1.0, and\n the minimal possible value -1.0).\n\n if integers are requested when the file contains floating point data,\n it may give wrong results because there is an ambiguity: if the\n floating data are normalized, you can get a file with only 0 ! Getting\n integer data from files encoded in normalized floating point is not\n supported (this is an audiolab limitation: sndfile supports it)."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - sf_count_t __pyx_v_nframes; - PyObject *__pyx_v_dtype = 0; - PyObject *__pyx_v_y; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_nframes,&__pyx_kp_dtype,0}; - __pyx_v_dtype = __pyx_k_92; - if (unlikely(__pyx_kwds)) { - PyObject* values[2] = {0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nframes); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_frames") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_nframes = __pyx_PyInt_AsLongLong(values[0]); if (unlikely((__pyx_v_nframes == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[1]) { - __pyx_v_dtype = values[1]; - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_dtype = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_nframes = __pyx_PyInt_AsLongLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_nframes == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_frames", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_y = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":620 - * integer data from files encoded in normalized floating point is not - * supported (this is an audiolab limitation: sndfile supports it).""" - * if nframes < 0: # <<<<<<<<<<<<<< - * raise ValueError("number of frames has to be >= 0 (was %d)" % - * nframes) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (__pyx_v_nframes < 0); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":622 - * if nframes < 0: - * raise ValueError("number of frames has to be >= 0 (was %d)" % - * nframes) # <<<<<<<<<<<<<< - * - * # TODO: inout argument - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_143, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":627 - * # XXX: rank 1 vs rank 2 for mono ? - * # XXX: endianness of dtype vs endianness of sndfile ? - * if dtype == np.float64: # <<<<<<<<<<<<<< - * y = self.read_frames_double(nframes) - * elif dtype == np.float32: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_91); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":628 - * # XXX: endianness of dtype vs endianness of sndfile ? - * if dtype == np.float64: - * y = self.read_frames_double(nframes) # <<<<<<<<<<<<<< - * elif dtype == np.float32: - * y = self.read_frames_float(nframes) - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_double(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_y); - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L7; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":629 - * if dtype == np.float64: - * y = self.read_frames_double(nframes) - * elif dtype == np.float32: # <<<<<<<<<<<<<< - * y = self.read_frames_float(nframes) - * elif dtype == np.int32: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_144); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":630 - * y = self.read_frames_double(nframes) - * elif dtype == np.float32: - * y = self.read_frames_float(nframes) # <<<<<<<<<<<<<< - * elif dtype == np.int32: - * y = self.read_frames_int(nframes) - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_float(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_y); - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L7; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":631 - * elif dtype == np.float32: - * y = self.read_frames_float(nframes) - * elif dtype == np.int32: # <<<<<<<<<<<<<< - * y = self.read_frames_int(nframes) - * elif dtype == np.int16: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_145); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":632 - * y = self.read_frames_float(nframes) - * elif dtype == np.int32: - * y = self.read_frames_int(nframes) # <<<<<<<<<<<<<< - * elif dtype == np.int16: - * y = self.read_frames_short(nframes) - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_y); - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L7; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":633 - * elif dtype == np.int32: - * y = self.read_frames_int(nframes) - * elif dtype == np.int16: # <<<<<<<<<<<<<< - * y = self.read_frames_short(nframes) - * else: - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_146); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":634 - * y = self.read_frames_int(nframes) - * elif dtype == np.int16: - * y = self.read_frames_short(nframes) # <<<<<<<<<<<<<< - * else: - * RuntimeError("Sorry, dtype %s not supported" % str(dtype)) - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = ((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->read_frames_short(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), __pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_y); - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L7; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":636 - * y = self.read_frames_short(nframes) - * else: - * RuntimeError("Sorry, dtype %s not supported" % str(dtype)) # <<<<<<<<<<<<<< - * - * if y.shape[1] == 1: - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_dtype); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dtype); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_147, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - } - __pyx_L7:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":638 - * RuntimeError("Sorry, dtype %s not supported" % str(dtype)) - * - * if y.shape[1] == 1: # <<<<<<<<<<<<<< - * return y[:, 0] - * return y - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_y, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetItemInt(__pyx_1, 1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_RichCompare(__pyx_2, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":639 - * - * if y.shape[1] == 1: - * return y[:, 0] # <<<<<<<<<<<<<< - * return y - * - */ - __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - Py_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); - __pyx_1 = 0; - __pyx_2 = PyObject_GetItem(__pyx_v_y, ((PyObject *)__pyx_t_3)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_r = __pyx_2; - __pyx_2 = 0; - goto __pyx_L0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":640 - * if y.shape[1] == 1: - * return y[:, 0] - * return y # <<<<<<<<<<<<<< - * - * cdef read_frames_double(Sndfile self, sf_count_t nframes): - */ - Py_INCREF(__pyx_v_y); - __pyx_r = __pyx_v_y; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_y); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":642 - * return y - * - * cdef read_frames_double(Sndfile self, sf_count_t nframes): # <<<<<<<<<<<<<< - * cdef cnp.ndarray[cnp.float64_t, ndim=2] ty - * cdef sf_count_t res - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_double(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) { - PyArrayObject *__pyx_v_ty; - sf_count_t __pyx_v_res; - Py_buffer __pyx_bstruct_ty; - Py_ssize_t __pyx_bstride_0_ty = 0; - Py_ssize_t __pyx_bstride_1_ty = 0; - Py_ssize_t __pyx_bshape_0_ty = 0; - Py_ssize_t __pyx_bshape_1_ty = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyArrayObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_bstruct_ty.buf = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":646 - * cdef sf_count_t res - * - * ty = np.empty((nframes, self._sfinfo.channels), # <<<<<<<<<<<<<< - * dtype=np.float64, order='C') - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":647 - * - * ty = np.empty((nframes, self._sfinfo.channels), - * dtype=np.float64, order='C') # <<<<<<<<<<<<<< - * - * res = sf_readf_double(self.hdl, ty.data, nframes) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_91); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_148) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_5 < 0)) { - /* __pyx_t_6 allocated */ - /* __pyx_t_7 allocated */ - /* __pyx_t_8 allocated */ - PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); - /* __pyx_t_6 released */ - /* __pyx_t_7 released */ - /* __pyx_t_8 released */ - } - } - __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1]; - __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1]; - if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 released */ - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - Py_DECREF(((PyObject *)__pyx_v_ty)); - __pyx_v_ty = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":649 - * dtype=np.float64, order='C') - * - * res = sf_readf_double(self.hdl, ty.data, nframes) # <<<<<<<<<<<<<< - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - */ - __pyx_v_res = sf_readf_double(__pyx_v_self->hdl, ((double *)__pyx_v_ty->data), __pyx_v_nframes); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":650 - * - * res = sf_readf_double(self.hdl, ty.data, nframes) - * if not res == nframes: # <<<<<<<<<<<<<< - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty - */ - /* __pyx_t_9 allocated */ - __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes)); - if (__pyx_t_9) { - /* __pyx_t_9 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":651 - * res = sf_readf_double(self.hdl, ty.data, nframes) - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) # <<<<<<<<<<<<<< - * return ty - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_149, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":652 - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty # <<<<<<<<<<<<<< - * - * cdef read_frames_float(Sndfile self, sf_count_t nframes): - */ - Py_INCREF(((PyObject *)__pyx_v_ty)); - __pyx_r = ((PyObject *)__pyx_v_ty); - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_double"); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __pyx_L2:; - Py_DECREF(__pyx_v_ty); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":654 - * return ty - * - * cdef read_frames_float(Sndfile self, sf_count_t nframes): # <<<<<<<<<<<<<< - * cdef cnp.ndarray[cnp.float32_t, ndim=2] ty - * cdef sf_count_t res - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_float(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) { - PyArrayObject *__pyx_v_ty; - sf_count_t __pyx_v_res; - Py_buffer __pyx_bstruct_ty; - Py_ssize_t __pyx_bstride_0_ty = 0; - Py_ssize_t __pyx_bstride_1_ty = 0; - Py_ssize_t __pyx_bshape_0_ty = 0; - Py_ssize_t __pyx_bshape_1_ty = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyArrayObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_bstruct_ty.buf = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":659 - * - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), # <<<<<<<<<<<<<< - * dtype=np.float32, order='F') - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":660 - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), - * dtype=np.float32, order='F') # <<<<<<<<<<<<<< - * - * res = sf_readf_float(self.hdl, ty.data, nframes) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_144); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_150) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_5 < 0)) { - /* __pyx_t_6 allocated */ - /* __pyx_t_7 allocated */ - /* __pyx_t_8 allocated */ - PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); - /* __pyx_t_6 released */ - /* __pyx_t_7 released */ - /* __pyx_t_8 released */ - } - } - __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1]; - __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1]; - if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 released */ - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - Py_DECREF(((PyObject *)__pyx_v_ty)); - __pyx_v_ty = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":662 - * dtype=np.float32, order='F') - * - * res = sf_readf_float(self.hdl, ty.data, nframes) # <<<<<<<<<<<<<< - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - */ - __pyx_v_res = sf_readf_float(__pyx_v_self->hdl, ((float *)__pyx_v_ty->data), __pyx_v_nframes); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":663 - * - * res = sf_readf_float(self.hdl, ty.data, nframes) - * if not res == nframes: # <<<<<<<<<<<<<< - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty - */ - /* __pyx_t_9 allocated */ - __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes)); - if (__pyx_t_9) { - /* __pyx_t_9 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":664 - * res = sf_readf_float(self.hdl, ty.data, nframes) - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) # <<<<<<<<<<<<<< - * return ty - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_151, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":665 - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty # <<<<<<<<<<<<<< - * - * cdef read_frames_int(Sndfile self, sf_count_t nframes): - */ - Py_INCREF(((PyObject *)__pyx_v_ty)); - __pyx_r = ((PyObject *)__pyx_v_ty); - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_float"); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __pyx_L2:; - Py_DECREF(__pyx_v_ty); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":667 - * return ty - * - * cdef read_frames_int(Sndfile self, sf_count_t nframes): # <<<<<<<<<<<<<< - * cdef cnp.ndarray[cnp.int32_t, ndim=2] ty - * cdef sf_count_t res - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) { - PyArrayObject *__pyx_v_ty; - sf_count_t __pyx_v_res; - Py_buffer __pyx_bstruct_ty; - Py_ssize_t __pyx_bstride_0_ty = 0; - Py_ssize_t __pyx_bstride_1_ty = 0; - Py_ssize_t __pyx_bshape_0_ty = 0; - Py_ssize_t __pyx_bshape_1_ty = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyArrayObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_bstruct_ty.buf = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":672 - * - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), # <<<<<<<<<<<<<< - * dtype=np.int, order='F') - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":673 - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), - * dtype=np.int, order='F') # <<<<<<<<<<<<<< - * - * res = sf_readf_int(self.hdl, ty.data, nframes) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_int); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_152) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_5 < 0)) { - /* __pyx_t_6 allocated */ - /* __pyx_t_7 allocated */ - /* __pyx_t_8 allocated */ - PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); - /* __pyx_t_6 released */ - /* __pyx_t_7 released */ - /* __pyx_t_8 released */ - } - } - __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1]; - __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1]; - if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 released */ - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - Py_DECREF(((PyObject *)__pyx_v_ty)); - __pyx_v_ty = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":675 - * dtype=np.int, order='F') - * - * res = sf_readf_int(self.hdl, ty.data, nframes) # <<<<<<<<<<<<<< - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - */ - __pyx_v_res = sf_readf_int(__pyx_v_self->hdl, ((int *)__pyx_v_ty->data), __pyx_v_nframes); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":676 - * - * res = sf_readf_int(self.hdl, ty.data, nframes) - * if not res == nframes: # <<<<<<<<<<<<<< - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty - */ - /* __pyx_t_9 allocated */ - __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes)); - if (__pyx_t_9) { - /* __pyx_t_9 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":677 - * res = sf_readf_int(self.hdl, ty.data, nframes) - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) # <<<<<<<<<<<<<< - * return ty - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_153, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":678 - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty # <<<<<<<<<<<<<< - * - * cdef read_frames_short(Sndfile self, sf_count_t nframes): - */ - Py_INCREF(((PyObject *)__pyx_v_ty)); - __pyx_r = ((PyObject *)__pyx_v_ty); - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_int"); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __pyx_L2:; - Py_DECREF(__pyx_v_ty); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":680 - * return ty - * - * cdef read_frames_short(Sndfile self, sf_count_t nframes): # <<<<<<<<<<<<<< - * cdef cnp.ndarray[cnp.int16_t, ndim=2] ty - * cdef sf_count_t res - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_short(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, sf_count_t __pyx_v_nframes) { - PyArrayObject *__pyx_v_ty; - sf_count_t __pyx_v_res; - Py_buffer __pyx_bstruct_ty; - Py_ssize_t __pyx_bstride_0_ty = 0; - Py_ssize_t __pyx_bstride_1_ty = 0; - Py_ssize_t __pyx_bshape_0_ty = 0; - Py_ssize_t __pyx_bshape_1_ty = 0; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyArrayObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __pyx_v_ty = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_bstruct_ty.buf = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":685 - * - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), # <<<<<<<<<<<<<< - * dtype=np.short, order='F') - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_sfinfo.channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":686 - * # Use Fortran order to cope with interleaving - * ty = np.empty((nframes, self._sfinfo.channels), - * dtype=np.short, order='F') # <<<<<<<<<<<<<< - * - * res = sf_readf_short(self.hdl, ty.data, nframes) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_short); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PyDict_SetItem(__pyx_1, __pyx_kp_order, __pyx_kp_154) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = ((PyArrayObject *)__pyx_t_3); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - /* __pyx_t_5 allocated */ - __pyx_t_5 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_t_4, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_5 < 0)) { - /* __pyx_t_6 allocated */ - /* __pyx_t_7 allocated */ - /* __pyx_t_8 allocated */ - PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_v_ty, &__pyx_bstruct_ty, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); - /* __pyx_t_6 released */ - /* __pyx_t_7 released */ - /* __pyx_t_8 released */ - } - } - __pyx_bstride_0_ty = __pyx_bstruct_ty.strides[0]; __pyx_bstride_1_ty = __pyx_bstruct_ty.strides[1]; - __pyx_bshape_0_ty = __pyx_bstruct_ty.shape[0]; __pyx_bshape_1_ty = __pyx_bstruct_ty.shape[1]; - if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 released */ - __pyx_t_4 = 0; - /* __pyx_t_4 released */ - Py_DECREF(((PyObject *)__pyx_v_ty)); - __pyx_v_ty = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":688 - * dtype=np.short, order='F') - * - * res = sf_readf_short(self.hdl, ty.data, nframes) # <<<<<<<<<<<<<< - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - */ - __pyx_v_res = sf_readf_short(__pyx_v_self->hdl, ((short *)__pyx_v_ty->data), __pyx_v_nframes); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":689 - * - * res = sf_readf_short(self.hdl, ty.data, nframes) - * if not res == nframes: # <<<<<<<<<<<<<< - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty - */ - /* __pyx_t_9 allocated */ - __pyx_t_9 = (!(__pyx_v_res == __pyx_v_nframes)); - if (__pyx_t_9) { - /* __pyx_t_9 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":690 - * res = sf_readf_short(self.hdl, ty.data, nframes) - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) # <<<<<<<<<<<<<< - * return ty - * - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyLong_FromLongLong(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_155, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":691 - * if not res == nframes: - * raise RuntimeError("Asked %d frames, read %d" % (nframes, res)) - * return ty # <<<<<<<<<<<<<< - * - * def write_frames(self, cnp.ndarray input): - */ - Py_INCREF(((PyObject *)__pyx_v_ty)); - __pyx_r = ((PyObject *)__pyx_v_ty); - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.read_frames_short"); - __pyx_r = 0; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ty); - __pyx_L2:; - Py_DECREF(__pyx_v_ty); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":693 - * return ty - * - * def write_frames(self, cnp.ndarray input): # <<<<<<<<<<<<<< - * """\ - * write given number frames into file. - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames(PyObject *__pyx_v_self, PyObject *__pyx_v_input); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames[] = "Sndfile.write_frames(self, ndarray input)\n write given number frames into file.\n\n Parameters\n ----------\n input : ndarray\n array containing data to write.\n\n Notes\n -----\n One column per channel.\n\n updates the write pointer.\n\n if the input type is float, and the file encoding is an integer type,\n you should make sure the input data are normalized normalized data\n (that is in the range [-1..1] - which will corresponds to the maximum\n range allowed by the integer bitwidth)."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames(PyObject *__pyx_v_self, PyObject *__pyx_v_input) { - int __pyx_v_nc; - sf_count_t __pyx_v_nframes; - PyObject *__pyx_v_res; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - sf_count_t __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Py_INCREF(__pyx_v_input); - __pyx_v_res = Py_None; Py_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":716 - * - * # First, get the number of channels and frames from input - * if input.ndim == 2: # <<<<<<<<<<<<<< - * nc = input.shape[1] - * nframes = input.size / nc - */ - switch (((PyArrayObject *)__pyx_v_input)->nd) { - case 2: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":717 - * # First, get the number of channels and frames from input - * if input.ndim == 2: - * nc = input.shape[1] # <<<<<<<<<<<<<< - * nframes = input.size / nc - * elif input.ndim == 1: - */ - __pyx_v_nc = (((PyArrayObject *)__pyx_v_input)->dimensions[1]); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":718 - * if input.ndim == 2: - * nc = input.shape[1] - * nframes = input.size / nc # <<<<<<<<<<<<<< - * elif input.ndim == 1: - * nc = 1 - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_1, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = __pyx_PyInt_AsLongLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __pyx_v_nframes = __pyx_t_3; - /* __pyx_t_3 released */ - break; - case 1: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":720 - * nframes = input.size / nc - * elif input.ndim == 1: - * nc = 1 # <<<<<<<<<<<<<< - * input = input[:, None] - * nframes = input.size - */ - __pyx_v_nc = 1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":721 - * elif input.ndim == 1: - * nc = 1 - * input = input[:, None] # <<<<<<<<<<<<<< - * nframes = input.size - * else: - */ - __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1); - Py_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); - __pyx_1 = 0; - __pyx_1 = PyObject_GetItem(__pyx_v_input, ((PyObject *)__pyx_t_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_input); - __pyx_v_input = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":722 - * nc = 1 - * input = input[:, None] - * nframes = input.size # <<<<<<<<<<<<<< - * else: - * raise ValueError("Expect array of rank 2, got %d" % input.ndim) - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = __pyx_PyInt_AsLongLong(__pyx_1); if (unlikely((__pyx_t_3 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_nframes = __pyx_t_3; - /* __pyx_t_3 released */ - break; - default: - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":724 - * nframes = input.size - * else: - * raise ValueError("Expect array of rank 2, got %d" % input.ndim) # <<<<<<<<<<<<<< - * - * # Number of channels should be the one expected - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(((PyArrayObject *)__pyx_v_input)->nd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_156, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_1, 0, 0); - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":727 - * - * # Number of channels should be the one expected - * if not nc == self._sfinfo.channels: # <<<<<<<<<<<<<< - * raise ValueError("Expected %d channels, got %d" % - * (self._sfinfo.channels, nc)) - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = (!(__pyx_v_nc == ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels)); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":729 - * if not nc == self._sfinfo.channels: - * raise ValueError("Expected %d channels, got %d" % - * (self._sfinfo.channels, nc)) # <<<<<<<<<<<<<< - * - * input = np.require(input, requirements = 'C') - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->_sfinfo.channels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_157, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":731 - * (self._sfinfo.channels, nc)) - * - * input = np.require(input, requirements = 'C') # <<<<<<<<<<<<<< - * - * # XXX: check for overflow ? - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_require); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_input); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_input); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_requirements, __pyx_kp_158) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - /* __pyx_t_2 released */ - if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_input); - __pyx_v_input = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":734 - * - * # XXX: check for overflow ? - * if input.dtype == np.float64: # <<<<<<<<<<<<<< - * res = self.write_frames_double(input, nframes) - * elif input.dtype == np.float32: - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_91); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_2, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":735 - * # XXX: check for overflow ? - * if input.dtype == np.float64: - * res = self.write_frames_double(input, nframes) # <<<<<<<<<<<<<< - * elif input.dtype == np.float32: - * res = self.write_frames_float(input, nframes) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_double(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":736 - * if input.dtype == np.float64: - * res = self.write_frames_double(input, nframes) - * elif input.dtype == np.float32: # <<<<<<<<<<<<<< - * res = self.write_frames_float(input, nframes) - * elif input.dtype == np.int: - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_144); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":737 - * res = self.write_frames_double(input, nframes) - * elif input.dtype == np.float32: - * res = self.write_frames_float(input, nframes) # <<<<<<<<<<<<<< - * elif input.dtype == np.int: - * res = self.write_frames_int(input, nframes) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_float(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":738 - * elif input.dtype == np.float32: - * res = self.write_frames_float(input, nframes) - * elif input.dtype == np.int: # <<<<<<<<<<<<<< - * res = self.write_frames_int(input, nframes) - * elif input.dtype == np.short: - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_int); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_2, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":739 - * res = self.write_frames_float(input, nframes) - * elif input.dtype == np.int: - * res = self.write_frames_int(input, nframes) # <<<<<<<<<<<<<< - * elif input.dtype == np.short: - * res = self.write_frames_short(input, nframes) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_int(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":740 - * elif input.dtype == np.int: - * res = self.write_frames_int(input, nframes) - * elif input.dtype == np.short: # <<<<<<<<<<<<<< - * res = self.write_frames_short(input, nframes) - * else: - */ - __pyx_1 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_short); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":741 - * res = self.write_frames_int(input, nframes) - * elif input.dtype == np.short: - * res = self.write_frames_short(input, nframes) # <<<<<<<<<<<<<< - * else: - * raise Exception("type of input &s not understood" % str(input.dtype)) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(((struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->__pyx_vtab)->write_frames_short(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input), __pyx_v_nframes)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_5; - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - goto __pyx_L6; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":743 - * res = self.write_frames_short(input, nframes) - * else: - * raise Exception("type of input &s not understood" % str(input.dtype)) # <<<<<<<<<<<<<< - * - * if not(res == nframes): - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_2); - __pyx_2 = 0; - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyNumber_Remainder(__pyx_kp_159, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); - __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_5, 0, 0); - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":745 - * raise Exception("type of input &s not understood" % str(input.dtype)) - * - * if not(res == nframes): # <<<<<<<<<<<<<< - * raise IOError("write %d frames, expected to write %d" - * % res, nframes) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_res, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = (!__pyx_t_4); - if (__pyx_t_6) { - /* __pyx_t_6 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":747 - * if not(res == nframes): - * raise IOError("write %d frames, expected to write %d" - * % res, nframes) # <<<<<<<<<<<<<< - * - * cdef sf_count_t write_frames_double(self, cnp.ndarray input, - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_160, __pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyLong_FromLongLong(__pyx_v_nframes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_2 = 0; - __pyx_t_5 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_5 released */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_5, 0, 0); - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.write_frames"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_res); - Py_DECREF(__pyx_v_input); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":749 - * % res, nframes) - * - * cdef sf_count_t write_frames_double(self, cnp.ndarray input, # <<<<<<<<<<<<<< - * sf_count_t nframes): - * cdef cnp.ndarray[cnp.float64_t, ndim=2] ty - */ - -static sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_double(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) { - sf_count_t __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":753 - * cdef cnp.ndarray[cnp.float64_t, ndim=2] ty - * - * return sf_writef_double(self.hdl, input.data, nframes) # <<<<<<<<<<<<<< - * - * cdef sf_count_t write_frames_float(self, cnp.ndarray input, - */ - __pyx_r = sf_writef_double(__pyx_v_self->hdl, ((double *)__pyx_v_input->data), __pyx_v_nframes); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":755 - * return sf_writef_double(self.hdl, input.data, nframes) - * - * cdef sf_count_t write_frames_float(self, cnp.ndarray input, # <<<<<<<<<<<<<< - * sf_count_t nframes): - * cdef cnp.ndarray[cnp.float32_t, ndim=2] ty - */ - -static sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_float(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) { - sf_count_t __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":759 - * cdef cnp.ndarray[cnp.float32_t, ndim=2] ty - * - * return sf_writef_float(self.hdl, input.data, nframes) # <<<<<<<<<<<<<< - * - * cdef sf_count_t write_frames_int(self, cnp.ndarray input, - */ - __pyx_r = sf_writef_float(__pyx_v_self->hdl, ((float *)__pyx_v_input->data), __pyx_v_nframes); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":761 - * return sf_writef_float(self.hdl, input.data, nframes) - * - * cdef sf_count_t write_frames_int(self, cnp.ndarray input, # <<<<<<<<<<<<<< - * sf_count_t nframes): - * cdef cnp.ndarray[cnp.int32_t, ndim=2] ty - */ - -static sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_int(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) { - sf_count_t __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":765 - * cdef cnp.ndarray[cnp.int32_t, ndim=2] ty - * - * return sf_writef_int(self.hdl, input.data, nframes) # <<<<<<<<<<<<<< - * - * cdef sf_count_t write_frames_short(self, cnp.ndarray input, - */ - __pyx_r = sf_writef_int(__pyx_v_self->hdl, ((int *)__pyx_v_input->data), __pyx_v_nframes); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":767 - * return sf_writef_int(self.hdl, input.data, nframes) - * - * cdef sf_count_t write_frames_short(self, cnp.ndarray input, # <<<<<<<<<<<<<< - * sf_count_t nframes): - * cdef cnp.ndarray[cnp.int16_t, ndim=2] ty - */ - -static sf_count_t __pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_short(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *__pyx_v_self, PyArrayObject *__pyx_v_input, sf_count_t __pyx_v_nframes) { - sf_count_t __pyx_r; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":771 - * cdef cnp.ndarray[cnp.int16_t, ndim=2] ty - * - * return sf_writef_short(self.hdl, input.data, nframes) # <<<<<<<<<<<<<< - * - * def seek(Sndfile self, sf_count_t offset, int whence=0, mode='rw'): - */ - __pyx_r = sf_writef_short(__pyx_v_self->hdl, ((short *)__pyx_v_input->data), __pyx_v_nframes); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":773 - * return sf_writef_short(self.hdl, input.data, nframes) - * - * def seek(Sndfile self, sf_count_t offset, int whence=0, mode='rw'): # <<<<<<<<<<<<<< - * """\ - * Seek into audio file: similar to python seek function, taking only in - */ - -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek[] = "Sndfile.seek(self, scikits.audiolab.pysndfile.sndfile.sf_count_t offset, int whence=0, mode=rw)\n Seek into audio file: similar to python seek function, taking only in\n account audio data.\n\n Parameters\n ----------\n offset : int\n the number of frames (eg two samples for stereo files) to move\n relatively to position set by whence.\n whence : int\n only 0 (beginning), 1 (current) and 2 (end of the file) are\n valid.\n mode : string\n If set to 'rw', both read and write pointers are updated. If\n 'r' is given, only read pointer is updated, if 'w', only the\n write one is (this may of course make sense only if you open\n the file in a certain mode).\n\n Returns\n -------\n offset : int\n the number of frames from the beginning of the file\n\n Notes\n -----\n\n Offset relative to audio data: meta-data are ignored.\n\n if an invalid seek is given (beyond or before the file), an IOError is\n launched; note that this is different from the seek method of a File\n object."; -static PyObject *__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - sf_count_t __pyx_v_offset; - int __pyx_v_whence; - PyObject *__pyx_v_mode = 0; - sf_count_t __pyx_v_st; - PyObject *__pyx_v_msg; - PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_offset,&__pyx_kp_whence,&__pyx_kp_mode,0}; - __pyx_v_whence = 0; - __pyx_v_mode = __pyx_kp_93; - if (unlikely(__pyx_kwds)) { - PyObject* values[3] = {0,0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_offset); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_offset = __pyx_PyInt_AsLongLong(values[0]); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - if (values[1]) { - __pyx_v_whence = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[2]) { - __pyx_v_mode = values[2]; - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: __pyx_v_whence = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_offset = __pyx_PyInt_AsLongLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_offset == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.seek"); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_msg = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":806 - * object.""" - * cdef sf_count_t st - * if mode == 'rw': # <<<<<<<<<<<<<< - * # Update both read and write pointers - * st = sf_seek(self.hdl, offset, whence) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_161, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":808 - * if mode == 'rw': - * # Update both read and write pointers - * st = sf_seek(self.hdl, offset, whence) # <<<<<<<<<<<<<< - * elif mode == 'r': - * whence = whence | SFM_READ - */ - __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence); - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":809 - * # Update both read and write pointers - * st = sf_seek(self.hdl, offset, whence) - * elif mode == 'r': # <<<<<<<<<<<<<< - * whence = whence | SFM_READ - * st = sf_seek(self.hdl, offset, whence) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_162, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":810 - * st = sf_seek(self.hdl, offset, whence) - * elif mode == 'r': - * whence = whence | SFM_READ # <<<<<<<<<<<<<< - * st = sf_seek(self.hdl, offset, whence) - * elif mode == 'w': - */ - __pyx_v_whence = (__pyx_v_whence | SFM_READ); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":811 - * elif mode == 'r': - * whence = whence | SFM_READ - * st = sf_seek(self.hdl, offset, whence) # <<<<<<<<<<<<<< - * elif mode == 'w': - * whence = whence | SFM_WRITE - */ - __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence); - goto __pyx_L6; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":812 - * whence = whence | SFM_READ - * st = sf_seek(self.hdl, offset, whence) - * elif mode == 'w': # <<<<<<<<<<<<<< - * whence = whence | SFM_WRITE - * st = sf_seek(self.hdl, offset, whence) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_163, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":813 - * st = sf_seek(self.hdl, offset, whence) - * elif mode == 'w': - * whence = whence | SFM_WRITE # <<<<<<<<<<<<<< - * st = sf_seek(self.hdl, offset, whence) - * else: - */ - __pyx_v_whence = (__pyx_v_whence | SFM_WRITE); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":814 - * elif mode == 'w': - * whence = whence | SFM_WRITE - * st = sf_seek(self.hdl, offset, whence) # <<<<<<<<<<<<<< - * else: - * raise ValueError("mode should be one of 'r', 'w' or 'rw' only") - */ - __pyx_v_st = sf_seek(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl, __pyx_v_offset, __pyx_v_whence); - goto __pyx_L6; - } - /*else*/ { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":816 - * st = sf_seek(self.hdl, offset, whence) - * else: - * raise ValueError("mode should be one of 'r', 'w' or 'rw' only") # <<<<<<<<<<<<<< - * - * if st == -1: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_164); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_164); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":818 - * raise ValueError("mode should be one of 'r', 'w' or 'rw' only") - * - * if st == -1: # <<<<<<<<<<<<<< - * msg = "Error while seeking, libsndfile error is %s" \ - * % sf_strerror(self.hdl) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = (__pyx_v_st == -1); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":820 - * if st == -1: - * msg = "Error while seeking, libsndfile error is %s" \ - * % sf_strerror(self.hdl) # <<<<<<<<<<<<<< - * raise IOError(msg) - * return st - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = __Pyx_PyBytes_FromString(sf_strerror(((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)__pyx_v_self)->hdl)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_165, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - Py_DECREF(__pyx_v_msg); - __pyx_v_msg = __pyx_t_1; - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":821 - * msg = "Error while seeking, libsndfile error is %s" \ - * % sf_strerror(self.hdl) - * raise IOError(msg) # <<<<<<<<<<<<<< - * return st - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_msg); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":822 - * % sf_strerror(self.hdl) - * raise IOError(msg) - * return st # <<<<<<<<<<<<<< - * - * cdef int_to_format(int format): - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyLong_FromLongLong(__pyx_v_st); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_1); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.Sndfile.seek"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_msg); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":824 - * return st - * - * cdef int_to_format(int format): # <<<<<<<<<<<<<< - * """Gives a triple of strings (format, encoding, endian) given actual format - * integer, as used internally by sndfile.""" - */ - -static PyObject *__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_int_to_format(int __pyx_v_format) { - int __pyx_v_ctype; - int __pyx_v_cencoding; - int __pyx_v_cendian; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":828 - * integer, as used internally by sndfile.""" - * cdef int ctype, cencoding, cendian - * ctype = format & SF_FORMAT_TYPEMASK # <<<<<<<<<<<<<< - * cencoding = format & SF_FORMAT_SUBMASK - * cendian = format & SF_FORMAT_ENDMASK - */ - __pyx_v_ctype = (__pyx_v_format & SF_FORMAT_TYPEMASK); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":829 - * cdef int ctype, cencoding, cendian - * ctype = format & SF_FORMAT_TYPEMASK - * cencoding = format & SF_FORMAT_SUBMASK # <<<<<<<<<<<<<< - * cendian = format & SF_FORMAT_ENDMASK - * - */ - __pyx_v_cencoding = (__pyx_v_format & SF_FORMAT_SUBMASK); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":830 - * ctype = format & SF_FORMAT_TYPEMASK - * cencoding = format & SF_FORMAT_SUBMASK - * cendian = format & SF_FORMAT_ENDMASK # <<<<<<<<<<<<<< - * - * if not format == (ctype | cencoding | cendian): - */ - __pyx_v_cendian = (__pyx_v_format & SF_FORMAT_ENDMASK); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":832 - * cendian = format & SF_FORMAT_ENDMASK - * - * if not format == (ctype | cencoding | cendian): # <<<<<<<<<<<<<< - * raise RuntimeError("Inconsistent format: this is a bug") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (!(__pyx_v_format == ((__pyx_v_ctype | __pyx_v_cencoding) | __pyx_v_cendian))); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":833 - * - * if not format == (ctype | cencoding | cendian): - * raise RuntimeError("Inconsistent format: this is a bug") # <<<<<<<<<<<<<< - * - * return _ENUM_TO_STR_FILE_FORMAT[ctype], \ - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_166); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_166); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":835 - * raise RuntimeError("Inconsistent format: this is a bug") - * - * return _ENUM_TO_STR_FILE_FORMAT[ctype], \ # <<<<<<<<<<<<<< - * _ENUM_TO_STR_ENCODING[cencoding], \ - * _ENUM_TO_STR_ENDIAN[cendian] - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_86); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetItemInt(__pyx_1, __pyx_v_ctype, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":836 - * - * return _ENUM_TO_STR_FILE_FORMAT[ctype], \ - * _ENUM_TO_STR_ENCODING[cencoding], \ # <<<<<<<<<<<<<< - * _ENUM_TO_STR_ENDIAN[cendian] - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_85); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_GetItemInt(__pyx_1, __pyx_v_cencoding, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":837 - * return _ENUM_TO_STR_FILE_FORMAT[ctype], \ - * _ENUM_TO_STR_ENCODING[cencoding], \ - * _ENUM_TO_STR_ENDIAN[cendian] # <<<<<<<<<<<<<< - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__ENUM_TO_STR_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = __Pyx_GetItemInt(__pyx_1, __pyx_v_cendian, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_3); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_4); - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile.int_to_format"); - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":50 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_hasfields; - int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - char *__pyx_t_5; - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; Py_INCREF(Py_None); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":56 - * # of flags - * cdef int copy_shape, i, ndim - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":58 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":59 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":61 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":63 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") - */ - if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":64 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not C contiguous") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - } - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":65 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_1); - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":67 - * raise ValueError("ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") - */ - if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":68 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not Fortran contiguous") - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } else { - __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - } - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":69 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_2); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_2); - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":71 - * raise ValueError("ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":72 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":73 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __pyx_v_copy_shape; - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":76 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":77 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":78 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i+=1) { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":79 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":80 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":82 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":83 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":84 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":85 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":86 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":89 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":90 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * - */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":93 - * cdef list stack - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * # Ugly hack warning: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":103 - * # functions). - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - if ((!__pyx_v_hasfields)) { - /* __pyx_t_1 allocated */ - __pyx_t_1 = (!__pyx_v_copy_shape); - } else { - __pyx_t_1 = (!__pyx_v_hasfields); - } - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":105 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - Py_INCREF(Py_None); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":108 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - Py_INCREF(__pyx_v_self); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":110 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":111 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":112 - * if not hasfields: - * t = descr.type_num - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = __pyx_k_3; - break; - case NPY_UBYTE: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":113 - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_v_f = __pyx_k_4; - break; - case NPY_SHORT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":114 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_v_f = __pyx_k_5; - break; - case NPY_USHORT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":115 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_v_f = __pyx_k_6; - break; - case NPY_INT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":116 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_v_f = __pyx_k_7; - break; - case NPY_UINT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":117 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_v_f = __pyx_k_8; - break; - case NPY_LONG: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":118 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_v_f = __pyx_k_9; - break; - case NPY_ULONG: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":119 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_v_f = __pyx_k_10; - break; - case NPY_LONGLONG: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":120 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_v_f = __pyx_k_11; - break; - case NPY_ULONGLONG: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":121 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_v_f = __pyx_k_12; - break; - case NPY_FLOAT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":122 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_v_f = __pyx_k_13; - break; - case NPY_DOUBLE: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":123 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_v_f = __pyx_k_14; - break; - case NPY_LONGDOUBLE: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":124 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_v_f = __pyx_k_15; - break; - case NPY_CFLOAT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":125 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_v_f = __pyx_k_16; - break; - case NPY_CDOUBLE: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":126 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_v_f = __pyx_k_17; - break; - case NPY_CLONGDOUBLE: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":127 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_v_f = __pyx_k_18; - break; - case NPY_OBJECT: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":128 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_v_f = __pyx_k_19; - break; - default: - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":130 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyNumber_Remainder(__pyx_kp_20, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_3, 0, 0); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":131 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":132 - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(255) # static size - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":134 - * return - * else: - * info.format = stdlib.malloc(255) # static size # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format, info.format + 255) - * f[0] = 0 # Terminate format string - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":135 - * else: - * info.format = stdlib.malloc(255) # static size - * f = _util_dtypestring(descr, info.format, info.format + 255) # <<<<<<<<<<<<<< - * f[0] = 0 # Terminate format string - * - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, __pyx_v_info->format, (__pyx_v_info->format + 255)); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_5; - /* __pyx_t_5 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":136 - * info.format = stdlib.malloc(255) # static size - * f = _util_dtypestring(descr, info.format, info.format + 255) - * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = 0; - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - Py_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { Py_DECREF(Py_None); __pyx_v_info->obj = NULL; } - __pyx_L2:; - Py_XDECREF(__pyx_v_descr); - return __pyx_r; -} - -/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":138 - * f[0] = 0 # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; - int __pyx_t_2; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":139 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { - /* __pyx_t_1 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":140 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":141 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { - /* __pyx_t_2 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":142 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - -} - -/* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":248 - * - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end) { - PyArray_Descr *__pyx_v_child; - PyObject *__pyx_v_i; - PyObject *__pyx_v_t; - char *__pyx_r; - PyObject *__pyx_1 = 0; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - __pyx_v_child = ((PyArray_Descr *)Py_None); Py_INCREF(Py_None); - __pyx_v_i = ((PyObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_t = Py_None; Py_INCREF(Py_None); - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":254 - * cdef dtype child - * cdef tuple i - * for i in descr.fields.itervalues(): # <<<<<<<<<<<<<< - * child = i[0] - * if not PyDataType_HASFIELDS(child): - */ - /* __pyx_t_1 allocated */ - __pyx_1 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_itervalues); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; Py_INCREF(__pyx_t_3); - } else { - __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - for (;;) { - /* __pyx_t_2 allocated */ - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); Py_INCREF(__pyx_t_2); __pyx_t_1++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); Py_INCREF(__pyx_t_2); __pyx_t_1++; - } else { - __pyx_t_2 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - if (!(likely(PyTuple_CheckExact(__pyx_t_2)) || (__pyx_t_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_i)); - __pyx_v_i = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":255 - * cdef tuple i - * for i in descr.fields.itervalues(): - * child = i[0] # <<<<<<<<<<<<<< - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - */ - __pyx_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_i), 0, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((PyArray_Descr *)__pyx_1); - __pyx_1 = 0; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":256 - * for i in descr.fields.itervalues(): - * child = i[0] - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 15: # this should leave room for "T{" and "}" as well - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = (!PyDataType_HASFIELDS(__pyx_v_child)); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":257 - * child = i[0] - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 15: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_t); - __pyx_v_t = __pyx_t_2; - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":258 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 15: # this should leave room for "T{" and "}" as well # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short.") - * - */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = ((__pyx_v_end - __pyx_v_f) < 15); - if (__pyx_t_4) { - /* __pyx_t_4 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":259 - * t = child.type_num - * if end - f < 15: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_21); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_21); - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - __Pyx_Raise(__pyx_t_5, 0, 0); - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":262 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 98; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":263 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 66; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":264 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 104; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":265 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 72; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":266 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 105; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":267 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 73; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":268 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 108; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":269 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 76; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":270 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 113; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":271 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 81; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":272 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 102; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":273 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 100; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":274 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 103; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":275 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":276 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":277 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - goto __pyx_L7; - } - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":278 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - if (__pyx_t_4) { - /* __pyx_t_4 released */ - (__pyx_v_f[0]) = 79; - goto __pyx_L7; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":280 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyNumber_Remainder(__pyx_kp_22, __pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_5 allocated */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __pyx_t_2 = 0; - /* __pyx_t_2 released */ - /* __pyx_t_2 allocated */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* __pyx_t_5 released */ - __Pyx_Raise(__pyx_t_2, 0, 0); - Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* __pyx_t_2 released */ - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L7:; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":281 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * f[0] = 84 #"T" - */ - __pyx_v_f += 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":283 - * f += 1 - * else: - * f[0] = 84 #"T" # <<<<<<<<<<<<<< - * f[1] = 123 #"{" - * f += 2 - */ - (__pyx_v_f[0]) = 84; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":284 - * else: - * f[0] = 84 #"T" - * f[1] = 123 #"{" # <<<<<<<<<<<<<< - * f += 2 - * f = _util_dtypestring(child, f, end) - */ - (__pyx_v_f[1]) = 123; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":285 - * f[0] = 84 #"T" - * f[1] = 123 #"{" - * f += 2 # <<<<<<<<<<<<<< - * f = _util_dtypestring(child, f, end) - * f[0] = 125 #"}" - */ - __pyx_v_f += 2; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":286 - * f[1] = 123 #"{" - * f += 2 - * f = _util_dtypestring(child, f, end) # <<<<<<<<<<<<<< - * f[0] = 125 #"}" - * f += 1 - */ - /* __pyx_t_6 allocated */ - __pyx_t_6 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_6; - /* __pyx_t_6 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":287 - * f += 2 - * f = _util_dtypestring(child, f, end) - * f[0] = 125 #"}" # <<<<<<<<<<<<<< - * f += 1 - * return f - */ - (__pyx_v_f[0]) = 125; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":288 - * f = _util_dtypestring(child, f, end) - * f[0] = 125 #"}" - * f += 1 # <<<<<<<<<<<<<< - * return f - * - */ - __pyx_v_f += 1; - } - __pyx_L5:; - } - /* __pyx_t_1 released */ - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":289 - * f[0] = 125 #"}" - * f += 1 - * return f # <<<<<<<<<<<<<< - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_t_2); - Py_XDECREF(__pyx_t_3); - Py_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("numpy._util_dtypestring"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_child); - Py_DECREF(__pyx_v_i); - Py_DECREF(__pyx_v_t); - return __pyx_r; -} -static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Format __pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format; - -static PyObject *__pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o); - p->__pyx_vtab = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format; - p->_type = Py_None; Py_INCREF(Py_None); - p->_encoding = Py_None; Py_INCREF(Py_None); - p->_endianness = Py_None; Py_INCREF(Py_None); - p->_format_str = Py_None; Py_INCREF(Py_None); - p->_encoding_str = Py_None; Py_INCREF(Py_None); - p->_endian_str = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o; - Py_XDECREF(p->_type); - Py_XDECREF(p->_encoding); - Py_XDECREF(p->_endianness); - Py_XDECREF(p->_format_str); - Py_XDECREF(p->_encoding_str); - Py_XDECREF(p->_endian_str); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o; - if (p->_type) { - e = (*v)(p->_type, a); if (e) return e; - } - if (p->_encoding) { - e = (*v)(p->_encoding, a); if (e) return e; - } - if (p->_endianness) { - e = (*v)(p->_endianness, a); if (e) return e; - } - if (p->_format_str) { - e = (*v)(p->_format_str, a); if (e) return e; - } - if (p->_encoding_str) { - e = (*v)(p->_encoding_str, a); if (e) return e; - } - if (p->_endian_str) { - e = (*v)(p->_endian_str, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Format(PyObject *o) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)o; - PyObject* tmp; - tmp = ((PyObject*)p->_type); - p->_type = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_encoding); - p->_encoding = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_endianness); - p->_endianness = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_format_str); - p->_format_str = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_encoding_str); - p->_encoding_str = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_endian_str); - p->_endian_str = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_11file_format___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_8encoding___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_10endianness___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_description(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_23file_format_description___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_description(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_20encoding_description___get__(o); -} - -static struct PyMethodDef __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Format[] = { - {"__copy__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___copy__}, - {"__deepcopy__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___deepcopy__}, - {"__str__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__, METH_NOARGS|METH_COEXIST, 0}, - {"__repr__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__, METH_NOARGS|METH_COEXIST, 0}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Format[] = { - {(char *)"file_format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format, 0, __pyx_k_23, 0}, - {(char *)"encoding", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding, 0, __pyx_k_24, 0}, - {(char *)"endianness", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness, 0, __pyx_k_25, 0}, - {(char *)"file_format_description", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_description, 0, __pyx_k_26, 0}, - {(char *)"encoding_description", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_description, 0, __pyx_k_27, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Format = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - 0, /*nb_long*/ - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Format = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - 0, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_Format = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Format = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format = { - PyVarObject_HEAD_INIT(0, 0) - "scikits.audiolab.pysndfile._sndfile.Format", /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___repr__, /*tp_repr*/ - &__pyx_tp_as_number_Format, /*tp_as_number*/ - &__pyx_tp_as_sequence_Format, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Format, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Format, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Format(type=wav, encoding=pcm16, endianness=file)\n This class represents an audio file format. It knows about audio file\n format (wav, aiff, etc...), encoding (pcm, etc...) and endianness.\n\n Parameters\n ----------\n type : str\n the major file format (wav, etc...).\n encoding : str\n the encoding (pcm16, etc..).\n endianness : str\n the endianess.\n\n Notes\n -----\n The possible values for type, and encoding depend on your installed\n libsndfile. You can query the possible values with the functions\n available_file_formats and available_encodings.\n\n See also\n --------\n Sndfile class.\n ", /*tp_doc*/ - __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_traverse*/ - __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_clear*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___richcmp__, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_6Format___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Format, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ -}; -static struct __pyx_vtabstruct_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile __pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile; - -static PyObject *__pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o); - p->__pyx_vtab = __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile; - p->filename = Py_None; Py_INCREF(Py_None); - p->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o; - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_XDECREF(p->filename); - Py_XDECREF(((PyObject *)p->_format)); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o; - if (p->filename) { - e = (*v)(p->filename, a); if (e) return e; - } - if (p->_format) { - e = (*v)(((PyObject*)p->_format), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile(PyObject *o) { - struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *p = (struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile *)o; - PyObject* tmp; - tmp = ((PyObject*)p->filename); - p->filename = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_format); - p->_format = ((struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Format *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_nframes(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_7nframes___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_samplerate(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10samplerate___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_channels(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8channels___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_format(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_6format___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_file_format(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_11file_format___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_encoding(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_8encoding___get__(o); -} - -static PyObject *__pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_endianness(PyObject *o, void *x) { - return __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_10endianness___get__(o); -} - -static struct PyMethodDef __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile[] = { - {"close", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_close}, - {"sync", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_sync}, - {"__str__", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__, METH_NOARGS|METH_COEXIST, 0}, - {"read_frames", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames}, - {"write_frames", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames, METH_O, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames}, - {"seek", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_seek}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile[] = { - {(char *)"nframes", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_nframes, 0, __pyx_k_28, 0}, - {(char *)"samplerate", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_samplerate, 0, __pyx_k_29, 0}, - {(char *)"channels", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_channels, 0, __pyx_k_30, 0}, - {(char *)"format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_format, 0, __pyx_k_31, 0}, - {(char *)"file_format", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_file_format, 0, 0, 0}, - {(char *)"encoding", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_encoding, 0, 0, 0}, - {(char *)"endianness", __pyx_getprop_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_endianness, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Sndfile = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - 0, /*nb_long*/ - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_Sndfile = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - 0, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_Sndfile = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_Sndfile = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = { - PyVarObject_HEAD_INIT(0, 0) - "scikits.audiolab.pysndfile._sndfile.Sndfile", /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - &__pyx_tp_as_number_Sndfile, /*tp_as_number*/ - &__pyx_tp_as_sequence_Sndfile, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Sndfile, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___str__, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_Sndfile, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - "Sndfile(filename, mode=r, Format format=None, int channels=0, int samplerate=0)\n Sndfile is the core class to read/write audio files. Once an instance is\n created, it can be used to read and/or writes data from numpy arrays, query\n the audio file meta-data, etc...\n\n Parameters\n ----------\n filename : string or int\n name of the file to open (string), or file descriptor (integer)\n mode : string\n 'r' for read, 'w' for write, or 'rw' for read and\n write.\n format : Format\n Required when opening a new file for writing, or to read raw audio\n files (without header).\n channels : int\n number of channels.\n samplerate : int\n sampling rate.\n\n Returns\n -------\n sndfile: as Sndfile instance.\n\n Notes\n -----\n format, channels and samplerate need to be given only in the write modes\n and for raw files.", /*tp_doc*/ - __pyx_tp_traverse_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_traverse*/ - __pyx_tp_clear_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ -}; - -static struct PyMethodDef __pyx_methods[] = { - {"sndfile_version", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_sndfile_version}, - {"available_file_formats", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats, METH_NOARGS, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_file_formats}, - {"available_encodings", (PyCFunction)__pyx_pf_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings, METH_O, __pyx_doc_7scikits_8audiolab_9pysndfile_8_sndfile_available_encodings}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - "_sndfile", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1}, - {&__pyx_kp___copy__, __pyx_k___copy__, sizeof(__pyx_k___copy__), 1, 1, 1}, - {&__pyx_kp___deepcopy__, __pyx_k___deepcopy__, sizeof(__pyx_k___deepcopy__), 1, 1, 1}, - {&__pyx_kp___richcmp__, __pyx_k___richcmp__, sizeof(__pyx_k___richcmp__), 1, 1, 1}, - {&__pyx_kp___str__, __pyx_k___str__, sizeof(__pyx_k___str__), 1, 1, 1}, - {&__pyx_kp___repr__, __pyx_k___repr__, sizeof(__pyx_k___repr__), 1, 1, 1}, - {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1}, - {&__pyx_kp_close, __pyx_k_close, sizeof(__pyx_k_close), 1, 1, 1}, - {&__pyx_kp_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 1, 1, 1}, - {&__pyx_kp_read_frames, __pyx_k_read_frames, sizeof(__pyx_k_read_frames), 1, 1, 1}, - {&__pyx_kp_write_frames, __pyx_k_write_frames, sizeof(__pyx_k_write_frames), 1, 1, 1}, - {&__pyx_kp_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 1, 1, 1}, - {&__pyx_kp_type, __pyx_k_type, sizeof(__pyx_k_type), 1, 1, 1}, - {&__pyx_kp_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 1, 1, 1}, - {&__pyx_kp_endianness, __pyx_k_endianness, sizeof(__pyx_k_endianness), 1, 1, 1}, - {&__pyx_kp_self, __pyx_k_self, sizeof(__pyx_k_self), 1, 1, 1}, - {&__pyx_kp_other, __pyx_k_other, sizeof(__pyx_k_other), 1, 1, 1}, - {&__pyx_kp_op, __pyx_k_op, sizeof(__pyx_k_op), 1, 1, 1}, - {&__pyx_kp_major, __pyx_k_major, sizeof(__pyx_k_major), 1, 1, 1}, - {&__pyx_kp_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 1, 1, 1}, - {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1}, - {&__pyx_kp_format, __pyx_k_format, sizeof(__pyx_k_format), 1, 1, 1}, - {&__pyx_kp_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 1, 1, 1}, - {&__pyx_kp_samplerate, __pyx_k_samplerate, sizeof(__pyx_k_samplerate), 1, 1, 1}, - {&__pyx_kp_nframes, __pyx_k_nframes, sizeof(__pyx_k_nframes), 1, 1, 1}, - {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1}, - {&__pyx_kp_input, __pyx_k_input, sizeof(__pyx_k_input), 1, 1, 1}, - {&__pyx_kp_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 1, 1, 1}, - {&__pyx_kp_whence, __pyx_k_whence, sizeof(__pyx_k_whence), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 1, 1, 1}, - {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0}, - {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0}, - {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0}, - {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 1, 0}, - {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0}, - {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0}, - {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 1, 0}, - {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0}, - {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 1, 0}, - {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 1, 0}, - {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 1, 0}, - {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 1, 0}, - {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 1, 0}, - {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 1, 0}, - {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0}, - {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 1, 0}, - {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0}, - {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0}, - {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0}, - {&__pyx_kp__SNDFILE_ENCODING, __pyx_k__SNDFILE_ENCODING, sizeof(__pyx_k__SNDFILE_ENCODING), 1, 1, 1}, - {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 1, 0}, - {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0}, - {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0}, - {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0}, - {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0}, - {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0}, - {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 1, 0}, - {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0}, - {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0}, - {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0}, - {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 1, 0}, - {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0}, - {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 1, 0}, - {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0}, - {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 1, 0}, - {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0}, - {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 1, 0}, - {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0}, - {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0}, - {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 1, 1, 1}, - {&__pyx_kp_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 1, 0}, - {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0}, - {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 1, 0}, - {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 1, 0}, - {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 1, 0}, - {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 1, 0}, - {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 1, 0}, - {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 1, 0}, - {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 1, 0}, - {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 1, 0}, - {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 1, 0}, - {&__pyx_kp__SNDFILE_ENDIAN, __pyx_k__SNDFILE_ENDIAN, sizeof(__pyx_k__SNDFILE_ENDIAN), 1, 1, 1}, - {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 1, 1, 1}, - {&__pyx_kp_j, __pyx_k_j, sizeof(__pyx_k_j), 1, 1, 1}, - {&__pyx_kp_i, __pyx_k_i, sizeof(__pyx_k_i), 1, 1, 1}, - {&__pyx_kp_items, __pyx_k_items, sizeof(__pyx_k_items), 1, 1, 1}, - {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 1, 1, 1}, - {&__pyx_kp__ENUM_TO_STR_ENDIAN, __pyx_k__ENUM_TO_STR_ENDIAN, sizeof(__pyx_k__ENUM_TO_STR_ENDIAN), 1, 1, 1}, - {&__pyx_kp_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 1, 0}, - {&__pyx_kp_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 1, 0}, - {&__pyx_kp_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 1, 0}, - {&__pyx_kp_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 1, 0}, - {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 1, 1, 1}, - {&__pyx_kp_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 1, 0}, - {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1}, - {&__pyx_kp_split, __pyx_k_split, sizeof(__pyx_k_split), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 1, 0}, - {&__pyx_kp_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 1, 1, 1}, - {&__pyx_kp___class__, __pyx_k___class__, sizeof(__pyx_k___class__), 1, 1, 1}, - {&__pyx_kp_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 1, 1, 1}, - {&__pyx_kp_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 1, 1, 1}, - {&__pyx_kp_join, __pyx_k_join, sizeof(__pyx_k_join), 1, 1, 1}, - {&__pyx_kp_has_key, __pyx_k_has_key, sizeof(__pyx_k_has_key), 1, 1, 1}, - {&__pyx_kp_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 1, 1, 1}, - {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, - {&__pyx_kp_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 1, 0}, - {&__pyx_kp_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 1, 0}, - {&__pyx_kp_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 1, 0}, - {&__pyx_kp_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 1, 0}, - {&__pyx_kp_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 1, 1, 1}, - {&__pyx_kp_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 1, 0}, - {&__pyx_kp_file_format, __pyx_k_file_format, sizeof(__pyx_k_file_format), 1, 1, 1}, - {&__pyx_kp_144, __pyx_k_144, sizeof(__pyx_k_144), 1, 1, 1}, - {&__pyx_kp_145, __pyx_k_145, sizeof(__pyx_k_145), 1, 1, 1}, - {&__pyx_kp_146, __pyx_k_146, sizeof(__pyx_k_146), 1, 1, 1}, - {&__pyx_kp_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 1, 1, 1}, - {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1}, - {&__pyx_kp_order, __pyx_k_order, sizeof(__pyx_k_order), 1, 1, 1}, - {&__pyx_kp_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 1, 0}, - {&__pyx_kp_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 1, 0}, - {&__pyx_kp_int, __pyx_k_int, sizeof(__pyx_k_int), 1, 1, 1}, - {&__pyx_kp_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 1, 0}, - {&__pyx_kp_short, __pyx_k_short, sizeof(__pyx_k_short), 1, 1, 1}, - {&__pyx_kp_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 1, 0}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, - {&__pyx_kp_require, __pyx_k_require, sizeof(__pyx_k_require), 1, 1, 1}, - {&__pyx_kp_requirements, __pyx_k_requirements, sizeof(__pyx_k_requirements), 1, 1, 1}, - {&__pyx_kp_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 1, 0}, - {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1}, - {&__pyx_kp_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 1, 0}, - {&__pyx_kp_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 1, 0}, - {&__pyx_kp_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 1, 0}, - {&__pyx_kp_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 0}, - {&__pyx_kp_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 0}, - {&__pyx_kp_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 0}, - {&__pyx_kp_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 0}, - {&__pyx_kp_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 0}, - {&__pyx_kp_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 0}, - {&__pyx_kp_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 0}, - {&__pyx_kp_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 0}, - {&__pyx_kp_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 0}, - {&__pyx_kp_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 0}, - {&__pyx_kp_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 0}, - {&__pyx_kp_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 0}, - {&__pyx_kp_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 0}, - {&__pyx_kp_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 0}, - {&__pyx_kp_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 0}, - {&__pyx_kp_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 0}, - {&__pyx_kp_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 0}, - {&__pyx_kp_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 0}, - {&__pyx_kp_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 0}, - {&__pyx_kp_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 0}, - {&__pyx_kp_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 0}, - {&__pyx_kp_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 0}, - {&__pyx_kp_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 0}, - {&__pyx_kp_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 0}, - {&__pyx_kp_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 0}, - {&__pyx_kp_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 0}, - {&__pyx_kp_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 0}, - {&__pyx_kp_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 0}, - {&__pyx_kp_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 0}, - {&__pyx_kp_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 0}, - {&__pyx_kp_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 0}, - {&__pyx_kp_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 0}, - {&__pyx_kp_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 0}, - {&__pyx_kp_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 0}, - {&__pyx_kp_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 0}, - {&__pyx_kp_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 0}, - {&__pyx_kp_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 0}, - {&__pyx_kp_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 0}, - {&__pyx_kp_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 0}, - {&__pyx_kp_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 0}, - {&__pyx_kp_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 0}, - {&__pyx_kp_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 0}, - {&__pyx_kp_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 0}, - {&__pyx_kp_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 0}, - {&__pyx_kp_147, __pyx_k_147, sizeof(__pyx_k_147), 0, 0, 0}, - {&__pyx_kp_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 0}, - {&__pyx_kp_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 0}, - {&__pyx_kp_153, __pyx_k_153, sizeof(__pyx_k_153), 0, 0, 0}, - {&__pyx_kp_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 0}, - {&__pyx_kp_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 0}, - {&__pyx_kp_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 0}, - {&__pyx_kp_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 0}, - {&__pyx_kp_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 0}, - {&__pyx_kp_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 0}, - {&__pyx_kp_165, __pyx_k_165, sizeof(__pyx_k_165), 0, 0, 0}, - {&__pyx_kp_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 0}, - {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1}, - {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1}, - {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1}, - {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1}, - {&__pyx_kp_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, - {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0}, - {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0}, - {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_kp_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_kp_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_kp_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_kp_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - __pyx_int_0x0060 = PyInt_FromLong(0x0060); if (unlikely(!__pyx_int_0x0060)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x170000 = PyInt_FromLong(0x170000); if (unlikely(!__pyx_int_0x170000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x180000 = PyInt_FromLong(0x180000); if (unlikely(!__pyx_int_0x180000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x190000 = PyInt_FromLong(0x190000); if (unlikely(!__pyx_int_0x190000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x200000 = PyInt_FromLong(0x200000); if (unlikely(!__pyx_int_0x200000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x210000 = PyInt_FromLong(0x210000); if (unlikely(!__pyx_int_0x210000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0x220000 = PyInt_FromLong(0x220000); if (unlikely(!__pyx_int_0x220000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_sndfile(void); /*proto*/ -PyMODINIT_FUNC init_sndfile(void) -#else -PyMODINIT_FUNC PyInit__sndfile(void); /*proto*/ -PyMODINIT_FUNC PyInit__sndfile(void) -#endif -{ - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Library function declarations ---*/ - __pyx_init_filenames(); - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_sndfile", __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format = &__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.format_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_format_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.file_format_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_file_format_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.encoding_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_encoding_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format.endianness_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format_endianness_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Format._is_equal = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_6Format__is_equal; - if (PyType_Ready(&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format.tp_dict, __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Format", (PyObject *)&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Format = &__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Format; - __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = &__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile._close = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__close; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile._get_nframes = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile__get_nframes; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_double = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_double; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_float = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_float; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.read_frames_short = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_read_frames_short; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_double = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_double; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_float = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_float; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_int = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_int; - *(void(**)(void))&__pyx_vtable_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.write_frames_short = (void(*)(void))__pyx_f_7scikits_8audiolab_9pysndfile_8_sndfile_7Sndfile_write_frames_short; - if (PyType_Ready(&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile.tp_dict, __pyx_vtabptr_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Sndfile", (PyObject *)&__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile = &__pyx_type_7scikits_8audiolab_9pysndfile_8_sndfile_Sndfile; - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":3 - * # cython: embedsignature=True - * - * import numpy as np # <<<<<<<<<<<<<< - * import warnings - * import copy - */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":4 - * - * import numpy as np - * import warnings # <<<<<<<<<<<<<< - * import copy - * - */ - __pyx_1 = __Pyx_Import(__pyx_kp_warnings, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp_warnings, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":5 - * import numpy as np - * import warnings - * import copy # <<<<<<<<<<<<<< - * - * cimport numpy as cnp - */ - __pyx_1 = __Pyx_Import(__pyx_kp_copy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp_copy, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":24 - * # format equivalence: dic used to create internally - * # the right enum values from user friendly strings - * _SNDFILE_ENCODING = { # <<<<<<<<<<<<<< - * 'pcms8' : SF_FORMAT_PCM_S8, - * 'pcm16' : SF_FORMAT_PCM_16, - */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":25 - * # the right enum values from user friendly strings - * _SNDFILE_ENCODING = { - * 'pcms8' : SF_FORMAT_PCM_S8, # <<<<<<<<<<<<<< - * 'pcm16' : SF_FORMAT_PCM_16, - * 'pcm24' : SF_FORMAT_PCM_24, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_S8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":26 - * _SNDFILE_ENCODING = { - * 'pcms8' : SF_FORMAT_PCM_S8, - * 'pcm16' : SF_FORMAT_PCM_16, # <<<<<<<<<<<<<< - * 'pcm24' : SF_FORMAT_PCM_24, - * 'pcm32' : SF_FORMAT_PCM_32, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_33, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":27 - * 'pcms8' : SF_FORMAT_PCM_S8, - * 'pcm16' : SF_FORMAT_PCM_16, - * 'pcm24' : SF_FORMAT_PCM_24, # <<<<<<<<<<<<<< - * 'pcm32' : SF_FORMAT_PCM_32, - * 'pcmu8' : SF_FORMAT_PCM_U8, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_34, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":28 - * 'pcm16' : SF_FORMAT_PCM_16, - * 'pcm24' : SF_FORMAT_PCM_24, - * 'pcm32' : SF_FORMAT_PCM_32, # <<<<<<<<<<<<<< - * 'pcmu8' : SF_FORMAT_PCM_U8, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_35, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":29 - * 'pcm24' : SF_FORMAT_PCM_24, - * 'pcm32' : SF_FORMAT_PCM_32, - * 'pcmu8' : SF_FORMAT_PCM_U8, # <<<<<<<<<<<<<< - * - * 'float32' : SF_FORMAT_FLOAT, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PCM_U8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_36, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":31 - * 'pcmu8' : SF_FORMAT_PCM_U8, - * - * 'float32' : SF_FORMAT_FLOAT, # <<<<<<<<<<<<<< - * 'float64' : SF_FORMAT_DOUBLE, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_FLOAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_37, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":32 - * - * 'float32' : SF_FORMAT_FLOAT, - * 'float64' : SF_FORMAT_DOUBLE, # <<<<<<<<<<<<<< - * - * 'ulaw' : SF_FORMAT_ULAW, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_38, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":34 - * 'float64' : SF_FORMAT_DOUBLE, - * - * 'ulaw' : SF_FORMAT_ULAW, # <<<<<<<<<<<<<< - * 'alaw' : SF_FORMAT_ALAW, - * 'ima_adpcm' : SF_FORMAT_IMA_ADPCM, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_ULAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_39, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":35 - * - * 'ulaw' : SF_FORMAT_ULAW, - * 'alaw' : SF_FORMAT_ALAW, # <<<<<<<<<<<<<< - * 'ima_adpcm' : SF_FORMAT_IMA_ADPCM, - * 'ms_adpcm' : SF_FORMAT_MS_ADPCM, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_ALAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_40, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":36 - * 'ulaw' : SF_FORMAT_ULAW, - * 'alaw' : SF_FORMAT_ALAW, - * 'ima_adpcm' : SF_FORMAT_IMA_ADPCM, # <<<<<<<<<<<<<< - * 'ms_adpcm' : SF_FORMAT_MS_ADPCM, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_IMA_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_41, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":37 - * 'alaw' : SF_FORMAT_ALAW, - * 'ima_adpcm' : SF_FORMAT_IMA_ADPCM, - * 'ms_adpcm' : SF_FORMAT_MS_ADPCM, # <<<<<<<<<<<<<< - * - * 'gsm610' : SF_FORMAT_GSM610, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MS_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_42, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":39 - * 'ms_adpcm' : SF_FORMAT_MS_ADPCM, - * - * 'gsm610' : SF_FORMAT_GSM610, # <<<<<<<<<<<<<< - * 'vox_adpcm' : SF_FORMAT_VOX_ADPCM, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_GSM610); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_43, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":40 - * - * 'gsm610' : SF_FORMAT_GSM610, - * 'vox_adpcm' : SF_FORMAT_VOX_ADPCM, # <<<<<<<<<<<<<< - * - * 'g721_32' : SF_FORMAT_G721_32, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_VOX_ADPCM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_44, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":42 - * 'vox_adpcm' : SF_FORMAT_VOX_ADPCM, - * - * 'g721_32' : SF_FORMAT_G721_32, # <<<<<<<<<<<<<< - * 'g723_24' : SF_FORMAT_G723_24, - * 'g723_40' : SF_FORMAT_G723_40, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G721_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_45, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":43 - * - * 'g721_32' : SF_FORMAT_G721_32, - * 'g723_24' : SF_FORMAT_G723_24, # <<<<<<<<<<<<<< - * 'g723_40' : SF_FORMAT_G723_40, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G723_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_46, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":44 - * 'g721_32' : SF_FORMAT_G721_32, - * 'g723_24' : SF_FORMAT_G723_24, - * 'g723_40' : SF_FORMAT_G723_40, # <<<<<<<<<<<<<< - * - * 'dww12' : SF_FORMAT_DWVW_12, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_G723_40); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_47, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":46 - * 'g723_40' : SF_FORMAT_G723_40, - * - * 'dww12' : SF_FORMAT_DWVW_12, # <<<<<<<<<<<<<< - * 'dww16' : SF_FORMAT_DWVW_16, - * 'dww24' : SF_FORMAT_DWVW_24, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_48, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":47 - * - * 'dww12' : SF_FORMAT_DWVW_12, - * 'dww16' : SF_FORMAT_DWVW_16, # <<<<<<<<<<<<<< - * 'dww24' : SF_FORMAT_DWVW_24, - * 'dwwN' : SF_FORMAT_DWVW_N, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_49, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":48 - * 'dww12' : SF_FORMAT_DWVW_12, - * 'dww16' : SF_FORMAT_DWVW_16, - * 'dww24' : SF_FORMAT_DWVW_24, # <<<<<<<<<<<<<< - * 'dwwN' : SF_FORMAT_DWVW_N, - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_50, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":49 - * 'dww16' : SF_FORMAT_DWVW_16, - * 'dww24' : SF_FORMAT_DWVW_24, - * 'dwwN' : SF_FORMAT_DWVW_N, # <<<<<<<<<<<<<< - * - * 'dpcm8' : SF_FORMAT_DPCM_8, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DWVW_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_51, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":51 - * 'dwwN' : SF_FORMAT_DWVW_N, - * - * 'dpcm8' : SF_FORMAT_DPCM_8, # <<<<<<<<<<<<<< - * 'dpcm16': SF_FORMAT_DPCM_16, - * } - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DPCM_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_52, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":52 - * - * 'dpcm8' : SF_FORMAT_DPCM_8, - * 'dpcm16': SF_FORMAT_DPCM_16, # <<<<<<<<<<<<<< - * } - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_DPCM_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_53, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp__SNDFILE_ENCODING, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":55 - * } - * - * _SNDFILE_FILE_FORMAT = { # <<<<<<<<<<<<<< - * 'wav' : SF_FORMAT_WAV, - * 'aiff' : SF_FORMAT_AIFF, - */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":56 - * - * _SNDFILE_FILE_FORMAT = { - * 'wav' : SF_FORMAT_WAV, # <<<<<<<<<<<<<< - * 'aiff' : SF_FORMAT_AIFF, - * 'au' : SF_FORMAT_AU, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_WAV); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_54, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":57 - * _SNDFILE_FILE_FORMAT = { - * 'wav' : SF_FORMAT_WAV, - * 'aiff' : SF_FORMAT_AIFF, # <<<<<<<<<<<<<< - * 'au' : SF_FORMAT_AU, - * 'raw' : SF_FORMAT_RAW, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AIFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_55, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":58 - * 'wav' : SF_FORMAT_WAV, - * 'aiff' : SF_FORMAT_AIFF, - * 'au' : SF_FORMAT_AU, # <<<<<<<<<<<<<< - * 'raw' : SF_FORMAT_RAW, - * 'paf' : SF_FORMAT_PAF, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AU); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_56, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":59 - * 'aiff' : SF_FORMAT_AIFF, - * 'au' : SF_FORMAT_AU, - * 'raw' : SF_FORMAT_RAW, # <<<<<<<<<<<<<< - * 'paf' : SF_FORMAT_PAF, - * 'svx' : SF_FORMAT_SVX, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_RAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_57, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":60 - * 'au' : SF_FORMAT_AU, - * 'raw' : SF_FORMAT_RAW, - * 'paf' : SF_FORMAT_PAF, # <<<<<<<<<<<<<< - * 'svx' : SF_FORMAT_SVX, - * 'nist' : SF_FORMAT_NIST, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PAF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_58, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":61 - * 'raw' : SF_FORMAT_RAW, - * 'paf' : SF_FORMAT_PAF, - * 'svx' : SF_FORMAT_SVX, # <<<<<<<<<<<<<< - * 'nist' : SF_FORMAT_NIST, - * 'voc' : SF_FORMAT_VOC, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SVX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_59, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":62 - * 'paf' : SF_FORMAT_PAF, - * 'svx' : SF_FORMAT_SVX, - * 'nist' : SF_FORMAT_NIST, # <<<<<<<<<<<<<< - * 'voc' : SF_FORMAT_VOC, - * 'ircam' : SF_FORMAT_IRCAM, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_NIST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_60, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":63 - * 'svx' : SF_FORMAT_SVX, - * 'nist' : SF_FORMAT_NIST, - * 'voc' : SF_FORMAT_VOC, # <<<<<<<<<<<<<< - * 'ircam' : SF_FORMAT_IRCAM, - * 'wav64' : SF_FORMAT_W64, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_VOC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_61, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":64 - * 'nist' : SF_FORMAT_NIST, - * 'voc' : SF_FORMAT_VOC, - * 'ircam' : SF_FORMAT_IRCAM, # <<<<<<<<<<<<<< - * 'wav64' : SF_FORMAT_W64, - * 'mat4' : SF_FORMAT_MAT4, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_IRCAM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_62, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":65 - * 'voc' : SF_FORMAT_VOC, - * 'ircam' : SF_FORMAT_IRCAM, - * 'wav64' : SF_FORMAT_W64, # <<<<<<<<<<<<<< - * 'mat4' : SF_FORMAT_MAT4, - * 'mat5' : SF_FORMAT_MAT5, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_W64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_63, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":66 - * 'ircam' : SF_FORMAT_IRCAM, - * 'wav64' : SF_FORMAT_W64, - * 'mat4' : SF_FORMAT_MAT4, # <<<<<<<<<<<<<< - * 'mat5' : SF_FORMAT_MAT5, - * 'pvf' : SF_FORMAT_PVF, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MAT4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":67 - * 'wav64' : SF_FORMAT_W64, - * 'mat4' : SF_FORMAT_MAT4, - * 'mat5' : SF_FORMAT_MAT5, # <<<<<<<<<<<<<< - * 'pvf' : SF_FORMAT_PVF, - * 'xi' : SF_FORMAT_XI, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_MAT5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_65, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":68 - * 'mat4' : SF_FORMAT_MAT4, - * 'mat5' : SF_FORMAT_MAT5, - * 'pvf' : SF_FORMAT_PVF, # <<<<<<<<<<<<<< - * 'xi' : SF_FORMAT_XI, - * 'htk' : SF_FORMAT_HTK, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_PVF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_66, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":69 - * 'mat5' : SF_FORMAT_MAT5, - * 'pvf' : SF_FORMAT_PVF, - * 'xi' : SF_FORMAT_XI, # <<<<<<<<<<<<<< - * 'htk' : SF_FORMAT_HTK, - * 'sds' : SF_FORMAT_SDS, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_XI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_67, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":70 - * 'pvf' : SF_FORMAT_PVF, - * 'xi' : SF_FORMAT_XI, - * 'htk' : SF_FORMAT_HTK, # <<<<<<<<<<<<<< - * 'sds' : SF_FORMAT_SDS, - * 'avr' : SF_FORMAT_AVR, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_HTK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_68, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":71 - * 'xi' : SF_FORMAT_XI, - * 'htk' : SF_FORMAT_HTK, - * 'sds' : SF_FORMAT_SDS, # <<<<<<<<<<<<<< - * 'avr' : SF_FORMAT_AVR, - * 'wavex' : SF_FORMAT_WAVEX, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SDS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_69, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":72 - * 'htk' : SF_FORMAT_HTK, - * 'sds' : SF_FORMAT_SDS, - * 'avr' : SF_FORMAT_AVR, # <<<<<<<<<<<<<< - * 'wavex' : SF_FORMAT_WAVEX, - * 'sd2' : SF_FORMAT_SD2, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_AVR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_70, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":73 - * 'sds' : SF_FORMAT_SDS, - * 'avr' : SF_FORMAT_AVR, - * 'wavex' : SF_FORMAT_WAVEX, # <<<<<<<<<<<<<< - * 'sd2' : SF_FORMAT_SD2, - * } - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_WAVEX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_71, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":74 - * 'avr' : SF_FORMAT_AVR, - * 'wavex' : SF_FORMAT_WAVEX, - * 'sd2' : SF_FORMAT_SD2, # <<<<<<<<<<<<<< - * } - * - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_FORMAT_SD2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_72, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp_73, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":80 - * # relatively recent and not available on all sndfile available, harcode the - * # values to avoid breaking compilation older sndfile. - * _SNDFILE_ENCODING['vorbis'] = 0x0060 # <<<<<<<<<<<<<< - * - * _SNDFILE_FILE_FORMAT['flac'] = 0x170000 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_74, __pyx_int_0x0060) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":82 - * _SNDFILE_ENCODING['vorbis'] = 0x0060 - * - * _SNDFILE_FILE_FORMAT['flac'] = 0x170000 # <<<<<<<<<<<<<< - * _SNDFILE_FILE_FORMAT['caf'] = 0x180000 - * _SNDFILE_FILE_FORMAT['wve'] = 0x190000 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_75, __pyx_int_0x170000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":83 - * - * _SNDFILE_FILE_FORMAT['flac'] = 0x170000 - * _SNDFILE_FILE_FORMAT['caf'] = 0x180000 # <<<<<<<<<<<<<< - * _SNDFILE_FILE_FORMAT['wve'] = 0x190000 - * _SNDFILE_FILE_FORMAT['ogg'] = 0x200000 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_76, __pyx_int_0x180000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":84 - * _SNDFILE_FILE_FORMAT['flac'] = 0x170000 - * _SNDFILE_FILE_FORMAT['caf'] = 0x180000 - * _SNDFILE_FILE_FORMAT['wve'] = 0x190000 # <<<<<<<<<<<<<< - * _SNDFILE_FILE_FORMAT['ogg'] = 0x200000 - * _SNDFILE_FILE_FORMAT['mpc2k'] = 0x210000 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_77, __pyx_int_0x190000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":85 - * _SNDFILE_FILE_FORMAT['caf'] = 0x180000 - * _SNDFILE_FILE_FORMAT['wve'] = 0x190000 - * _SNDFILE_FILE_FORMAT['ogg'] = 0x200000 # <<<<<<<<<<<<<< - * _SNDFILE_FILE_FORMAT['mpc2k'] = 0x210000 - * _SNDFILE_FILE_FORMAT['rf64'] = 0x220000 - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_78, __pyx_int_0x200000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":86 - * _SNDFILE_FILE_FORMAT['wve'] = 0x190000 - * _SNDFILE_FILE_FORMAT['ogg'] = 0x200000 - * _SNDFILE_FILE_FORMAT['mpc2k'] = 0x210000 # <<<<<<<<<<<<<< - * _SNDFILE_FILE_FORMAT['rf64'] = 0x220000 - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_79, __pyx_int_0x210000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":87 - * _SNDFILE_FILE_FORMAT['ogg'] = 0x200000 - * _SNDFILE_FILE_FORMAT['mpc2k'] = 0x210000 - * _SNDFILE_FILE_FORMAT['rf64'] = 0x220000 # <<<<<<<<<<<<<< - * - * - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetItem(__pyx_1, __pyx_kp_80, __pyx_int_0x220000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":90 - * - * - * _SNDFILE_ENDIAN = { # <<<<<<<<<<<<<< - * 'file' : SF_ENDIAN_FILE, - * 'little' : SF_ENDIAN_LITTLE, - */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":91 - * - * _SNDFILE_ENDIAN = { - * 'file' : SF_ENDIAN_FILE, # <<<<<<<<<<<<<< - * 'little' : SF_ENDIAN_LITTLE, - * 'big' : SF_ENDIAN_BIG, - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_FILE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_81, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":92 - * _SNDFILE_ENDIAN = { - * 'file' : SF_ENDIAN_FILE, - * 'little' : SF_ENDIAN_LITTLE, # <<<<<<<<<<<<<< - * 'big' : SF_ENDIAN_BIG, - * 'cpu' : SF_ENDIAN_CPU - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_LITTLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_82, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":93 - * 'file' : SF_ENDIAN_FILE, - * 'little' : SF_ENDIAN_LITTLE, - * 'big' : SF_ENDIAN_BIG, # <<<<<<<<<<<<<< - * 'cpu' : SF_ENDIAN_CPU - * } - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_BIG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_83, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":95 - * 'big' : SF_ENDIAN_BIG, - * 'cpu' : SF_ENDIAN_CPU - * } # <<<<<<<<<<<<<< - * - * # Those following dic are used internally to get user-friendly values from - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyInt_FromLong(SF_ENDIAN_CPU); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_1, __pyx_kp_84, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp__SNDFILE_ENDIAN, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":100 - * # sndfile enum - * _ENUM_TO_STR_ENCODING = \ - * dict([(i, j) for j, i in _SNDFILE_ENCODING.items()]) # <<<<<<<<<<<<<< - * _ENUM_TO_STR_FILE_FORMAT = \ - * dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()]) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENCODING); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_4 allocated */ - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; Py_INCREF(__pyx_t_4); - } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - for (;;) { - /* __pyx_t_3 allocated */ - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - if (PyTuple_CheckExact(__pyx_t_3) && PyTuple_GET_SIZE(__pyx_t_3) == 2) { - PyObject* tuple = __pyx_t_3; - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_3); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - } else { - __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - } - /* __pyx_t_3 released */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - } - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp_85, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":102 - * dict([(i, j) for j, i in _SNDFILE_ENCODING.items()]) - * _ENUM_TO_STR_FILE_FORMAT = \ - * dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()]) # <<<<<<<<<<<<<< - * _ENUM_TO_STR_ENDIAN = \ - * dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()]) - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_73); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_kp_items); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; Py_INCREF(__pyx_t_3); - } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - for (;;) { - /* __pyx_t_4 allocated */ - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); Py_INCREF(__pyx_t_4); __pyx_t_2++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - if (PyTuple_CheckExact(__pyx_t_4) && PyTuple_GET_SIZE(__pyx_t_4) == 2) { - PyObject* tuple = __pyx_t_4; - __pyx_3 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_3); - __pyx_1 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_1); - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - } else { - __pyx_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - } - /* __pyx_t_4 released */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_3); - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - } - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp_86, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":104 - * dict([(i, j) for j, i in _SNDFILE_FILE_FORMAT.items()]) - * _ENUM_TO_STR_ENDIAN = \ - * dict([(i, j) for j, i in _SNDFILE_ENDIAN.items()]) # <<<<<<<<<<<<<< - * - * def sndfile_version(): - */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_2 allocated */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__SNDFILE_ENDIAN); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* __pyx_t_4 allocated */ - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_3; Py_INCREF(__pyx_t_4); - } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - for (;;) { - /* __pyx_t_3 allocated */ - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); Py_INCREF(__pyx_t_3); __pyx_t_2++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - } - if (PyTuple_CheckExact(__pyx_t_3) && PyTuple_GET_SIZE(__pyx_t_3) == 2) { - PyObject* tuple = __pyx_t_3; - __pyx_1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(__pyx_1); - __pyx_2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(__pyx_2); - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - } else { - __pyx_3 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_UnpackItem(__pyx_3, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_j, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - } - /* __pyx_t_3 released */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_i); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_j); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* __pyx_t_3 allocated */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_3); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_1); - __pyx_3 = 0; - __pyx_1 = 0; - __pyx_4 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_3); if (unlikely(__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* __pyx_t_3 released */ - } - /* __pyx_t_2 released */ - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - /* __pyx_t_4 allocated */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - /* __pyx_t_1 released */ - /* __pyx_t_1 allocated */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - /* __pyx_t_4 released */ - if (PyObject_SetAttr(__pyx_m, __pyx_kp__ENUM_TO_STR_ENDIAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* __pyx_t_1 released */ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/pysndfile/_sndfile.pyx":591 - * return "\n".join(repstr) - * - * def read_frames(self, sf_count_t nframes, dtype=np.float64): # <<<<<<<<<<<<<< - * """\ - * Read the given number of frames and put the data into a numpy array of - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_91); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_k_92 = __pyx_3; - __pyx_3 = 0; - - /* "/home/david/local/lib/python2.5/site-packages/Cython/Includes/stdlib.pxd":2 - * - * cdef extern from "stdlib.h": # <<<<<<<<<<<<<< - * ctypedef unsigned long size_t - * void free(void *ptr) - */ - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_AddTraceback("scikits.audiolab.pysndfile._sndfile"); - #if PY_MAJOR_VERSION >= 3 - return NULL; - #endif -} - -static const char *__pyx_filenames[] = { - "_sndfile.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - name = argnames; - while (*name && (**name != key)) name++; - if (*name) { - if (name < first_kw_arg) goto arg_passed_twice; - values[name-argnames] = value; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} - -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts) { - while (1) { - switch (*ts) { - case '@': - case 10: - case 13: - case ' ': - ++ts; - break; - case '=': - case '<': - case '>': - case '!': - PyErr_SetString(PyExc_ValueError, "Buffer acquisition error: Only native byte order, size and alignment supported."); - return NULL; - default: - return ts; - } - } -} - -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - expected_ndim, buffer->ndim); -} - -static const char* __Pyx_DescribeTokenInFormatString(const char* ts) { - switch (*ts) { - case 'b': return "char"; - case 'B': return "unsigned char"; - case 'h': return "short"; - case 'H': return "unsigned short"; - case 'i': return "int"; - case 'I': return "unsigned int"; - case 'l': return "long"; - case 'L': return "unsigned long"; - case 'q': return "long long"; - case 'Q': return "unsigned long long"; - case 'f': return "float"; - case 'd': return "double"; - case 'g': return "long double"; - case 'Z': switch (*(ts+1)) { - case 'f': return "complex float"; - case 'd': return "complex double"; - case 'g': return "complex long double"; - default: return "unparseable format string"; - } - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - default: return "unparseable format string"; - } -} - -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'f': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(float) && (__pyx_t_5numpy_float64_t)-1 < 0); break; - case 'd': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(double) && (__pyx_t_5numpy_float64_t)-1 < 0); break; - case 'g': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(long double) && (__pyx_t_5numpy_float64_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float64_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_float64_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_Format(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'f': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(float) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - case 'd': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(double) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - case 'g': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(long double) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_float32_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -}static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'b': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(char) && (__pyx_t_5numpy_int32_t)-1 < 0); break; - case 'h': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(short) && (__pyx_t_5numpy_int32_t)-1 < 0); break; - case 'i': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(int) && (__pyx_t_5numpy_int32_t)-1 < 0); break; - case 'l': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (__pyx_t_5numpy_int32_t)-1 < 0); break; - case 'q': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long long) && (__pyx_t_5numpy_int32_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_int32_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -}static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'b': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(char) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'h': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(short) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'i': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(int) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'l': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'q': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long long) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int16_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_int16_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - #if PY_VERSION_HEX >= 0x02060000 - if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER) - return PyObject_GetBuffer(obj, view, flags); - #endif - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags); - else { - PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; - } -} - -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject* obj = view->obj; - if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); - Py_DECREF(obj); - view->obj = NULL; - } -} - -#endif - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunctionObjArgs(__import__, - name, global_dict, empty_dict, list, NULL); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d values to unpack", (int)index); - #else - "need more than %zd values to unpack", index); - #endif - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - __Pyx_ErrFetch(type, value, tb); - PyErr_NormalizeException(type, value, tb); - if (PyErr_Occurred()) - goto bad; - Py_INCREF(*type); - Py_INCREF(*value); - Py_INCREF(*tb); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - Py_XDECREF(*type); - Py_XDECREF(*value); - Py_XDECREF(*tb); - return -1; -} - - -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { - PyObject *pycobj = 0; - int result; - - pycobj = PyCObject_FromVoidPtr(vtable, 0); - if (!pycobj) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) - goto bad; - result = 0; - goto done; - -bad: - result = -1; -done: - Py_XDECREF(pycobj); - return result; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyObject *empty_string = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - #if PY_MAJOR_VERSION < 3 - empty_string = PyString_FromStringAndSize("", 0); - #else - empty_string = PyBytes_FromStringAndSize("", 0); - #endif - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_string); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if (x == Py_False) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - return PyInt_AS_LONG(x); - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - long val = PyInt_AS_LONG(x); - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); - return (unsigned PY_LONG_LONG)-1; - } - return val; - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsUnsignedLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned char val = (unsigned char)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); - return (unsigned char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned short val = (unsigned short)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short"); - return (unsigned short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE char __pyx_PyInt_char(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - char val = (char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); - return (char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE short __pyx_PyInt_short(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - short val = (short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to short"); - return (short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE int __pyx_PyInt_int(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - int val = (int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); - return (int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long __pyx_PyInt_long(PyObject* x) { - if (sizeof(long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long val = (long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); - return (long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed char val = (signed char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char"); - return (signed char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed short val = (signed short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short"); - return (signed short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed int val = (signed int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int"); - return (signed int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) { - if (sizeof(signed long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed long val = (signed long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long"); - return (signed long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long double __pyx_PyInt_long_double(PyObject* x) { - if (sizeof(long double) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long double val = (long double)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double"); - return (long double)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - diff --git a/audiolab/pysndfile/_sndfile.pyx b/audiolab/pysndfile/_sndfile.pyx index 48df0e9..deb77fe 100644 --- a/audiolab/pysndfile/_sndfile.pyx +++ b/audiolab/pysndfile/_sndfile.pyx @@ -5,9 +5,10 @@ import warnings import copy cimport numpy as cnp -cimport stdlib +cimport libc.stdlib as stdlib from sndfile cimport * cimport sndfile as csndfile +cimport libc.string as string cdef extern from "sndfile.h": cdef struct SF_FORMAT_INFO: @@ -16,6 +17,15 @@ cdef extern from "sndfile.h": char *extension ctypedef SF_FORMAT_INFO SF_FORMAT_INFO +# FIXME: Hacky workaround. __quad_t is defined in sndfile.pxd, +# but the compiler seems to not find it on Macs +IF UNAME_SYSNAME == "Darwin": + cdef extern from *: + """ + typedef long long int __quad_t; + """ + pass + cdef extern from "Python.h": object PyString_FromStringAndSize(char *v, int len) @@ -112,7 +122,7 @@ def sndfile_version(): if st < 1: raise RuntimeError("Error while getting version of libsndfile") - ver = PyString_FromStringAndSize(buff, stdlib.strlen(buff)) + ver = PyString_FromStringAndSize(buff, string.strlen(buff)) # Get major, minor and micro from version # Template: libsndfile-X.X.XpreX with preX being optional @@ -213,7 +223,7 @@ cdef class Format: "problem to the maintainer") self._format_str = PyString_FromStringAndSize(format_info.name, - stdlib.strlen(format_info.name)) + string.strlen(format_info.name)) # Get the sndfile string description of the encoding type format_info.format = cencoding @@ -225,7 +235,7 @@ cdef class Format: "problem to the maintainer") self._encoding_str = PyString_FromStringAndSize(format_info.name, - stdlib.strlen(format_info.name)) + string.strlen(format_info.name)) self._format_raw_int = format @@ -634,7 +644,7 @@ broken)""" elif dtype == np.int16: y = self.read_frames_short(nframes) else: - RuntimeError("Sorry, dtype %s not supported" % str(dtype)) + raise RuntimeError("Sorry, dtype %s not supported" % str(dtype)) if y.shape[1] == 1: return y[:, 0] @@ -671,7 +681,7 @@ broken)""" # Use Fortran order to cope with interleaving ty = np.empty((nframes, self._sfinfo.channels), - dtype=np.int, order='F') + dtype=np.int32, order='F') res = sf_readf_int(self.hdl, ty.data, nframes) if not res == nframes: @@ -736,12 +746,12 @@ broken)""" res = self.write_frames_double(input, nframes) elif input.dtype == np.float32: res = self.write_frames_float(input, nframes) - elif input.dtype == np.int: + elif input.dtype == np.int32: res = self.write_frames_int(input, nframes) elif input.dtype == np.short: res = self.write_frames_short(input, nframes) else: - raise Exception("type of input &s not understood" % str(input.dtype)) + raise Exception("type of input %s not understood" % str(input.dtype)) if not(res == nframes): raise IOError("write %d frames, expected to write %d" diff --git a/audiolab/pysndfile/setup.py b/audiolab/pysndfile/setup.py index 27366e7..e73bdef 100644 --- a/audiolab/pysndfile/setup.py +++ b/audiolab/pysndfile/setup.py @@ -1,7 +1,6 @@ import os import sys -from numpy.distutils.core import setup, Extension from setuphelp import info_factory, NotFoundError SNDFILE_MAJ_VERSION = 1 @@ -24,7 +23,7 @@ def configuration(parent_package='',top_path=None): Directories to search for the libraries can be specified in the site.cfg file, in section [sndfile].""") - confgr.add_extension('_sndfile', ['_sndfile.c'], extra_info=sf_config) + confgr.add_extension('_sndfile', ['_sndfile.pyx'], extra_info=sf_config) return confgr diff --git a/audiolab/soundio/.gitignore b/audiolab/soundio/.gitignore new file mode 100644 index 0000000..88e8fe4 --- /dev/null +++ b/audiolab/soundio/.gitignore @@ -0,0 +1,2 @@ +_alsa_backend.so +macosx_backend.so \ No newline at end of file diff --git a/audiolab/soundio/alsa/.gitignore b/audiolab/soundio/alsa/.gitignore new file mode 100644 index 0000000..a70160f --- /dev/null +++ b/audiolab/soundio/alsa/.gitignore @@ -0,0 +1 @@ +_alsa_backend.c \ No newline at end of file diff --git a/audiolab/soundio/alsa/_alsa_backend.c b/audiolab/soundio/alsa/_alsa_backend.c deleted file mode 100644 index 71070b1..0000000 --- a/audiolab/soundio/alsa/_alsa_backend.c +++ /dev/null @@ -1,4918 +0,0 @@ -/* Generated by Cython 0.10.2 on Thu Dec 4 19:57:25 2008 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_LOCK 0x0002 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif -#else - #define _USE_MATH_DEFINES -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API___alsa_backend -#include "alsa/asoundlib.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x); -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); - -#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x); -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x); -static INLINE char __pyx_PyInt_char(PyObject* x); -static INLINE short __pyx_PyInt_short(PyObject* x); -static INLINE int __pyx_PyInt_int(PyObject* x); -static INLINE long __pyx_PyInt_long(PyObject* x); -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x); -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x); -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x); -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x); -static INLINE long double __pyx_PyInt_long_double(PyObject* x); -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/ -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/ -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/ -static const char* __Pyx_DescribeTokenInFormatString(const char* ts); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ - -static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { - PyObject *r; - if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned)) - r = PySequence_GetItem(o, i); - else { - PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); - if (!j) - return 0; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - } - return r; -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); -static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else -#define __Pyx_GetBuffer PyObject_GetBuffer -#define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - -Py_ssize_t __Pyx_zeros[] = {0, 0}; -Py_ssize_t __Pyx_minusones[] = {-1, -1}; - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ - -static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; - Py_INCREF(Py_None); - return Py_None; // this is just to have an accurate signature - } - else { - return PyObject_CallMethod(L, "append", "(O)", x); - } -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_Print(PyObject *, int); /*proto*/ -#if PY_MAJOR_VERSION >= 3 -static PyObject* __pyx_print = 0; -static PyObject* __pyx_print_kwargs = 0; -#endif - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":50 - * return devices - * - * cdef struct format_info: # <<<<<<<<<<<<<< - * # number of channels - * int nchannels - */ - -struct __pyx_t_13_alsa_backend_format_info { - int nchannels; - int rate; - int nbits; - int byte_fmt; -}; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":60 - * int byte_fmt - * - * cdef class AlsaDevice: # <<<<<<<<<<<<<< - * cdef snd_pcm_t *handle - * cdef format_info format - */ - -struct __pyx_obj_13_alsa_backend_AlsaDevice { - PyObject_HEAD - struct __pyx_vtabstruct_13_alsa_backend_AlsaDevice *__pyx_vtab; - snd_pcm_t *handle; - struct __pyx_t_13_alsa_backend_format_info format; -}; - - -struct __pyx_vtabstruct_13_alsa_backend_AlsaDevice { - int (*_play)(struct __pyx_obj_13_alsa_backend_AlsaDevice *, PyArrayObject *); -}; -static struct __pyx_vtabstruct_13_alsa_backend_AlsaDevice *__pyx_vtabptr_13_alsa_backend_AlsaDevice; -/* Module declarations from python_buffer */ - -/* Module declarations from stdlib */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -/* Module declarations from python_exc */ - -/* Module declarations from alsa */ - -/* Module declarations from _alsa_backend */ - -static PyTypeObject *__pyx_ptype_13_alsa_backend_AlsaDevice = 0; -static int __pyx_v_13_alsa_backend_BUFFER_TIME; -static int __pyx_v_13_alsa_backend_PERIOD_TIME; -static PyObject *__pyx_f_13_alsa_backend_set_hw_params(snd_pcm_t *, struct __pyx_t_13_alsa_backend_format_info, snd_pcm_uframes_t *, snd_pcm_uframes_t *); /*proto*/ -static PyObject *__pyx_f_13_alsa_backend_set_sw_params(snd_pcm_t *, unsigned int, unsigned int); /*proto*/ - - -/* Implementation of _alsa_backend */ -static PyObject *__pyx_int_32568; -static PyObject *__pyx_int_0; -static char __pyx_k___init__[] = "__init__"; -static PyObject *__pyx_kp___init__; -static char __pyx_k_play[] = "play"; -static PyObject *__pyx_kp_play; -static char __pyx_k___dealloc__[] = "__dealloc__"; -static PyObject *__pyx_kp___dealloc__; -static char __pyx_k_fs[] = "fs"; -static PyObject *__pyx_kp_fs; -static char __pyx_k_nchannels[] = "nchannels"; -static PyObject *__pyx_kp_nchannels; -static char __pyx_k_input[] = "input"; -static PyObject *__pyx_kp_input; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k_AlsaException[] = "AlsaException"; -static PyObject *__pyx_kp_AlsaException; -static char __pyx_k_Exception[] = "Exception"; -static PyObject *__pyx_kp_Exception; -static char __pyx_k_append[] = "append"; -static PyObject *__pyx_kp_append; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_empty[] = "empty"; -static PyObject *__pyx_kp_empty; -static char __pyx_k_dtype[] = "dtype"; -static PyObject *__pyx_kp_dtype; -static char __pyx_k_31[] = "int16"; -static PyObject *__pyx_kp_31; -static char __pyx_k_size[] = "size"; -static PyObject *__pyx_kp_size; -static char __pyx_k_asfortranarray[] = "asfortranarray"; -static PyObject *__pyx_kp_asfortranarray; -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_ValueError; -static char __pyx_k_23[] = "pcm"; -static PyObject *__pyx_kp_24; -static PyObject *__pyx_kp_26; -static PyObject *__pyx_kp_27; -static PyObject *__pyx_kp_28; -static char __pyx_k_24[] = "Only mono/stereo signals supported for now"; -static char __pyx_k_25[] = "default"; -static char __pyx_k_26[] = "Fail opening 'default'"; -static char __pyx_k_27[] = "Period size is"; -static char __pyx_k_28[] = ", Buffer size is"; -static PyObject *__pyx_kp_29; -static PyObject *__pyx_kp_30; -static PyObject *__pyx_kp_32; -static PyObject *__pyx_kp_33; -static PyObject *__pyx_kp_34; -static char __pyx_k_29[] = "Only rank 2 for now"; -static char __pyx_k_30[] = "AlsaDevice configured for %d channels, signal has %d channels"; -static char __pyx_k_32[] = "Error while preparing the pcm device"; -static char __pyx_k_33[] = "Error in writei"; -static char __pyx_k_34[] = "Got SIGINT: draining the pcm device... "; -static PyObject *__pyx_kp_35; -static PyObject *__pyx_kp_36; -static PyObject *__pyx_kp_37; -static PyObject *__pyx_kp_38; -static PyObject *__pyx_kp_39; -static PyObject *__pyx_kp_40; -static PyObject *__pyx_kp_41; -static PyObject *__pyx_kp_42; -static PyObject *__pyx_kp_43; -static PyObject *__pyx_kp_44; -static PyObject *__pyx_kp_45; -static char __pyx_k_35[] = "Error in _any"; -static char __pyx_k_36[] = "Error in _set_rate_resample"; -static char __pyx_k_37[] = "Error in _set_access"; -static char __pyx_k_38[] = "Error in _set_format"; -static char __pyx_k_39[] = "Error in _set_channels"; -static char __pyx_k_40[] = "Error in _set_rate_near"; -static char __pyx_k_41[] = "Error in _set_buffer_near"; -static char __pyx_k_42[] = "Error in _set_period_time_near"; -static char __pyx_k_43[] = "Error in applying hw params"; -static char __pyx_k_44[] = "Error in get_period_sizse"; -static char __pyx_k_45[] = "Error in get_buffer_sizse"; -static PyObject *__pyx_kp_46; -static PyObject *__pyx_kp_47; -static PyObject *__pyx_kp_48; -static PyObject *__pyx_kp_49; -static char __pyx_k_46[] = "Error in _current"; -static char __pyx_k_47[] = "Error in _set_start_threshold"; -static char __pyx_k_48[] = "Error in _set_avail_min"; -static char __pyx_k_49[] = "Error in applying sw params"; -static char __pyx_k___getbuffer__[] = "__getbuffer__"; -static PyObject *__pyx_kp___getbuffer__; -static char __pyx_k___releasebuffer__[] = "__releasebuffer__"; -static PyObject *__pyx_kp___releasebuffer__; -static char __pyx_k_info[] = "info"; -static PyObject *__pyx_kp_info; -static char __pyx_k_flags[] = "flags"; -static PyObject *__pyx_kp_flags; -static char __pyx_k_iteritems[] = "iteritems"; -static PyObject *__pyx_kp_iteritems; -static char __pyx_k_next[] = "next"; -static PyObject *__pyx_kp_next; -static char __pyx_k_StopIteration[] = "StopIteration"; -static PyObject *__pyx_kp_StopIteration; -static char __pyx_k_pop[] = "pop"; -static PyObject *__pyx_kp_pop; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static PyObject *__pyx_kp_RuntimeError; -static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_20; -static PyObject *__pyx_kp_21; -static PyObject *__pyx_kp_22; -static PyObject *__pyx_builtin_StopIteration; -static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_1[] = "ndarray is not C contiguous"; -static char __pyx_k_2[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_3[] = "b"; -static char __pyx_k_4[] = "B"; -static char __pyx_k_5[] = "h"; -static char __pyx_k_6[] = "H"; -static char __pyx_k_7[] = "i"; -static char __pyx_k_8[] = "I"; -static char __pyx_k_9[] = "l"; -static char __pyx_k_10[] = "L"; -static char __pyx_k_11[] = "q"; -static char __pyx_k_12[] = "Q"; -static char __pyx_k_13[] = "f"; -static char __pyx_k_14[] = "d"; -static char __pyx_k_15[] = "g"; -static char __pyx_k_16[] = "Zf"; -static char __pyx_k_17[] = "Zd"; -static char __pyx_k_18[] = "Zg"; -static char __pyx_k_19[] = "O"; -static char __pyx_k_20[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_21[] = "Format string allocated too short."; -static char __pyx_k_22[] = "unknown dtype code in numpy.pxd (%d)"; - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":22 - * pass - * - * def alsa_version(): # <<<<<<<<<<<<<< - * """Return the version of libasound used by the alsa backend.""" - * return snd_asoundlib_version() - */ - -static PyObject *__pyx_pf_13_alsa_backend_alsa_version(PyObject *__pyx_self, PyObject *unused); /*proto*/ -static char __pyx_doc_13_alsa_backend_alsa_version[] = "Return the version of libasound used by the alsa backend."; -static PyObject *__pyx_pf_13_alsa_backend_alsa_version(PyObject *__pyx_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - __pyx_self = __pyx_self; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":24 - * def alsa_version(): - * """Return the version of libasound used by the alsa backend.""" - * return snd_asoundlib_version() # <<<<<<<<<<<<<< - * - * def enumerate_devices(): - */ - __pyx_1 = __Pyx_PyBytes_FromString(snd_asoundlib_version()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("_alsa_backend.alsa_version"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":26 - * return snd_asoundlib_version() - * - * def enumerate_devices(): # <<<<<<<<<<<<<< - * """Return list of found devices (includes user-space ones).""" - * cdef int st, card - */ - -static PyObject *__pyx_pf_13_alsa_backend_enumerate_devices(PyObject *__pyx_self, PyObject *unused); /*proto*/ -static char __pyx_doc_13_alsa_backend_enumerate_devices[] = "Return list of found devices (includes user-space ones)."; -static PyObject *__pyx_pf_13_alsa_backend_enumerate_devices(PyObject *__pyx_self, PyObject *unused) { - int __pyx_v_st; - int __pyx_v_card; - char **__pyx_v_hints; - PyObject *__pyx_v_devices; - PyObject *__pyx_v_names; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - __pyx_self = __pyx_self; - __pyx_v_devices = Py_None; Py_INCREF(Py_None); - __pyx_v_names = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":32 - * cdef char* name - * - * devices = [] # <<<<<<<<<<<<<< - * names = [] - * - */ - __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_devices); - __pyx_v_devices = ((PyObject *)__pyx_1); - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":33 - * - * devices = [] - * names = [] # <<<<<<<<<<<<<< - * - * card = -1 - */ - __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_names); - __pyx_v_names = ((PyObject *)__pyx_1); - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":35 - * names = [] - * - * card = -1 # <<<<<<<<<<<<<< - * st = snd_device_name_hint(card, "pcm", &hints) - * card = 0 - */ - __pyx_v_card = -1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":36 - * - * card = -1 - * st = snd_device_name_hint(card, "pcm", &hints) # <<<<<<<<<<<<<< - * card = 0 - * while(hints[card] != NULL): - */ - __pyx_v_st = snd_device_name_hint(__pyx_v_card, __pyx_k_23, ((void ***)(&__pyx_v_hints))); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":37 - * card = -1 - * st = snd_device_name_hint(card, "pcm", &hints) - * card = 0 # <<<<<<<<<<<<<< - * while(hints[card] != NULL): - * #name = snd_device_name_get_hint(hints[card], "NAME") - */ - __pyx_v_card = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":38 - * st = snd_device_name_hint(card, "pcm", &hints) - * card = 0 - * while(hints[card] != NULL): # <<<<<<<<<<<<<< - * #name = snd_device_name_get_hint(hints[card], "NAME") - * #names.append(PyString_FromStringAndSize(name, stdlib.strlen(name))) - */ - while (1) { - __pyx_2 = ((__pyx_v_hints[__pyx_v_card]) != NULL); - if (!__pyx_2) break; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":44 - * # stdlib.free(name) - * devices.append(PyString_FromStringAndSize(hints[card], - * stdlib.strlen(hints[card]))) # <<<<<<<<<<<<<< - * card += 1 - * snd_device_name_free_hint(hints) - */ - __pyx_1 = PyString_FromStringAndSize((__pyx_v_hints[__pyx_v_card]), strlen((__pyx_v_hints[__pyx_v_card]))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_PyObject_Append(__pyx_v_devices, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":45 - * devices.append(PyString_FromStringAndSize(hints[card], - * stdlib.strlen(hints[card]))) - * card += 1 # <<<<<<<<<<<<<< - * snd_device_name_free_hint(hints) - * - */ - __pyx_v_card += 1; - } - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":46 - * stdlib.strlen(hints[card]))) - * card += 1 - * snd_device_name_free_hint(hints) # <<<<<<<<<<<<<< - * - * return devices - */ - snd_device_name_free_hint(((void **)__pyx_v_hints)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":48 - * snd_device_name_free_hint(hints) - * - * return devices # <<<<<<<<<<<<<< - * - * cdef struct format_info: - */ - Py_INCREF(__pyx_v_devices); - __pyx_r = __pyx_v_devices; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_3); - __Pyx_AddTraceback("_alsa_backend.enumerate_devices"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_devices); - Py_DECREF(__pyx_v_names); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":63 - * cdef snd_pcm_t *handle - * cdef format_info format - * def __init__(AlsaDevice self, unsigned int fs=48000, int nchannels=1): # <<<<<<<<<<<<<< - * cdef int st - * cdef snd_pcm_uframes_t psize, bsize - */ - -static int __pyx_pf_13_alsa_backend_10AlsaDevice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_13_alsa_backend_10AlsaDevice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - unsigned int __pyx_v_fs; - int __pyx_v_nchannels; - int __pyx_v_st; - snd_pcm_uframes_t __pyx_v_psize; - snd_pcm_uframes_t __pyx_v_bsize; - int __pyx_r; - int __pyx_1; - int __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_fs,&__pyx_kp_nchannels,0}; - __pyx_v_fs = 48000; - __pyx_v_nchannels = 1; - if (unlikely(__pyx_kwds)) { - PyObject* values[2] = {0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_fs = PyInt_AsUnsignedLongMask(values[0]); if (unlikely((__pyx_v_fs == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[1]) { - __pyx_v_nchannels = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_nchannels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_nchannels = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_nchannels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_fs = PyInt_AsUnsignedLongMask(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_fs == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("_alsa_backend.AlsaDevice.__init__"); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":67 - * cdef snd_pcm_uframes_t psize, bsize - * - * self.format.rate = fs # <<<<<<<<<<<<<< - * self.format.nchannels = nchannels - * - */ - ((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->format.rate = __pyx_v_fs; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":68 - * - * self.format.rate = fs - * self.format.nchannels = nchannels # <<<<<<<<<<<<<< - * - * if not (nchannels > 0 and nchannels < 3): - */ - ((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->format.nchannels = __pyx_v_nchannels; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":70 - * self.format.nchannels = nchannels - * - * if not (nchannels > 0 and nchannels < 3): # <<<<<<<<<<<<<< - * raise ValueError,\ - * "Only mono/stereo signals supported for now" - */ - __pyx_1 = (__pyx_v_nchannels > 0); - if (__pyx_1) { - __pyx_1 = (__pyx_v_nchannels < 3); - } - __pyx_2 = (!__pyx_1); - if (__pyx_2) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":72 - * if not (nchannels > 0 and nchannels < 3): - * raise ValueError,\ - * "Only mono/stereo signals supported for now" # <<<<<<<<<<<<<< - * - * self.handle = 0 - */ - __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_24, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":74 - * "Only mono/stereo signals supported for now" - * - * self.handle = 0 # <<<<<<<<<<<<<< - * st = snd_pcm_open(&self.handle, "default", SND_PCM_STREAM_PLAYBACK, 0) - * if st < 0: - */ - ((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle = ((snd_pcm_t *)0); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":75 - * - * self.handle = 0 - * st = snd_pcm_open(&self.handle, "default", SND_PCM_STREAM_PLAYBACK, 0) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Fail opening 'default'") - */ - __pyx_v_st = snd_pcm_open((&((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle), __pyx_k_25, SND_PCM_STREAM_PLAYBACK, 0); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":76 - * self.handle = 0 - * st = snd_pcm_open(&self.handle, "default", SND_PCM_STREAM_PLAYBACK, 0) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Fail opening 'default'") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":77 - * st = snd_pcm_open(&self.handle, "default", SND_PCM_STREAM_PLAYBACK, 0) - * if st < 0: - * raise AlsaException("Fail opening 'default'") # <<<<<<<<<<<<<< - * - * set_hw_params(self.handle, self.format, &psize, &bsize) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_26); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_26); - __pyx_5 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":79 - * raise AlsaException("Fail opening 'default'") - * - * set_hw_params(self.handle, self.format, &psize, &bsize) # <<<<<<<<<<<<<< - * print "Period size is", psize, ", Buffer size is", bsize - * - */ - __pyx_3 = __pyx_f_13_alsa_backend_set_hw_params(((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle, ((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->format, (&__pyx_v_psize), (&__pyx_v_bsize)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":80 - * - * set_hw_params(self.handle, self.format, &psize, &bsize) - * print "Period size is", psize, ", Buffer size is", bsize # <<<<<<<<<<<<<< - * - * set_sw_params(self.handle, psize, bsize) - */ - __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_psize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyLong_FromUnsignedLong(__pyx_v_bsize); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_27); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_27); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - Py_INCREF(__pyx_kp_28); - PyTuple_SET_ITEM(__pyx_3, 2, __pyx_kp_28); - PyTuple_SET_ITEM(__pyx_3, 3, __pyx_5); - __pyx_4 = 0; - __pyx_5 = 0; - if (__Pyx_Print(((PyObject *)__pyx_3), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":82 - * print "Period size is", psize, ", Buffer size is", bsize - * - * set_sw_params(self.handle, psize, bsize) # <<<<<<<<<<<<<< - * - * def play(AlsaDevice self, cnp.ndarray input): - */ - __pyx_4 = __pyx_f_13_alsa_backend_set_sw_params(((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle, __pyx_v_psize, __pyx_v_bsize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - __Pyx_AddTraceback("_alsa_backend.AlsaDevice.__init__"); - __pyx_r = -1; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":84 - * set_sw_params(self.handle, psize, bsize) - * - * def play(AlsaDevice self, cnp.ndarray input): # <<<<<<<<<<<<<< - * self._play(input) - * - */ - -static PyObject *__pyx_pf_13_alsa_backend_10AlsaDevice_play(PyObject *__pyx_v_self, PyObject *__pyx_v_input); /*proto*/ -static PyObject *__pyx_pf_13_alsa_backend_10AlsaDevice_play(PyObject *__pyx_v_self, PyObject *__pyx_v_input) { - PyObject *__pyx_r; - int __pyx_1; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":85 - * - * def play(AlsaDevice self, cnp.ndarray input): - * self._play(input) # <<<<<<<<<<<<<< - * - * cdef int _play(AlsaDevice self, cnp.ndarray input) except -1: - */ - __pyx_1 = ((struct __pyx_vtabstruct_13_alsa_backend_AlsaDevice *)((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->__pyx_vtab)->_play(((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self), ((PyArrayObject *)__pyx_v_input)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("_alsa_backend.AlsaDevice.play"); - __pyx_r = NULL; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":87 - * self._play(input) - * - * cdef int _play(AlsaDevice self, cnp.ndarray input) except -1: # <<<<<<<<<<<<<< - * cdef cnp.ndarray[cnp.int16_t, ndim=2] tx - * cdef int nr, i, nc - */ - -static int __pyx_f_13_alsa_backend_10AlsaDevice__play(struct __pyx_obj_13_alsa_backend_AlsaDevice *__pyx_v_self, PyArrayObject *__pyx_v_input) { - PyArrayObject *__pyx_v_tx; - int __pyx_v_nr; - int __pyx_v_i; - int __pyx_v_nc; - int __pyx_v_bufsize; - int __pyx_v_err; - PyObject *__pyx_v_st; - Py_buffer __pyx_bstruct_tx; - Py_ssize_t __pyx_bstride_0_tx = 0; - Py_ssize_t __pyx_bstride_1_tx = 0; - Py_ssize_t __pyx_bshape_0_tx = 0; - Py_ssize_t __pyx_bshape_1_tx = 0; - int __pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - int __pyx_7; - PyObject *__pyx_t_1 = NULL; - PyArrayObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __pyx_v_tx = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_st = Py_None; Py_INCREF(Py_None); - __pyx_bstruct_tx.buf = NULL; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":90 - * cdef cnp.ndarray[cnp.int16_t, ndim=2] tx - * cdef int nr, i, nc - * cdef int bufsize = 1024 # <<<<<<<<<<<<<< - * cdef int err = 0 - * - */ - __pyx_v_bufsize = 1024; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":91 - * cdef int nr, i, nc - * cdef int bufsize = 1024 - * cdef int err = 0 # <<<<<<<<<<<<<< - * - * if not input.ndim == 2: - */ - __pyx_v_err = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":93 - * cdef int err = 0 - * - * if not input.ndim == 2: # <<<<<<<<<<<<<< - * raise ValueError("Only rank 2 for now") - * - */ - __pyx_1 = (!(__pyx_v_input->nd == 2)); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":94 - * - * if not input.ndim == 2: - * raise ValueError("Only rank 2 for now") # <<<<<<<<<<<<<< - * - * nc = input.shape[0] - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_29); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_29); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":96 - * raise ValueError("Only rank 2 for now") - * - * nc = input.shape[0] # <<<<<<<<<<<<<< - * if not nc == self.format.nchannels: - * raise ValueError( - */ - __pyx_v_nc = (__pyx_v_input->dimensions[0]); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":97 - * - * nc = input.shape[0] - * if not nc == self.format.nchannels: # <<<<<<<<<<<<<< - * raise ValueError( - * "AlsaDevice configured for %d channels, "\ - */ - __pyx_1 = (!(__pyx_v_nc == __pyx_v_self->format.nchannels)); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":100 - * raise ValueError( - * "AlsaDevice configured for %d channels, "\ - * "signal has %d channels" % (self.format.nchannels, nc)) # <<<<<<<<<<<<<< - * - * tx = np.empty((nc, bufsize), dtype=np.int16) - */ - __pyx_2 = PyInt_FromLong(__pyx_v_self->format.nchannels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); - __pyx_2 = 0; - __pyx_3 = 0; - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_30, ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":102 - * "signal has %d channels" % (self.format.nchannels, nc)) - * - * tx = np.empty((nc, bufsize), dtype=np.int16) # <<<<<<<<<<<<<< - * nr = input.size / nc / bufsize - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyInt_FromLong(__pyx_v_bufsize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); - __pyx_3 = 0; - __pyx_4 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_5)); - __pyx_5 = 0; - __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyObject_GetAttr(__pyx_5, __pyx_kp_31); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - if (PyDict_SetItem(__pyx_4, __pyx_kp_dtype, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_5 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_3), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - if (!(__Pyx_TypeTest(__pyx_5, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((PyArrayObject *)__pyx_5); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tx); - __pyx_t_3 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_t_2, &__pyx_bstruct_tx, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_3 < 0)) - { - PyErr_Fetch(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_v_tx, &__pyx_bstruct_tx, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_1); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_1, __pyx_t_4, __pyx_t_5); - } - } - __pyx_bstride_0_tx = __pyx_bstruct_tx.strides[0]; __pyx_bstride_1_tx = __pyx_bstruct_tx.strides[1]; - __pyx_bshape_0_tx = __pyx_bstruct_tx.shape[0]; __pyx_bshape_1_tx = __pyx_bstruct_tx.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_v_tx)); - __pyx_v_tx = ((PyArrayObject *)__pyx_5); - __pyx_5 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":103 - * - * tx = np.empty((nc, bufsize), dtype=np.int16) - * nr = input.size / nc / bufsize # <<<<<<<<<<<<<< - * - * st = snd_pcm_prepare(self.handle) - */ - __pyx_6 = PyObject_GetAttr(((PyObject *)__pyx_v_input), __pyx_kp_size); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_6, __pyx_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyInt_FromLong(__pyx_v_bufsize); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_7 = __pyx_PyInt_int(__pyx_t_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_nr = __pyx_7; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":105 - * nr = input.size / nc / bufsize - * - * st = snd_pcm_prepare(self.handle) # <<<<<<<<<<<<<< - * if st: - * raise AlsaException("Error while preparing the pcm device") - */ - __pyx_4 = PyInt_FromLong(snd_pcm_prepare(__pyx_v_self->handle)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_4; - __pyx_4 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":106 - * - * st = snd_pcm_prepare(self.handle) - * if st: # <<<<<<<<<<<<<< - * raise AlsaException("Error while preparing the pcm device") - * - */ - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_st); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":107 - * st = snd_pcm_prepare(self.handle) - * if st: - * raise AlsaException("Error while preparing the pcm device") # <<<<<<<<<<<<<< - * - * for i in range(nr): - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_32); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_kp_32); - __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":109 - * raise AlsaException("Error while preparing the pcm device") - * - * for i in range(nr): # <<<<<<<<<<<<<< - * err = python_exc.PyErr_CheckSignals() - * if err != 0: - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nr; __pyx_v_i+=1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":110 - * - * for i in range(nr): - * err = python_exc.PyErr_CheckSignals() # <<<<<<<<<<<<<< - * if err != 0: - * break - */ - __pyx_v_err = PyErr_CheckSignals(); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":111 - * for i in range(nr): - * err = python_exc.PyErr_CheckSignals() - * if err != 0: # <<<<<<<<<<<<<< - * break - * # We make sure the buffer is in fortran order to deal - */ - __pyx_1 = (__pyx_v_err != 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":112 - * err = python_exc.PyErr_CheckSignals() - * if err != 0: - * break # <<<<<<<<<<<<<< - * # We make sure the buffer is in fortran order to deal - * # with interleaved data. - */ - goto __pyx_L7; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":115 - * # We make sure the buffer is in fortran order to deal - * # with interleaved data. - * tx = np.asfortranarray( # <<<<<<<<<<<<<< - * 32568 * input[:, i * bufsize: - * i * bufsize + bufsize], - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_asfortranarray); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":116 - * # with interleaved data. - * tx = np.asfortranarray( - * 32568 * input[:, i * bufsize: # <<<<<<<<<<<<<< - * i * bufsize + bufsize], - * np.int16) - */ - __pyx_5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyInt_FromLong((__pyx_v_i * __pyx_v_bufsize)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":117 - * tx = np.asfortranarray( - * 32568 * input[:, i * bufsize: - * i * bufsize + bufsize], # <<<<<<<<<<<<<< - * np.int16) - * st = snd_pcm_writei(self.handle, tx.data, bufsize) - */ - __pyx_2 = PyInt_FromLong(((__pyx_v_i * __pyx_v_bufsize) + __pyx_v_bufsize)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":116 - * # with interleaved data. - * tx = np.asfortranarray( - * 32568 * input[:, i * bufsize: # <<<<<<<<<<<<<< - * i * bufsize + bufsize], - * np.int16) - */ - __pyx_3 = PySlice_New(__pyx_6, __pyx_2, Py_None); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3); - __pyx_5 = 0; - __pyx_3 = 0; - __pyx_2 = PyObject_GetItem(((PyObject *)__pyx_v_input), ((PyObject *)__pyx_6)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_int_32568, __pyx_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":118 - * 32568 * input[:, i * bufsize: - * i * bufsize + bufsize], - * np.int16) # <<<<<<<<<<<<<< - * st = snd_pcm_writei(self.handle, tx.data, bufsize) - * if st < 0: - */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_31); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_t_4); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3); - __pyx_t_4 = 0; - __pyx_3 = 0; - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((PyArrayObject *)__pyx_2); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tx); - __pyx_t_3 = __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_t_2, &__pyx_bstruct_tx, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_3 < 0)) - { - PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_1); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t((PyObject*)__pyx_v_tx, &__pyx_bstruct_tx, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_1); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_1); - } - } - __pyx_bstride_0_tx = __pyx_bstruct_tx.strides[0]; __pyx_bstride_1_tx = __pyx_bstruct_tx.strides[1]; - __pyx_bshape_0_tx = __pyx_bstruct_tx.shape[0]; __pyx_bshape_1_tx = __pyx_bstruct_tx.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_v_tx)); - __pyx_v_tx = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":119 - * i * bufsize + bufsize], - * np.int16) - * st = snd_pcm_writei(self.handle, tx.data, bufsize) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in writei") - */ - __pyx_5 = PyInt_FromLong(snd_pcm_writei(__pyx_v_self->handle, ((void *)__pyx_v_tx->data), __pyx_v_bufsize)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_5; - __pyx_5 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":120 - * np.int16) - * st = snd_pcm_writei(self.handle, tx.data, bufsize) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in writei") - * - */ - __pyx_3 = PyObject_RichCompare(__pyx_v_st, __pyx_int_0, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":121 - * st = snd_pcm_writei(self.handle, tx.data, bufsize) - * if st < 0: - * raise AlsaException("Error in writei") # <<<<<<<<<<<<<< - * - * if err: - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_33); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_kp_33); - __pyx_2 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_6), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - } - __pyx_L7:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":123 - * raise AlsaException("Error in writei") - * - * if err: # <<<<<<<<<<<<<< - * print "Got SIGINT: draining the pcm device... " - * snd_pcm_drain(self.handle) - */ - __pyx_7 = __pyx_v_err; - if (__pyx_7) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":124 - * - * if err: - * print "Got SIGINT: draining the pcm device... " # <<<<<<<<<<<<<< - * snd_pcm_drain(self.handle) - * return -1 - */ - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_34); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_kp_34); - if (__Pyx_Print(((PyObject *)__pyx_5), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":125 - * if err: - * print "Got SIGINT: draining the pcm device... " - * snd_pcm_drain(self.handle) # <<<<<<<<<<<<<< - * return -1 - * snd_pcm_drain(self.handle) - */ - snd_pcm_drain(__pyx_v_self->handle); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":126 - * print "Got SIGINT: draining the pcm device... " - * snd_pcm_drain(self.handle) - * return -1 # <<<<<<<<<<<<<< - * snd_pcm_drain(self.handle) - * return 0 - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L10; - } - __pyx_L10:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":127 - * snd_pcm_drain(self.handle) - * return -1 - * snd_pcm_drain(self.handle) # <<<<<<<<<<<<<< - * return 0 - * - */ - snd_pcm_drain(__pyx_v_self->handle); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":128 - * return -1 - * snd_pcm_drain(self.handle) - * return 0 # <<<<<<<<<<<<<< - * - * def __dealloc__(AlsaDevice self): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tx); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("_alsa_backend.AlsaDevice._play"); - __pyx_r = -1; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tx); - __pyx_L2:; - Py_DECREF(__pyx_v_tx); - Py_DECREF(__pyx_v_st); - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":130 - * return 0 - * - * def __dealloc__(AlsaDevice self): # <<<<<<<<<<<<<< - * if self.handle: - * snd_pcm_close(self.handle) - */ - -static void __pyx_pf_13_alsa_backend_10AlsaDevice___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_13_alsa_backend_10AlsaDevice___dealloc__(PyObject *__pyx_v_self) { - int __pyx_1; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":131 - * - * def __dealloc__(AlsaDevice self): - * if self.handle: # <<<<<<<<<<<<<< - * snd_pcm_close(self.handle) - * - */ - __pyx_1 = (((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle != 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":132 - * def __dealloc__(AlsaDevice self): - * if self.handle: - * snd_pcm_close(self.handle) # <<<<<<<<<<<<<< - * - * cdef set_hw_params(snd_pcm_t *hdl, format_info info, snd_pcm_uframes_t* period_size, snd_pcm_uframes_t *buffer_size): - */ - snd_pcm_close(((struct __pyx_obj_13_alsa_backend_AlsaDevice *)__pyx_v_self)->handle); - goto __pyx_L5; - } - __pyx_L5:; - -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":134 - * snd_pcm_close(self.handle) - * - * cdef set_hw_params(snd_pcm_t *hdl, format_info info, snd_pcm_uframes_t* period_size, snd_pcm_uframes_t *buffer_size): # <<<<<<<<<<<<<< - * cdef unsigned int nchannels, buftime, pertime, samplerate - * cdef snd_pcm_hw_params_t *params - */ - -static PyObject *__pyx_f_13_alsa_backend_set_hw_params(snd_pcm_t *__pyx_v_hdl, struct __pyx_t_13_alsa_backend_format_info __pyx_v_info, snd_pcm_uframes_t *__pyx_v_period_size, snd_pcm_uframes_t *__pyx_v_buffer_size) { - unsigned int __pyx_v_nchannels; - unsigned int __pyx_v_buftime; - unsigned int __pyx_v_pertime; - unsigned int __pyx_v_samplerate; - snd_pcm_hw_params_t *__pyx_v_params; - int __pyx_v_st; - int __pyx_v_dir; - snd_pcm_access_t __pyx_v_access; - snd_pcm_format_t __pyx_v_format; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":141 - * cdef snd_pcm_format_t format - * - * access = SND_PCM_ACCESS_RW_INTERLEAVED # <<<<<<<<<<<<<< - * buftime = BUFFER_TIME - * pertime = PERIOD_TIME - */ - __pyx_v_access = SND_PCM_ACCESS_RW_INTERLEAVED; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":142 - * - * access = SND_PCM_ACCESS_RW_INTERLEAVED - * buftime = BUFFER_TIME # <<<<<<<<<<<<<< - * pertime = PERIOD_TIME - * - */ - __pyx_v_buftime = __pyx_v_13_alsa_backend_BUFFER_TIME; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":143 - * access = SND_PCM_ACCESS_RW_INTERLEAVED - * buftime = BUFFER_TIME - * pertime = PERIOD_TIME # <<<<<<<<<<<<<< - * - * nchannels = info.nchannels - */ - __pyx_v_pertime = __pyx_v_13_alsa_backend_PERIOD_TIME; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":145 - * pertime = PERIOD_TIME - * - * nchannels = info.nchannels # <<<<<<<<<<<<<< - * samplerate = info.rate - * format = SND_PCM_FORMAT_S16_LE - */ - __pyx_v_nchannels = __pyx_v_info.nchannels; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":146 - * - * nchannels = info.nchannels - * samplerate = info.rate # <<<<<<<<<<<<<< - * format = SND_PCM_FORMAT_S16_LE - * - */ - __pyx_v_samplerate = __pyx_v_info.rate; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":147 - * nchannels = info.nchannels - * samplerate = info.rate - * format = SND_PCM_FORMAT_S16_LE # <<<<<<<<<<<<<< - * - * snd_pcm_hw_params_alloca(¶ms) - */ - __pyx_v_format = SND_PCM_FORMAT_S16_LE; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":149 - * format = SND_PCM_FORMAT_S16_LE - * - * snd_pcm_hw_params_alloca(¶ms) # <<<<<<<<<<<<<< - * st = snd_pcm_hw_params_any(hdl, params) - * if st < 0: - */ - snd_pcm_hw_params_alloca((&__pyx_v_params)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":150 - * - * snd_pcm_hw_params_alloca(¶ms) - * st = snd_pcm_hw_params_any(hdl, params) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _any") - */ - __pyx_v_st = snd_pcm_hw_params_any(__pyx_v_hdl, __pyx_v_params); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":151 - * snd_pcm_hw_params_alloca(¶ms) - * st = snd_pcm_hw_params_any(hdl, params) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _any") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":152 - * st = snd_pcm_hw_params_any(hdl, params) - * if st < 0: - * raise AlsaException("Error in _any") # <<<<<<<<<<<<<< - * - * # Restrict sampling rates to the ones supported by the hardware - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_35); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_35); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":155 - * - * # Restrict sampling rates to the ones supported by the hardware - * st = snd_pcm_hw_params_set_rate_resample(hdl, params, 1) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_rate_resample") - */ - __pyx_v_st = snd_pcm_hw_params_set_rate_resample(__pyx_v_hdl, __pyx_v_params, 1); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":156 - * # Restrict sampling rates to the ones supported by the hardware - * st = snd_pcm_hw_params_set_rate_resample(hdl, params, 1) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_rate_resample") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":157 - * st = snd_pcm_hw_params_set_rate_resample(hdl, params, 1) - * if st < 0: - * raise AlsaException("Error in _set_rate_resample") # <<<<<<<<<<<<<< - * - * st = snd_pcm_hw_params_set_access(hdl, params, access) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_36); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_36); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":159 - * raise AlsaException("Error in _set_rate_resample") - * - * st = snd_pcm_hw_params_set_access(hdl, params, access) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_access") - */ - __pyx_v_st = snd_pcm_hw_params_set_access(__pyx_v_hdl, __pyx_v_params, __pyx_v_access); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":160 - * - * st = snd_pcm_hw_params_set_access(hdl, params, access) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_access") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":161 - * st = snd_pcm_hw_params_set_access(hdl, params, access) - * if st < 0: - * raise AlsaException("Error in _set_access") # <<<<<<<<<<<<<< - * - * st = snd_pcm_hw_params_set_format(hdl, params, format) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_37); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_37); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":163 - * raise AlsaException("Error in _set_access") - * - * st = snd_pcm_hw_params_set_format(hdl, params, format) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_format") - */ - __pyx_v_st = snd_pcm_hw_params_set_format(__pyx_v_hdl, __pyx_v_params, __pyx_v_format); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":164 - * - * st = snd_pcm_hw_params_set_format(hdl, params, format) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_format") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":165 - * st = snd_pcm_hw_params_set_format(hdl, params, format) - * if st < 0: - * raise AlsaException("Error in _set_format") # <<<<<<<<<<<<<< - * - * st = snd_pcm_hw_params_set_channels(hdl, params, nchannels) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_38); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_38); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":167 - * raise AlsaException("Error in _set_format") - * - * st = snd_pcm_hw_params_set_channels(hdl, params, nchannels) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_channels") - */ - __pyx_v_st = snd_pcm_hw_params_set_channels(__pyx_v_hdl, __pyx_v_params, __pyx_v_nchannels); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":168 - * - * st = snd_pcm_hw_params_set_channels(hdl, params, nchannels) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_channels") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":169 - * st = snd_pcm_hw_params_set_channels(hdl, params, nchannels) - * if st < 0: - * raise AlsaException("Error in _set_channels") # <<<<<<<<<<<<<< - * - * dir = 0 - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_39); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_39); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":171 - * raise AlsaException("Error in _set_channels") - * - * dir = 0 # <<<<<<<<<<<<<< - * st = snd_pcm_hw_params_set_rate_near(hdl, params, &samplerate, &dir) - * if st < 0: - */ - __pyx_v_dir = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":172 - * - * dir = 0 - * st = snd_pcm_hw_params_set_rate_near(hdl, params, &samplerate, &dir) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_rate_near") - */ - __pyx_v_st = snd_pcm_hw_params_set_rate_near(__pyx_v_hdl, __pyx_v_params, (&__pyx_v_samplerate), (&__pyx_v_dir)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":173 - * dir = 0 - * st = snd_pcm_hw_params_set_rate_near(hdl, params, &samplerate, &dir) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_rate_near") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":174 - * st = snd_pcm_hw_params_set_rate_near(hdl, params, &samplerate, &dir) - * if st < 0: - * raise AlsaException("Error in _set_rate_near") # <<<<<<<<<<<<<< - * - * dir = 0 - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_40); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_40); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":176 - * raise AlsaException("Error in _set_rate_near") - * - * dir = 0 # <<<<<<<<<<<<<< - * st = snd_pcm_hw_params_set_buffer_time_near(hdl, params, &buftime, &dir) - * if st < 0: - */ - __pyx_v_dir = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":177 - * - * dir = 0 - * st = snd_pcm_hw_params_set_buffer_time_near(hdl, params, &buftime, &dir) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_buffer_near") - */ - __pyx_v_st = snd_pcm_hw_params_set_buffer_time_near(__pyx_v_hdl, __pyx_v_params, (&__pyx_v_buftime), (&__pyx_v_dir)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":178 - * dir = 0 - * st = snd_pcm_hw_params_set_buffer_time_near(hdl, params, &buftime, &dir) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_buffer_near") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":179 - * st = snd_pcm_hw_params_set_buffer_time_near(hdl, params, &buftime, &dir) - * if st < 0: - * raise AlsaException("Error in _set_buffer_near") # <<<<<<<<<<<<<< - * - * dir = 0 - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_41); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_41); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":181 - * raise AlsaException("Error in _set_buffer_near") - * - * dir = 0 # <<<<<<<<<<<<<< - * st = snd_pcm_hw_params_set_period_time_near(hdl, params, &pertime, &dir) - * if st < 0: - */ - __pyx_v_dir = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":182 - * - * dir = 0 - * st = snd_pcm_hw_params_set_period_time_near(hdl, params, &pertime, &dir) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_period_time_near") - */ - __pyx_v_st = snd_pcm_hw_params_set_period_time_near(__pyx_v_hdl, __pyx_v_params, (&__pyx_v_pertime), (&__pyx_v_dir)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":183 - * dir = 0 - * st = snd_pcm_hw_params_set_period_time_near(hdl, params, &pertime, &dir) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_period_time_near") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":184 - * st = snd_pcm_hw_params_set_period_time_near(hdl, params, &pertime, &dir) - * if st < 0: - * raise AlsaException("Error in _set_period_time_near") # <<<<<<<<<<<<<< - * - * st = snd_pcm_hw_params(hdl, params) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_42); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_42); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":186 - * raise AlsaException("Error in _set_period_time_near") - * - * st = snd_pcm_hw_params(hdl, params) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in applying hw params") - */ - __pyx_v_st = snd_pcm_hw_params(__pyx_v_hdl, __pyx_v_params); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":187 - * - * st = snd_pcm_hw_params(hdl, params) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in applying hw params") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":188 - * st = snd_pcm_hw_params(hdl, params) - * if st < 0: - * raise AlsaException("Error in applying hw params") # <<<<<<<<<<<<<< - * - * dir = 0 - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_43); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_43); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; - } - __pyx_L11:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":190 - * raise AlsaException("Error in applying hw params") - * - * dir = 0 # <<<<<<<<<<<<<< - * st = snd_pcm_hw_params_get_period_size(params, period_size, &dir) - * if st < 0: - */ - __pyx_v_dir = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":191 - * - * dir = 0 - * st = snd_pcm_hw_params_get_period_size(params, period_size, &dir) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in get_period_sizse") - */ - __pyx_v_st = snd_pcm_hw_params_get_period_size(__pyx_v_params, __pyx_v_period_size, (&__pyx_v_dir)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":192 - * dir = 0 - * st = snd_pcm_hw_params_get_period_size(params, period_size, &dir) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in get_period_sizse") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":193 - * st = snd_pcm_hw_params_get_period_size(params, period_size, &dir) - * if st < 0: - * raise AlsaException("Error in get_period_sizse") # <<<<<<<<<<<<<< - * - * st = snd_pcm_hw_params_get_buffer_size(params, buffer_size) - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_44); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_44); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L12; - } - __pyx_L12:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":195 - * raise AlsaException("Error in get_period_sizse") - * - * st = snd_pcm_hw_params_get_buffer_size(params, buffer_size) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in get_buffer_sizse") - */ - __pyx_v_st = snd_pcm_hw_params_get_buffer_size(__pyx_v_params, __pyx_v_buffer_size); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":196 - * - * st = snd_pcm_hw_params_get_buffer_size(params, buffer_size) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in get_buffer_sizse") - * - */ - __pyx_1 = (__pyx_v_st < 0); - if (__pyx_1) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":197 - * st = snd_pcm_hw_params_get_buffer_size(params, buffer_size) - * if st < 0: - * raise AlsaException("Error in get_buffer_sizse") # <<<<<<<<<<<<<< - * - * cdef set_sw_params(snd_pcm_t *hdl, unsigned int period_size, unsigned int buffer_size): - */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_45); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_45); - __pyx_4 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; - } - __pyx_L13:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - __Pyx_AddTraceback("_alsa_backend.set_hw_params"); - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":199 - * raise AlsaException("Error in get_buffer_sizse") - * - * cdef set_sw_params(snd_pcm_t *hdl, unsigned int period_size, unsigned int buffer_size): # <<<<<<<<<<<<<< - * cdef snd_pcm_sw_params_t *params - * - */ - -static PyObject *__pyx_f_13_alsa_backend_set_sw_params(snd_pcm_t *__pyx_v_hdl, unsigned int __pyx_v_period_size, unsigned int __pyx_v_buffer_size) { - snd_pcm_sw_params_t *__pyx_v_params; - PyObject *__pyx_v_st; - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - __pyx_v_st = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":202 - * cdef snd_pcm_sw_params_t *params - * - * snd_pcm_sw_params_alloca(¶ms) # <<<<<<<<<<<<<< - * - * st = snd_pcm_sw_params_current(hdl, params) - */ - snd_pcm_sw_params_alloca((&__pyx_v_params)); - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":204 - * snd_pcm_sw_params_alloca(¶ms) - * - * st = snd_pcm_sw_params_current(hdl, params) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _current") - */ - __pyx_1 = PyInt_FromLong(snd_pcm_sw_params_current(__pyx_v_hdl, __pyx_v_params)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":205 - * - * st = snd_pcm_sw_params_current(hdl, params) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _current") - * - */ - __pyx_1 = PyObject_RichCompare(__pyx_v_st, __pyx_int_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_2) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":206 - * st = snd_pcm_sw_params_current(hdl, params) - * if st < 0: - * raise AlsaException("Error in _current") # <<<<<<<<<<<<<< - * - * st = snd_pcm_sw_params_set_start_threshold(hdl, params, period_size) - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_46); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_46); - __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":208 - * raise AlsaException("Error in _current") - * - * st = snd_pcm_sw_params_set_start_threshold(hdl, params, period_size) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_start_threshold") - */ - __pyx_1 = PyInt_FromLong(snd_pcm_sw_params_set_start_threshold(__pyx_v_hdl, __pyx_v_params, __pyx_v_period_size)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_1; - __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":209 - * - * st = snd_pcm_sw_params_set_start_threshold(hdl, params, period_size) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_start_threshold") - * - */ - __pyx_3 = PyObject_RichCompare(__pyx_v_st, __pyx_int_0, Py_LT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__pyx_2) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":210 - * st = snd_pcm_sw_params_set_start_threshold(hdl, params, period_size) - * if st < 0: - * raise AlsaException("Error in _set_start_threshold") # <<<<<<<<<<<<<< - * - * st = snd_pcm_sw_params_set_avail_min(hdl, params, period_size) - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_47); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_47); - __pyx_3 = PyObject_Call(__pyx_4, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":212 - * raise AlsaException("Error in _set_start_threshold") - * - * st = snd_pcm_sw_params_set_avail_min(hdl, params, period_size) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in _set_avail_min") - */ - __pyx_4 = PyInt_FromLong(snd_pcm_sw_params_set_avail_min(__pyx_v_hdl, __pyx_v_params, __pyx_v_period_size)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_4; - __pyx_4 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":213 - * - * st = snd_pcm_sw_params_set_avail_min(hdl, params, period_size) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in _set_avail_min") - * - */ - __pyx_1 = PyObject_RichCompare(__pyx_v_st, __pyx_int_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_2) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":214 - * st = snd_pcm_sw_params_set_avail_min(hdl, params, period_size) - * if st < 0: - * raise AlsaException("Error in _set_avail_min") # <<<<<<<<<<<<<< - * - * st = snd_pcm_sw_params(hdl, params) - */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_48); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_kp_48); - __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __Pyx_Raise(__pyx_1, 0, 0); - Py_DECREF(__pyx_1); __pyx_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":216 - * raise AlsaException("Error in _set_avail_min") - * - * st = snd_pcm_sw_params(hdl, params) # <<<<<<<<<<<<<< - * if st < 0: - * raise AlsaException("Error in applying sw params") - */ - __pyx_3 = PyInt_FromLong(snd_pcm_sw_params(__pyx_v_hdl, __pyx_v_params)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_st); - __pyx_v_st = __pyx_3; - __pyx_3 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":217 - * - * st = snd_pcm_sw_params(hdl, params) - * if st < 0: # <<<<<<<<<<<<<< - * raise AlsaException("Error in applying sw params") - */ - __pyx_4 = PyObject_RichCompare(__pyx_v_st, __pyx_int_0, Py_LT); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__pyx_2) { - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":218 - * st = snd_pcm_sw_params(hdl, params) - * if st < 0: - * raise AlsaException("Error in applying sw params") # <<<<<<<<<<<<<< - */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_AlsaException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_49); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_kp_49); - __pyx_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - __Pyx_AddTraceback("_alsa_backend.set_sw_params"); - __pyx_r = 0; - __pyx_L0:; - Py_DECREF(__pyx_v_st); - return __pyx_r; -} - -/* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":50 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - PyObject *__pyx_v_stack; - int __pyx_v_hasfields; - PyObject *__pyx_v_iterator; - int __pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - PyObject *__pyx_7 = 0; - Py_ssize_t __pyx_8 = 0; - PyObject *__pyx_t_1 = NULL; - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; Py_INCREF(Py_None); - __pyx_v_stack = ((PyObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_iterator = Py_None; Py_INCREF(Py_None); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":56 - * # of flags - * cdef int copy_shape, i, ndim - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":58 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":59 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":61 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":63 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") - */ - __pyx_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":64 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not C contiguous") - * - */ - __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":65 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_1); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_1); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":67 - * raise ValueError("ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") - */ - __pyx_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":68 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not Fortran contiguous") - * - */ - __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":69 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_2); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_2); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":71 - * raise ValueError("ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":72 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":73 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - __pyx_4 = __pyx_v_copy_shape; - if (__pyx_4) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":76 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":77 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":78 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i+=1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":79 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":80 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":82 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":83 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":84 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":85 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":86 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":89 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":90 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * - */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":93 - * cdef list stack - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * # Ugly hack warning: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":103 - * # functions). - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - __pyx_1 = (!__pyx_v_copy_shape); - } - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":105 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - Py_INCREF(Py_None); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":108 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - Py_INCREF(__pyx_v_self); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":110 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":111 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":112 - * if not hasfields: - * t = descr.type_num - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = __pyx_k_3; - break; - case NPY_UBYTE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":113 - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_v_f = __pyx_k_4; - break; - case NPY_SHORT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":114 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_v_f = __pyx_k_5; - break; - case NPY_USHORT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":115 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_v_f = __pyx_k_6; - break; - case NPY_INT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":116 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_v_f = __pyx_k_7; - break; - case NPY_UINT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":117 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_v_f = __pyx_k_8; - break; - case NPY_LONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":118 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_v_f = __pyx_k_9; - break; - case NPY_ULONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":119 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_v_f = __pyx_k_10; - break; - case NPY_LONGLONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":120 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_v_f = __pyx_k_11; - break; - case NPY_ULONGLONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":121 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_v_f = __pyx_k_12; - break; - case NPY_FLOAT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":122 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_v_f = __pyx_k_13; - break; - case NPY_DOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":123 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_v_f = __pyx_k_14; - break; - case NPY_LONGDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":124 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_v_f = __pyx_k_15; - break; - case NPY_CFLOAT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":125 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_v_f = __pyx_k_16; - break; - case NPY_CDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":126 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_v_f = __pyx_k_17; - break; - case NPY_CLONGDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":127 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_v_f = __pyx_k_18; - break; - case NPY_OBJECT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":128 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_v_f = __pyx_k_19; - break; - default: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":130 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_20, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":131 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":132 - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(255) # static size - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":134 - * return - * else: - * info.format = stdlib.malloc(255) # static size # <<<<<<<<<<<<<< - * f = info.format - * stack = [iter(descr.fields.iteritems())] - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":135 - * else: - * info.format = stdlib.malloc(255) # static size - * f = info.format # <<<<<<<<<<<<<< - * stack = [iter(descr.fields.iteritems())] - * - */ - __pyx_v_f = __pyx_v_info->format; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":136 - * info.format = stdlib.malloc(255) # static size - * f = info.format - * stack = [iter(descr.fields.iteritems())] # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_3 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_2, 0, __pyx_3); - __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_v_stack)); - __pyx_v_stack = __pyx_2; - __pyx_2 = 0; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":138 - * stack = [iter(descr.fields.iteritems())] - * - * while True: # <<<<<<<<<<<<<< - * iterator = stack[-1] - * descr = None - */ - while (1) { - __pyx_1 = 1; - if (!__pyx_1) break; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":139 - * - * while True: - * iterator = stack[-1] # <<<<<<<<<<<<<< - * descr = None - * while descr is None: - */ - __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_iterator); - __pyx_v_iterator = __pyx_3; - __pyx_3 = 0; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":140 - * while True: - * iterator = stack[-1] - * descr = None # <<<<<<<<<<<<<< - * while descr is None: - * try: - */ - Py_INCREF(Py_None); - Py_DECREF(((PyObject *)__pyx_v_descr)); - __pyx_v_descr = ((PyArray_Descr *)Py_None); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":141 - * iterator = stack[-1] - * descr = None - * while descr is None: # <<<<<<<<<<<<<< - * try: - * descr = iterator.next()[1][0] - */ - while (1) { - __pyx_1 = (((PyObject *)__pyx_v_descr) == Py_None); - if (!__pyx_1) break; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":142 - * descr = None - * while descr is None: - * try: # <<<<<<<<<<<<<< - * descr = iterator.next()[1][0] - * except StopIteration: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":143 - * while descr is None: - * try: - * descr = iterator.next()[1][0] # <<<<<<<<<<<<<< - * except StopIteration: - * stack.pop() - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_iterator, __pyx_kp_next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_3, 1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(((PyObject *)__pyx_v_descr)); - __pyx_v_descr = ((PyArray_Descr *)__pyx_3); - __pyx_3 = 0; - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L21_try; - __pyx_L17_error:; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - Py_XDECREF(__pyx_3); __pyx_3 = 0; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":144 - * try: - * descr = iterator.next()[1][0] - * except StopIteration: # <<<<<<<<<<<<<< - * stack.pop() - * if len(stack) > 0: - */ - __pyx_4 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); - if (__pyx_4) { - __Pyx_AddTraceback("numpy.__getbuffer__"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":145 - * descr = iterator.next()[1][0] - * except StopIteration: - * stack.pop() # <<<<<<<<<<<<<< - * if len(stack) > 0: - * f[0] = 125 #"}" - */ - __pyx_6 = PyObject_GetAttr(((PyObject *)__pyx_v_stack), __pyx_kp_pop); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __pyx_7 = PyObject_Call(__pyx_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_7); __pyx_7 = 0; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":146 - * except StopIteration: - * stack.pop() - * if len(stack) > 0: # <<<<<<<<<<<<<< - * f[0] = 125 #"}" - * f += 1 - */ - __pyx_8 = PyObject_Length(((PyObject *)__pyx_v_stack)); if (unlikely(__pyx_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __pyx_1 = (__pyx_8 > 0); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":147 - * stack.pop() - * if len(stack) > 0: - * f[0] = 125 #"}" # <<<<<<<<<<<<<< - * f += 1 - * iterator = stack[-1] - */ - (__pyx_v_f[0]) = 125; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":148 - * if len(stack) > 0: - * f[0] = 125 #"}" - * f += 1 # <<<<<<<<<<<<<< - * iterator = stack[-1] - * else: - */ - __pyx_v_f += 1; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":149 - * f[0] = 125 #"}" - * f += 1 - * iterator = stack[-1] # <<<<<<<<<<<<<< - * else: - * f[0] = 0 # Terminate string! - */ - __pyx_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - Py_DECREF(__pyx_v_iterator); - __pyx_v_iterator = __pyx_6; - __pyx_6 = 0; - goto __pyx_L22; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":151 - * iterator = stack[-1] - * else: - * f[0] = 0 # Terminate string! # <<<<<<<<<<<<<< - * return - * - */ - (__pyx_v_f[0]) = 0; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":152 - * else: - * f[0] = 0 # Terminate string! - * return # <<<<<<<<<<<<<< - * - * hasfields = PyDataType_HASFIELDS(descr) - */ - __pyx_r = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L20_except_return; - } - __pyx_L22:; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L18_exception_handled; - } - __pyx_L19_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L20_except_return:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L18_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L21_try:; - } - } - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":154 - * return - * - * hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * if not hasfields: - * t = descr.type_num - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":155 - * - * hasfields = PyDataType_HASFIELDS(descr) - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":156 - * hasfields = PyDataType_HASFIELDS(descr) - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":157 - * if not hasfields: - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short.") - * - */ - __pyx_1 = ((__pyx_v_f - __pyx_v_info->format) > 240); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":158 - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_21); - PyTuple_SET_ITEM(__pyx_7, 0, __pyx_kp_21); - __pyx_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_7)); __pyx_7 = 0; - __Pyx_Raise(__pyx_6, 0, 0); - Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L24; - } - __pyx_L24:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":161 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - (__pyx_v_f[0]) = 98; - break; - case NPY_UBYTE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":162 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - (__pyx_v_f[0]) = 66; - break; - case NPY_SHORT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":163 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - (__pyx_v_f[0]) = 104; - break; - case NPY_USHORT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":164 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - (__pyx_v_f[0]) = 72; - break; - case NPY_INT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":165 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - (__pyx_v_f[0]) = 105; - break; - case NPY_UINT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":166 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - (__pyx_v_f[0]) = 73; - break; - case NPY_LONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":167 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - (__pyx_v_f[0]) = 108; - break; - case NPY_ULONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":168 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - (__pyx_v_f[0]) = 76; - break; - case NPY_LONGLONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":169 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - (__pyx_v_f[0]) = 113; - break; - case NPY_ULONGLONG: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":170 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - (__pyx_v_f[0]) = 81; - break; - case NPY_FLOAT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":171 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - (__pyx_v_f[0]) = 102; - break; - case NPY_DOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":172 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - */ - (__pyx_v_f[0]) = 100; - break; - case NPY_LONGDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":173 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - */ - (__pyx_v_f[0]) = 103; - break; - case NPY_CFLOAT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":174 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - break; - case NPY_CDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":175 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - break; - case NPY_CLONGDOUBLE: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":176 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - break; - case NPY_OBJECT: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":177 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - (__pyx_v_f[0]) = 79; - break; - default: - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":179 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_22, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":180 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * f[0] = 84 #"T" - */ - __pyx_v_f += 1; - goto __pyx_L23; - } - /*else*/ { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":182 - * f += 1 - * else: - * f[0] = 84 #"T" # <<<<<<<<<<<<<< - * f[1] = 123 #"{" - * f += 2 - */ - (__pyx_v_f[0]) = 84; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":183 - * else: - * f[0] = 84 #"T" - * f[1] = 123 #"{" # <<<<<<<<<<<<<< - * f += 2 - * stack.append(iter(descr.fields.iteritems())) - */ - (__pyx_v_f[1]) = 123; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":184 - * f[0] = 84 #"T" - * f[1] = 123 #"{" - * f += 2 # <<<<<<<<<<<<<< - * stack.append(iter(descr.fields.iteritems())) - * - */ - __pyx_v_f += 2; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":185 - * f[1] = 123 #"{" - * f += 2 - * stack.append(iter(descr.fields.iteritems())) # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - __pyx_7 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_7); __pyx_7 = 0; - __pyx_2 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_4 = PyList_Append(((PyObject *)__pyx_v_stack), __pyx_2); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - } - __pyx_L23:; - } - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); - Py_XDECREF(__pyx_7); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - Py_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { Py_DECREF(Py_None); __pyx_v_info->obj = NULL; } - __pyx_L2:; - Py_XDECREF(__pyx_v_descr); - Py_DECREF(__pyx_v_stack); - Py_DECREF(__pyx_v_iterator); - return __pyx_r; -} - -/* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":187 - * stack.append(iter(descr.fields.iteritems())) - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_1; - int __pyx_2; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":188 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_1) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":189 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":190 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_2) { - - /* "/usr/media/misc/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":191 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - -} -static struct __pyx_vtabstruct_13_alsa_backend_AlsaDevice __pyx_vtable_13_alsa_backend_AlsaDevice; - -static PyObject *__pyx_tp_new_13_alsa_backend_AlsaDevice(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_13_alsa_backend_AlsaDevice *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_13_alsa_backend_AlsaDevice *)o); - p->__pyx_vtab = __pyx_vtabptr_13_alsa_backend_AlsaDevice; - return o; -} - -static void __pyx_tp_dealloc_13_alsa_backend_AlsaDevice(PyObject *o) { - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_13_alsa_backend_10AlsaDevice___dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - (*Py_TYPE(o)->tp_free)(o); -} - -static struct PyMethodDef __pyx_methods_13_alsa_backend_AlsaDevice[] = { - {"play", (PyCFunction)__pyx_pf_13_alsa_backend_10AlsaDevice_play, METH_O, 0}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_AlsaDevice = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - 0, /*nb_long*/ - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_AlsaDevice = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - 0, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_AlsaDevice = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_AlsaDevice = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_13_alsa_backend_AlsaDevice = { - PyVarObject_HEAD_INIT(0, 0) - "_alsa_backend.AlsaDevice", /*tp_name*/ - sizeof(struct __pyx_obj_13_alsa_backend_AlsaDevice), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_13_alsa_backend_AlsaDevice, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - &__pyx_tp_as_number_AlsaDevice, /*tp_as_number*/ - &__pyx_tp_as_sequence_AlsaDevice, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_AlsaDevice, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_AlsaDevice, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_13_alsa_backend_AlsaDevice, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_13_alsa_backend_10AlsaDevice___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_13_alsa_backend_AlsaDevice, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ -}; - -static struct PyMethodDef __pyx_methods[] = { - {"alsa_version", (PyCFunction)__pyx_pf_13_alsa_backend_alsa_version, METH_NOARGS, __pyx_doc_13_alsa_backend_alsa_version}, - {"enumerate_devices", (PyCFunction)__pyx_pf_13_alsa_backend_enumerate_devices, METH_NOARGS, __pyx_doc_13_alsa_backend_enumerate_devices}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - "_alsa_backend", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1}, - {&__pyx_kp_play, __pyx_k_play, sizeof(__pyx_k_play), 1, 1, 1}, - {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1}, - {&__pyx_kp_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 1, 1, 1}, - {&__pyx_kp_nchannels, __pyx_k_nchannels, sizeof(__pyx_k_nchannels), 1, 1, 1}, - {&__pyx_kp_input, __pyx_k_input, sizeof(__pyx_k_input), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp_AlsaException, __pyx_k_AlsaException, sizeof(__pyx_k_AlsaException), 0, 1, 1}, - {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1}, - {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1}, - {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1}, - {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 1, 1, 1}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, - {&__pyx_kp_asfortranarray, __pyx_k_asfortranarray, sizeof(__pyx_k_asfortranarray), 1, 1, 1}, - {&__pyx_kp_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 0}, - {&__pyx_kp_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 0}, - {&__pyx_kp_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 0}, - {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 0}, - {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 0}, - {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 0}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 0}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 0}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 0}, - {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 0}, - {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 0}, - {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 0}, - {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 0}, - {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 0}, - {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 0}, - {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 0}, - {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 0}, - {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 0}, - {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 0}, - {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 0}, - {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 0}, - {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 0}, - {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 0}, - {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1}, - {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1}, - {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1}, - {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1}, - {&__pyx_kp_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 1, 1, 1}, - {&__pyx_kp_next, __pyx_k_next, sizeof(__pyx_k_next), 1, 1, 1}, - {&__pyx_kp_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 1, 1, 1}, - {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1}, - {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, - {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0}, - {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0}, - {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_kp_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - __pyx_int_32568 = PyInt_FromLong(32568); if (unlikely(!__pyx_int_32568)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_alsa_backend(void); /*proto*/ -PyMODINIT_FUNC init_alsa_backend(void) -#else -PyMODINIT_FUNC PyInit__alsa_backend(void); /*proto*/ -PyMODINIT_FUNC PyInit__alsa_backend(void) -#endif -{ - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Library function declarations ---*/ - __pyx_init_filenames(); - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_alsa_backend", __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_13_alsa_backend_AlsaDevice = &__pyx_vtable_13_alsa_backend_AlsaDevice; - *(void(**)(void))&__pyx_vtable_13_alsa_backend_AlsaDevice._play = (void(*)(void))__pyx_f_13_alsa_backend_10AlsaDevice__play; - if (PyType_Ready(&__pyx_type_13_alsa_backend_AlsaDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_13_alsa_backend_AlsaDevice.tp_dict, __pyx_vtabptr_13_alsa_backend_AlsaDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "AlsaDevice", (PyObject *)&__pyx_type_13_alsa_backend_AlsaDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_13_alsa_backend_AlsaDevice = &__pyx_type_13_alsa_backend_AlsaDevice; - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":1 - * import numpy as np # <<<<<<<<<<<<<< - * cimport numpy as cnp - * cimport stdlib - */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":7 - * from alsa cimport * - * - * cdef int BUFFER_TIME = 500000 # <<<<<<<<<<<<<< - * cdef int PERIOD_TIME = 0 - * - */ - __pyx_v_13_alsa_backend_BUFFER_TIME = 500000; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":8 - * - * cdef int BUFFER_TIME = 500000 - * cdef int PERIOD_TIME = 0 # <<<<<<<<<<<<<< - * - * cdef extern from "alsa/asoundlib.h": - */ - __pyx_v_13_alsa_backend_PERIOD_TIME = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/_alsa_backend.pyx":19 - * object PyString_FromStringAndSize(char *v, int len) - * - * class AlsaException(Exception): # <<<<<<<<<<<<<< - * pass - * - */ - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_builtin_Exception); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_builtin_Exception); - __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_2), ((PyObject *)__pyx_1), __pyx_kp_AlsaException, "_alsa_backend"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_AlsaException, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - - /* "/usr/media/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/alsa/alsa.pxd":1 - * # This file was generated by cycodegenlib, DO NOT EDIT # <<<<<<<<<<<<<< - * # Generated by command /home/david/local/bin/xml2cython.py -l alsa -i input -o alsa.pxd alsa/asoundlib.h asoundlib.xml - * # Codegenlib version 0.3dev - */ - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_AddTraceback("_alsa_backend"); - #if PY_MAJOR_VERSION >= 3 - return NULL; - #endif -} - -static const char *__pyx_filenames[] = { - "_alsa_backend.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - name = argnames; - while (*name && (**name != key)) name++; - if (*name) { - if (name < first_kw_arg) goto arg_passed_twice; - values[name-argnames] = value; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} - -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts) { - while (1) { - switch (*ts) { - case '@': - case 10: - case 13: - case ' ': - ++ts; - break; - case '=': - case '<': - case '>': - case '!': - PyErr_SetString(PyExc_ValueError, "Buffer acquisition error: Only native byte order, size and alignment supported."); - return NULL; - default: - return ts; - } - } -} - -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - expected_ndim, buffer->ndim); -} - -static const char* __Pyx_DescribeTokenInFormatString(const char* ts) { - switch (*ts) { - case 'b': return "char"; - case 'B': return "unsigned char"; - case 'h': return "short"; - case 'H': return "unsigned short"; - case 'i': return "int"; - case 'I': return "unsigned int"; - case 'l': return "long"; - case 'L': return "unsigned long"; - case 'q': return "long long"; - case 'Q': return "unsigned long long"; - case 'f': return "float"; - case 'd': return "double"; - case 'g': return "long double"; - case 'Z': switch (*(ts+1)) { - case 'f': return "complex float"; - case 'd': return "complex double"; - case 'g': return "complex long double"; - default: return "unparseable format string"; - } - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - default: return "unparseable format string"; - } -} - -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'b': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(char) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'h': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(short) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'i': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(int) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'l': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - case 'q': ok = (sizeof(__pyx_t_5numpy_int16_t) == sizeof(long long) && (__pyx_t_5numpy_int16_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int16_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int16_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int16_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_int16_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_Format(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - #if PY_VERSION_HEX >= 0x02060000 - if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER) - return PyObject_GetBuffer(obj, view, flags); - #endif - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags); - else { - PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; - } -} - -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject* obj = view->obj; - if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); - Py_DECREF(obj); - view->obj = NULL; - } -} - -#endif - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunction(__import__, "OOOO", - name, global_dict, empty_dict, list); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static PyObject *__Pyx_CreateClass( - PyObject *bases, PyObject *dict, PyObject *name, char *modname) -{ - PyObject *py_modname; - PyObject *result = 0; - - #if PY_MAJOR_VERSION < 3 - py_modname = PyString_FromString(modname); - #else - py_modname = PyUnicode_FromString(modname); - #endif - if (!py_modname) - goto bad; - if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) - goto bad; - #if PY_MAJOR_VERSION < 3 - result = PyClass_New(bases, dict, name); - #else - result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL); - #endif -bad: - Py_XDECREF(py_modname); - return result; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#if PY_MAJOR_VERSION < 3 -static PyObject *__Pyx_GetStdout(void) { - PyObject *f = PySys_GetObject("stdout"); - if (!f) { - PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); - } - return f; -} - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; - PyObject* v; - int i; - - if (!(f = __Pyx_GetStdout())) - return -1; - for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { - if (PyFile_SoftSpace(f, 1)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - v = PyTuple_GET_ITEM(arg_tuple, i); - if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) - return -1; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); - Py_ssize_t len = PyString_Size(v); - if (len > 0 && - isspace(Py_CHARMASK(s[len-1])) && - s[len-1] != ' ') - PyFile_SoftSpace(f, 0); - } - } - if (newline) { - if (PyFile_WriteString("\n", f) < 0) - return -1; - PyFile_SoftSpace(f, 0); - } - return 0; -} - -#else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject* kwargs = 0; - PyObject* result = 0; - PyObject* end_string; - if (!__pyx_print) { - __pyx_print = PyObject_GetAttrString(__pyx_b, "print"); - if (!__pyx_print) - return -1; - } - if (!newline) { - if (!__pyx_print_kwargs) { - __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) - return -1; - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) - return -1; - if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { - Py_DECREF(end_string); - return -1; - } - Py_DECREF(end_string); - } - kwargs = __pyx_print_kwargs; - } - result = PyObject_Call(__pyx_print, arg_tuple, kwargs); - if (!result) - return -1; - Py_DECREF(result); - return 0; -} -#endif - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - __Pyx_ErrFetch(type, value, tb); - PyErr_NormalizeException(type, value, tb); - if (PyErr_Occurred()) - goto bad; - Py_INCREF(*type); - Py_INCREF(*value); - Py_INCREF(*tb); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - Py_XDECREF(*type); - Py_XDECREF(*value); - Py_XDECREF(*tb); - return -1; -} - - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { - PyObject *pycobj = 0; - int result; - - pycobj = PyCObject_FromVoidPtr(vtable, 0); - if (!pycobj) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) - goto bad; - result = 0; - goto done; - -bad: - result = -1; -done: - Py_XDECREF(pycobj); - return result; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyObject *empty_string = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - #if PY_MAJOR_VERSION < 3 - empty_string = PyString_FromStringAndSize("", 0); - #else - empty_string = PyBytes_FromStringAndSize("", 0); - #endif - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_string); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if (x == Py_False) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - return PyInt_AS_LONG(x); - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - long val = PyInt_AS_LONG(x); - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); - return (unsigned PY_LONG_LONG)-1; - } - return val; - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsUnsignedLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned char val = (unsigned char)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); - return (unsigned char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned short val = (unsigned short)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short"); - return (unsigned short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE char __pyx_PyInt_char(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - char val = (char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); - return (char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE short __pyx_PyInt_short(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - short val = (short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to short"); - return (short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE int __pyx_PyInt_int(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - int val = (int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); - return (int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long __pyx_PyInt_long(PyObject* x) { - if (sizeof(long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long val = (long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); - return (long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed char val = (signed char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char"); - return (signed char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed short val = (signed short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short"); - return (signed short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed int val = (signed int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int"); - return (signed int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) { - if (sizeof(signed long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed long val = (signed long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long"); - return (signed long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long double __pyx_PyInt_long_double(PyObject* x) { - if (sizeof(long double) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long double val = (long double)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double"); - return (long double)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - diff --git a/audiolab/soundio/alsa/_alsa_backend.pyx b/audiolab/soundio/alsa/_alsa_backend.pyx index 12c5831..247e49f 100644 --- a/audiolab/soundio/alsa/_alsa_backend.pyx +++ b/audiolab/soundio/alsa/_alsa_backend.pyx @@ -31,9 +31,10 @@ import numpy as np cimport numpy as cnp -cimport stdlib -cimport python_exc +cimport libc.stdlib as stdlib +cimport cpython from alsa cimport * +cimport libc.string as string cdef int BUFFER_TIME = 500000 cdef int PERIOD_TIME = 0 @@ -41,8 +42,8 @@ cdef int PERIOD_TIME = 0 cdef extern from "alsa/asoundlib.h": # This is needed here because it is a macro and is not recognized by # gccxml it seems - int snd_pcm_hw_params_alloca(snd_pcm_hw_params_t **) - int snd_pcm_sw_params_alloca(snd_pcm_sw_params_t **) + void snd_pcm_hw_params_alloca(snd_pcm_hw_params_t **) + void snd_pcm_sw_params_alloca(snd_pcm_sw_params_t **) cdef extern from "Python.h": object PyString_FromStringAndSize(char *v, int len) @@ -68,11 +69,11 @@ def enumerate_devices(): card = 0 while(hints[card] != NULL): #name = snd_device_name_get_hint(hints[card], "NAME") - #names.append(PyString_FromStringAndSize(name, stdlib.strlen(name))) + #names.append(PyString_FromStringAndSize(name, string.strlen(name))) #if name != NULL: # stdlib.free(name) devices.append(PyString_FromStringAndSize(hints[card], - stdlib.strlen(hints[card]))) + string.strlen(hints[card]))) card += 1 snd_device_name_free_hint(hints) @@ -138,7 +139,7 @@ cdef class AlsaDevice: raise AlsaException("Error while preparing the pcm device") for i in range(nr): - err = python_exc.PyErr_CheckSignals() + err = cpython.PyErr_CheckSignals() if err != 0: break # We make sure the buffer is in fortran order to deal diff --git a/audiolab/soundio/macosx/.gitignore b/audiolab/soundio/macosx/.gitignore new file mode 100644 index 0000000..11bea52 --- /dev/null +++ b/audiolab/soundio/macosx/.gitignore @@ -0,0 +1 @@ +macosx_backend.c \ No newline at end of file diff --git a/audiolab/soundio/macosx/AudioHardware.pxd b/audiolab/soundio/macosx/AudioHardware.pxd index 64f73b5..cdb2d78 100644 --- a/audiolab/soundio/macosx/AudioHardware.pxd +++ b/audiolab/soundio/macosx/AudioHardware.pxd @@ -1,6 +1,7 @@ # This was generated by cycodegelib, please do not edit # Generated by command /Users/david/local/bin/xml2cython.py -o AudioHardware.pxd -l CoreAudio CoreAudio/AudioHardware.h AudioHardware.xml # Codegenlib version: 0.3dev +from libcpp cimport bool cdef extern from 'CoreAudio/AudioHardware.h': cdef enum: kAppleLosslessFormatFlag_16BitSourceData = 1 diff --git a/audiolab/soundio/macosx/macosx_backend.c b/audiolab/soundio/macosx/macosx_backend.c deleted file mode 100644 index d0381d7..0000000 --- a/audiolab/soundio/macosx/macosx_backend.c +++ /dev/null @@ -1,4211 +0,0 @@ -/* Generated by Cython 0.10.2 on Tue Dec 9 20:56:52 2008 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_LOCK 0x0002 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif -#else - #define _USE_MATH_DEFINES -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__macosx_backend -#include "CoreAudio/AudioHardware.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x); -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x); -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x); -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b); - -#define __pyx_PyInt_AsLong(x) (PyInt_CheckExact(x) ? PyInt_AS_LONG(x) : PyInt_AsLong(x)) -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x); -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x); -static INLINE char __pyx_PyInt_char(PyObject* x); -static INLINE short __pyx_PyInt_short(PyObject* x); -static INLINE int __pyx_PyInt_int(PyObject* x); -static INLINE long __pyx_PyInt_long(PyObject* x); -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x); -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x); -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x); -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x); -static INLINE long double __pyx_PyInt_long_double(PyObject* x); -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/ -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/ -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/ -static const char* __Pyx_DescribeTokenInFormatString(const char* ts); /*proto*/ -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts); /*proto*/ - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/ - -static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { - PyObject *r; - if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned)) - r = PySequence_GetItem(o, i); - else { - PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i); - if (!j) - return 0; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - } - return r; -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); -static void __Pyx_ReleaseBuffer(Py_buffer *view); -#else -#define __Pyx_GetBuffer PyObject_GetBuffer -#define __Pyx_ReleaseBuffer PyBuffer_Release -#endif - -Py_ssize_t __Pyx_zeros[] = {0, 0}; -Py_ssize_t __Pyx_minusones[] = {-1, -1}; - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static int __Pyx_Print(PyObject *, int); /*proto*/ -#if PY_MAJOR_VERSION >= 3 -static PyObject* __pyx_print = 0; -static PyObject* __pyx_print_kwargs = 0; -#endif - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef npy_int8 __pyx_t_5numpy_int8_t; - -typedef npy_int16 __pyx_t_5numpy_int16_t; - -typedef npy_int32 __pyx_t_5numpy_int32_t; - -typedef npy_int64 __pyx_t_5numpy_int64_t; - -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -typedef npy_float32 __pyx_t_5numpy_float32_t; - -typedef npy_float64 __pyx_t_5numpy_float64_t; - -typedef npy_long __pyx_t_5numpy_int_t; - -typedef npy_longlong __pyx_t_5numpy_long_t; - -typedef npy_ulong __pyx_t_5numpy_uint_t; - -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -typedef npy_double __pyx_t_5numpy_float_t; - -typedef npy_double __pyx_t_5numpy_double_t; - -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":49 - * pass - * - * cdef struct CallbackData: # <<<<<<<<<<<<<< - * int remaining - * int nframes - */ - -struct __pyx_t_14macosx_backend_CallbackData { - int remaining; - int nframes; - int fake_stereo; - float *idata; -}; - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":104 - * return st - * - * cdef class CoreAudioDevice: # <<<<<<<<<<<<<< - * cdef AudioDeviceID dev - * cdef AudioStreamBasicDescription format - */ - -struct __pyx_obj_14macosx_backend_CoreAudioDevice { - PyObject_HEAD - struct __pyx_vtabstruct_14macosx_backend_CoreAudioDevice *__pyx_vtab; - AudioDeviceID dev; - AudioStreamBasicDescription format; - AudioDeviceIOProc callback; - int proc_set; - int dev_started; - int nchannels; -}; - - -struct __pyx_vtabstruct_14macosx_backend_CoreAudioDevice { - int (*_play)(struct __pyx_obj_14macosx_backend_CoreAudioDevice *, PyArrayObject *); -}; -static struct __pyx_vtabstruct_14macosx_backend_CoreAudioDevice *__pyx_vtabptr_14macosx_backend_CoreAudioDevice; -/* Module declarations from AudioHardware */ - -/* Module declarations from stdlib */ - -/* Module declarations from python_exc */ - -/* Module declarations from python_buffer */ - -/* Module declarations from numpy */ - -/* Module declarations from numpy */ - -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -/* Module declarations from macosx_backend */ - -static PyTypeObject *__pyx_ptype_14macosx_backend_CoreAudioDevice = 0; -static OSStatus __pyx_f_14macosx_backend_class_callback(AudioDeviceID, AudioTimeStamp *, AudioBufferList *, AudioTimeStamp *, AudioBufferList *, AudioTimeStamp *, void *); /*proto*/ - - -/* Implementation of macosx_backend */ -static char __pyx_k___init__[] = "__init__"; -static PyObject *__pyx_kp___init__; -static char __pyx_k_play[] = "play"; -static PyObject *__pyx_kp_play; -static char __pyx_k_fs[] = "fs"; -static PyObject *__pyx_kp_fs; -static char __pyx_k_nchannels[] = "nchannels"; -static PyObject *__pyx_kp_nchannels; -static char __pyx_k_input[] = "input"; -static PyObject *__pyx_kp_input; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k_RuntimeError[] = "RuntimeError"; -static PyObject *__pyx_kp_RuntimeError; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_dtype[] = "dtype"; -static PyObject *__pyx_kp_dtype; -static char __pyx_k_28[] = "float64"; -static PyObject *__pyx_kp_28; -static char __pyx_k_NotImplementedError[] = "NotImplementedError"; -static PyObject *__pyx_kp_NotImplementedError; -static char __pyx_k_channels[] = "channels"; -static PyObject *__pyx_kp_channels; -static char __pyx_k_asfortranarray[] = "asfortranarray"; -static PyObject *__pyx_kp_asfortranarray; -static char __pyx_k_31[] = "float32"; -static PyObject *__pyx_kp_31; -static char __pyx_k_size[] = "size"; -static PyObject *__pyx_kp_size; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_kp_23; -static PyObject *__pyx_kp_24; -static PyObject *__pyx_kp_25; -static PyObject *__pyx_kp_26; -static char __pyx_k_23[] = "Error while getting default output properties."; -static char __pyx_k_24[] = "Error while getting stream format."; -static char __pyx_k_25[] = "Not linear pcm"; -static char __pyx_k_26[] = "Error while setting stream format."; -static PyObject *__pyx_kp_27; -static PyObject *__pyx_kp_29; -static PyObject *__pyx_kp_30; -static char __pyx_k_27[] = "Expect rank 2 array"; -static char __pyx_k_29[] = "Only float64 supported for now"; -static char __pyx_k_30[] = "CoreAudioDevice configured for %d channels, signal has %d channels"; -static PyObject *__pyx_kp_32; -static PyObject *__pyx_kp_33; -static PyObject *__pyx_kp_34; -static PyObject *__pyx_kp_35; -static char __pyx_k_32[] = "error setting callback"; -static char __pyx_k_33[] = "error starting "; -static char __pyx_k_34[] = "AudioDeviceStop failed"; -static char __pyx_k_35[] = "AudioDeviceRemoveIO failed"; -static char __pyx_k___getbuffer__[] = "__getbuffer__"; -static PyObject *__pyx_kp___getbuffer__; -static char __pyx_k___releasebuffer__[] = "__releasebuffer__"; -static PyObject *__pyx_kp___releasebuffer__; -static char __pyx_k_info[] = "info"; -static PyObject *__pyx_kp_info; -static char __pyx_k_flags[] = "flags"; -static PyObject *__pyx_kp_flags; -static char __pyx_k_iteritems[] = "iteritems"; -static PyObject *__pyx_kp_iteritems; -static char __pyx_k_next[] = "next"; -static PyObject *__pyx_kp_next; -static char __pyx_k_StopIteration[] = "StopIteration"; -static PyObject *__pyx_kp_StopIteration; -static char __pyx_k_pop[] = "pop"; -static PyObject *__pyx_kp_pop; -static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_20; -static PyObject *__pyx_kp_21; -static PyObject *__pyx_kp_22; -static PyObject *__pyx_builtin_StopIteration; -static char __pyx_k_1[] = "ndarray is not C contiguous"; -static char __pyx_k_2[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_3[] = "b"; -static char __pyx_k_4[] = "B"; -static char __pyx_k_5[] = "h"; -static char __pyx_k_6[] = "H"; -static char __pyx_k_7[] = "i"; -static char __pyx_k_8[] = "I"; -static char __pyx_k_9[] = "l"; -static char __pyx_k_10[] = "L"; -static char __pyx_k_11[] = "q"; -static char __pyx_k_12[] = "Q"; -static char __pyx_k_13[] = "f"; -static char __pyx_k_14[] = "d"; -static char __pyx_k_15[] = "g"; -static char __pyx_k_16[] = "Zf"; -static char __pyx_k_17[] = "Zd"; -static char __pyx_k_18[] = "Zg"; -static char __pyx_k_19[] = "O"; -static char __pyx_k_20[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_21[] = "Format string allocated too short."; -static char __pyx_k_22[] = "unknown dtype code in numpy.pxd (%d)"; - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":55 - * float* idata - * - * cdef OSStatus class_callback(AudioDeviceID device, AudioTimeStamp* current_time, # <<<<<<<<<<<<<< - * AudioBufferList* data_in, AudioTimeStamp* time_in, - * AudioBufferList* data_out, AudioTimeStamp* time_out, - */ - -static OSStatus __pyx_f_14macosx_backend_class_callback(AudioDeviceID __pyx_v_device, AudioTimeStamp *__pyx_v_current_time, AudioBufferList *__pyx_v_data_in, AudioTimeStamp *__pyx_v_time_in, AudioBufferList *__pyx_v_data_out, AudioTimeStamp *__pyx_v_time_out, void *__pyx_v_client_data) { - OSStatus __pyx_v_st; - int __pyx_v_sz; - int __pyx_v_obuffsz; - int __pyx_v_i; - int __pyx_v_nframes; - int __pyx_v_fake_stereo; - int __pyx_v_wcount; - float *__pyx_v_data; - float *__pyx_v_obuffer; - OSStatus __pyx_r; - int __pyx_1; - int __pyx_2; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":59 - * AudioBufferList* data_out, AudioTimeStamp* time_out, - * void* client_data): - * cdef OSStatus st = 0 # <<<<<<<<<<<<<< - * cdef int sz, obuffsz, i, nframes, fake_stereo, wcount - * cdef float *data, *obuffer - */ - __pyx_v_st = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":64 - * - * # Prevent compilation warnings - * device = device # <<<<<<<<<<<<<< - * current_time = current_time - * data_in = data_in - */ - __pyx_v_device = __pyx_v_device; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":65 - * # Prevent compilation warnings - * device = device - * current_time = current_time # <<<<<<<<<<<<<< - * data_in = data_in - * time_in = time_in - */ - __pyx_v_current_time = __pyx_v_current_time; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":66 - * device = device - * current_time = current_time - * data_in = data_in # <<<<<<<<<<<<<< - * time_in = time_in - * time_out = time_out - */ - __pyx_v_data_in = __pyx_v_data_in; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":67 - * current_time = current_time - * data_in = data_in - * time_in = time_in # <<<<<<<<<<<<<< - * time_out = time_out - * - */ - __pyx_v_time_in = __pyx_v_time_in; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":68 - * data_in = data_in - * time_in = time_in - * time_out = time_out # <<<<<<<<<<<<<< - * - * data = (client_data)[0].idata - */ - __pyx_v_time_out = __pyx_v_time_out; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":70 - * time_out = time_out - * - * data = (client_data)[0].idata # <<<<<<<<<<<<<< - * nframes = (client_data)[0].nframes - * fake_stereo = (client_data)[0].fake_stereo - */ - __pyx_v_data = (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).idata; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":71 - * - * data = (client_data)[0].idata - * nframes = (client_data)[0].nframes # <<<<<<<<<<<<<< - * fake_stereo = (client_data)[0].fake_stereo - * - */ - __pyx_v_nframes = (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).nframes; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":72 - * data = (client_data)[0].idata - * nframes = (client_data)[0].nframes - * fake_stereo = (client_data)[0].fake_stereo # <<<<<<<<<<<<<< - * - * sz = (data_out[0].mBuffers)[0].mDataByteSize - */ - __pyx_v_fake_stereo = (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).fake_stereo; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":74 - * fake_stereo = (client_data)[0].fake_stereo - * - * sz = (data_out[0].mBuffers)[0].mDataByteSize # <<<<<<<<<<<<<< - * obuffsz = sz / sizeof (float) ; - * obuffer = ((data_out[0].mBuffers)[0].mData) - */ - __pyx_v_sz = ((__pyx_v_data_out[0]).mBuffers[0]).mDataByteSize; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":75 - * - * sz = (data_out[0].mBuffers)[0].mDataByteSize - * obuffsz = sz / sizeof (float) ; # <<<<<<<<<<<<<< - * obuffer = ((data_out[0].mBuffers)[0].mData) - * - */ - __pyx_v_obuffsz = (__pyx_v_sz / (sizeof(float))); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":76 - * sz = (data_out[0].mBuffers)[0].mDataByteSize - * obuffsz = sz / sizeof (float) ; - * obuffer = ((data_out[0].mBuffers)[0].mData) # <<<<<<<<<<<<<< - * - * if nframes < obuffsz: - */ - __pyx_v_obuffer = ((float *)((__pyx_v_data_out[0]).mBuffers[0]).mData); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":78 - * obuffer = ((data_out[0].mBuffers)[0].mData) - * - * if nframes < obuffsz: # <<<<<<<<<<<<<< - * wcount = nframes - * (client_data)[0].remaining = 0 - */ - __pyx_1 = (__pyx_v_nframes < __pyx_v_obuffsz); - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":79 - * - * if nframes < obuffsz: - * wcount = nframes # <<<<<<<<<<<<<< - * (client_data)[0].remaining = 0 - * else: - */ - __pyx_v_wcount = __pyx_v_nframes; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":80 - * if nframes < obuffsz: - * wcount = nframes - * (client_data)[0].remaining = 0 # <<<<<<<<<<<<<< - * else: - * wcount = obuffsz - */ - (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).remaining = 0; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":82 - * (client_data)[0].remaining = 0 - * else: - * wcount = obuffsz # <<<<<<<<<<<<<< - * - * if fake_stereo: - */ - __pyx_v_wcount = __pyx_v_obuffsz; - } - __pyx_L3:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":84 - * wcount = obuffsz - * - * if fake_stereo: # <<<<<<<<<<<<<< - * wcount /= 2 - * for i in range(wcount): - */ - __pyx_2 = __pyx_v_fake_stereo; - if (__pyx_2) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":85 - * - * if fake_stereo: - * wcount /= 2 # <<<<<<<<<<<<<< - * for i in range(wcount): - * obuffer[2 * i] = data[i] - */ - __pyx_v_wcount /= 2; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":86 - * if fake_stereo: - * wcount /= 2 - * for i in range(wcount): # <<<<<<<<<<<<<< - * obuffer[2 * i] = data[i] - * obuffer[2 * i + 1] = data[i] - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_wcount; __pyx_v_i+=1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":87 - * wcount /= 2 - * for i in range(wcount): - * obuffer[2 * i] = data[i] # <<<<<<<<<<<<<< - * obuffer[2 * i + 1] = data[i] - * # Fill with 0 if output buffer biffer than remaining data to be read - */ - (__pyx_v_obuffer[(2 * __pyx_v_i)]) = (__pyx_v_data[__pyx_v_i]); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":88 - * for i in range(wcount): - * obuffer[2 * i] = data[i] - * obuffer[2 * i + 1] = data[i] # <<<<<<<<<<<<<< - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(2 * wcount, obuffsz): - */ - (__pyx_v_obuffer[((2 * __pyx_v_i) + 1)]) = (__pyx_v_data[__pyx_v_i]); - } - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":90 - * obuffer[2 * i + 1] = data[i] - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(2 * wcount, obuffsz): # <<<<<<<<<<<<<< - * obuffer[i] = 0.0 - * else: - */ - for (__pyx_v_i = (2 * __pyx_v_wcount); __pyx_v_i < __pyx_v_obuffsz; __pyx_v_i+=1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":91 - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(2 * wcount, obuffsz): - * obuffer[i] = 0.0 # <<<<<<<<<<<<<< - * else: - * for i in range(wcount): - */ - (__pyx_v_obuffer[__pyx_v_i]) = 0.0; - } - goto __pyx_L4; - } - /*else*/ { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":93 - * obuffer[i] = 0.0 - * else: - * for i in range(wcount): # <<<<<<<<<<<<<< - * obuffer[i] = data[i] - * # Fill with 0 if output buffer biffer than remaining data to be read - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_wcount; __pyx_v_i+=1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":94 - * else: - * for i in range(wcount): - * obuffer[i] = data[i] # <<<<<<<<<<<<<< - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(wcount, obuffsz): - */ - (__pyx_v_obuffer[__pyx_v_i]) = (__pyx_v_data[__pyx_v_i]); - } - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":96 - * obuffer[i] = data[i] - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(wcount, obuffsz): # <<<<<<<<<<<<<< - * obuffer[i] = 0.0 - * - */ - for (__pyx_v_i = __pyx_v_wcount; __pyx_v_i < __pyx_v_obuffsz; __pyx_v_i+=1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":97 - * # Fill with 0 if output buffer biffer than remaining data to be read - * for i in range(wcount, obuffsz): - * obuffer[i] = 0.0 # <<<<<<<<<<<<<< - * - * (client_data)[0].nframes -= wcount - */ - (__pyx_v_obuffer[__pyx_v_i]) = 0.0; - } - } - __pyx_L4:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":99 - * obuffer[i] = 0.0 - * - * (client_data)[0].nframes -= wcount # <<<<<<<<<<<<<< - * (client_data)[0].idata += wcount - * - */ - (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).nframes -= __pyx_v_wcount; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":100 - * - * (client_data)[0].nframes -= wcount - * (client_data)[0].idata += wcount # <<<<<<<<<<<<<< - * - * return st - */ - (((struct __pyx_t_14macosx_backend_CallbackData *)__pyx_v_client_data)[0]).idata += __pyx_v_wcount; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":102 - * (client_data)[0].idata += wcount - * - * return st # <<<<<<<<<<<<<< - * - * cdef class CoreAudioDevice: - */ - __pyx_r = __pyx_v_st; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":111 - * cdef int nchannels - * - * def __init__(CoreAudioDevice self, Float64 fs=48000, int nchannels=1): # <<<<<<<<<<<<<< - * cdef UInt32 sz, buffer_size - * cdef OSStatus st - */ - -static int __pyx_pf_14macosx_backend_15CoreAudioDevice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_14macosx_backend_15CoreAudioDevice___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - Float64 __pyx_v_fs; - int __pyx_v_nchannels; - UInt32 __pyx_v_sz; - OSStatus __pyx_v_st; - int __pyx_r; - OSStatus __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_fs,&__pyx_kp_nchannels,0}; - __pyx_v_fs = ((Float64)48000); - __pyx_v_nchannels = 1; - if (unlikely(__pyx_kwds)) { - PyObject* values[2] = {0,0}; - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_fs = __pyx_PyFloat_AsDouble(values[0]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[1]) { - __pyx_v_nchannels = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_nchannels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_nchannels = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_nchannels == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_fs = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("macosx_backend.CoreAudioDevice.__init__"); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":115 - * cdef OSStatus st - * - * self.proc_set = 0 # <<<<<<<<<<<<<< - * self.dev_started = 0 - * - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->proc_set = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":116 - * - * self.proc_set = 0 - * self.dev_started = 0 # <<<<<<<<<<<<<< - * - * self.callback = class_callback - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->dev_started = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":118 - * self.dev_started = 0 - * - * self.callback = class_callback # <<<<<<<<<<<<<< - * - * # Get default output - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->callback = __pyx_f_14macosx_backend_class_callback; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":121 - * - * # Get default output - * sz = sizeof(AudioDeviceID) # <<<<<<<<<<<<<< - * st = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &sz, - * &self.dev) - */ - __pyx_v_sz = (sizeof(AudioDeviceID)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":123 - * sz = sizeof(AudioDeviceID) - * st = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &sz, - * &self.dev) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("Error while getting default output properties.") - */ - __pyx_v_st = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, (&__pyx_v_sz), (&((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->dev)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":124 - * st = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &sz, - * &self.dev) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while getting default output properties.") - * - */ - __pyx_1 = __pyx_v_st; - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":125 - * &self.dev) - * if st: - * raise RuntimeError("Error while getting default output properties.") # <<<<<<<<<<<<<< - * - * # Get default output stream format - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_23); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_23); - __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":128 - * - * # Get default output stream format - * sz = sizeof(self.format) # <<<<<<<<<<<<<< - * st = AudioDeviceGetProperty(self.dev, 0, False, - * kAudioDevicePropertyStreamFormat, &sz, - */ - __pyx_v_sz = (sizeof(((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":131 - * st = AudioDeviceGetProperty(self.dev, 0, False, - * kAudioDevicePropertyStreamFormat, &sz, - * &self.format) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("Error while getting stream format.") - */ - __pyx_v_st = AudioDeviceGetProperty(((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->dev, 0, 0, kAudioDevicePropertyStreamFormat, (&__pyx_v_sz), (&((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":132 - * kAudioDevicePropertyStreamFormat, &sz, - * &self.format) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while getting stream format.") - * - */ - __pyx_1 = __pyx_v_st; - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":133 - * &self.format) - * if st: - * raise RuntimeError("Error while getting stream format.") # <<<<<<<<<<<<<< - * - * # Set sampling rate and number of channels - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_24); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_24); - __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":136 - * - * # Set sampling rate and number of channels - * self.format.mSampleRate = fs # <<<<<<<<<<<<<< - * - * # CoreAudio can't do mono ? Fake stereo in that case for now - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format.mSampleRate = __pyx_v_fs; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":139 - * - * # CoreAudio can't do mono ? Fake stereo in that case for now - * self.nchannels = nchannels # <<<<<<<<<<<<<< - * if nchannels == 1: - * self.format.mChannelsPerFrame = 2 - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->nchannels = __pyx_v_nchannels; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":140 - * # CoreAudio can't do mono ? Fake stereo in that case for now - * self.nchannels = nchannels - * if nchannels == 1: # <<<<<<<<<<<<<< - * self.format.mChannelsPerFrame = 2 - * else: - */ - __pyx_4 = (__pyx_v_nchannels == 1); - if (__pyx_4) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":141 - * self.nchannels = nchannels - * if nchannels == 1: - * self.format.mChannelsPerFrame = 2 # <<<<<<<<<<<<<< - * else: - * self.format.mChannelsPerFrame = nchannels - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format.mChannelsPerFrame = 2; - goto __pyx_L8; - } - /*else*/ { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":143 - * self.format.mChannelsPerFrame = 2 - * else: - * self.format.mChannelsPerFrame = nchannels # <<<<<<<<<<<<<< - * - * # XXX: how to make sure we have 32 bits native float here ? - */ - ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format.mChannelsPerFrame = __pyx_v_nchannels; - } - __pyx_L8:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":146 - * - * # XXX: how to make sure we have 32 bits native float here ? - * if self.format.mFormatID != kAudioFormatLinearPCM: # <<<<<<<<<<<<<< - * raise ValueError("Not linear pcm") - * - */ - __pyx_4 = (((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format.mFormatID != kAudioFormatLinearPCM); - if (__pyx_4) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":147 - * # XXX: how to make sure we have 32 bits native float here ? - * if self.format.mFormatID != kAudioFormatLinearPCM: - * raise ValueError("Not linear pcm") # <<<<<<<<<<<<<< - * - * st = AudioDeviceSetProperty(self.dev, NULL, 0, False, - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_25); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_25); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":151 - * st = AudioDeviceSetProperty(self.dev, NULL, 0, False, - * kAudioDevicePropertyStreamFormat, - * sizeof(self.format), &self.format) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("Error while setting stream format.") - */ - __pyx_v_st = AudioDeviceSetProperty(((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->dev, NULL, 0, 0, kAudioDevicePropertyStreamFormat, (sizeof(((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format)), (&((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->format)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":152 - * kAudioDevicePropertyStreamFormat, - * sizeof(self.format), &self.format) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("Error while setting stream format.") - * - */ - __pyx_1 = __pyx_v_st; - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":153 - * sizeof(self.format), &self.format) - * if st: - * raise RuntimeError("Error while setting stream format.") # <<<<<<<<<<<<<< - * - * def play(CoreAudioDevice self, cnp.ndarray input): - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_26); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_26); - __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_AddTraceback("macosx_backend.CoreAudioDevice.__init__"); - __pyx_r = -1; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":155 - * raise RuntimeError("Error while setting stream format.") - * - * def play(CoreAudioDevice self, cnp.ndarray input): # <<<<<<<<<<<<<< - * cdef int nc - * cdef cnp.ndarray[cnp.float32_t, ndim=2] cinput - */ - -static PyObject *__pyx_pf_14macosx_backend_15CoreAudioDevice_play(PyObject *__pyx_v_self, PyObject *__pyx_v_input); /*proto*/ -static PyObject *__pyx_pf_14macosx_backend_15CoreAudioDevice_play(PyObject *__pyx_v_self, PyObject *__pyx_v_input) { - int __pyx_v_nc; - PyArrayObject *__pyx_v_cinput; - Py_buffer __pyx_bstruct_cinput; - Py_ssize_t __pyx_bstride_0_cinput = 0; - Py_ssize_t __pyx_bstride_1_cinput = 0; - Py_ssize_t __pyx_bshape_0_cinput = 0; - Py_ssize_t __pyx_bshape_1_cinput = 0; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_5; - int __pyx_6; - PyObject *__pyx_t_1 = NULL; - PyArrayObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __pyx_v_cinput = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - __pyx_bstruct_cinput.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":159 - * cdef cnp.ndarray[cnp.float32_t, ndim=2] cinput - * - * if not input.ndim == 2: # <<<<<<<<<<<<<< - * raise ValueError("Expect rank 2 array") - * - */ - __pyx_1 = (!(((PyArrayObject *)__pyx_v_input)->nd == 2)); - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":160 - * - * if not input.ndim == 2: - * raise ValueError("Expect rank 2 array") # <<<<<<<<<<<<<< - * - * if not input.dtype == np.float64: - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_27); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_27); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":162 - * raise ValueError("Expect rank 2 array") - * - * if not input.dtype == np.float64: # <<<<<<<<<<<<<< - * raise NotImplementedError("Only float64 supported for now") - * - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_input, __pyx_kp_dtype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_kp_28); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyObject_RichCompare(__pyx_2, __pyx_4, Py_EQ); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = (!__pyx_1); - if (__pyx_5) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":163 - * - * if not input.dtype == np.float64: - * raise NotImplementedError("Only float64 supported for now") # <<<<<<<<<<<<<< - * - * nc = input.shape[0] - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_29); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_29); - __pyx_4 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":165 - * raise NotImplementedError("Only float64 supported for now") - * - * nc = input.shape[0] # <<<<<<<<<<<<<< - * if not nc == self.nchannels: - * raise ValueError( - */ - __pyx_v_nc = (((PyArrayObject *)__pyx_v_input)->dimensions[0]); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":166 - * - * nc = input.shape[0] - * if not nc == self.nchannels: # <<<<<<<<<<<<<< - * raise ValueError( - * "CoreAudioDevice configured for %d channels, "\ - */ - __pyx_1 = (!(__pyx_v_nc == ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->nchannels)); - if (__pyx_1) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":170 - * "CoreAudioDevice configured for %d channels, "\ - * "signal has %d channels" % \ - * (self.channels, nc)) # <<<<<<<<<<<<<< - * - * cinput = np.asfortranarray(input, np.float32) - */ - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_channels); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyInt_FromLong(__pyx_v_nc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_3 = 0; - __pyx_2 = 0; - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_30, ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":172 - * (self.channels, nc)) - * - * cinput = np.asfortranarray(input, np.float32) # <<<<<<<<<<<<<< - * self._play(cinput) - * - */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_kp_asfortranarray); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_31); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_v_input); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_input); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((PyArrayObject *)__pyx_4); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_cinput); - __pyx_t_3 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_t_2, &__pyx_bstruct_cinput, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0); - if (unlikely(__pyx_t_3 < 0)) - { - PyErr_Fetch(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); - if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t((PyObject*)__pyx_v_cinput, &__pyx_bstruct_cinput, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0) == -1)) { - Py_XDECREF(__pyx_t_1); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_1, __pyx_t_4, __pyx_t_5); - } - } - __pyx_bstride_0_cinput = __pyx_bstruct_cinput.strides[0]; __pyx_bstride_1_cinput = __pyx_bstruct_cinput.strides[1]; - __pyx_bshape_0_cinput = __pyx_bstruct_cinput.shape[0]; __pyx_bshape_1_cinput = __pyx_bstruct_cinput.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = 0; - Py_DECREF(((PyObject *)__pyx_v_cinput)); - __pyx_v_cinput = ((PyArrayObject *)__pyx_4); - __pyx_4 = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":173 - * - * cinput = np.asfortranarray(input, np.float32) - * self._play(cinput) # <<<<<<<<<<<<<< - * - * cdef int _play(CoreAudioDevice self, cnp.ndarray input) except -1: - */ - __pyx_6 = ((struct __pyx_vtabstruct_14macosx_backend_CoreAudioDevice *)((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self)->__pyx_vtab)->_play(((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)__pyx_v_self), ((PyArrayObject *)__pyx_v_cinput)); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_cinput); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("macosx_backend.CoreAudioDevice.play"); - __pyx_r = NULL; - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_bstruct_cinput); - __pyx_L2:; - Py_DECREF(__pyx_v_cinput); - return __pyx_r; -} - -/* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":175 - * self._play(cinput) - * - * cdef int _play(CoreAudioDevice self, cnp.ndarray input) except -1: # <<<<<<<<<<<<<< - * cdef OSStatus st - * cdef CallbackData data - */ - -static int __pyx_f_14macosx_backend_15CoreAudioDevice__play(struct __pyx_obj_14macosx_backend_CoreAudioDevice *__pyx_v_self, PyArrayObject *__pyx_v_input) { - OSStatus __pyx_v_st; - struct __pyx_t_14macosx_backend_CallbackData __pyx_v_data; - int __pyx_v_gotsig; - int __pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - int __pyx_3; - int __pyx_4; - OSStatus __pyx_5; - PyObject *__pyx_t_1 = NULL; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":179 - * cdef CallbackData data - * cdef int bufsize, nframes - * cdef int gotsig = 0 # <<<<<<<<<<<<<< - * - * data.idata = input.data - */ - __pyx_v_gotsig = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":181 - * cdef int gotsig = 0 - * - * data.idata = input.data # <<<<<<<<<<<<<< - * data.nframes = input.size / input.shape[0] - * if self.nchannels == 1: - */ - __pyx_v_data.idata = ((float *)__pyx_v_input->data); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":182 - * - * data.idata = input.data - * data.nframes = input.size / input.shape[0] # <<<<<<<<<<<<<< - * if self.nchannels == 1: - * data.fake_stereo = 1 - */ - __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_input), __pyx_kp_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyInt_FromLong((__pyx_v_input->dimensions[0])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_1, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __pyx_PyInt_int(__pyx_t_1); if (unlikely((__pyx_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_data.nframes = __pyx_3; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":183 - * data.idata = input.data - * data.nframes = input.size / input.shape[0] - * if self.nchannels == 1: # <<<<<<<<<<<<<< - * data.fake_stereo = 1 - * else: - */ - __pyx_4 = (__pyx_v_self->nchannels == 1); - if (__pyx_4) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":184 - * data.nframes = input.size / input.shape[0] - * if self.nchannels == 1: - * data.fake_stereo = 1 # <<<<<<<<<<<<<< - * else: - * data.fake_stereo = 0 - */ - __pyx_v_data.fake_stereo = 1; - goto __pyx_L3; - } - /*else*/ { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":186 - * data.fake_stereo = 1 - * else: - * data.fake_stereo = 0 # <<<<<<<<<<<<<< - * data.remaining = 1 - * - */ - __pyx_v_data.fake_stereo = 0; - } - __pyx_L3:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":187 - * else: - * data.fake_stereo = 0 - * data.remaining = 1 # <<<<<<<<<<<<<< - * - * # Add callback, and starts the device - */ - __pyx_v_data.remaining = 1; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":190 - * - * # Add callback, and starts the device - * st = AudioDeviceAddIOProc(self.dev, self.callback, &data) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("error setting callback") - */ - __pyx_v_st = AudioDeviceAddIOProc(__pyx_v_self->dev, __pyx_v_self->callback, (&__pyx_v_data)); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":191 - * # Add callback, and starts the device - * st = AudioDeviceAddIOProc(self.dev, self.callback, &data) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("error setting callback") - * - */ - __pyx_5 = __pyx_v_st; - if (__pyx_5) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":192 - * st = AudioDeviceAddIOProc(self.dev, self.callback, &data) - * if st: - * raise RuntimeError("error setting callback") # <<<<<<<<<<<<<< - * - * st = AudioDeviceStart (self.dev, self.callback) - */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_32); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_32); - __pyx_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":194 - * raise RuntimeError("error setting callback") - * - * st = AudioDeviceStart (self.dev, self.callback) # <<<<<<<<<<<<<< - * if st: - * raise RuntimeError("error starting ") - */ - __pyx_v_st = AudioDeviceStart(__pyx_v_self->dev, __pyx_v_self->callback); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":195 - * - * st = AudioDeviceStart (self.dev, self.callback) - * if st: # <<<<<<<<<<<<<< - * raise RuntimeError("error starting ") - * - */ - __pyx_5 = __pyx_v_st; - if (__pyx_5) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":196 - * st = AudioDeviceStart (self.dev, self.callback) - * if st: - * raise RuntimeError("error starting ") # <<<<<<<<<<<<<< - * - * while (data.remaining == 1): - */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_33); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_33); - __pyx_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":198 - * raise RuntimeError("error starting ") - * - * while (data.remaining == 1): # <<<<<<<<<<<<<< - * st = python_exc.PyErr_CheckSignals() - * if st != 0: - */ - while (1) { - __pyx_4 = (__pyx_v_data.remaining == 1); - if (!__pyx_4) break; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":199 - * - * while (data.remaining == 1): - * st = python_exc.PyErr_CheckSignals() # <<<<<<<<<<<<<< - * if st != 0: - * gotsig = 1 - */ - __pyx_v_st = PyErr_CheckSignals(); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":200 - * while (data.remaining == 1): - * st = python_exc.PyErr_CheckSignals() - * if st != 0: # <<<<<<<<<<<<<< - * gotsig = 1 - * break - */ - __pyx_4 = (__pyx_v_st != 0); - if (__pyx_4) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":201 - * st = python_exc.PyErr_CheckSignals() - * if st != 0: - * gotsig = 1 # <<<<<<<<<<<<<< - * break - * #printf("Main: %d\n", data.nframes) - */ - __pyx_v_gotsig = 1; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":202 - * if st != 0: - * gotsig = 1 - * break # <<<<<<<<<<<<<< - * #printf("Main: %d\n", data.nframes) - * usleep(10000) - */ - goto __pyx_L7; - goto __pyx_L8; - } - __pyx_L8:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":204 - * break - * #printf("Main: %d\n", data.nframes) - * usleep(10000) # <<<<<<<<<<<<<< - * - * #if self.dev_started: - */ - usleep(10000); - } - __pyx_L7:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":207 - * - * #if self.dev_started: - * st = AudioDeviceStop(self.dev, self.callback) # <<<<<<<<<<<<<< - * if st: - * print "AudioDeviceStop failed" - */ - __pyx_v_st = AudioDeviceStop(__pyx_v_self->dev, __pyx_v_self->callback); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":208 - * #if self.dev_started: - * st = AudioDeviceStop(self.dev, self.callback) - * if st: # <<<<<<<<<<<<<< - * print "AudioDeviceStop failed" - * - */ - __pyx_5 = __pyx_v_st; - if (__pyx_5) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":209 - * st = AudioDeviceStop(self.dev, self.callback) - * if st: - * print "AudioDeviceStop failed" # <<<<<<<<<<<<<< - * - * #if self.proc_set: - */ - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_34); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_34); - if (__Pyx_Print(((PyObject *)__pyx_1), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - goto __pyx_L9; - } - __pyx_L9:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":212 - * - * #if self.proc_set: - * st = AudioDeviceRemoveIOProc(self.dev, self.callback) # <<<<<<<<<<<<<< - * if st: - * print "AudioDeviceRemoveIO failed" - */ - __pyx_v_st = AudioDeviceRemoveIOProc(__pyx_v_self->dev, __pyx_v_self->callback); - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":213 - * #if self.proc_set: - * st = AudioDeviceRemoveIOProc(self.dev, self.callback) - * if st: # <<<<<<<<<<<<<< - * print "AudioDeviceRemoveIO failed" - * - */ - __pyx_5 = __pyx_v_st; - if (__pyx_5) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":214 - * st = AudioDeviceRemoveIOProc(self.dev, self.callback) - * if st: - * print "AudioDeviceRemoveIO failed" # <<<<<<<<<<<<<< - * - * if gotsig: - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_35); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_35); - if (__Pyx_Print(((PyObject *)__pyx_2), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - goto __pyx_L10; - } - __pyx_L10:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":216 - * print "AudioDeviceRemoveIO failed" - * - * if gotsig: # <<<<<<<<<<<<<< - * return -1 - * - */ - __pyx_3 = __pyx_v_gotsig; - if (__pyx_3) { - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":217 - * - * if gotsig: - * return -1 # <<<<<<<<<<<<<< - * - * return 0 - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L11; - } - __pyx_L11:; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":219 - * return -1 - * - * return 0 # <<<<<<<<<<<<<< - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - __Pyx_AddTraceback("macosx_backend.CoreAudioDevice._play"); - __pyx_r = -1; - __pyx_L0:; - return __pyx_r; -} - -/* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":50 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - PyObject *__pyx_v_stack; - int __pyx_v_hasfields; - PyObject *__pyx_v_iterator; - int __pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - int __pyx_4; - PyObject *__pyx_5 = 0; - PyObject *__pyx_6 = 0; - PyObject *__pyx_7 = 0; - Py_ssize_t __pyx_8 = 0; - PyObject *__pyx_t_1 = NULL; - if (__pyx_v_info == NULL) return 0; - __pyx_v_info->obj = Py_None; Py_INCREF(Py_None); - __pyx_v_stack = ((PyObject *)Py_None); Py_INCREF(Py_None); - __pyx_v_iterator = Py_None; Py_INCREF(Py_None); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":56 - * # of flags - * cdef int copy_shape, i, ndim - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":58 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":59 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - goto __pyx_L5; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":61 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - __pyx_v_copy_shape = 0; - } - __pyx_L5:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":63 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") - */ - __pyx_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":64 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not C contiguous") - * - */ - __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - } - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":65 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_1); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_1); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":67 - * raise ValueError("ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") - */ - __pyx_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":68 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError("ndarray is not Fortran contiguous") - * - */ - __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - } - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":69 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_2); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_2); - __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":71 - * raise ValueError("ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":72 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. This is allocated - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":73 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - */ - __pyx_4 = __pyx_v_copy_shape; - if (__pyx_4) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":76 - * # Allocate new buffer for strides and shape info. This is allocated - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":77 - * # as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":78 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i+=1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":79 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":80 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - } - goto __pyx_L8; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":82 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":83 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); - } - __pyx_L8:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":84 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":85 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":86 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":89 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef list stack - */ - __pyx_v_f = NULL; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":90 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef list stack - * - */ - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); - __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":93 - * cdef list stack - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * # Ugly hack warning: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":103 - * # functions). - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - __pyx_1 = (!__pyx_v_copy_shape); - } - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":105 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - Py_INCREF(Py_None); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - goto __pyx_L11; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":108 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - Py_INCREF(__pyx_v_self); - Py_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = __pyx_v_self; - } - __pyx_L11:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":110 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":111 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":112 - * if not hasfields: - * t = descr.type_num - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = __pyx_k_3; - break; - case NPY_UBYTE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":113 - * t = descr.type_num - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - __pyx_v_f = __pyx_k_4; - break; - case NPY_SHORT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":114 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - __pyx_v_f = __pyx_k_5; - break; - case NPY_USHORT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":115 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - __pyx_v_f = __pyx_k_6; - break; - case NPY_INT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":116 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - __pyx_v_f = __pyx_k_7; - break; - case NPY_UINT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":117 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - __pyx_v_f = __pyx_k_8; - break; - case NPY_LONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":118 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - __pyx_v_f = __pyx_k_9; - break; - case NPY_ULONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":119 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - __pyx_v_f = __pyx_k_10; - break; - case NPY_LONGLONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":120 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - __pyx_v_f = __pyx_k_11; - break; - case NPY_ULONGLONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":121 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - __pyx_v_f = __pyx_k_12; - break; - case NPY_FLOAT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":122 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - __pyx_v_f = __pyx_k_13; - break; - case NPY_DOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":123 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - __pyx_v_f = __pyx_k_14; - break; - case NPY_LONGDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":124 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - __pyx_v_f = __pyx_k_15; - break; - case NPY_CFLOAT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":125 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - __pyx_v_f = __pyx_k_16; - break; - case NPY_CDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":126 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - __pyx_v_f = __pyx_k_17; - break; - case NPY_CLONGDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":127 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - __pyx_v_f = __pyx_k_18; - break; - case NPY_OBJECT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":128 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_v_f = __pyx_k_19; - break; - default: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":130 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_20, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":131 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":132 - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(255) # static size - */ - __pyx_r = 0; - goto __pyx_L0; - goto __pyx_L12; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":134 - * return - * else: - * info.format = stdlib.malloc(255) # static size # <<<<<<<<<<<<<< - * f = info.format - * stack = [iter(descr.fields.iteritems())] - */ - __pyx_v_info->format = ((char *)malloc(255)); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":135 - * else: - * info.format = stdlib.malloc(255) # static size - * f = info.format # <<<<<<<<<<<<<< - * stack = [iter(descr.fields.iteritems())] - * - */ - __pyx_v_f = __pyx_v_info->format; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":136 - * info.format = stdlib.malloc(255) # static size - * f = info.format - * stack = [iter(descr.fields.iteritems())] # <<<<<<<<<<<<<< - * - * while True: - */ - __pyx_3 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyList_SET_ITEM(__pyx_2, 0, __pyx_3); - __pyx_3 = 0; - Py_DECREF(((PyObject *)__pyx_v_stack)); - __pyx_v_stack = __pyx_2; - __pyx_2 = 0; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":138 - * stack = [iter(descr.fields.iteritems())] - * - * while True: # <<<<<<<<<<<<<< - * iterator = stack[-1] - * descr = None - */ - while (1) { - __pyx_1 = 1; - if (!__pyx_1) break; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":139 - * - * while True: - * iterator = stack[-1] # <<<<<<<<<<<<<< - * descr = None - * while descr is None: - */ - __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_v_iterator); - __pyx_v_iterator = __pyx_3; - __pyx_3 = 0; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":140 - * while True: - * iterator = stack[-1] - * descr = None # <<<<<<<<<<<<<< - * while descr is None: - * try: - */ - Py_INCREF(Py_None); - Py_DECREF(((PyObject *)__pyx_v_descr)); - __pyx_v_descr = ((PyArray_Descr *)Py_None); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":141 - * iterator = stack[-1] - * descr = None - * while descr is None: # <<<<<<<<<<<<<< - * try: - * descr = iterator.next()[1][0] - */ - while (1) { - __pyx_1 = (((PyObject *)__pyx_v_descr) == Py_None); - if (!__pyx_1) break; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":142 - * descr = None - * while descr is None: - * try: # <<<<<<<<<<<<<< - * descr = iterator.next()[1][0] - * except StopIteration: - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - /*try:*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":143 - * while descr is None: - * try: - * descr = iterator.next()[1][0] # <<<<<<<<<<<<<< - * except StopIteration: - * stack.pop() - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_iterator, __pyx_kp_next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_3, 1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;} - Py_DECREF(((PyObject *)__pyx_v_descr)); - __pyx_v_descr = ((PyArray_Descr *)__pyx_3); - __pyx_3 = 0; - } - Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L21_try; - __pyx_L17_error:; - Py_XDECREF(__pyx_2); __pyx_2 = 0; - Py_XDECREF(__pyx_3); __pyx_3 = 0; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":144 - * try: - * descr = iterator.next()[1][0] - * except StopIteration: # <<<<<<<<<<<<<< - * stack.pop() - * if len(stack) > 0: - */ - __pyx_4 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); - if (__pyx_4) { - __Pyx_AddTraceback("numpy.__getbuffer__"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":145 - * descr = iterator.next()[1][0] - * except StopIteration: - * stack.pop() # <<<<<<<<<<<<<< - * if len(stack) > 0: - * f[0] = 125 #"}" - */ - __pyx_6 = PyObject_GetAttr(((PyObject *)__pyx_v_stack), __pyx_kp_pop); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __pyx_7 = PyObject_Call(__pyx_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_7); __pyx_7 = 0; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":146 - * except StopIteration: - * stack.pop() - * if len(stack) > 0: # <<<<<<<<<<<<<< - * f[0] = 125 #"}" - * f += 1 - */ - __pyx_8 = PyObject_Length(((PyObject *)__pyx_v_stack)); if (unlikely(__pyx_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - __pyx_1 = (__pyx_8 > 0); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":147 - * stack.pop() - * if len(stack) > 0: - * f[0] = 125 #"}" # <<<<<<<<<<<<<< - * f += 1 - * iterator = stack[-1] - */ - (__pyx_v_f[0]) = 125; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":148 - * if len(stack) > 0: - * f[0] = 125 #"}" - * f += 1 # <<<<<<<<<<<<<< - * iterator = stack[-1] - * else: - */ - __pyx_v_f += 1; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":149 - * f[0] = 125 #"}" - * f += 1 - * iterator = stack[-1] # <<<<<<<<<<<<<< - * else: - * f[0] = 0 # Terminate string! - */ - __pyx_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;} - Py_DECREF(__pyx_v_iterator); - __pyx_v_iterator = __pyx_6; - __pyx_6 = 0; - goto __pyx_L22; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":151 - * iterator = stack[-1] - * else: - * f[0] = 0 # Terminate string! # <<<<<<<<<<<<<< - * return - * - */ - (__pyx_v_f[0]) = 0; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":152 - * else: - * f[0] = 0 # Terminate string! - * return # <<<<<<<<<<<<<< - * - * hasfields = PyDataType_HASFIELDS(descr) - */ - __pyx_r = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L20_except_return; - } - __pyx_L22:; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - goto __pyx_L18_exception_handled; - } - __pyx_L19_except_error:; - Py_XDECREF(__pyx_save_exc_type); - Py_XDECREF(__pyx_save_exc_value); - Py_XDECREF(__pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L20_except_return:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L0; - __pyx_L18_exception_handled:; - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L21_try:; - } - } - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":154 - * return - * - * hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * if not hasfields: - * t = descr.type_num - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":155 - * - * hasfields = PyDataType_HASFIELDS(descr) - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - */ - __pyx_1 = (!__pyx_v_hasfields); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":156 - * hasfields = PyDataType_HASFIELDS(descr) - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") - */ - __pyx_v_t = __pyx_v_descr->type_num; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":157 - * if not hasfields: - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well # <<<<<<<<<<<<<< - * raise RuntimeError("Format string allocated too short.") - * - */ - __pyx_1 = ((__pyx_v_f - __pyx_v_info->format) > 240); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":158 - * t = descr.type_num - * if f - info.format > 240: # this should leave room for "T{" and "}" as well - * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_kp_21); - PyTuple_SET_ITEM(__pyx_7, 0, __pyx_kp_21); - __pyx_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_7)); __pyx_7 = 0; - __Pyx_Raise(__pyx_6, 0, 0); - Py_DECREF(__pyx_6); __pyx_6 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L24; - } - __pyx_L24:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":161 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - (__pyx_v_f[0]) = 98; - break; - case NPY_UBYTE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":162 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - (__pyx_v_f[0]) = 66; - break; - case NPY_SHORT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":163 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - (__pyx_v_f[0]) = 104; - break; - case NPY_USHORT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":164 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - (__pyx_v_f[0]) = 72; - break; - case NPY_INT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":165 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - (__pyx_v_f[0]) = 105; - break; - case NPY_UINT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":166 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - (__pyx_v_f[0]) = 73; - break; - case NPY_LONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":167 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - (__pyx_v_f[0]) = 108; - break; - case NPY_ULONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":168 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - (__pyx_v_f[0]) = 76; - break; - case NPY_LONGLONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":169 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - (__pyx_v_f[0]) = 113; - break; - case NPY_ULONGLONG: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":170 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - (__pyx_v_f[0]) = 81; - break; - case NPY_FLOAT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":171 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - (__pyx_v_f[0]) = 102; - break; - case NPY_DOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":172 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - */ - (__pyx_v_f[0]) = 100; - break; - case NPY_LONGDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":173 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - */ - (__pyx_v_f[0]) = 103; - break; - case NPY_CFLOAT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":174 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; - break; - case NPY_CDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":175 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; - break; - case NPY_CLONGDOUBLE: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":176 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; - break; - case NPY_OBJECT: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":177 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - */ - (__pyx_v_f[0]) = 79; - break; - default: - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":179 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyNumber_Remainder(__pyx_kp_22, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":180 - * else: - * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * f[0] = 84 #"T" - */ - __pyx_v_f += 1; - goto __pyx_L23; - } - /*else*/ { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":182 - * f += 1 - * else: - * f[0] = 84 #"T" # <<<<<<<<<<<<<< - * f[1] = 123 #"{" - * f += 2 - */ - (__pyx_v_f[0]) = 84; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":183 - * else: - * f[0] = 84 #"T" - * f[1] = 123 #"{" # <<<<<<<<<<<<<< - * f += 2 - * stack.append(iter(descr.fields.iteritems())) - */ - (__pyx_v_f[1]) = 123; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":184 - * f[0] = 84 #"T" - * f[1] = 123 #"{" - * f += 2 # <<<<<<<<<<<<<< - * stack.append(iter(descr.fields.iteritems())) - * - */ - __pyx_v_f += 2; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":185 - * f[1] = 123 #"{" - * f += 2 - * stack.append(iter(descr.fields.iteritems())) # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - __pyx_7 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_6 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_7); __pyx_7 = 0; - __pyx_2 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_4 = PyList_Append(((PyObject *)__pyx_v_stack), __pyx_2); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - } - __pyx_L23:; - } - } - __pyx_L12:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_5); - Py_XDECREF(__pyx_6); - Py_XDECREF(__pyx_7); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); - __pyx_r = -1; - Py_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info->obj == Py_None) { Py_DECREF(Py_None); __pyx_v_info->obj = NULL; } - __pyx_L2:; - Py_XDECREF(__pyx_v_descr); - Py_DECREF(__pyx_v_stack); - Py_DECREF(__pyx_v_iterator); - return __pyx_r; -} - -/* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":187 - * stack.append(iter(descr.fields.iteritems())) - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_1; - int __pyx_2; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":188 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); - if (__pyx_1) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":189 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":190 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_2) { - - /* "/Users/david/local/lib/python2.5/site-packages/Cython/Includes/numpy.pxd":191 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - goto __pyx_L6; - } - __pyx_L6:; - -} -static struct __pyx_vtabstruct_14macosx_backend_CoreAudioDevice __pyx_vtable_14macosx_backend_CoreAudioDevice; - -static PyObject *__pyx_tp_new_14macosx_backend_CoreAudioDevice(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_14macosx_backend_CoreAudioDevice *p; - PyObject *o = (*t->tp_alloc)(t, 0); - if (!o) return 0; - p = ((struct __pyx_obj_14macosx_backend_CoreAudioDevice *)o); - p->__pyx_vtab = __pyx_vtabptr_14macosx_backend_CoreAudioDevice; - return o; -} - -static void __pyx_tp_dealloc_14macosx_backend_CoreAudioDevice(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); -} - -static struct PyMethodDef __pyx_methods_14macosx_backend_CoreAudioDevice[] = { - {"play", (PyCFunction)__pyx_pf_14macosx_backend_15CoreAudioDevice_play, METH_O, 0}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_CoreAudioDevice = { - 0, /*nb_add*/ - 0, /*nb_subtract*/ - 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - 0, /*nb_negative*/ - 0, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - 0, /*nb_long*/ - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) - 0, /*nb_index*/ - #endif -}; - -static PySequenceMethods __pyx_tp_as_sequence_CoreAudioDevice = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - 0, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_CoreAudioDevice = { - 0, /*mp_length*/ - 0, /*mp_subscript*/ - 0, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_CoreAudioDevice = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -PyTypeObject __pyx_type_14macosx_backend_CoreAudioDevice = { - PyVarObject_HEAD_INIT(0, 0) - "macosx_backend.CoreAudioDevice", /*tp_name*/ - sizeof(struct __pyx_obj_14macosx_backend_CoreAudioDevice), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_14macosx_backend_CoreAudioDevice, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - &__pyx_tp_as_number_CoreAudioDevice, /*tp_as_number*/ - &__pyx_tp_as_sequence_CoreAudioDevice, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_CoreAudioDevice, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_CoreAudioDevice, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ - 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_14macosx_backend_CoreAudioDevice, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pf_14macosx_backend_15CoreAudioDevice___init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_14macosx_backend_CoreAudioDevice, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ -}; - -static struct PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - "macosx_backend", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1}, - {&__pyx_kp_play, __pyx_k_play, sizeof(__pyx_k_play), 1, 1, 1}, - {&__pyx_kp_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 1, 1, 1}, - {&__pyx_kp_nchannels, __pyx_k_nchannels, sizeof(__pyx_k_nchannels), 1, 1, 1}, - {&__pyx_kp_input, __pyx_k_input, sizeof(__pyx_k_input), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1}, - {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 1, 1, 1}, - {&__pyx_kp_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 1, 1, 1}, - {&__pyx_kp_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 1, 1, 1}, - {&__pyx_kp_asfortranarray, __pyx_k_asfortranarray, sizeof(__pyx_k_asfortranarray), 1, 1, 1}, - {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 1, 1, 1}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, - {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0}, - {&__pyx_kp_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 0}, - {&__pyx_kp_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 0}, - {&__pyx_kp_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 0}, - {&__pyx_kp_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 0}, - {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 0}, - {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 0}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 0}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 0}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 0}, - {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1}, - {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1}, - {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1}, - {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1}, - {&__pyx_kp_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 1, 1, 1}, - {&__pyx_kp_next, __pyx_k_next, sizeof(__pyx_k_next), 1, 1, 1}, - {&__pyx_kp_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 1, 1, 1}, - {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0}, - {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0}, - {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0}, - {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_kp_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_kp_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initmacosx_backend(void); /*proto*/ -PyMODINIT_FUNC initmacosx_backend(void) -#else -PyMODINIT_FUNC PyInit_macosx_backend(void); /*proto*/ -PyMODINIT_FUNC PyInit_macosx_backend(void) -#endif -{ - PyObject *__pyx_1 = 0; - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Library function declarations ---*/ - __pyx_init_filenames(); - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("macosx_backend", __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_14macosx_backend_CoreAudioDevice = &__pyx_vtable_14macosx_backend_CoreAudioDevice; - *(void(**)(void))&__pyx_vtable_14macosx_backend_CoreAudioDevice._play = (void(*)(void))__pyx_f_14macosx_backend_15CoreAudioDevice__play; - if (PyType_Ready(&__pyx_type_14macosx_backend_CoreAudioDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_14macosx_backend_CoreAudioDevice.tp_dict, __pyx_vtabptr_14macosx_backend_CoreAudioDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "CoreAudioDevice", (PyObject *)&__pyx_type_14macosx_backend_CoreAudioDevice) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_14macosx_backend_CoreAudioDevice = &__pyx_type_14macosx_backend_CoreAudioDevice; - /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/macosx_backend.pyx":38 - * cimport numpy as cnp - * - * import numpy as np # <<<<<<<<<<<<<< - * - * cdef extern from "Python.h": - */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/Users/david/src/dsp/scikits/git/audiolab/scikits/audiolab/soundio/macosx/AudioHardware.pxd":1 - * # This was generated by cycodegelib, please do not edit # <<<<<<<<<<<<<< - * # Generated by command /Users/david/local/bin/xml2cython.py -o AudioHardware.pxd -l CoreAudio CoreAudio/AudioHardware.h AudioHardware.xml - * # Codegenlib version: 0.3dev - */ - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif - __pyx_L1_error:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("macosx_backend"); - #if PY_MAJOR_VERSION >= 3 - return NULL; - #endif -} - -static const char *__pyx_filenames[] = { - "macosx_backend.pyx", - "numpy.pxd", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - name = argnames; - while (*name && (**name != key)) name++; - if (*name) { - if (name < first_kw_arg) goto arg_passed_twice; - values[name-argnames] = value; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - strcmp(PyString_AS_STRING(**name), - PyString_AS_STRING(key)) == 0) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) { - if (info->buf == NULL) return; - if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL; - __Pyx_ReleaseBuffer(info); -} - -static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { - buf->buf = NULL; - buf->obj = NULL; - buf->strides = __Pyx_zeros; - buf->shape = __Pyx_zeros; - buf->suboffsets = __Pyx_minusones; -} - -static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts) { - while (1) { - switch (*ts) { - case '@': - case 10: - case 13: - case ' ': - ++ts; - break; - case '=': - case '<': - case '>': - case '!': - PyErr_SetString(PyExc_ValueError, "Buffer acquisition error: Only native byte order, size and alignment supported."); - return NULL; - default: - return ts; - } - } -} - -static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - expected_ndim, buffer->ndim); -} - -static const char* __Pyx_DescribeTokenInFormatString(const char* ts) { - switch (*ts) { - case 'b': return "char"; - case 'B': return "unsigned char"; - case 'h': return "short"; - case 'H': return "unsigned short"; - case 'i': return "int"; - case 'I': return "unsigned int"; - case 'l': return "long"; - case 'L': return "unsigned long"; - case 'q': return "long long"; - case 'Q': return "unsigned long long"; - case 'f': return "float"; - case 'd': return "double"; - case 'g': return "long double"; - case 'Z': switch (*(ts+1)) { - case 'f': return "complex float"; - case 'd': return "complex double"; - case 'g': return "complex long double"; - default: return "unparseable format string"; - } - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - default: return "unparseable format string"; - } -} - -static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(const char* ts) { - int ok; - ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL; - if (*ts == '1') ++ts; - switch (*ts) { - case 'f': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(float) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - case 'd': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(double) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - case 'g': ok = (sizeof(__pyx_t_5numpy_float32_t) == sizeof(long double) && (__pyx_t_5numpy_float32_t)-1 < 0); break; - default: ok = 0; - } - if (!(ok)) { - PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts)); - return NULL; - } - ++ts; - return ts; - } - -static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) { - const char* ts; - if (obj == Py_None) { - __Pyx_ZeroBuffer(buf); - return 0; - } - buf->buf = NULL; - if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail; - if (buf->ndim != nd) { - __Pyx_BufferNdimError(buf, nd); - goto fail; - } - if (!cast) { - ts = buf->format; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float32_t(ts); - if (!ts) goto fail; - ts = __Pyx_ConsumeWhitespace(ts); - if (!ts) goto fail; - if (*ts != 0) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch (expected end, got %s)", - __Pyx_DescribeTokenInFormatString(ts)); - goto fail; - } - } else { - if (buf->itemsize != sizeof(__pyx_t_5numpy_float32_t)) { - PyErr_SetString(PyExc_ValueError, - "Attempted cast of buffer to datatype of different size."); - goto fail; - } - } - if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; - return 0; -fail:; - __Pyx_ZeroBuffer(buf); - return -1; -} -static void __Pyx_RaiseBufferFallbackError(void) { - PyErr_Format(PyExc_ValueError, - "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!"); -} - - -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -#if PY_MAJOR_VERSION < 3 -static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { - #if PY_VERSION_HEX >= 0x02060000 - if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER) - return PyObject_GetBuffer(obj, view, flags); - #endif - if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags); - else { - PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name); - return -1; - } -} - -static void __Pyx_ReleaseBuffer(Py_buffer *view) { - PyObject* obj = view->obj; - if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); - Py_DECREF(obj); - view->obj = NULL; - } -} - -#endif - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); - if (!__import__) - goto bad; - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - module = PyObject_CallFunction(__import__, "OOOO", - name, global_dict, empty_dict, list); -bad: - Py_XDECREF(empty_list); - Py_XDECREF(__import__); - Py_XDECREF(empty_dict); - return module; -} - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -#if PY_MAJOR_VERSION < 3 -static PyObject *__Pyx_GetStdout(void) { - PyObject *f = PySys_GetObject("stdout"); - if (!f) { - PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); - } - return f; -} - -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; - PyObject* v; - int i; - - if (!(f = __Pyx_GetStdout())) - return -1; - for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { - if (PyFile_SoftSpace(f, 1)) { - if (PyFile_WriteString(" ", f) < 0) - return -1; - } - v = PyTuple_GET_ITEM(arg_tuple, i); - if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) - return -1; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); - Py_ssize_t len = PyString_Size(v); - if (len > 0 && - isspace(Py_CHARMASK(s[len-1])) && - s[len-1] != ' ') - PyFile_SoftSpace(f, 0); - } - } - if (newline) { - if (PyFile_WriteString("\n", f) < 0) - return -1; - PyFile_SoftSpace(f, 0); - } - return 0; -} - -#else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject* kwargs = 0; - PyObject* result = 0; - PyObject* end_string; - if (!__pyx_print) { - __pyx_print = PyObject_GetAttrString(__pyx_b, "print"); - if (!__pyx_print) - return -1; - } - if (!newline) { - if (!__pyx_print_kwargs) { - __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) - return -1; - end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) - return -1; - if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { - Py_DECREF(end_string); - return -1; - } - Py_DECREF(end_string); - } - kwargs = __pyx_print_kwargs; - } - result = PyObject_Call(__pyx_print, arg_tuple, kwargs); - if (!result) - return -1; - Py_DECREF(result); - return 0; -} -#endif - -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - __Pyx_ErrFetch(type, value, tb); - PyErr_NormalizeException(type, value, tb); - if (PyErr_Occurred()) - goto bad; - Py_INCREF(*type); - Py_INCREF(*value); - Py_INCREF(*tb); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - Py_XDECREF(*type); - Py_XDECREF(*value); - Py_XDECREF(*tb); - return -1; -} - - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { - PyObject *pycobj = 0; - int result; - - pycobj = PyCObject_FromVoidPtr(vtable, 0); - if (!pycobj) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) - goto bad; - result = 0; - goto done; - -bad: - result = -1; -done: - Py_XDECREF(pycobj); - return result; -} - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } - if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyObject *empty_string = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - #if PY_MAJOR_VERSION < 3 - empty_string = PyString_FromStringAndSize("", 0); - #else - empty_string = PyBytes_FromStringAndSize("", 0); - #endif - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_string); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if (x == Py_False) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - return PyInt_AS_LONG(x); - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - if (PyInt_CheckExact(x)) { - long val = PyInt_AS_LONG(x); - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_TypeError, "Negative assignment to unsigned type."); - return (unsigned PY_LONG_LONG)-1; - } - return val; - } - else if (PyLong_CheckExact(x)) { - return PyLong_AsUnsignedLongLong(x); - } - else { - PY_LONG_LONG val; - PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; - val = __pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - - -static INLINE unsigned char __pyx_PyInt_unsigned_char(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned char val = (unsigned char)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned char"); - return (unsigned char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE unsigned short __pyx_PyInt_unsigned_short(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - unsigned short val = (unsigned short)long_val; - if (unlikely((val != long_val) || (long_val < 0))) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned short"); - return (unsigned short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE char __pyx_PyInt_char(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - char val = (char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); - return (char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE short __pyx_PyInt_short(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - short val = (short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to short"); - return (short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE int __pyx_PyInt_int(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - int val = (int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); - return (int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long __pyx_PyInt_long(PyObject* x) { - if (sizeof(long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long val = (long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); - return (long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed char __pyx_PyInt_signed_char(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed char val = (signed char)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed char"); - return (signed char)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed short __pyx_PyInt_signed_short(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed short val = (signed short)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed short"); - return (signed short)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed int __pyx_PyInt_signed_int(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed int val = (signed int)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed int"); - return (signed int)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE signed long __pyx_PyInt_signed_long(PyObject* x) { - if (sizeof(signed long) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - signed long val = (signed long)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to signed long"); - return (signed long)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - -static INLINE long double __pyx_PyInt_long_double(PyObject* x) { - if (sizeof(long double) < sizeof(long)) { - long long_val = __pyx_PyInt_AsLong(x); - long double val = (long double)long_val; - if (unlikely((val != long_val) )) { - PyErr_SetString(PyExc_OverflowError, "value too large to convert to long double"); - return (long double)-1; - } - return val; - } - else { - return __pyx_PyInt_AsLong(x); - } -} - diff --git a/audiolab/soundio/macosx/macosx_backend.pyx b/audiolab/soundio/macosx/macosx_backend.pyx index cc60b92..28b532f 100644 --- a/audiolab/soundio/macosx/macosx_backend.pyx +++ b/audiolab/soundio/macosx/macosx_backend.pyx @@ -31,8 +31,8 @@ cimport AudioHardware from AudioHardware cimport * -cimport stdlib -cimport python_exc +cimport libc.stdlib as stdlib +cimport cpython cimport numpy as cnp import numpy as np @@ -196,7 +196,7 @@ cdef class CoreAudioDevice: raise RuntimeError("error starting ") while (data.remaining == 1): - st = python_exc.PyErr_CheckSignals() + st = cpython.PyErr_CheckSignals() if st != 0: gotsig = 1 break diff --git a/audiolab/soundio/setup.py b/audiolab/soundio/setup.py index c15ca56..39db2a2 100644 --- a/audiolab/soundio/setup.py +++ b/audiolab/soundio/setup.py @@ -15,7 +15,7 @@ def configuration(parent_package='', top_path=None, package_name='soundio'): classname='AlsaInfo')() try: alsa_config = alsa_info.get_info(2) - config.add_extension("_alsa_backend", sources = ["alsa/_alsa_backend.c"], + config.add_extension("_alsa_backend", sources = ["alsa/_alsa_backend.pyx"], extra_info=alsa_config) except NotFoundError: warnings.warn("Alsa not found - alsa backend not build") @@ -25,7 +25,7 @@ def configuration(parent_package='', top_path=None, package_name='soundio'): classname='CoreAudioInfo')() try: core_audio_config = core_audio_info.get_info(2) - config.add_extension("macosx_backend", sources=["macosx/macosx_backend.c"], + config.add_extension("macosx_backend", sources=["macosx/macosx_backend.pyx"], extra_info=core_audio_config) except NotFoundError: warnings.warn("CoreAudio not found - CoreAudio backend not build") diff --git a/audiolab/tests/test_matapi.py b/audiolab/tests/test_matapi.py index 2fc209e..b8b17e7 100644 --- a/audiolab/tests/test_matapi.py +++ b/audiolab/tests/test_matapi.py @@ -5,6 +5,7 @@ from tempfile import mkstemp from numpy.testing import * +from numpy.testing import dec import numpy as N from audiolab import wavread, auread, aiffread, sdifread, flacread, \ diff --git a/audiolab/tests/test_pysndfile.py b/audiolab/tests/test_pysndfile.py index 516eec4..6c3d0b1 100644 --- a/audiolab/tests/test_pysndfile.py +++ b/audiolab/tests/test_pysndfile.py @@ -176,7 +176,7 @@ def test_short_io(self): nb = 2 ** 14 nbuff = 22050 fs = 22050 - a = np.random.random_integers(-nb, nb, nbuff) + a = np.random.randint(-nb, nb, nbuff) a = a.astype(np.short) # Open the file for writing @@ -203,7 +203,7 @@ def test_int_io(self): nb = 2 ** 25 nbuff = 22050 fs = 22050 - a = np.random.random_integers(-nb, nb, nbuff) + a = np.random.randint(-nb, nb, nbuff) a = a.astype(np.int32) # Open the file for writing @@ -263,7 +263,7 @@ def test_float_frames(self): format = audio_format('wav', 'pcm16') a = sndfile(fd, 'rwrite', format, channels = 1, samplerate = 22050) - tmp = np.random.random_integers(-100, 100, 1000) + tmp = np.random.randint(-100, 100, 1000) tmp = tmp.astype(np.short) a.write_frames(tmp, tmp.size) a.seek(0) diff --git a/audiolab/tests/test_sndfile.py b/audiolab/tests/test_sndfile.py index a2ff835..9540d69 100644 --- a/audiolab/tests/test_sndfile.py +++ b/audiolab/tests/test_sndfile.py @@ -142,7 +142,7 @@ def _test_int_io(self, dt): nb = 2 ** (8 * np.dtype(dt).itemsize - 3) fs = 22050 nbuff = fs - a = np.random.random_integers(-nb, nb, nbuff) + a = np.random.randint(-nb, nb, nbuff) a = a.astype(dt) # Open the file for writing @@ -201,7 +201,7 @@ def test_float_frames(self): # Open the file for writing format = Format('wav', 'pcm16') a = Sndfile(fd, 'rw', format, channels=1, samplerate=22050) - tmp = np.random.random_integers(-100, 100, 1000) + tmp = np.random.randint(-100, 100, 1000) tmp = tmp.astype(np.short) a.write_frames(tmp) a.seek(0) diff --git a/common.py b/common.py index 66265e1..3db32d9 100644 --- a/common.py +++ b/common.py @@ -71,4 +71,4 @@ def write_info(fname): f.close() VERSION = build_fverstring() -INSTALL_REQUIRE = 'numpy' +INSTALL_REQUIRE = ['numpy < 1.17.0'] diff --git a/docs/src/.gitignore b/docs/src/.gitignore new file mode 100644 index 0000000..ac95903 --- /dev/null +++ b/docs/src/.gitignore @@ -0,0 +1 @@ +audiolab_version.py \ No newline at end of file diff --git a/numpy_monkey.py b/numpy_monkey.py new file mode 100644 index 0000000..3618beb --- /dev/null +++ b/numpy_monkey.py @@ -0,0 +1,39 @@ +# Standard library imports +from os.path import join as pjoin, dirname +from distutils.dep_util import newer_group +from distutils.errors import DistutilsError + +from numpy.distutils.misc_util import appendpath +from numpy.distutils import log + +def generate_a_pyrex_source(self, base, ext_name, source, extension): + ''' Monkey patch for numpy build_src.build_src method + + Uses Cython instead of Pyrex. + + Assumes Cython is present + ''' + if self.inplace: + target_dir = dirname(base) + else: + target_dir = appendpath(self.build_src, dirname(base)) + target_file = pjoin(target_dir, ext_name + '.c') + depends = [source] + extension.depends + if self.force or newer_group(depends, target_file, 'newer'): + import Cython.Compiler.Main + log.info("cythonc:> %s" % (target_file)) + self.mkpath(target_dir) + options = Cython.Compiler.Main.CompilationOptions( + defaults=Cython.Compiler.Main.default_options, + include_path=extension.include_dirs, + output_file=target_file) + cython_result = Cython.Compiler.Main.compile(source, + options=options) + if cython_result.num_errors != 0: + raise DistutilsError("%d errors while compiling %r with Cython" \ + % (cython_result.num_errors, source)) + return target_file + + +from numpy.distutils.command import build_src +build_src.build_src.generate_a_pyrex_source = generate_a_pyrex_source diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..887e2d2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ["setuptools", "wheel", "cython", "numpy"] \ No newline at end of file diff --git a/setup.py b/setup.py index 37f5e14..a7b5fd1 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,9 @@ from numpy.distutils.core import setup from numpy.distutils.misc_util import Configuration +from numpy.distutils.command.build_ext import build_ext + +import numpy_monkey from common import * @@ -65,6 +68,7 @@ def configuration(parent_package='',top_path=None, package_name=DISTNAME): # setuptools version of config script setup(configuration=configuration, name=DISTNAME, + cmdclass = {'build_ext': build_ext}, install_requires=INSTALL_REQUIRE, packages=setuptools.find_packages(), include_package_data = True,