/* Generated by Cython 0.17.1 on Sat Sep 29 03:03:01 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#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 PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define PyIndex_Check(o)     (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o))
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
#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_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)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#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_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #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
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__xmmsapi
#define __PYX_HAVE_API__xmmsapi
#include "xmmsc/xmmsv.h"
#include "xmmsc/xmmsc_idnumbers.h"
#include "xmmsclient/xmmsclient.h"
#include "xmmsc/xmmsc_util.h"
#include "xmmsc/xmmsc_visualization.h"
#include "string.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(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 PyObject *__pyx_empty_bytes;
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[] = {
  "xmmsapi.pyx",
  "xmmsutils.pxd",
  "xmmsvalue.pxd",
};

/* "xmmsapi.pxd":40
 * 	cpdef value(self)
 * 
 * ctypedef int VisResultCommand             # <<<<<<<<<<<<<<
 * cdef enum:
 * 	VIS_RESULT_CMD_NONE = 0
 */
typedef int __pyx_t_7xmmsapi_VisResultCommand;

/*--- Type declarations ---*/
struct __pyx_obj_7xmmsapi_XmmsCore;
struct __pyx_obj_7xmmsapi_XmmsApi;
struct __pyx_obj_7xmmsapi_XmmsLoop;
struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated;
struct __pyx_obj_7xmmsapi_XmmsVisChunk;
struct __pyx_obj_9xmmsvalue_CollectionRef;
struct __pyx_obj_9xmmsvalue_CollectionIDList;
struct __pyx_obj_9xmmsvalue_CollectionOperands;
struct __pyx_obj_9xmmsvalue_AttributesIterator;
struct __pyx_obj_9xmmsvalue_XmmsListIter;
struct __pyx_obj_7xmmsapi_XmmsResultTracker;
struct __pyx_obj_9xmmsvalue_XmmsValue;
struct __pyx_obj_7xmmsapi_XmmsResult;
struct __pyx_obj_7xmmsapi_XmmsVisResult;
struct __pyx_obj_7xmmsapi_XmmsSourcePreference;
struct __pyx_obj_9xmmsvalue_CollectionAttributes;
struct __pyx_obj_9xmmsvalue_XmmsDictIter;
struct __pyx_obj_9xmmsvalue_Collection;
struct __pyx_opt_args_9xmmsvalue_9XmmsValue_set_value;

/* "xmmsvalue.pxd":65
 * 	cpdef clear(self)
 * 
 * cdef enum AttributesIterType:             # <<<<<<<<<<<<<<
 * 	ITER_KEYS = 1
 * 	ITER_VALUES = 2
 */
enum __pyx_t_9xmmsvalue_AttributesIterType {
  __pyx_e_9xmmsvalue_ITER_KEYS = 1,
  __pyx_e_9xmmsvalue_ITER_VALUES = 2,
  __pyx_e_9xmmsvalue_ITER_ITEMS = 3
};

/* "xmmsvalue.pxd":14
 * 	cdef int ispropdict
 * 
 * 	cdef  set_value(self, xmmsv_t *value, int ispropdict=*)             # <<<<<<<<<<<<<<
 * 	cpdef set_pyval(self, pyval)
 * 	cpdef get_type(self)
 */
struct __pyx_opt_args_9xmmsvalue_9XmmsValue_set_value {
  int __pyx_n;
  int ispropdict;
};
struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set;
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get;

/* "xmmsapi.pxd":41
 * 
 * ctypedef int VisResultCommand
 * cdef enum:             # <<<<<<<<<<<<<<
 * 	VIS_RESULT_CMD_NONE = 0
 * 	VIS_RESULT_CMD_INIT = 1
 */
enum  {
  __pyx_e_7xmmsapi_VIS_RESULT_CMD_NONE = 0,
  __pyx_e_7xmmsapi_VIS_RESULT_CMD_INIT = 1,
  __pyx_e_7xmmsapi_VIS_RESULT_CMD_START = 2
};

/* "xmmsapi.pxd":85
 * 	cpdef set_need_out_fun(self, fun)
 * 	cpdef get_fd(self)
 * 	cpdef connect(self, path=*, disconnect_func=*)             # <<<<<<<<<<<<<<
 * 	cdef XmmsResult _create_result(self, cb, xmmsc_result_t *res, Cls)
 * 	cdef XmmsResult create_result(self, cb, xmmsc_result_t *res)
 */
struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect {
  int __pyx_n;
  PyObject *path;
  PyObject *disconnect_func;
};

/* "xmmsapi.pxd":95
 * 
 * cdef class XmmsApi(XmmsCore):
 * 	cpdef XmmsResult quit(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult plugin_list(self, typ, cb=*)
 * 	cpdef XmmsResult playback_start(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":96
 * cdef class XmmsApi(XmmsCore):
 * 	cpdef XmmsResult quit(self, cb=*)
 * 	cpdef XmmsResult plugin_list(self, typ, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_start(self, cb=*)
 * 	cpdef XmmsResult playback_stop(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":97
 * 	cpdef XmmsResult quit(self, cb=*)
 * 	cpdef XmmsResult plugin_list(self, typ, cb=*)
 * 	cpdef XmmsResult playback_start(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_stop(self, cb=*)
 * 	cpdef XmmsResult playback_tickle(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":98
 * 	cpdef XmmsResult plugin_list(self, typ, cb=*)
 * 	cpdef XmmsResult playback_start(self, cb=*)
 * 	cpdef XmmsResult playback_stop(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_tickle(self, cb=*)
 * 	cpdef XmmsResult playback_pause(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":99
 * 	cpdef XmmsResult playback_start(self, cb=*)
 * 	cpdef XmmsResult playback_stop(self, cb=*)
 * 	cpdef XmmsResult playback_tickle(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_pause(self, cb=*)
 * 	cpdef XmmsResult playback_current_id(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":100
 * 	cpdef XmmsResult playback_stop(self, cb=*)
 * 	cpdef XmmsResult playback_tickle(self, cb=*)
 * 	cpdef XmmsResult playback_pause(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":101
 * 	cpdef XmmsResult playback_tickle(self, cb=*)
 * 	cpdef XmmsResult playback_pause(self, cb=*)
 * 	cpdef XmmsResult playback_current_id(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":102
 * 	cpdef XmmsResult playback_pause(self, cb=*)
 * 	cpdef XmmsResult playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_status(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms {
  int __pyx_n;
  xmms_playback_seek_mode_t whence;
  PyObject *cb;
};

/* "xmmsapi.pxd":103
 * 	cpdef XmmsResult playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_status(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples {
  int __pyx_n;
  xmms_playback_seek_mode_t whence;
  PyObject *cb;
};

/* "xmmsapi.pxd":104
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_status(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":105
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=*, cb=*)
 * 	cpdef XmmsResult playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_status(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_playtime(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":106
 * 	cpdef XmmsResult playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_playtime(self, cb=*)
 * 	cpdef XmmsResult signal_playback_playtime(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":107
 * 	cpdef XmmsResult broadcast_playback_status(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_playtime(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult signal_playback_playtime(self, cb=*)
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":108
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb=*)
 * 	cpdef XmmsResult playback_playtime(self, cb=*)
 * 	cpdef XmmsResult signal_playback_playtime(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb=*)
 * 	cpdef XmmsResult playback_volume_get(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":109
 * 	cpdef XmmsResult playback_playtime(self, cb=*)
 * 	cpdef XmmsResult signal_playback_playtime(self, cb=*)
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playback_volume_get(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":110
 * 	cpdef XmmsResult signal_playback_playtime(self, cb=*)
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb=*)
 * 	cpdef XmmsResult playback_volume_get(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":111
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb=*)
 * 	cpdef XmmsResult playback_volume_get(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb=*)
 * 	cpdef XmmsResult playlist_load(self, playlist, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":112
 * 	cpdef XmmsResult playback_volume_get(self, cb=*)
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_load(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_list(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":113
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb=*)
 * 	cpdef XmmsResult playlist_load(self, playlist, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_list(self, cb=*)
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":114
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb=*)
 * 	cpdef XmmsResult playlist_load(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_list(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_shuffle(self, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":115
 * 	cpdef XmmsResult playlist_load(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_list(self, cb=*)
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_shuffle(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist=*, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":116
 * 	cpdef XmmsResult playlist_list(self, cb=*)
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_shuffle(self, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist=*, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":117
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_shuffle(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist=*, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":118
 * 	cpdef XmmsResult playlist_shuffle(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist=*, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order=*, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":119
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_radd(self, url, playlist=*, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":120
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order=*, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_radd(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist=*, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection {
  int __pyx_n;
  PyObject *order;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":121
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_radd(self, url, playlist=*, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":122
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_radd(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist=*, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order=*, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":123
 * 	cpdef XmmsResult playlist_radd(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":124
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist=*, cb=*, encoded=*)
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order=*, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_clear(self, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection {
  int __pyx_n;
  PyObject *order;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":125
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_clear(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_list_entries(self, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":126
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order=*, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_clear(self, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_list_entries(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_sort(self, props, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":127
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_clear(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_list_entries(self, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_sort(self, props, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":128
 * 	cpdef XmmsResult playlist_clear(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_list_entries(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_sort(self, props, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":129
 * 	cpdef XmmsResult playlist_list_entries(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_sort(self, props, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":130
 * 	cpdef XmmsResult playlist_sort(self, props, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_create(self, playlist, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":131
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_create(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_current_pos(self, playlist=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":132
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb=*)
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_create(self, playlist, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_current_pos(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_current_active(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":133
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_create(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_current_pos(self, playlist=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult playlist_current_active(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos {
  int __pyx_n;
  PyObject *playlist;
  PyObject *cb;
};

/* "xmmsapi.pxd":134
 * 	cpdef XmmsResult playlist_create(self, playlist, cb=*)
 * 	cpdef XmmsResult playlist_current_pos(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_current_active(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":135
 * 	cpdef XmmsResult playlist_current_pos(self, playlist=*, cb=*)
 * 	cpdef XmmsResult playlist_current_active(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":136
 * 	cpdef XmmsResult playlist_current_active(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb=*)
 * 	cpdef XmmsResult config_set_value(self, key, val, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":137
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb=*)
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult config_set_value(self, key, val, cb=*)
 * 	cpdef XmmsResult config_get_value(self, key, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":138
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb=*)
 * 	cpdef XmmsResult config_set_value(self, key, val, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult config_get_value(self, key, cb=*)
 * 	cpdef XmmsResult config_list_values(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":139
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb=*)
 * 	cpdef XmmsResult config_set_value(self, key, val, cb=*)
 * 	cpdef XmmsResult config_get_value(self, key, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult config_list_values(self, cb=*)
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":140
 * 	cpdef XmmsResult config_set_value(self, key, val, cb=*)
 * 	cpdef XmmsResult config_get_value(self, key, cb=*)
 * 	cpdef XmmsResult config_list_values(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb=*)
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":141
 * 	cpdef XmmsResult config_get_value(self, key, cb=*)
 * 	cpdef XmmsResult config_list_values(self, cb=*)
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":142
 * 	cpdef XmmsResult config_list_values(self, cb=*)
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb=*)
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_move_entry(self, int id, url, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry {
  int __pyx_n;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":143
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb=*)
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_move_entry(self, int id, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":144
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_move_entry(self, int id, url, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_rehash(self, int id=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry {
  int __pyx_n;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":145
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_move_entry(self, int id, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_rehash(self, int id=*, cb=*)
 * 	cpdef XmmsResult medialib_get_id(self, url, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":146
 * 	cpdef XmmsResult medialib_move_entry(self, int id, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_rehash(self, int id=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_get_id(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_import_path(self, path, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash {
  int __pyx_n;
  int id;
  PyObject *cb;
};

/* "xmmsapi.pxd":147
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb=*)
 * 	cpdef XmmsResult medialib_rehash(self, int id=*, cb=*)
 * 	cpdef XmmsResult medialib_get_id(self, url, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_import_path(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id {
  int __pyx_n;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":148
 * 	cpdef XmmsResult medialib_rehash(self, int id=*, cb=*)
 * 	cpdef XmmsResult medialib_get_id(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_import_path(self, path, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=*, cb=*)
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path {
  int __pyx_n;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":149
 * 	cpdef XmmsResult medialib_get_id(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_import_path(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=*, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set {
  int __pyx_n;
  PyObject *source;
  PyObject *cb;
};

/* "xmmsapi.pxd":150
 * 	cpdef XmmsResult medialib_import_path(self, path, cb=*, encoded=*)
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=*, cb=*)
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove {
  int __pyx_n;
  PyObject *source;
  PyObject *cb;
};

/* "xmmsapi.pxd":151
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=*, cb=*)
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=*, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":152
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=*, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb=*)
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":153
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb=*)
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb=*)
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":154
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb=*)
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb=*)
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb=*)
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=*, encoded=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":155
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb=*)
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb=*)
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult coll_get(self, name, ns=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":156
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb=*)
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb=*)
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=*, encoded=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_get(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_list(self, ns=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse {
  int __pyx_n;
  PyObject *cb;
  PyObject *encoded;
};

/* "xmmsapi.pxd":157
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb=*)
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult coll_get(self, name, ns=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_list(self, ns=*, cb=*)
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get {
  int __pyx_n;
  PyObject *ns;
  PyObject *cb;
};

/* "xmmsapi.pxd":158
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=*, encoded=*)
 * 	cpdef XmmsResult coll_get(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_list(self, ns=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_remove(self, name, ns=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list {
  int __pyx_n;
  PyObject *ns;
  PyObject *cb;
};

/* "xmmsapi.pxd":159
 * 	cpdef XmmsResult coll_get(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_list(self, ns=*, cb=*)
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_remove(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save {
  int __pyx_n;
  PyObject *ns;
  PyObject *cb;
};

/* "xmmsapi.pxd":160
 * 	cpdef XmmsResult coll_list(self, ns=*, cb=*)
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_remove(self, name, ns=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns=*, cb=*)
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove {
  int __pyx_n;
  PyObject *ns;
  PyObject *cb;
};

/* "xmmsapi.pxd":161
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_remove(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=*)
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename {
  int __pyx_n;
  PyObject *ns;
  PyObject *cb;
};

/* "xmmsapi.pxd":162
 * 	cpdef XmmsResult coll_remove(self, name, ns=*, cb=*)
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns=*, cb=*)
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=*)
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=*, leng=*, order=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":163
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns=*, cb=*)
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=*)
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=*, leng=*, order=*, cb=*)
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=*, leng=*, order=*, groupby=*, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":164
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=*)
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=*)
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=*, leng=*, order=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=*, leng=*, order=*, groupby=*, cb=*)
 * 	cpdef XmmsResult bindata_add(self, data, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids {
  int __pyx_n;
  PyObject *start;
  PyObject *leng;
  PyObject *order;
  PyObject *cb;
};

/* "xmmsapi.pxd":165
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=*)
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=*, leng=*, order=*, cb=*)
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=*, leng=*, order=*, groupby=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult bindata_add(self, data, cb=*)
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos {
  int __pyx_n;
  PyObject *start;
  PyObject *leng;
  PyObject *order;
  PyObject *groupby;
  PyObject *cb;
};

/* "xmmsapi.pxd":166
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=*, leng=*, order=*, cb=*)
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=*, leng=*, order=*, groupby=*, cb=*)
 * 	cpdef XmmsResult bindata_add(self, data, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":167
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=*, leng=*, order=*, groupby=*, cb=*)
 * 	cpdef XmmsResult bindata_add(self, data, cb=*)
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_list(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":168
 * 	cpdef XmmsResult bindata_add(self, data, cb=*)
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult bindata_list(self, cb=*)
 * 	cpdef XmmsResult stats(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":169
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_list(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult stats(self, cb=*)
 * 	cpdef XmmsResult visualization_version(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":170
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=*)
 * 	cpdef XmmsResult bindata_list(self, cb=*)
 * 	cpdef XmmsResult stats(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult visualization_version(self, cb=*)
 * 	cpdef XmmsResult visualization_init(self, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":171
 * 	cpdef XmmsResult bindata_list(self, cb=*)
 * 	cpdef XmmsResult stats(self, cb=*)
 * 	cpdef XmmsResult visualization_version(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult visualization_init(self, cb=*)
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":172
 * 	cpdef XmmsResult stats(self, cb=*)
 * 	cpdef XmmsResult visualization_version(self, cb=*)
 * 	cpdef XmmsResult visualization_init(self, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=*)
 * 	cpdef bint visualization_started(self, int handle)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":173
 * 	cpdef XmmsResult visualization_version(self, cb=*)
 * 	cpdef XmmsResult visualization_init(self, cb=*)
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef bint visualization_started(self, int handle)
 * 	cpdef bint visualization_errored(self, int handle)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":176
 * 	cpdef bint visualization_started(self, int handle)
 * 	cpdef bint visualization_errored(self, int handle)
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props=*, cb=*)
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=*, bint blocking=*)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set {
  int __pyx_n;
  PyObject *cb;
};

/* "xmmsapi.pxd":177
 * 	cpdef bint visualization_errored(self, int handle)
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=*)
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props=*, cb=*)             # <<<<<<<<<<<<<<
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=*, bint blocking=*)
 * 	cpdef visualization_shutdown(self, int handle)
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set {
  int __pyx_n;
  PyObject *props;
  PyObject *cb;
};

/* "xmmsapi.pxd":178
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=*)
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props=*, cb=*)
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=*, bint blocking=*)             # <<<<<<<<<<<<<<
 * 	cpdef visualization_shutdown(self, int handle)
 * 
 */
struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get {
  int __pyx_n;
  int drawtime;
  int blocking;
};

/* "xmmsapi.pxd":65
 * 	cpdef get_data(self)
 * 
 * cdef class XmmsCore:             # <<<<<<<<<<<<<<
 * 	cdef xmmsc_connection_t *conn
 * 	cdef int isconnected
 */
struct __pyx_obj_7xmmsapi_XmmsCore {
  PyObject_HEAD
  struct __pyx_vtabstruct_7xmmsapi_XmmsCore *__pyx_vtab;
  xmmsc_connection_t *conn;
  int isconnected;
  PyObject *disconnect_fun;
  PyObject *needout_fun;
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *source_preference;
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *result_tracker;
  PyObject *clientname;
};


/* "xmmsapi.pxd":94
 * cpdef userconfdir_get()
 * 
 * cdef class XmmsApi(XmmsCore):             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult quit(self, cb=*)
 * 	cpdef XmmsResult plugin_list(self, typ, cb=*)
 */
struct __pyx_obj_7xmmsapi_XmmsApi {
  struct __pyx_obj_7xmmsapi_XmmsCore __pyx_base;
};


/* "xmmsapi.pxd":181
 * 	cpdef visualization_shutdown(self, int handle)
 * 
 * cdef class XmmsLoop(XmmsApi):             # <<<<<<<<<<<<<<
 * 	cdef bint do_loop
 * 	cdef object wakeup
 */
struct __pyx_obj_7xmmsapi_XmmsLoop {
  struct __pyx_obj_7xmmsapi_XmmsApi __pyx_base;
  int do_loop;
  PyObject *wakeup;
};


/* "xmmsapi.pyx":61
 * del getenv
 * 
 * def deprecated(f):             # <<<<<<<<<<<<<<
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:
 */
struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated {
  PyObject_HEAD
  PyObject *__pyx_v_f;
};


/* "xmmsapi.pxd":57
 * 	cpdef xmmsvalue(self)
 * 
 * cdef class XmmsVisChunk:             # <<<<<<<<<<<<<<
 * 	cdef short *data
 * 	cdef int sample_count
 */
struct __pyx_obj_7xmmsapi_XmmsVisChunk {
  PyObject_HEAD
  struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk *__pyx_vtab;
  short *data;
  int sample_count;
};


/* "xmmsvalue.pxd":41
 * 	cdef xmmsv_dict_iter_t *it
 * 
 * cdef class CollectionRef:             # <<<<<<<<<<<<<<
 * 	cdef xmmsv_coll_t *coll
 * 
 */
struct __pyx_obj_9xmmsvalue_CollectionRef {
  PyObject_HEAD
  struct __pyx_vtabstruct_9xmmsvalue_CollectionRef *__pyx_vtab;
  xmmsv_coll_t *coll;
};


/* "xmmsvalue.pxd":88
 * 
 * 
 * cdef class CollectionIDList(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cpdef list(self)
 * 	cpdef append(self, int v)
 */
struct __pyx_obj_9xmmsvalue_CollectionIDList {
  struct __pyx_obj_9xmmsvalue_CollectionRef __pyx_base;
};


/* "xmmsvalue.pxd":77
 * 
 * 
 * cdef class CollectionOperands(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cdef object pylist
 * 	cdef init_pylist(self)
 */
struct __pyx_obj_9xmmsvalue_CollectionOperands {
  struct __pyx_obj_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *pylist;
};


/* "xmmsvalue.pxd":69
 * 	ITER_VALUES = 2
 * 	ITER_ITEMS = 3
 * cdef class AttributesIterator:             # <<<<<<<<<<<<<<
 * 	cdef xmmsv_dict_iter_t *diter
 * 	cdef int itertype
 */
struct __pyx_obj_9xmmsvalue_AttributesIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_9xmmsvalue_AttributesIterator *__pyx_vtab;
  xmmsv_dict_iter_t *diter;
  int itertype;
  struct __pyx_obj_9xmmsvalue_CollectionAttributes *attr;
};


/* "xmmsvalue.pxd":31
 * 	cpdef value(self)
 * 
 * cdef class XmmsListIter:             # <<<<<<<<<<<<<<
 * 	cdef object sourcepref
 * 	cdef xmmsv_t *val
 */
struct __pyx_obj_9xmmsvalue_XmmsListIter {
  PyObject_HEAD
  PyObject *sourcepref;
  xmmsv_t *val;
  xmmsv_list_iter_t *it;
};


/* "xmmsapi.pxd":12
 * 
 * cdef class XmmsResult
 * cdef class XmmsResultTracker:             # <<<<<<<<<<<<<<
 * 	cdef object results
 * 
 */
struct __pyx_obj_7xmmsapi_XmmsResultTracker {
  PyObject_HEAD
  struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker *__pyx_vtab;
  PyObject *results;
};


/* "xmmsvalue.pxd":9
 * 	ctypedef struct xmmsv_list_iter_t
 * 
 * cdef class XmmsValue:             # <<<<<<<<<<<<<<
 * 	cdef object sourcepref
 * 	cdef xmmsv_t *val
 */
struct __pyx_obj_9xmmsvalue_XmmsValue {
  PyObject_HEAD
  struct __pyx_vtabstruct_9xmmsvalue_XmmsValue *__pyx_vtab;
  PyObject *sourcepref;
  xmmsv_t *val;
  int ispropdict;
};


/* "xmmsapi.pxd":11
 * 	cdef object sources
 * 
 * cdef class XmmsResult             # <<<<<<<<<<<<<<
 * cdef class XmmsResultTracker:
 * 	cdef object results
 */
struct __pyx_obj_7xmmsapi_XmmsResult {
  PyObject_HEAD
  struct __pyx_vtabstruct_7xmmsapi_XmmsResult *__pyx_vtab;
  xmmsc_result_t *res;
  PyObject *_cb;
  int _cb_issetup;
  PyObject *_exc;
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *source_pref;
  int ispropdict;
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *result_tracker;
};


/* "xmmsapi.pxd":46
 * 	VIS_RESULT_CMD_START = 2
 * 
 * cdef class XmmsVisResult(XmmsResult):             # <<<<<<<<<<<<<<
 * 	cdef XmmsValue _val
 * 	cdef VisResultCommand command
 */
struct __pyx_obj_7xmmsapi_XmmsVisResult {
  struct __pyx_obj_7xmmsapi_XmmsResult __pyx_base;
  struct __pyx_obj_9xmmsvalue_XmmsValue *_val;
  __pyx_t_7xmmsapi_VisResultCommand command;
  xmmsc_connection_t *conn;
};


/* "xmmsapi.pxd":8
 * cdef void ResultDestroyNotifier(void *o)
 * 
 * cdef class XmmsSourcePreference:             # <<<<<<<<<<<<<<
 * 	cdef object sources
 * 
 */
struct __pyx_obj_7xmmsapi_XmmsSourcePreference {
  PyObject_HEAD
  PyObject *sources;
};


/* "xmmsvalue.pxd":55
 * 	cdef init_operands(self)
 * 
 * cdef class CollectionAttributes(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cpdef get_dict(self)
 * 	cpdef iterkeys(self)
 */
struct __pyx_obj_9xmmsvalue_CollectionAttributes {
  struct __pyx_obj_9xmmsvalue_CollectionRef __pyx_base;
};


/* "xmmsvalue.pxd":36
 * 	cdef xmmsv_list_iter_t *it
 * 
 * cdef class XmmsDictIter:             # <<<<<<<<<<<<<<
 * 	cdef object sourcepref
 * 	cdef xmmsv_t *val
 */
struct __pyx_obj_9xmmsvalue_XmmsDictIter {
  PyObject_HEAD
  PyObject *sourcepref;
  xmmsv_t *val;
  xmmsv_dict_iter_t *it;
};


/* "xmmsvalue.pxd":46
 * 	cdef set_collection(self, xmmsv_coll_t *coll)
 * 
 * cdef class Collection(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cdef object _attributes
 * 	cdef object _operands
 */
struct __pyx_obj_9xmmsvalue_Collection {
  struct __pyx_obj_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *_attributes;
  PyObject *_operands;
  PyObject *_idlist;
};



/* "xmmsvalue.pxd":41
 * 	cdef xmmsv_dict_iter_t *it
 * 
 * cdef class CollectionRef:             # <<<<<<<<<<<<<<
 * 	cdef xmmsv_coll_t *coll
 * 
 */

struct __pyx_vtabstruct_9xmmsvalue_CollectionRef {
  PyObject *(*set_collection)(struct __pyx_obj_9xmmsvalue_CollectionRef *, xmmsv_coll_t *);
};
static struct __pyx_vtabstruct_9xmmsvalue_CollectionRef *__pyx_vtabptr_9xmmsvalue_CollectionRef;


/* "xmmsvalue.pxd":55
 * 	cdef init_operands(self)
 * 
 * cdef class CollectionAttributes(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cpdef get_dict(self)
 * 	cpdef iterkeys(self)
 */

struct __pyx_vtabstruct_9xmmsvalue_CollectionAttributes {
  struct __pyx_vtabstruct_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *(*get_dict)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*iterkeys)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*keys)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*itervalues)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*iteritems)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
  PyObject *(*clear)(struct __pyx_obj_9xmmsvalue_CollectionAttributes *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9xmmsvalue_CollectionAttributes *__pyx_vtabptr_9xmmsvalue_CollectionAttributes;


/* "xmmsapi.pyx":148
 * 				r.res = NULL
 * 
 * cdef class XmmsResult:             # <<<<<<<<<<<<<<
 * 	"""
 * 	Class containing the results of some operation
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsResult {
  PyObject *(*set_sourcepref)(struct __pyx_obj_7xmmsapi_XmmsResult *, struct __pyx_obj_7xmmsapi_XmmsSourcePreference *);
  PyObject *(*set_result)(struct __pyx_obj_7xmmsapi_XmmsResult *, xmmsc_result_t *);
  PyObject *(*set_callback)(struct __pyx_obj_7xmmsapi_XmmsResult *, struct __pyx_obj_7xmmsapi_XmmsResultTracker *, PyObject *);
  PyObject *(*disconnect)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*wait)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*is_error)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*iserror)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*xmmsvalue)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*_value)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsResult *__pyx_vtabptr_7xmmsapi_XmmsResult;


/* "xmmsapi.pyx":261
 * 
 * 
 * cdef class XmmsVisResult(XmmsResult):             # <<<<<<<<<<<<<<
 * 	#cdef XmmsValue _val
 * 	#cdef VisResultCommand command
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult {
  struct __pyx_vtabstruct_7xmmsapi_XmmsResult __pyx_base;
  PyObject *(*set_command)(struct __pyx_obj_7xmmsapi_XmmsVisResult *, __pyx_t_7xmmsapi_VisResultCommand, xmmsc_connection_t *);
  PyObject *(*retrieve_error)(struct __pyx_obj_7xmmsapi_XmmsVisResult *);
  PyObject *(*_init_xmmsvalue)(struct __pyx_obj_7xmmsapi_XmmsVisResult *);
  PyObject *(*_start_xmmsvalue)(struct __pyx_obj_7xmmsapi_XmmsVisResult *);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *__pyx_vtabptr_7xmmsapi_XmmsVisResult;


/* "xmmsapi.pyx":419
 * 	return from_unicode(pls or ACTIVE_PLAYLIST)
 * 
 * cdef class XmmsCore:             # <<<<<<<<<<<<<<
 * 	"""
 * 	This is the class representing the XMMS2 client itself. The methods in
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsCore {
  PyObject *(*new_connection)(struct __pyx_obj_7xmmsapi_XmmsCore *);
  PyObject *(*get_source_preference)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*set_source_preference)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_needout_cb)(struct __pyx_obj_7xmmsapi_XmmsCore *, int, int __pyx_skip_dispatch);
  PyObject *(*_disconnect_cb)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*disconnect)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*ioin)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*ioout)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*want_ioout)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*set_need_out_fun)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_fd)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch);
  PyObject *(*connect)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*_create_result)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *, PyObject *);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*create_result)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*create_vis_result)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *, __pyx_t_7xmmsapi_VisResultCommand);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsCore *__pyx_vtabptr_7xmmsapi_XmmsCore;


/* "xmmsapi.pyx":125
 * 			self.sources = [enforce_unicode(s) for s in sources]
 * 
 * cdef class XmmsResultTracker:             # <<<<<<<<<<<<<<
 * 	"""
 * 	Class used by XmmsCore to track results that set a notifier.
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker {
  PyObject *(*track_result)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, struct __pyx_obj_7xmmsapi_XmmsResult *);
  PyObject *(*release_result)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, struct __pyx_obj_7xmmsapi_XmmsResult *);
  PyObject *(*disconnect_all)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, int);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker *__pyx_vtabptr_7xmmsapi_XmmsResultTracker;


/* "xmmsvalue.pxd":9
 * 	ctypedef struct xmmsv_list_iter_t
 * 
 * cdef class XmmsValue:             # <<<<<<<<<<<<<<
 * 	cdef object sourcepref
 * 	cdef xmmsv_t *val
 */

struct __pyx_vtabstruct_9xmmsvalue_XmmsValue {
  PyObject *(*set_value)(struct __pyx_obj_9xmmsvalue_XmmsValue *, xmmsv_t *, struct __pyx_opt_args_9xmmsvalue_9XmmsValue_set_value *__pyx_optional_args);
  PyObject *(*set_pyval)(struct __pyx_obj_9xmmsvalue_XmmsValue *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_type)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*iserror)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*is_error)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_error)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_int)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_string)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_bin)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_coll)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_dict)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_dict_iter)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_propdict)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_list)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*get_list_iter)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
  PyObject *(*value)(struct __pyx_obj_9xmmsvalue_XmmsValue *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9xmmsvalue_XmmsValue *__pyx_vtabptr_9xmmsvalue_XmmsValue;


/* "xmmsvalue.pxd":69
 * 	ITER_VALUES = 2
 * 	ITER_ITEMS = 3
 * cdef class AttributesIterator:             # <<<<<<<<<<<<<<
 * 	cdef xmmsv_dict_iter_t *diter
 * 	cdef int itertype
 */

struct __pyx_vtabstruct_9xmmsvalue_AttributesIterator {
  PyObject *(*reset)(struct __pyx_obj_9xmmsvalue_AttributesIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9xmmsvalue_AttributesIterator *__pyx_vtabptr_9xmmsvalue_AttributesIterator;


/* "xmmsapi.pyx":588
 * 
 * 
 * cdef class XmmsApi(XmmsCore):             # <<<<<<<<<<<<<<
 * 	cpdef XmmsResult quit(self, cb=None):
 * 		"""
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsApi {
  struct __pyx_vtabstruct_7xmmsapi_XmmsCore __pyx_base;
  struct __pyx_obj_7xmmsapi_XmmsResult *(*quit)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*plugin_list)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_start)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_stop)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_tickle)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_pause)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_current_id)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_seek_ms)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_seek_samples)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_status)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playback_status)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playback_current_id)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_playtime)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*signal_playback_playtime)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_volume_set)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playback_volume_get)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playback_volume_changed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playlist_loaded)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_load)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_list)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_remove)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_shuffle)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_rinsert)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_insert_url)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_insert_id)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_insert_collection)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_radd)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_add_url)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_add_id)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_add_collection)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_remove_entry)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_clear)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_list_entries)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_sort)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_set_next_rel)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_set_next)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_move)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_create)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_current_pos)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*playlist_current_active)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playlist_current_pos)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_playlist_changed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_config_value_changed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*config_set_value)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*config_get_value)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*config_list_values)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*config_register_value)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_add_entry)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_remove_entry)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_move_entry)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_get_info)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_rehash)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_get_id)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_import_path)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_property_set)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*medialib_property_remove)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_medialib_entry_added)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_medialib_entry_changed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_collection_changed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*signal_mediainfo_reader_unindexed)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*broadcast_mediainfo_reader_status)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*xform_media_browse)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_get)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_list)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_save)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_remove)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_rename)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_idlist_from_playlist_file)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_query)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_query_ids)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*coll_query_infos)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*bindata_add)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*bindata_retrieve)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*bindata_remove)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*bindata_list)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*stats)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*visualization_version)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*visualization_init)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*visualization_start)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start *__pyx_optional_args);
  int (*visualization_started)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch);
  int (*visualization_errored)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*visualization_property_set)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsResult *(*visualization_properties_set)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set *__pyx_optional_args);
  struct __pyx_obj_7xmmsapi_XmmsVisChunk *(*visualization_chunk_get)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get *__pyx_optional_args);
  PyObject *(*visualization_shutdown)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsApi *__pyx_vtabptr_7xmmsapi_XmmsApi;


/* "xmmsvalue.pxd":88
 * 
 * 
 * cdef class CollectionIDList(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cpdef list(self)
 * 	cpdef append(self, int v)
 */

struct __pyx_vtabstruct_9xmmsvalue_CollectionIDList {
  struct __pyx_vtabstruct_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *(*list)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, int __pyx_skip_dispatch);
  PyObject *(*append)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, int, int __pyx_skip_dispatch);
  PyObject *(*extend)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*insert)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, int, int, int __pyx_skip_dispatch);
  PyObject *(*remove)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, int, int __pyx_skip_dispatch);
  PyObject *(*clear)(struct __pyx_obj_9xmmsvalue_CollectionIDList *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9xmmsvalue_CollectionIDList *__pyx_vtabptr_9xmmsvalue_CollectionIDList;


/* "xmmsapi.pyx":1743
 * 
 * from os import write
 * cdef class XmmsLoop(XmmsApi):             # <<<<<<<<<<<<<<
 * 	#cdef bint do_loop
 * 	#cdef object wakeup
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsLoop {
  struct __pyx_vtabstruct_7xmmsapi_XmmsApi __pyx_base;
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsLoop *__pyx_vtabptr_7xmmsapi_XmmsLoop;


/* "xmmsvalue.pxd":46
 * 	cdef set_collection(self, xmmsv_coll_t *coll)
 * 
 * cdef class Collection(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cdef object _attributes
 * 	cdef object _operands
 */

struct __pyx_vtabstruct_9xmmsvalue_Collection {
  struct __pyx_vtabstruct_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *(*init_idlist)(struct __pyx_obj_9xmmsvalue_Collection *);
  PyObject *(*init_attributes)(struct __pyx_obj_9xmmsvalue_Collection *);
  PyObject *(*init_operands)(struct __pyx_obj_9xmmsvalue_Collection *);
};
static struct __pyx_vtabstruct_9xmmsvalue_Collection *__pyx_vtabptr_9xmmsvalue_Collection;


/* "xmmsvalue.pxd":77
 * 
 * 
 * cdef class CollectionOperands(CollectionRef):             # <<<<<<<<<<<<<<
 * 	cdef object pylist
 * 	cdef init_pylist(self)
 */

struct __pyx_vtabstruct_9xmmsvalue_CollectionOperands {
  struct __pyx_vtabstruct_9xmmsvalue_CollectionRef __pyx_base;
  PyObject *(*init_pylist)(struct __pyx_obj_9xmmsvalue_CollectionOperands *);
  PyObject *(*append)(struct __pyx_obj_9xmmsvalue_CollectionOperands *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch);
  PyObject *(*extend)(struct __pyx_obj_9xmmsvalue_CollectionOperands *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*remove)(struct __pyx_obj_9xmmsvalue_CollectionOperands *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch);
  PyObject *(*clear)(struct __pyx_obj_9xmmsvalue_CollectionOperands *, int __pyx_skip_dispatch);
  PyObject *(*list)(struct __pyx_obj_9xmmsvalue_CollectionOperands *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9xmmsvalue_CollectionOperands *__pyx_vtabptr_9xmmsvalue_CollectionOperands;


/* "xmmsapi.pyx":328
 * 			return XmmsResult.xmmsvalue(self)
 * 
 * cdef class XmmsVisChunk:             # <<<<<<<<<<<<<<
 * 	#cdef short *data
 * 	#cdef int sample_count
 */

struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk {
  PyObject *(*set_data)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, short *, int);
  PyObject *(*get_buffer)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, int __pyx_skip_dispatch);
  PyObject *(*get_data)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk *__pyx_vtabptr_7xmmsapi_XmmsVisChunk;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*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 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*/

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(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 = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f) \
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
    int flags;
    PyObject *func_dict;
    PyObject *func_weakreflist;
    PyObject *func_name;
    PyObject *func_doc;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj; /* No-args super() class cell */
    void *defaults;
    int defaults_pyobjects;
    PyObject *defaults_tuple; /* Const defaults tuple */
    PyObject *(*defaults_getter)(PyObject *);
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, self, module, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, self, module, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *,
                                      PyMethodDef *ml, int flags,
                                      PyObject *self, PyObject *module,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static int __Pyx_CyFunction_init(void);

static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*proto*/

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

static void* __Pyx_GetVtable(PyObject *dict); /*proto*/

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/


/* Module declarations from 'xmmsvalue' */
static PyTypeObject *__pyx_ptype_9xmmsvalue_XmmsValue = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_XmmsListIter = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_XmmsDictIter = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_CollectionRef = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_Collection = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_CollectionAttributes = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_AttributesIterator = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_CollectionOperands = 0;
static PyTypeObject *__pyx_ptype_9xmmsvalue_CollectionIDList = 0;
static xmmsv_t *(*__pyx_f_9xmmsvalue_create_native_value)(PyObject *); /*proto*/

/* Module declarations from 'cxmmsvalue' */

/* Module declarations from 'cxmmsclient' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cython' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'xmmsutils' */
static CYTHON_INLINE PyObject *__pyx_f_9xmmsutils_to_unicode(const char *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_9xmmsutils_from_unicode(PyObject *); /*proto*/

/* Module declarations from 'xmmsapi' */
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsSourcePreference = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsResult = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsResultTracker = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsVisResult = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsVisChunk = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsCore = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsApi = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi_XmmsLoop = 0;
static PyTypeObject *__pyx_ptype_7xmmsapi___pyx_scope_struct__deprecated = 0;
static int __pyx_v_7xmmsapi_show_deprecated;
static PyObject *__pyx_v_7xmmsapi_select = 0;
static int __pyx_f_7xmmsapi_ResultNotifier(xmmsv_t *, void *); /*proto*/
static void __pyx_f_7xmmsapi_ResultDestroyNotifier(void *); /*proto*/
static void __pyx_f_7xmmsapi_python_need_out_fun(int, void *); /*proto*/
static void __pyx_f_7xmmsapi_python_disconnect_fun(void *); /*proto*/
static PyObject *__pyx_f_7xmmsapi_userconfdir_get(int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7xmmsapi__install_select(void); /*proto*/
static char *__pyx_f_7xmmsapi_check_namespace(PyObject *, int); /*proto*/
static PyObject *__pyx_f_7xmmsapi_check_playlist(PyObject *, int); /*proto*/
#define __Pyx_MODULE_NAME "xmmsapi"
int __pyx_module_is_main_xmmsapi = 0;

/* Implementation of 'xmmsapi' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_pf_7xmmsapi_10deprecated_deprecated_decorator(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_7xmmsapi_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */
static int __pyx_pf_7xmmsapi_20XmmsSourcePreference___init__(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self, PyObject *__pyx_v_sources); /* proto */
static PyObject *__pyx_pf_7xmmsapi_20XmmsSourcePreference_2get(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_20XmmsSourcePreference_4set(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self, PyObject *__pyx_v_sources); /* proto */
static int __pyx_pf_7xmmsapi_17XmmsResultTracker___cinit__(struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_self); /* proto */
static int __pyx_pf_7xmmsapi_10XmmsResult___cinit__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static void __pyx_pf_7xmmsapi_10XmmsResult_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_4disconnect(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_8callback___get__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_6_callback(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_8__call__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_10wait(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_12is_error(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_14iserror(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_16xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_18_value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_20value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self); /* proto */
static int __pyx_pf_7xmmsapi_13XmmsVisResult___cinit__(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self); /* proto */
static void __pyx_pf_7xmmsapi_13XmmsVisResult_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_13XmmsVisResult_4xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self); /* proto */
static int __pyx_pf_7xmmsapi_12XmmsVisChunk___cinit__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self); /* proto */
static void __pyx_pf_7xmmsapi_12XmmsVisChunk_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7xmmsapi_12XmmsVisChunk_4__len__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_12XmmsVisChunk_6get_buffer(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_12XmmsVisChunk_8get_data(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_2userconfdir_get(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_4enforce_unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */
static int __pyx_pf_7xmmsapi_8XmmsCore___cinit__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static void __pyx_pf_7xmmsapi_8XmmsCore_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_4__del__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_6get_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_8set_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_sources); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_10_needout_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_12_disconnect_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_14disconnect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_16ioin(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_18ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_20want_ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_22set_need_out_fun(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_fun); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_24get_fd(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_26connect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_disconnect_func); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_28is_connected(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_17source_preference___get__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_10clientname___get__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_quit(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_2plugin_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_4playback_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_6playback_stop(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_8playback_tickle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_10playback_pause(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_12playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_14playback_seek_ms(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_ms, xmms_playback_seek_mode_t __pyx_v_whence, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_16playback_seek_samples(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_samples, xmms_playback_seek_mode_t __pyx_v_whence, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_18playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_20broadcast_playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_22broadcast_playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_24playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_26signal_playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_28playback_volume_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_channel, int __pyx_v_volume, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_30playback_volume_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_32broadcast_playback_volume_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_34broadcast_playlist_loaded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_36playlist_load(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_38playlist_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_40playlist_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_42playlist_shuffle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_44playlist_rinsert(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_46playlist_rinsert_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_48playlist_insert_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_50playlist_insert_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_52playlist_insert_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_54playlist_insert_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_order, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_56playlist_radd(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_58playlist_radd_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_60playlist_add_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_62playlist_add_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_64playlist_add_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_66playlist_add_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_order, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_68playlist_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_70playlist_clear(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_72playlist_list_entries(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_74playlist_sort(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_76playlist_set_next_rel(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_78playlist_set_next(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_80playlist_move(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_cur_pos, int __pyx_v_new_pos, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_82playlist_create(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_84playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_86playlist_current_active(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_88broadcast_playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_90broadcast_playlist_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_92broadcast_config_value_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_94config_set_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_96config_get_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_98config_list_values(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_100config_register_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_valuename, PyObject *__pyx_v_defaultvalue, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_102medialib_add_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_104medialib_add_entry_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_106medialib_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_108medialib_move_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_110medialib_get_info(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_112medialib_rehash(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_114medialib_get_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_116medialib_import_path(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_118medialib_path_import(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_120medialib_path_import_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_122medialib_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_source, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_124medialib_property_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, PyObject *__pyx_v_source, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_126broadcast_medialib_entry_added(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_128broadcast_medialib_entry_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_130broadcast_collection_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_132signal_mediainfo_reader_unindexed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_134broadcast_mediainfo_reader_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_136xform_media_browse(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_138xform_media_browse_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_140coll_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_142coll_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_144coll_save(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_146coll_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_148coll_rename(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_150coll_idlist_from_playlist_file(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_152coll_query(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fetch, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_154coll_query_ids(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_start, PyObject *__pyx_v_leng, PyObject *__pyx_v_order, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_156coll_query_infos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fields, PyObject *__pyx_v_start, PyObject *__pyx_v_leng, PyObject *__pyx_v_order, PyObject *__pyx_v_groupby, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_158bindata_add(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_160bindata_retrieve(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_162bindata_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_164bindata_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_166stats(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_168visualization_version(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_170visualization_init(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_172visualization_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_174visualization_started(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_176visualization_errored(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_178visualization_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_180visualization_properties_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_props, PyObject *__pyx_v_cb); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_182visualization_chunk_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_v_drawtime, int __pyx_v_blocking); /* proto */
static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_184visualization_shutdown(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle); /* proto */
static int __pyx_pf_7xmmsapi_8XmmsLoop___cinit__(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_2_loop_set_wakeup(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self, PyObject *__pyx_v_fd); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_4_loop_get_wakeup(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_6exit_loop(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_8loop_tickle(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_10loop_iter(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self, PyObject *__pyx_v_infd, PyObject *__pyx_v_outfd, PyObject *__pyx_v_errfd, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_12loop(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self); /* proto */
static char __pyx_k_1[] = "DEPRECATED: %s()";
static char __pyx_k_4[] = "deprecated_decorator";
static char __pyx_k_5[] = "/Users/loic/devel/xmms2-devel/src/clients/lib/python/xmmsapi.pyx";
static char __pyx_k_6[] = "COLLECTION_NS_COLLECTIONS";
static char __pyx_k_7[] = "COLLECTION_NS_PLAYLISTS";
static char __pyx_k_8[] = "Bad namespace";
static char __pyx_k_10[] = "Type '%s' is not callable";
static char __pyx_k_11[] = "Uninitialized result";
static char __pyx_k_14[] = "Failed to initialize visualization";
static char __pyx_k_17[] = "Internal connection reference not set";
static char __pyx_k_19[] = "Failed to initialize chunk data";
static char __pyx_k_21[] = "chunk data not initialized";
static char __pyx_k_24[] = "UTF-8";
static char __pyx_k_25[] = "expected str, %s found";
static char __pyx_k_26[] = "client/";
static char __pyx_k_27[] = "plugins/*";
static char __pyx_k_28[] = "client/*";
static char __pyx_k_29[] = "*";
static char __pyx_k_30[] = "Failed to initialize xmmsclient library! Probably due to broken name.";
static char __pyx_k_32[] = "get_source_preference";
static char __pyx_k_33[] = "set_source_preference";
static char __pyx_k_34[] = "Couldn't connect to the server";
static char __pyx_k_36[] = "xmmsc_result_t couldn't be allocated";
static char __pyx_k_39[] = "Bad whence parameter";
static char __pyx_k_42[] = "playback_seek_samples";
static char __pyx_k_44[] = "broadcast_playback_status";
static char __pyx_k_45[] = "broadcast_playback_current_id";
static char __pyx_k_46[] = "signal_playback_playtime";
static char __pyx_k_47[] = "broadcast_playback_volume_changed";
static char __pyx_k_48[] = "broadcast_playlist_loaded";
static char __pyx_k_51[] = "playlist_insert_collection";
static char __pyx_k_54[] = "playlist_add_collection";
static char __pyx_k_55[] = "playlist_remove_entry";
static char __pyx_k_56[] = "playlist_list_entries";
static char __pyx_k_57[] = "playlist_set_next_rel";
static char __pyx_k_58[] = "playlist_current_pos";
static char __pyx_k_59[] = "playlist_current_active";
static char __pyx_k_60[] = "broadcast_playlist_current_pos";
static char __pyx_k_61[] = "broadcast_playlist_changed";
static char __pyx_k_62[] = "broadcast_config_value_changed";
static char __pyx_k_63[] = "config_register_value";
static char __pyx_k_65[] = "medialib_remove_entry";
static char __pyx_k_67[] = "urllib.parse";
static char __pyx_k_70[] = "medialib_import_path";
static char __pyx_k_72[] = "medialib_property_set";
static char __pyx_k_73[] = "medialib_property_remove";
static char __pyx_k_74[] = "broadcast_medialib_entry_added";
static char __pyx_k_75[] = "broadcast_medialib_entry_changed";
static char __pyx_k_76[] = "broadcast_collection_changed";
static char __pyx_k_77[] = "signal_mediainfo_reader_unindexed";
static char __pyx_k_78[] = "broadcast_mediainfo_reader_status";
static char __pyx_k_80[] = "coll_idlist_from_playlist_file";
static char __pyx_k_81[] = "visualization_version";
static char __pyx_k_82[] = "visualization_started";
static char __pyx_k_83[] = "visualization_errored";
static char __pyx_k_84[] = "visualization_property_set";
static char __pyx_k_86[] = "visualization_properties_set";
static char __pyx_k_87[] = "visualization_chunk_get";
static char __pyx_k_88[] = "Unrecoverable error in visualization";
static char __pyx_k_90[] = "visualization_shutdown";
static char __pyx_k_92[] = "XmmsDisconnectException";
static char __pyx_k_94[] = "\nPython bindings for XMMS2.\n";
static char __pyx_k_95[] = "PLAYBACK_STATUS_STOP";
static char __pyx_k_96[] = "PLAYBACK_STATUS_PLAY";
static char __pyx_k_97[] = "PLAYBACK_STATUS_PAUSE";
static char __pyx_k_98[] = "PLAYLIST_CHANGED_ADD";
static char __pyx_k_99[] = "PLAYLIST_CHANGED_INSERT";
static char __pyx_k__1[] = "1";
static char __pyx_k__a[] = "a";
static char __pyx_k__f[] = "f";
static char __pyx_k__o[] = "o";
static char __pyx_k__s[] = "s";
static char __pyx_k_100[] = "PLAYLIST_CHANGED_SHUFFLE";
static char __pyx_k_101[] = "PLAYLIST_CHANGED_REMOVE";
static char __pyx_k_102[] = "PLAYLIST_CHANGED_CLEAR";
static char __pyx_k_103[] = "PLAYLIST_CHANGED_MOVE";
static char __pyx_k_104[] = "PLAYLIST_CHANGED_SORT";
static char __pyx_k_105[] = "PLAYLIST_CHANGED_UPDATE";
static char __pyx_k_106[] = "MEDIALIB_ENTRY_STATUS_NEW";
static char __pyx_k_107[] = "MEDIALIB_ENTRY_STATUS_OK";
static char __pyx_k_108[] = "MEDIALIB_ENTRY_STATUS_RESOLVING";
static char __pyx_k_109[] = "MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE";
static char __pyx_k_110[] = "MEDIALIB_ENTRY_STATUS_REHASH";
static char __pyx_k_111[] = "COLLECTION_CHANGED_ADD";
static char __pyx_k_112[] = "COLLECTION_CHANGED_UPDATE";
static char __pyx_k_113[] = "COLLECTION_CHANGED_RENAME";
static char __pyx_k_114[] = "COLLECTION_CHANGED_REMOVE";
static char __pyx_k_115[] = "XMMS_PYTHON_SHOW_DEPRECATED";
static char __pyx_k_121[] = "playlist_rinsert_encoded";
static char __pyx_k_122[] = "playlist_insert_encoded";
static char __pyx_k_123[] = "playlist_radd_encoded";
static char __pyx_k_124[] = "playlist_add_encoded";
static char __pyx_k_125[] = "medialib_add_entry_encoded";
static char __pyx_k_126[] = "medialib_path_import";
static char __pyx_k_127[] = "medialib_path_import_encoded";
static char __pyx_k_128[] = "xform_media_browse_encoded";
static char __pyx_k__cb[] = "cb";
static char __pyx_k__id[] = "id";
static char __pyx_k__kw[] = "kw";
static char __pyx_k__ms[] = "ms";
static char __pyx_k__ns[] = "ns";
static char __pyx_k__os[] = "os";
static char __pyx_k__get[] = "get";
static char __pyx_k__key[] = "key";
static char __pyx_k__pos[] = "pos";
static char __pyx_k__set[] = "set";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__typ[] = "typ";
static char __pyx_k__url[] = "url";
static char __pyx_k__val[] = "val";
static char __pyx_k__XMMS[] = "XMMS";
static char __pyx_k__coll[] = "coll";
static char __pyx_k__data[] = "data";
static char __pyx_k__hash[] = "hash";
static char __pyx_k__infd[] = "infd";
static char __pyx_k__ioin[] = "ioin";
static char __pyx_k__leng[] = "leng";
static char __pyx_k__name[] = "name";
static char __pyx_k__path[] = "path";
static char __pyx_k__pipe[] = "pipe";
static char __pyx_k__quit[] = "quit";
static char __pyx_k__read[] = "read";
static char __pyx_k__wait[] = "wait";
static char __pyx_k__ascii[] = "ascii";
static char __pyx_k__errfd[] = "errfd";
static char __pyx_k__fetch[] = "fetch";
static char __pyx_k__ioout[] = "ioout";
static char __pyx_k__order[] = "order";
static char __pyx_k__outfd[] = "outfd";
static char __pyx_k__props[] = "props";
static char __pyx_k__pyval[] = "pyval";
static char __pyx_k__range[] = "range";
static char __pyx_k__start[] = "start";
static char __pyx_k__stats[] = "stats";
static char __pyx_k__value[] = "value";
static char __pyx_k__write[] = "write";
static char __pyx_k___value[] = "_value";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__get_fd[] = "get_fd";
static char __pyx_k__getenv[] = "getenv";
static char __pyx_k__handle[] = "handle";
static char __pyx_k__remove[] = "remove";
static char __pyx_k__select[] = "select";
static char __pyx_k__server[] = "server";
static char __pyx_k__source[] = "source";
static char __pyx_k__stderr[] = "stderr";
static char __pyx_k__urllib[] = "urllib";
static char __pyx_k__volume[] = "volume";
static char __pyx_k__whence[] = "whence";
static char __pyx_k__IOError[] = "IOError";
static char __pyx_k__channel[] = "channel";
static char __pyx_k__connect[] = "connect";
static char __pyx_k__cur_pos[] = "cur_pos";
static char __pyx_k__encoded[] = "encoded";
static char __pyx_k__groupby[] = "groupby";
static char __pyx_k__iserror[] = "iserror";
static char __pyx_k__new_pos[] = "new_pos";
static char __pyx_k__newname[] = "newname";
static char __pyx_k__oldname[] = "oldname";
static char __pyx_k__replace[] = "replace";
static char __pyx_k__samples[] = "samples";
static char __pyx_k__sources[] = "sources";
static char __pyx_k__timeout[] = "timeout";
static char __pyx_k__xmmsapi[] = "xmmsapi";
static char __pyx_k____call__[] = "__call__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__blocking[] = "blocking";
static char __pyx_k__callback[] = "callback";
static char __pyx_k__coll_get[] = "coll_get";
static char __pyx_k__drawtime[] = "drawtime";
static char __pyx_k__exc_info[] = "exc_info";
static char __pyx_k__get_data[] = "get_data";
static char __pyx_k__is_error[] = "is_error";
static char __pyx_k__playlist[] = "playlist";
static char __pyx_k__position[] = "position";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k____class__[] = "__class__";
static char __pyx_k___callback[] = "_callback";
static char __pyx_k__coll_list[] = "coll_list";
static char __pyx_k__coll_save[] = "coll_save";
static char __pyx_k__loop_iter[] = "loop_iter";
static char __pyx_k__traceback[] = "traceback";
static char __pyx_k__valuename[] = "valuename";
static char __pyx_k__xmmsvalue[] = "xmmsvalue";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__XMMSResult[] = "XMMSResult";
static char __pyx_k__clientname[] = "clientname";
static char __pyx_k__coll_query[] = "coll_query";
static char __pyx_k__deprecated[] = "deprecated";
static char __pyx_k__disconnect[] = "disconnect";
static char __pyx_k__get_buffer[] = "get_buffer";
static char __pyx_k__want_ioout[] = "want_ioout";
static char __pyx_k__Collections[] = "Collections";
static char __pyx_k__ImportError[] = "ImportError";
static char __pyx_k___needout_cb[] = "_needout_cb";
static char __pyx_k__bindata_add[] = "bindata_add";
static char __pyx_k__coll_remove[] = "coll_remove";
static char __pyx_k__coll_rename[] = "coll_rename";
static char __pyx_k__loop_tickle[] = "loop_tickle";
static char __pyx_k__plugin_list[] = "plugin_list";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__bindata_list[] = "bindata_list";
static char __pyx_k__defaultvalue[] = "defaultvalue";
static char __pyx_k__unquote_plus[] = "unquote_plus";
static char __pyx_k__playback_stop[] = "playback_stop";
static char __pyx_k__playlist_list[] = "playlist_list";
static char __pyx_k__playlist_load[] = "playlist_load";
static char __pyx_k__playlist_move[] = "playlist_move";
static char __pyx_k__playlist_radd[] = "playlist_radd";
static char __pyx_k__playlist_sort[] = "playlist_sort";
static char __pyx_k___disconnect_cb[] = "_disconnect_cb";
static char __pyx_k__bindata_remove[] = "bindata_remove";
static char __pyx_k__coll_query_ids[] = "coll_query_ids";
static char __pyx_k__playback_pause[] = "playback_pause";
static char __pyx_k__playback_start[] = "playback_start";
static char __pyx_k__playlist_clear[] = "playlist_clear";
static char __pyx_k__ACTIVE_PLAYLIST[] = "ACTIVE_PLAYLIST";
static char __pyx_k__PLUGIN_TYPE_ALL[] = "PLUGIN_TYPE_ALL";
static char __pyx_k__disconnect_func[] = "disconnect_func";
static char __pyx_k__enforce_unicode[] = "enforce_unicode";
static char __pyx_k__medialib_get_id[] = "medialib_get_id";
static char __pyx_k__medialib_rehash[] = "medialib_rehash";
static char __pyx_k__playback_status[] = "playback_status";
static char __pyx_k__playback_tickle[] = "playback_tickle";
static char __pyx_k__playlist_add_id[] = "playlist_add_id";
static char __pyx_k__playlist_create[] = "playlist_create";
static char __pyx_k__playlist_remove[] = "playlist_remove";
static char __pyx_k__print_exception[] = "print_exception";
static char __pyx_k___loop_get_wakeup[] = "_loop_get_wakeup";
static char __pyx_k___loop_set_wakeup[] = "_loop_set_wakeup";
static char __pyx_k__bindata_retrieve[] = "bindata_retrieve";
static char __pyx_k__coll_query_infos[] = "coll_query_infos";
static char __pyx_k__config_get_value[] = "config_get_value";
static char __pyx_k__config_set_value[] = "config_set_value";
static char __pyx_k__playback_seek_ms[] = "playback_seek_ms";
static char __pyx_k__playlist_add_url[] = "playlist_add_url";
static char __pyx_k__playlist_rinsert[] = "playlist_rinsert";
static char __pyx_k__playlist_shuffle[] = "playlist_shuffle";
static char __pyx_k__set_need_out_fun[] = "set_need_out_fun";
static char __pyx_k__COLLECTION_NS_ALL[] = "COLLECTION_NS_ALL";
static char __pyx_k__PLAYBACK_SEEK_CUR[] = "PLAYBACK_SEEK_CUR";
static char __pyx_k__PLAYBACK_SEEK_SET[] = "PLAYBACK_SEEK_SET";
static char __pyx_k__PLUGIN_TYPE_XFORM[] = "PLUGIN_TYPE_XFORM";
static char __pyx_k__medialib_get_info[] = "medialib_get_info";
static char __pyx_k__playback_playtime[] = "playback_playtime";
static char __pyx_k__playlist_set_next[] = "playlist_set_next";
static char __pyx_k__PLUGIN_TYPE_OUTPUT[] = "PLUGIN_TYPE_OUTPUT";
static char __pyx_k__VisualizationError[] = "VisualizationError";
static char __pyx_k__config_list_values[] = "config_list_values";
static char __pyx_k__medialib_add_entry[] = "medialib_add_entry";
static char __pyx_k__playlist_insert_id[] = "playlist_insert_id";
static char __pyx_k__visualization_init[] = "visualization_init";
static char __pyx_k__xform_media_browse[] = "xform_media_browse";
static char __pyx_k__UnnamedPythonClient[] = "UnnamedPythonClient";
static char __pyx_k__medialib_move_entry[] = "medialib_move_entry";
static char __pyx_k__playback_current_id[] = "playback_current_id";
static char __pyx_k__playback_volume_get[] = "playback_volume_get";
static char __pyx_k__playback_volume_set[] = "playback_volume_set";
static char __pyx_k__playlist_insert_url[] = "playlist_insert_url";
static char __pyx_k__visualization_start[] = "visualization_start";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_n_s_100;
static PyObject *__pyx_n_s_101;
static PyObject *__pyx_n_s_102;
static PyObject *__pyx_n_s_103;
static PyObject *__pyx_n_s_104;
static PyObject *__pyx_n_s_105;
static PyObject *__pyx_n_s_106;
static PyObject *__pyx_n_s_107;
static PyObject *__pyx_n_s_108;
static PyObject *__pyx_n_s_109;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_n_s_110;
static PyObject *__pyx_n_s_111;
static PyObject *__pyx_n_s_112;
static PyObject *__pyx_n_s_113;
static PyObject *__pyx_n_s_114;
static PyObject *__pyx_n_s_115;
static PyObject *__pyx_n_s_121;
static PyObject *__pyx_n_s_122;
static PyObject *__pyx_n_s_123;
static PyObject *__pyx_n_s_124;
static PyObject *__pyx_n_s_125;
static PyObject *__pyx_n_s_126;
static PyObject *__pyx_n_s_127;
static PyObject *__pyx_n_s_128;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_n_s_32;
static PyObject *__pyx_n_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_n_s_4;
static PyObject *__pyx_n_s_42;
static PyObject *__pyx_n_s_44;
static PyObject *__pyx_n_s_45;
static PyObject *__pyx_n_s_46;
static PyObject *__pyx_n_s_47;
static PyObject *__pyx_n_s_48;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_n_s_51;
static PyObject *__pyx_n_s_54;
static PyObject *__pyx_n_s_55;
static PyObject *__pyx_n_s_56;
static PyObject *__pyx_n_s_57;
static PyObject *__pyx_n_s_58;
static PyObject *__pyx_n_s_59;
static PyObject *__pyx_n_s_6;
static PyObject *__pyx_n_s_60;
static PyObject *__pyx_n_s_61;
static PyObject *__pyx_n_s_62;
static PyObject *__pyx_n_s_63;
static PyObject *__pyx_n_s_65;
static PyObject *__pyx_n_s_67;
static PyObject *__pyx_n_s_7;
static PyObject *__pyx_n_s_70;
static PyObject *__pyx_n_s_72;
static PyObject *__pyx_n_s_73;
static PyObject *__pyx_n_s_74;
static PyObject *__pyx_n_s_75;
static PyObject *__pyx_n_s_76;
static PyObject *__pyx_n_s_77;
static PyObject *__pyx_n_s_78;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s_80;
static PyObject *__pyx_n_s_81;
static PyObject *__pyx_n_s_82;
static PyObject *__pyx_n_s_83;
static PyObject *__pyx_n_s_84;
static PyObject *__pyx_n_s_86;
static PyObject *__pyx_n_s_87;
static PyObject *__pyx_kp_s_88;
static PyObject *__pyx_n_s_90;
static PyObject *__pyx_n_s_92;
static PyObject *__pyx_n_s_95;
static PyObject *__pyx_n_s_96;
static PyObject *__pyx_n_s_97;
static PyObject *__pyx_n_s_98;
static PyObject *__pyx_n_s_99;
static PyObject *__pyx_kp_s__1;
static PyObject *__pyx_n_s__ACTIVE_PLAYLIST;
static PyObject *__pyx_n_s__COLLECTION_NS_ALL;
static PyObject *__pyx_n_s__Collections;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__IOError;
static PyObject *__pyx_n_s__ImportError;
static PyObject *__pyx_n_s__PLAYBACK_SEEK_CUR;
static PyObject *__pyx_n_s__PLAYBACK_SEEK_SET;
static PyObject *__pyx_n_s__PLUGIN_TYPE_ALL;
static PyObject *__pyx_n_s__PLUGIN_TYPE_OUTPUT;
static PyObject *__pyx_n_s__PLUGIN_TYPE_XFORM;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UnnamedPythonClient;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s__VisualizationError;
static PyObject *__pyx_n_s__XMMS;
static PyObject *__pyx_n_s__XMMSResult;
static PyObject *__pyx_n_s____call__;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___callback;
static PyObject *__pyx_n_s___disconnect_cb;
static PyObject *__pyx_n_s___loop_get_wakeup;
static PyObject *__pyx_n_s___loop_set_wakeup;
static PyObject *__pyx_n_s___needout_cb;
static PyObject *__pyx_n_s___value;
static PyObject *__pyx_n_s__a;
static PyObject *__pyx_n_s__ascii;
static PyObject *__pyx_n_s__bindata_add;
static PyObject *__pyx_n_s__bindata_list;
static PyObject *__pyx_n_s__bindata_remove;
static PyObject *__pyx_n_s__bindata_retrieve;
static PyObject *__pyx_n_s__blocking;
static PyObject *__pyx_n_s__callback;
static PyObject *__pyx_n_s__cb;
static PyObject *__pyx_n_s__channel;
static PyObject *__pyx_n_s__clientname;
static PyObject *__pyx_n_s__coll;
static PyObject *__pyx_n_s__coll_get;
static PyObject *__pyx_n_s__coll_list;
static PyObject *__pyx_n_s__coll_query;
static PyObject *__pyx_n_s__coll_query_ids;
static PyObject *__pyx_n_s__coll_query_infos;
static PyObject *__pyx_n_s__coll_remove;
static PyObject *__pyx_n_s__coll_rename;
static PyObject *__pyx_n_s__coll_save;
static PyObject *__pyx_n_s__config_get_value;
static PyObject *__pyx_n_s__config_list_values;
static PyObject *__pyx_n_s__config_set_value;
static PyObject *__pyx_n_s__connect;
static PyObject *__pyx_n_s__cur_pos;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__defaultvalue;
static PyObject *__pyx_n_s__deprecated;
static PyObject *__pyx_n_s__disconnect;
static PyObject *__pyx_n_s__disconnect_func;
static PyObject *__pyx_n_s__drawtime;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__encoded;
static PyObject *__pyx_n_s__enforce_unicode;
static PyObject *__pyx_n_s__errfd;
static PyObject *__pyx_n_s__exc_info;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__fetch;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__get_buffer;
static PyObject *__pyx_n_s__get_data;
static PyObject *__pyx_n_s__get_fd;
static PyObject *__pyx_n_s__getenv;
static PyObject *__pyx_n_s__groupby;
static PyObject *__pyx_n_s__handle;
static PyObject *__pyx_n_s__hash;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__infd;
static PyObject *__pyx_n_s__ioin;
static PyObject *__pyx_n_s__ioout;
static PyObject *__pyx_n_s__is_error;
static PyObject *__pyx_n_s__iserror;
static PyObject *__pyx_n_s__key;
static PyObject *__pyx_n_s__kw;
static PyObject *__pyx_n_s__leng;
static PyObject *__pyx_n_s__loop_iter;
static PyObject *__pyx_n_s__loop_tickle;
static PyObject *__pyx_n_s__medialib_add_entry;
static PyObject *__pyx_n_s__medialib_get_id;
static PyObject *__pyx_n_s__medialib_get_info;
static PyObject *__pyx_n_s__medialib_move_entry;
static PyObject *__pyx_n_s__medialib_rehash;
static PyObject *__pyx_n_s__ms;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__new_pos;
static PyObject *__pyx_n_s__newname;
static PyObject *__pyx_n_s__ns;
static PyObject *__pyx_n_s__o;
static PyObject *__pyx_n_s__oldname;
static PyObject *__pyx_n_s__order;
static PyObject *__pyx_n_s__os;
static PyObject *__pyx_n_s__outfd;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__pipe;
static PyObject *__pyx_n_s__playback_current_id;
static PyObject *__pyx_n_s__playback_pause;
static PyObject *__pyx_n_s__playback_playtime;
static PyObject *__pyx_n_s__playback_seek_ms;
static PyObject *__pyx_n_s__playback_start;
static PyObject *__pyx_n_s__playback_status;
static PyObject *__pyx_n_s__playback_stop;
static PyObject *__pyx_n_s__playback_tickle;
static PyObject *__pyx_n_s__playback_volume_get;
static PyObject *__pyx_n_s__playback_volume_set;
static PyObject *__pyx_n_s__playlist;
static PyObject *__pyx_n_s__playlist_add_id;
static PyObject *__pyx_n_s__playlist_add_url;
static PyObject *__pyx_n_s__playlist_clear;
static PyObject *__pyx_n_s__playlist_create;
static PyObject *__pyx_n_s__playlist_insert_id;
static PyObject *__pyx_n_s__playlist_insert_url;
static PyObject *__pyx_n_s__playlist_list;
static PyObject *__pyx_n_s__playlist_load;
static PyObject *__pyx_n_s__playlist_move;
static PyObject *__pyx_n_s__playlist_radd;
static PyObject *__pyx_n_s__playlist_remove;
static PyObject *__pyx_n_s__playlist_rinsert;
static PyObject *__pyx_n_s__playlist_set_next;
static PyObject *__pyx_n_s__playlist_shuffle;
static PyObject *__pyx_n_s__playlist_sort;
static PyObject *__pyx_n_s__plugin_list;
static PyObject *__pyx_n_s__pos;
static PyObject *__pyx_n_s__position;
static PyObject *__pyx_n_s__print_exception;
static PyObject *__pyx_n_s__props;
static PyObject *__pyx_n_s__pyval;
static PyObject *__pyx_n_s__quit;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__remove;
static PyObject *__pyx_n_s__s;
static PyObject *__pyx_n_s__samples;
static PyObject *__pyx_n_s__select;
static PyObject *__pyx_n_s__server;
static PyObject *__pyx_n_s__set;
static PyObject *__pyx_n_s__set_need_out_fun;
static PyObject *__pyx_n_s__source;
static PyObject *__pyx_n_s__sources;
static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__stats;
static PyObject *__pyx_n_s__stderr;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__timeout;
static PyObject *__pyx_n_s__traceback;
static PyObject *__pyx_n_s__typ;
static PyObject *__pyx_n_s__unquote_plus;
static PyObject *__pyx_n_s__url;
static PyObject *__pyx_n_s__urllib;
static PyObject *__pyx_n_s__val;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__valuename;
static PyObject *__pyx_n_s__visualization_init;
static PyObject *__pyx_n_s__visualization_start;
static PyObject *__pyx_n_s__volume;
static PyObject *__pyx_n_s__wait;
static PyObject *__pyx_n_s__want_ioout;
static PyObject *__pyx_n_s__whence;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__xform_media_browse;
static PyObject *__pyx_n_s__xmmsapi;
static PyObject *__pyx_n_s__xmmsvalue;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_neg_1;
static xmms_playback_seek_mode_t __pyx_k_38;
static xmms_playback_seek_mode_t __pyx_k_41;
static PyObject *__pyx_k_49;
static PyObject *__pyx_k_50;
static PyObject *__pyx_k_52;
static PyObject *__pyx_k_53;
static PyObject *__pyx_k_64;
static PyObject *__pyx_k_66;
static PyObject *__pyx_k_68;
static PyObject *__pyx_k_69;
static PyObject *__pyx_k_71;
static PyObject *__pyx_k_79;
static PyObject *__pyx_k_85;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_31;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_43;
static PyObject *__pyx_k_tuple_89;
static PyObject *__pyx_k_tuple_91;
static PyObject *__pyx_k_tuple_93;
static PyObject *__pyx_k_codeobj_3;
static PyObject *__pyx_k_tuple_116;
static PyObject *__pyx_k_tuple_117;
static PyObject *__pyx_k_tuple_119;
static PyObject *__pyx_k_codeobj_118;
static PyObject *__pyx_k_codeobj_120;

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_1deprecated(PyObject *__pyx_self, PyObject *__pyx_v_f); /*proto*/
static PyMethodDef __pyx_mdef_7xmmsapi_1deprecated = {__Pyx_NAMESTR("deprecated"), (PyCFunction)__pyx_pw_7xmmsapi_1deprecated, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7xmmsapi_1deprecated(PyObject *__pyx_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deprecated (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_deprecated(__pyx_self, ((PyObject *)__pyx_v_f));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10deprecated_1deprecated_decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7xmmsapi_10deprecated_1deprecated_decorator = {__Pyx_NAMESTR("deprecated_decorator"), (PyCFunction)__pyx_pw_7xmmsapi_10deprecated_1deprecated_decorator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7xmmsapi_10deprecated_1deprecated_decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deprecated_decorator (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deprecated_decorator", 1))) return NULL;
  __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_a = __pyx_args;
  __pyx_r = __pyx_pf_7xmmsapi_10deprecated_deprecated_decorator(__pyx_self, __pyx_v_a, __pyx_v_kw);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":62
 * 
 * def deprecated(f):
 * 	def deprecated_decorator(*a, **kw):             # <<<<<<<<<<<<<<
 * 		if show_deprecated:
 * 			from sys import stderr
 */

static PyObject *__pyx_pf_7xmmsapi_10deprecated_deprecated_decorator(PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_kw) {
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *__pyx_cur_scope;
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *__pyx_outer_scope;
  PyObject *__pyx_v_stderr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deprecated_decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "xmmsapi.pyx":63
 * def deprecated(f):
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:             # <<<<<<<<<<<<<<
 * 			from sys import stderr
 * 			print >>stderr, "DEPRECATED: %s()" % f.__name__
 */
  if (__pyx_v_7xmmsapi_show_deprecated) {

    /* "xmmsapi.pyx":64
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:
 * 			from sys import stderr             # <<<<<<<<<<<<<<
 * 			print >>stderr, "DEPRECATED: %s()" % f.__name__
 * 		return f(*a, **kw)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__stderr));
    PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__stderr));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__stderr));
    __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stderr);
    if (__pyx_t_1 == NULL) {
      if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__stderr);
      if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_stderr = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "xmmsapi.pyx":65
 * 		if show_deprecated:
 * 			from sys import stderr
 * 			print >>stderr, "DEPRECATED: %s()" % f.__name__             # <<<<<<<<<<<<<<
 * 		return f(*a, **kw)
 * 	return deprecated_decorator
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_f, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PrintOne(__pyx_v_stderr, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":66
 * 			from sys import stderr
 * 			print >>stderr, "DEPRECATED: %s()" % f.__name__
 * 		return f(*a, **kw)             # <<<<<<<<<<<<<<
 * 	return deprecated_decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = ((PyObject *)__pyx_v_kw);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_cur_scope->__pyx_v_f, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.deprecated.deprecated_decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stderr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":61
 * del getenv
 * 
 * def deprecated(f):             # <<<<<<<<<<<<<<
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:
 */

static PyObject *__pyx_pf_7xmmsapi_deprecated(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) {
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *__pyx_cur_scope;
  PyObject *__pyx_v_deprecated_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deprecated", 0);
  __pyx_cur_scope = (struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *)__pyx_ptype_7xmmsapi___pyx_scope_struct__deprecated->tp_new(__pyx_ptype_7xmmsapi___pyx_scope_struct__deprecated, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);

  /* "xmmsapi.pyx":62
 * 
 * def deprecated(f):
 * 	def deprecated_decorator(*a, **kw):             # <<<<<<<<<<<<<<
 * 		if show_deprecated:
 * 			from sys import stderr
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7xmmsapi_10deprecated_1deprecated_decorator, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s__xmmsapi, ((PyObject *)__pyx_k_codeobj_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_deprecated_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":67
 * 			print >>stderr, "DEPRECATED: %s()" % f.__name__
 * 		return f(*a, **kw)
 * 	return deprecated_decorator             # <<<<<<<<<<<<<<
 * 
 * # Trick to not expose select in the module, but keep it accessible from builtins
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_deprecated_decorator);
  __pyx_r = __pyx_v_deprecated_decorator;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.deprecated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_deprecated_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":72
 * # methods.
 * cdef object select
 * cdef _install_select():             # <<<<<<<<<<<<<<
 * 	global select
 * 	from select import select as _sel
 */

static PyObject *__pyx_f_7xmmsapi__install_select(void) {
  PyObject *__pyx_v__sel = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_install_select", 0);

  /* "xmmsapi.pyx":74
 * cdef _install_select():
 * 	global select
 * 	from select import select as _sel             # <<<<<<<<<<<<<<
 * 	select = _sel
 * _install_select()
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__select));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__select));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__select));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__select), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__select);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__select);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__sel = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":75
 * 	global select
 * 	from select import select as _sel
 * 	select = _sel             # <<<<<<<<<<<<<<
 * _install_select()
 * 
 */
  __Pyx_INCREF(__pyx_v__sel);
  __Pyx_XGOTREF(__pyx_v_7xmmsapi_select);
  __Pyx_DECREF(__pyx_v_7xmmsapi_select);
  __Pyx_GIVEREF(__pyx_v__sel);
  __pyx_v_7xmmsapi_select = __pyx_v__sel;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi._install_select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__sel);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":78
 * _install_select()
 * 
 * cdef char *check_namespace(object ns, bint can_be_all) except NULL:             # <<<<<<<<<<<<<<
 * 	cdef char *n
 * 	if ns == COLLECTION_NS_COLLECTIONS:
 */

static char *__pyx_f_7xmmsapi_check_namespace(PyObject *__pyx_v_ns, int __pyx_v_can_be_all) {
  char *__pyx_v_n;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_namespace", 0);

  /* "xmmsapi.pyx":80
 * cdef char *check_namespace(object ns, bint can_be_all) except NULL:
 * 	cdef char *n
 * 	if ns == COLLECTION_NS_COLLECTIONS:             # <<<<<<<<<<<<<<
 * 		n = <char *>XMMS_COLLECTION_NS_COLLECTIONS
 * 	elif ns == COLLECTION_NS_PLAYLISTS:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_ns, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":81
 * 	cdef char *n
 * 	if ns == COLLECTION_NS_COLLECTIONS:
 * 		n = <char *>XMMS_COLLECTION_NS_COLLECTIONS             # <<<<<<<<<<<<<<
 * 	elif ns == COLLECTION_NS_PLAYLISTS:
 * 		n = <char *>XMMS_COLLECTION_NS_PLAYLISTS
 */
    __pyx_v_n = ((char *)XMMS_COLLECTION_NS_COLLECTIONS);
    goto __pyx_L3;
  }

  /* "xmmsapi.pyx":82
 * 	if ns == COLLECTION_NS_COLLECTIONS:
 * 		n = <char *>XMMS_COLLECTION_NS_COLLECTIONS
 * 	elif ns == COLLECTION_NS_PLAYLISTS:             # <<<<<<<<<<<<<<
 * 		n = <char *>XMMS_COLLECTION_NS_PLAYLISTS
 * 	elif can_be_all and ns == COLLECTION_NS_ALL:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_ns, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":83
 * 		n = <char *>XMMS_COLLECTION_NS_COLLECTIONS
 * 	elif ns == COLLECTION_NS_PLAYLISTS:
 * 		n = <char *>XMMS_COLLECTION_NS_PLAYLISTS             # <<<<<<<<<<<<<<
 * 	elif can_be_all and ns == COLLECTION_NS_ALL:
 * 		n = <char *>XMMS_COLLECTION_NS_ALL
 */
    __pyx_v_n = ((char *)XMMS_COLLECTION_NS_PLAYLISTS);
    goto __pyx_L3;
  }

  /* "xmmsapi.pyx":84
 * 	elif ns == COLLECTION_NS_PLAYLISTS:
 * 		n = <char *>XMMS_COLLECTION_NS_PLAYLISTS
 * 	elif can_be_all and ns == COLLECTION_NS_ALL:             # <<<<<<<<<<<<<<
 * 		n = <char *>XMMS_COLLECTION_NS_ALL
 * 	else:
 */
  __pyx_t_3 = __pyx_v_can_be_all;
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__COLLECTION_NS_ALL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_ns, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "xmmsapi.pyx":85
 * 		n = <char *>XMMS_COLLECTION_NS_PLAYLISTS
 * 	elif can_be_all and ns == COLLECTION_NS_ALL:
 * 		n = <char *>XMMS_COLLECTION_NS_ALL             # <<<<<<<<<<<<<<
 * 	else:
 * 		raise ValueError("Bad namespace")
 */
    __pyx_v_n = ((char *)XMMS_COLLECTION_NS_ALL);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":87
 * 		n = <char *>XMMS_COLLECTION_NS_ALL
 * 	else:
 * 		raise ValueError("Bad namespace")             # <<<<<<<<<<<<<<
 * 	return n
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":88
 * 	else:
 * 		raise ValueError("Bad namespace")
 * 	return n             # <<<<<<<<<<<<<<
 * 
 * cdef bint ResultNotifier(xmmsv_t *res, void *o):
 */
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.check_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":90
 * 	return n
 * 
 * cdef bint ResultNotifier(xmmsv_t *res, void *o):             # <<<<<<<<<<<<<<
 * 	cdef object xres
 * 	xres = <object> o
 */

static int __pyx_f_7xmmsapi_ResultNotifier(CYTHON_UNUSED xmmsv_t *__pyx_v_res, void *__pyx_v_o) {
  PyObject *__pyx_v_xres = 0;
  PyObject *__pyx_v_traceback = NULL;
  PyObject *__pyx_v_sys = NULL;
  PyObject *__pyx_v_exc = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ResultNotifier", 0);

  /* "xmmsapi.pyx":92
 * cdef bint ResultNotifier(xmmsv_t *res, void *o):
 * 	cdef object xres
 * 	xres = <object> o             # <<<<<<<<<<<<<<
 * 	try:
 * 		return xres()
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_o));
  __pyx_v_xres = ((PyObject *)__pyx_v_o);

  /* "xmmsapi.pyx":93
 * 	cdef object xres
 * 	xres = <object> o
 * 	try:             # <<<<<<<<<<<<<<
 * 		return xres()
 * 	except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "xmmsapi.pyx":94
 * 	xres = <object> o
 * 	try:
 * 		return xres()             # <<<<<<<<<<<<<<
 * 	except:
 * 		import traceback, sys
 */
      __pyx_t_4 = PyObject_Call(__pyx_v_xres, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "xmmsapi.pyx":95
 * 	try:
 * 		return xres()
 * 	except:             # <<<<<<<<<<<<<<
 * 		import traceback, sys
 * 		exc = sys.exc_info()
 */
    /*except:*/ {
      __Pyx_AddTraceback("xmmsapi.ResultNotifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "xmmsapi.pyx":96
 * 		return xres()
 * 	except:
 * 		import traceback, sys             # <<<<<<<<<<<<<<
 * 		exc = sys.exc_info()
 * 		traceback.print_exception(*exc)
 */
      __pyx_t_8 = __Pyx_Import(((PyObject *)__pyx_n_s__traceback), 0, -1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_traceback = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_sys = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "xmmsapi.pyx":97
 * 	except:
 * 		import traceback, sys
 * 		exc = sys.exc_info()             # <<<<<<<<<<<<<<
 * 		traceback.print_exception(*exc)
 * 		return False
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_sys, __pyx_n_s__exc_info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_exc = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "xmmsapi.pyx":98
 * 		import traceback, sys
 * 		exc = sys.exc_info()
 * 		traceback.print_exception(*exc)             # <<<<<<<<<<<<<<
 * 		return False
 * 
 */
      __pyx_t_9 = PyObject_GetAttr(__pyx_v_traceback, __pyx_n_s__print_exception); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = PySequence_Tuple(__pyx_v_exc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "xmmsapi.pyx":99
 * 		exc = sys.exc_info()
 * 		traceback.print_exception(*exc)
 * 		return False             # <<<<<<<<<<<<<<
 * 
 * cdef void ResultDestroyNotifier(void *o):
 */
      __pyx_r = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("xmmsapi.ResultNotifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xres);
  __Pyx_XDECREF(__pyx_v_traceback);
  __Pyx_XDECREF(__pyx_v_sys);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":101
 * 		return False
 * 
 * cdef void ResultDestroyNotifier(void *o):             # <<<<<<<<<<<<<<
 * 	cdef XmmsResult obj
 * 	obj = <XmmsResult>o
 */

static void __pyx_f_7xmmsapi_ResultDestroyNotifier(void *__pyx_v_o) {
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_obj = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ResultDestroyNotifier", 0);

  /* "xmmsapi.pyx":103
 * cdef void ResultDestroyNotifier(void *o):
 * 	cdef XmmsResult obj
 * 	obj = <XmmsResult>o             # <<<<<<<<<<<<<<
 * 	obj._cb = None
 * 	obj.result_tracker.release_result(obj)
 */
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_o)));
  __pyx_v_obj = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_o);

  /* "xmmsapi.pyx":104
 * 	cdef XmmsResult obj
 * 	obj = <XmmsResult>o
 * 	obj._cb = None             # <<<<<<<<<<<<<<
 * 	obj.result_tracker.release_result(obj)
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_obj->_cb);
  __Pyx_DECREF(__pyx_v_obj->_cb);
  __pyx_v_obj->_cb = Py_None;

  /* "xmmsapi.pyx":105
 * 	obj = <XmmsResult>o
 * 	obj._cb = None
 * 	obj.result_tracker.release_result(obj)             # <<<<<<<<<<<<<<
 * 
 * cdef class XmmsSourcePreference:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker *)__pyx_v_obj->result_tracker->__pyx_vtab)->release_result(__pyx_v_obj->result_tracker, __pyx_v_obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("xmmsapi.ResultDestroyNotifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_20XmmsSourcePreference_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_20XmmsSourcePreference_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sources = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sources,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":113
 * 	#cdef object sources
 * 
 * 	def __init__(self, sources=None):             # <<<<<<<<<<<<<<
 * 		self.set(sources)
 * 
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sources);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sources = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsSourcePreference.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_20XmmsSourcePreference___init__(((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)__pyx_v_self), __pyx_v_sources);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7xmmsapi_20XmmsSourcePreference___init__(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self, PyObject *__pyx_v_sources) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "xmmsapi.pyx":114
 * 
 * 	def __init__(self, sources=None):
 * 		self.set(sources)             # <<<<<<<<<<<<<<
 * 
 * 	def get(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_sources);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sources);
  __Pyx_GIVEREF(__pyx_v_sources);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsSourcePreference.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_20XmmsSourcePreference_3get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_20XmmsSourcePreference_3get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_20XmmsSourcePreference_2get(((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":116
 * 		self.set(sources)
 * 
 * 	def get(self):             # <<<<<<<<<<<<<<
 * 		return self.sources
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_20XmmsSourcePreference_2get(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get", 0);

  /* "xmmsapi.pyx":117
 * 
 * 	def get(self):
 * 		return self.sources             # <<<<<<<<<<<<<<
 * 
 * 	def set(self, sources):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->sources);
  __pyx_r = __pyx_v_self->sources;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_20XmmsSourcePreference_5set(PyObject *__pyx_v_self, PyObject *__pyx_v_sources); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_20XmmsSourcePreference_5set(PyObject *__pyx_v_self, PyObject *__pyx_v_sources) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_20XmmsSourcePreference_4set(((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)__pyx_v_self), ((PyObject *)__pyx_v_sources));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":119
 * 		return self.sources
 * 
 * 	def set(self, sources):             # <<<<<<<<<<<<<<
 * 		if sources is None:
 * 			self.sources = []
 */

static PyObject *__pyx_pf_7xmmsapi_20XmmsSourcePreference_4set(struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_self, PyObject *__pyx_v_sources) {
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set", 0);

  /* "xmmsapi.pyx":120
 * 
 * 	def set(self, sources):
 * 		if sources is None:             # <<<<<<<<<<<<<<
 * 			self.sources = []
 * 		else:
 */
  __pyx_t_1 = (__pyx_v_sources == Py_None);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":121
 * 	def set(self, sources):
 * 		if sources is None:
 * 			self.sources = []             # <<<<<<<<<<<<<<
 * 		else:
 * 			self.sources = [enforce_unicode(s) for s in sources]
 */
    __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_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->sources);
    __Pyx_DECREF(__pyx_v_self->sources);
    __pyx_v_self->sources = ((PyObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":123
 * 			self.sources = []
 * 		else:
 * 			self.sources = [enforce_unicode(s) for s in sources]             # <<<<<<<<<<<<<<
 * 
 * cdef class XmmsResultTracker:
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyList_CheckExact(__pyx_v_sources) || PyTuple_CheckExact(__pyx_v_sources)) {
      __pyx_t_3 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_sources); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_s);
      __pyx_v_s = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__enforce_unicode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_s);
      __Pyx_GIVEREF(__pyx_v_s);
      __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      if (unlikely(__Pyx_PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(__pyx_v_self->sources);
    __Pyx_DECREF(__pyx_v_self->sources);
    __pyx_v_self->sources = ((PyObject *)__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("xmmsapi.XmmsSourcePreference.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_17XmmsResultTracker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_17XmmsResultTracker_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7xmmsapi_17XmmsResultTracker___cinit__(((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":131
 * 	#cdef object results
 * 
 * 	def __cinit__(self):             # <<<<<<<<<<<<<<
 * 		self.results = []
 * 
 */

static int __pyx_pf_7xmmsapi_17XmmsResultTracker___cinit__(struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":132
 * 
 * 	def __cinit__(self):
 * 		self.results = []             # <<<<<<<<<<<<<<
 * 
 * 	cdef track_result(self, XmmsResult r):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_self->results);
  __Pyx_DECREF(__pyx_v_self->results);
  __pyx_v_self->results = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResultTracker.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":134
 * 		self.results = []
 * 
 * 	cdef track_result(self, XmmsResult r):             # <<<<<<<<<<<<<<
 * 		self.results.append(r)
 * 
 */

static PyObject *__pyx_f_7xmmsapi_17XmmsResultTracker_track_result(struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_self, struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("track_result", 0);

  /* "xmmsapi.pyx":135
 * 
 * 	cdef track_result(self, XmmsResult r):
 * 		self.results.append(r)             # <<<<<<<<<<<<<<
 * 
 * 	cdef release_result(self, XmmsResult r):
 */
  __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_self->results, ((PyObject *)__pyx_v_r)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResultTracker.track_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":137
 * 		self.results.append(r)
 * 
 * 	cdef release_result(self, XmmsResult r):             # <<<<<<<<<<<<<<
 * 		self.results.remove(r)
 * 
 */

static PyObject *__pyx_f_7xmmsapi_17XmmsResultTracker_release_result(struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_self, struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_r) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("release_result", 0);

  /* "xmmsapi.pyx":138
 * 
 * 	cdef release_result(self, XmmsResult r):
 * 		self.results.remove(r)             # <<<<<<<<<<<<<<
 * 
 * 	cdef disconnect_all(self, bint unset_result):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->results, __pyx_n_s__remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_r));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_r));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_r));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsResultTracker.release_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":140
 * 		self.results.remove(r)
 * 
 * 	cdef disconnect_all(self, bint unset_result):             # <<<<<<<<<<<<<<
 * 		cdef XmmsResult r
 * 		for r in self.results[:]: # Create a copy because r.disconnect() will remove the result from the list.
 */

static PyObject *__pyx_f_7xmmsapi_17XmmsResultTracker_disconnect_all(struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_self, int __pyx_v_unset_result) {
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_r = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disconnect_all", 0);

  /* "xmmsapi.pyx":142
 * 	cdef disconnect_all(self, bint unset_result):
 * 		cdef XmmsResult r
 * 		for r in self.results[:]: # Create a copy because r.disconnect() will remove the result from the list.             # <<<<<<<<<<<<<<
 * 			r.disconnect()
 * 			if unset_result: #This would become useless if results didn't xmmsc_ref() the connection.
 */
  __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_self->results, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_r));
    __pyx_v_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "xmmsapi.pyx":143
 * 		cdef XmmsResult r
 * 		for r in self.results[:]: # Create a copy because r.disconnect() will remove the result from the list.
 * 			r.disconnect()             # <<<<<<<<<<<<<<
 * 			if unset_result: #This would become useless if results didn't xmmsc_ref() the connection.
 * 				xmmsc_result_unref(r.res)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_r->__pyx_vtab)->disconnect(__pyx_v_r, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "xmmsapi.pyx":144
 * 		for r in self.results[:]: # Create a copy because r.disconnect() will remove the result from the list.
 * 			r.disconnect()
 * 			if unset_result: #This would become useless if results didn't xmmsc_ref() the connection.             # <<<<<<<<<<<<<<
 * 				xmmsc_result_unref(r.res)
 * 				r.res = NULL
 */
    if (__pyx_v_unset_result) {

      /* "xmmsapi.pyx":145
 * 			r.disconnect()
 * 			if unset_result: #This would become useless if results didn't xmmsc_ref() the connection.
 * 				xmmsc_result_unref(r.res)             # <<<<<<<<<<<<<<
 * 				r.res = NULL
 * 
 */
      xmmsc_result_unref(__pyx_v_r->res);

      /* "xmmsapi.pyx":146
 * 			if unset_result: #This would become useless if results didn't xmmsc_ref() the connection.
 * 				xmmsc_result_unref(r.res)
 * 				r.res = NULL             # <<<<<<<<<<<<<<
 * 
 * cdef class XmmsResult:
 */
      __pyx_v_r->res = NULL;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResultTracker.disconnect_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_10XmmsResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_10XmmsResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult___cinit__(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":160
 * 	#cdef XmmsResultTracker result_tracker
 * 
 * 	def __cinit__(self):             # <<<<<<<<<<<<<<
 * 		self.res = NULL
 * 		self.ispropdict = 0
 */

static int __pyx_pf_7xmmsapi_10XmmsResult___cinit__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":161
 * 
 * 	def __cinit__(self):
 * 		self.res = NULL             # <<<<<<<<<<<<<<
 * 		self.ispropdict = 0
 * 		self._cb_issetup = False
 */
  __pyx_v_self->res = NULL;

  /* "xmmsapi.pyx":162
 * 	def __cinit__(self):
 * 		self.res = NULL
 * 		self.ispropdict = 0             # <<<<<<<<<<<<<<
 * 		self._cb_issetup = False
 * 
 */
  __pyx_v_self->ispropdict = 0;

  /* "xmmsapi.pyx":163
 * 		self.res = NULL
 * 		self.ispropdict = 0
 * 		self._cb_issetup = False             # <<<<<<<<<<<<<<
 * 
 * 	def __dealloc__(self):
 */
  __pyx_v_self->_cb_issetup = 0;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_7xmmsapi_10XmmsResult_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7xmmsapi_10XmmsResult_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7xmmsapi_10XmmsResult_2__dealloc__(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":165
 * 		self._cb_issetup = False
 * 
 * 	def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 		if self.res != NULL:
 * 			xmmsc_result_unref(self.res)
 */

static void __pyx_pf_7xmmsapi_10XmmsResult_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "xmmsapi.pyx":166
 * 
 * 	def __dealloc__(self):
 * 		if self.res != NULL:             # <<<<<<<<<<<<<<
 * 			xmmsc_result_unref(self.res)
 * 			self.res = NULL
 */
  __pyx_t_1 = (__pyx_v_self->res != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":167
 * 	def __dealloc__(self):
 * 		if self.res != NULL:
 * 			xmmsc_result_unref(self.res)             # <<<<<<<<<<<<<<
 * 			self.res = NULL
 * 
 */
    xmmsc_result_unref(__pyx_v_self->res);

    /* "xmmsapi.pyx":168
 * 		if self.res != NULL:
 * 			xmmsc_result_unref(self.res)
 * 			self.res = NULL             # <<<<<<<<<<<<<<
 * 
 * 	cdef set_sourcepref(self, XmmsSourcePreference sourcepref):
 */
    __pyx_v_self->res = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":170
 * 			self.res = NULL
 * 
 * 	cdef set_sourcepref(self, XmmsSourcePreference sourcepref):             # <<<<<<<<<<<<<<
 * 		self.source_pref = sourcepref
 * 	cdef set_result(self, xmmsc_result_t *res):
 */

static PyObject *__pyx_f_7xmmsapi_10XmmsResult_set_sourcepref(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, struct __pyx_obj_7xmmsapi_XmmsSourcePreference *__pyx_v_sourcepref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_sourcepref", 0);

  /* "xmmsapi.pyx":171
 * 
 * 	cdef set_sourcepref(self, XmmsSourcePreference sourcepref):
 * 		self.source_pref = sourcepref             # <<<<<<<<<<<<<<
 * 	cdef set_result(self, xmmsc_result_t *res):
 * 		self.res = res
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_sourcepref));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_sourcepref));
  __Pyx_GOTREF(__pyx_v_self->source_pref);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_pref));
  __pyx_v_self->source_pref = __pyx_v_sourcepref;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":172
 * 	cdef set_sourcepref(self, XmmsSourcePreference sourcepref):
 * 		self.source_pref = sourcepref
 * 	cdef set_result(self, xmmsc_result_t *res):             # <<<<<<<<<<<<<<
 * 		self.res = res
 * 	cdef set_callback(self, XmmsResultTracker rt, cb):
 */

static PyObject *__pyx_f_7xmmsapi_10XmmsResult_set_result(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, xmmsc_result_t *__pyx_v_res) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_result", 0);

  /* "xmmsapi.pyx":173
 * 		self.source_pref = sourcepref
 * 	cdef set_result(self, xmmsc_result_t *res):
 * 		self.res = res             # <<<<<<<<<<<<<<
 * 	cdef set_callback(self, XmmsResultTracker rt, cb):
 * 		"""
 */
  __pyx_v_self->res = __pyx_v_res;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":174
 * 	cdef set_result(self, xmmsc_result_t *res):
 * 		self.res = res
 * 	cdef set_callback(self, XmmsResultTracker rt, cb):             # <<<<<<<<<<<<<<
 * 		"""
 * 		Set a callback function for a result
 */

static PyObject *__pyx_f_7xmmsapi_10XmmsResult_set_callback(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, struct __pyx_obj_7xmmsapi_XmmsResultTracker *__pyx_v_rt, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_callback", 0);

  /* "xmmsapi.pyx":178
 * 		Set a callback function for a result
 * 		"""
 * 		if cb is not None and not hasattr(cb, '__call__'):             # <<<<<<<<<<<<<<
 * 			raise TypeError("Type '%s' is not callable"%cb.__class__.__name__)
 * 		self._cb = cb
 */
  __pyx_t_1 = (__pyx_v_cb != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = ((PyObject *)__pyx_n_s____call__);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyObject_HasAttr(__pyx_v_cb, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":179
 * 		"""
 * 		if cb is not None and not hasattr(cb, '__call__'):
 * 			raise TypeError("Type '%s' is not callable"%cb.__class__.__name__)             # <<<<<<<<<<<<<<
 * 		self._cb = cb
 * 		if cb is not None and not self._cb_issetup:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_cb, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":180
 * 		if cb is not None and not hasattr(cb, '__call__'):
 * 			raise TypeError("Type '%s' is not callable"%cb.__class__.__name__)
 * 		self._cb = cb             # <<<<<<<<<<<<<<
 * 		if cb is not None and not self._cb_issetup:
 * 			self.result_tracker = rt
 */
  __Pyx_INCREF(__pyx_v_cb);
  __Pyx_GIVEREF(__pyx_v_cb);
  __Pyx_GOTREF(__pyx_v_self->_cb);
  __Pyx_DECREF(__pyx_v_self->_cb);
  __pyx_v_self->_cb = __pyx_v_cb;

  /* "xmmsapi.pyx":181
 * 			raise TypeError("Type '%s' is not callable"%cb.__class__.__name__)
 * 		self._cb = cb
 * 		if cb is not None and not self._cb_issetup:             # <<<<<<<<<<<<<<
 * 			self.result_tracker = rt
 * 			rt.track_result(self)
 */
  __pyx_t_3 = (__pyx_v_cb != Py_None);
  if (__pyx_t_3) {
    __pyx_t_1 = (!__pyx_v_self->_cb_issetup);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":182
 * 		self._cb = cb
 * 		if cb is not None and not self._cb_issetup:
 * 			self.result_tracker = rt             # <<<<<<<<<<<<<<
 * 			rt.track_result(self)
 * 			xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *> self, ResultDestroyNotifier)
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_rt));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_rt));
    __Pyx_GOTREF(__pyx_v_self->result_tracker);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->result_tracker));
    __pyx_v_self->result_tracker = __pyx_v_rt;

    /* "xmmsapi.pyx":183
 * 		if cb is not None and not self._cb_issetup:
 * 			self.result_tracker = rt
 * 			rt.track_result(self)             # <<<<<<<<<<<<<<
 * 			xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *> self, ResultDestroyNotifier)
 * 			self._cb_issetup = True
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker *)__pyx_v_rt->__pyx_vtab)->track_result(__pyx_v_rt, __pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "xmmsapi.pyx":184
 * 			self.result_tracker = rt
 * 			rt.track_result(self)
 * 			xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *> self, ResultDestroyNotifier)             # <<<<<<<<<<<<<<
 * 			self._cb_issetup = True
 * 
 */
    xmmsc_result_notifier_set_full(__pyx_v_self->res, __pyx_f_7xmmsapi_ResultNotifier, ((void *)__pyx_v_self), __pyx_f_7xmmsapi_ResultDestroyNotifier);

    /* "xmmsapi.pyx":185
 * 			rt.track_result(self)
 * 			xmmsc_result_notifier_set_full(self.res, ResultNotifier, <void *> self, ResultDestroyNotifier)
 * 			self._cb_issetup = True             # <<<<<<<<<<<<<<
 * 
 * 	cpdef disconnect(self):
 */
    __pyx_v_self->_cb_issetup = 1;
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.set_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":187
 * 			self._cb_issetup = True
 * 
 * 	cpdef disconnect(self):             # <<<<<<<<<<<<<<
 * 		self._cb = None
 * 		if self._cb_issetup and self.res != NULL:
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_5disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_disconnect(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disconnect", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__disconnect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_5disconnect)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":188
 * 
 * 	cpdef disconnect(self):
 * 		self._cb = None             # <<<<<<<<<<<<<<
 * 		if self._cb_issetup and self.res != NULL:
 * 			self._cb_issetup = False
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_cb);
  __Pyx_DECREF(__pyx_v_self->_cb);
  __pyx_v_self->_cb = Py_None;

  /* "xmmsapi.pyx":189
 * 	cpdef disconnect(self):
 * 		self._cb = None
 * 		if self._cb_issetup and self.res != NULL:             # <<<<<<<<<<<<<<
 * 			self._cb_issetup = False
 * 			#xmmsc_result_ref(self.res) # Needed ? oO
 */
  if (__pyx_v_self->_cb_issetup) {
    __pyx_t_3 = (__pyx_v_self->res != NULL);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_v_self->_cb_issetup;
  }
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":190
 * 		self._cb = None
 * 		if self._cb_issetup and self.res != NULL:
 * 			self._cb_issetup = False             # <<<<<<<<<<<<<<
 * 			#xmmsc_result_ref(self.res) # Needed ? oO
 * 			xmmsc_result_disconnect(self.res) #self.result_tracker.release_result() called in ResultDestroyNotifier()
 */
    __pyx_v_self->_cb_issetup = 0;

    /* "xmmsapi.pyx":192
 * 			self._cb_issetup = False
 * 			#xmmsc_result_ref(self.res) # Needed ? oO
 * 			xmmsc_result_disconnect(self.res) #self.result_tracker.release_result() called in ResultDestroyNotifier()             # <<<<<<<<<<<<<<
 * 
 * 	property callback:
 */
    xmmsc_result_disconnect(__pyx_v_self->res);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_5disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_5disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disconnect (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_4disconnect(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":187
 * 			self._cb_issetup = True
 * 
 * 	cpdef disconnect(self):             # <<<<<<<<<<<<<<
 * 		self._cb = None
 * 		if self._cb_issetup and self.res != NULL:
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_4disconnect(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disconnect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->disconnect(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_8callback___get__(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":195
 * 
 * 	property callback:
 * 		def __get__(self):             # <<<<<<<<<<<<<<
 * 			return self._cb
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_8callback___get__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "xmmsapi.pyx":196
 * 	property callback:
 * 		def __get__(self):
 * 			return self._cb             # <<<<<<<<<<<<<<
 * 
 * 	# XXX Kept for compatibility.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_cb);
  __pyx_r = __pyx_v_self->_cb;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_7_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_10XmmsResult_6_callback[] = "\n\t\t@deprecated\n\t\tUse __call__ instead.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_7_callback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_callback (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_6_callback(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":200
 * 	# XXX Kept for compatibility.
 * 	@deprecated
 * 	def _callback(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_6_callback(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_v_traceback = NULL;
  PyObject *__pyx_v_sys = NULL;
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_callback", 0);

  /* "xmmsapi.pyx":205
 * 		Use __call__ instead.
 * 		"""
 * 		try:             # <<<<<<<<<<<<<<
 * 			ret = self()
 * 		except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "xmmsapi.pyx":206
 * 		"""
 * 		try:
 * 			ret = self()             # <<<<<<<<<<<<<<
 * 		except:
 * 			import traceback, sys
 */
      __pyx_t_4 = PyObject_Call(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_ret = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "xmmsapi.pyx":207
 * 		try:
 * 			ret = self()
 * 		except:             # <<<<<<<<<<<<<<
 * 			import traceback, sys
 * 			exc = sys.exc_info()
 */
    /*except:*/ {
      __Pyx_AddTraceback("xmmsapi.XmmsResult._callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "xmmsapi.pyx":208
 * 			ret = self()
 * 		except:
 * 			import traceback, sys             # <<<<<<<<<<<<<<
 * 			exc = sys.exc_info()
 * 			traceback.print_exception(exc[0], exc[1], exc[2])
 */
      __pyx_t_7 = __Pyx_Import(((PyObject *)__pyx_n_s__traceback), 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_traceback = __pyx_t_7;
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_sys = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "xmmsapi.pyx":209
 * 		except:
 * 			import traceback, sys
 * 			exc = sys.exc_info()             # <<<<<<<<<<<<<<
 * 			traceback.print_exception(exc[0], exc[1], exc[2])
 * 			return False
 */
      __pyx_t_7 = PyObject_GetAttr(__pyx_v_sys, __pyx_n_s__exc_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_exc = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "xmmsapi.pyx":210
 * 			import traceback, sys
 * 			exc = sys.exc_info()
 * 			traceback.print_exception(exc[0], exc[1], exc[2])             # <<<<<<<<<<<<<<
 * 			return False
 * 		return ret
 */
      __pyx_t_8 = PyObject_GetAttr(__pyx_v_traceback, __pyx_n_s__print_exception); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_exc, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_exc, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_exc, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_7 = 0;
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "xmmsapi.pyx":211
 * 			exc = sys.exc_info()
 * 			traceback.print_exception(exc[0], exc[1], exc[2])
 * 			return False             # <<<<<<<<<<<<<<
 * 		return ret
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "xmmsapi.pyx":212
 * 			traceback.print_exception(exc[0], exc[1], exc[2])
 * 			return False
 * 		return ret             # <<<<<<<<<<<<<<
 * 
 * 	def __call__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("xmmsapi.XmmsResult._callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_traceback);
  __Pyx_XDECREF(__pyx_v_sys);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_9__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_9__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL;
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_8__call__(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":214
 * 		return ret
 * 
 * 	def __call__(self):             # <<<<<<<<<<<<<<
 * 		cb = self.callback
 * 		if cb is not None:
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_8__call__(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_v_cb = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "xmmsapi.pyx":215
 * 
 * 	def __call__(self):
 * 		cb = self.callback             # <<<<<<<<<<<<<<
 * 		if cb is not None:
 * 			ret = cb(self.xmmsvalue())
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__callback); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cb = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":216
 * 	def __call__(self):
 * 		cb = self.callback
 * 		if cb is not None:             # <<<<<<<<<<<<<<
 * 			ret = cb(self.xmmsvalue())
 * 			return True if ret is None else ret
 */
  __pyx_t_2 = (__pyx_v_cb != Py_None);
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":217
 * 		cb = self.callback
 * 		if cb is not None:
 * 			ret = cb(self.xmmsvalue())             # <<<<<<<<<<<<<<
 * 			return True if ret is None else ret
 * 		return False
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->xmmsvalue(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_v_cb, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_ret = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "xmmsapi.pyx":218
 * 		if cb is not None:
 * 			ret = cb(self.xmmsvalue())
 * 			return True if ret is None else ret             # <<<<<<<<<<<<<<
 * 		return False
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = (__pyx_v_ret == Py_None);
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_v_ret);
      __pyx_t_1 = __pyx_v_ret;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":219
 * 			ret = cb(self.xmmsvalue())
 * 			return True if ret is None else ret
 * 		return False             # <<<<<<<<<<<<<<
 * 
 * 	cpdef wait(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":221
 * 		return False
 * 
 * 	cpdef wait(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		Wait for the result from the daemon.
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_11wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_wait(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__wait); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_11wait)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":225
 * 		Wait for the result from the daemon.
 * 		"""
 * 		if self.res == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("Uninitialized result")
 * 
 */
  __pyx_t_3 = (__pyx_v_self->res == NULL);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":226
 * 		"""
 * 		if self.res == NULL:
 * 			raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 
 * 		xmmsc_result_wait(self.res)
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":228
 * 			raise RuntimeError("Uninitialized result")
 * 
 * 		xmmsc_result_wait(self.res)             # <<<<<<<<<<<<<<
 * 
 * 		# XXX Never used.
 */
  xmmsc_result_wait(__pyx_v_self->res);

  /* "xmmsapi.pyx":231
 * 
 * 		# XXX Never used.
 * 		if self._exc is not None:             # <<<<<<<<<<<<<<
 * 			raise self._exc[0], self._exc[1], self._exc[2]
 * 
 */
  __pyx_t_3 = (__pyx_v_self->_exc != Py_None);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":232
 * 		# XXX Never used.
 * 		if self._exc is not None:
 * 			raise self._exc[0], self._exc[1], self._exc[2]             # <<<<<<<<<<<<<<
 * 
 * 	cpdef is_error(self):
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_exc, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->_exc, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->_exc, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_1, __pyx_t_2, __pyx_t_4, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_11wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_10XmmsResult_10wait[] = "\n\t\tWait for the result from the daemon.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_11wait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_10wait(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":221
 * 		return False
 * 
 * 	cpdef wait(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		Wait for the result from the daemon.
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_10wait(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->wait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":234
 * 			raise self._exc[0], self._exc[1], self._exc[2]
 * 
 * 	cpdef is_error(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@return: Whether the result represents an error or not.
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_13is_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_is_error(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_13is_error)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":239
 * 		@rtype: Boolean
 * 		"""
 * 		return self._value().is_error()             # <<<<<<<<<<<<<<
 * 
 * 	cpdef iserror(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->_value(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.is_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_13is_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_10XmmsResult_12is_error[] = "\n\t\t@return: Whether the result represents an error or not.\n\t\t@rtype: Boolean\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_13is_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_error (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_12is_error(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":234
 * 			raise self._exc[0], self._exc[1], self._exc[2]
 * 
 * 	cpdef is_error(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@return: Whether the result represents an error or not.
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_12is_error(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->is_error(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.is_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":241
 * 		return self._value().is_error()
 * 
 * 	cpdef iserror(self):             # <<<<<<<<<<<<<<
 * 		return self.is_error()
 * 
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_15iserror(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_iserror(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("iserror", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__iserror); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_15iserror)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":242
 * 
 * 	cpdef iserror(self):
 * 		return self.is_error()             # <<<<<<<<<<<<<<
 * 
 * 	cpdef xmmsvalue(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->is_error(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.iserror", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_15iserror(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_15iserror(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iserror (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_14iserror(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":241
 * 		return self._value().is_error()
 * 
 * 	cpdef iserror(self):             # <<<<<<<<<<<<<<
 * 		return self.is_error()
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_14iserror(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("iserror", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->iserror(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.iserror", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":244
 * 		return self.is_error()
 * 
 * 	cpdef xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		cdef XmmsValue obj
 * 		cdef xmmsv_t *value
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_17xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9xmmsvalue_XmmsValue *__pyx_v_obj = 0;
  xmmsv_t *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  struct __pyx_opt_args_9xmmsvalue_9XmmsValue_set_value __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xmmsvalue", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__xmmsvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_17xmmsvalue)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":247
 * 		cdef XmmsValue obj
 * 		cdef xmmsv_t *value
 * 		if self.res == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("Uninitialized result")
 * 		value = xmmsc_result_get_value(self.res)
 */
  __pyx_t_3 = (__pyx_v_self->res == NULL);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":248
 * 		cdef xmmsv_t *value
 * 		if self.res == NULL:
 * 			raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 		value = xmmsc_result_get_value(self.res)
 * 		obj = XmmsValue(self.source_pref.get())
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":249
 * 		if self.res == NULL:
 * 			raise RuntimeError("Uninitialized result")
 * 		value = xmmsc_result_get_value(self.res)             # <<<<<<<<<<<<<<
 * 		obj = XmmsValue(self.source_pref.get())
 * 		obj.set_value(value, self.ispropdict)
 */
  __pyx_v_value = xmmsc_result_get_value(__pyx_v_self->res);

  /* "xmmsapi.pyx":250
 * 			raise RuntimeError("Uninitialized result")
 * 		value = xmmsc_result_get_value(self.res)
 * 		obj = XmmsValue(self.source_pref.get())             # <<<<<<<<<<<<<<
 * 		obj.set_value(value, self.ispropdict)
 * 		return obj
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->source_pref), __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9xmmsvalue_XmmsValue)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_obj = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":251
 * 		value = xmmsc_result_get_value(self.res)
 * 		obj = XmmsValue(self.source_pref.get())
 * 		obj.set_value(value, self.ispropdict)             # <<<<<<<<<<<<<<
 * 		return obj
 * 
 */
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.ispropdict = __pyx_v_self->ispropdict;
  __pyx_t_2 = ((struct __pyx_vtabstruct_9xmmsvalue_XmmsValue *)__pyx_v_obj->__pyx_vtab)->set_value(__pyx_v_obj, __pyx_v_value, &__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":252
 * 		obj = XmmsValue(self.source_pref.get())
 * 		obj.set_value(value, self.ispropdict)
 * 		return obj             # <<<<<<<<<<<<<<
 * 
 * 	cpdef _value(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_17xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_17xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xmmsvalue (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_16xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":244
 * 		return self.is_error()
 * 
 * 	cpdef xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		cdef XmmsValue obj
 * 		cdef xmmsv_t *value
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_16xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xmmsvalue", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->xmmsvalue(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":254
 * 		return obj
 * 
 * 	cpdef _value(self):             # <<<<<<<<<<<<<<
 * 		return self.xmmsvalue()
 * 
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_19_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult__value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_19_value)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":255
 * 
 * 	cpdef _value(self):
 * 		return self.xmmsvalue()             # <<<<<<<<<<<<<<
 * 
 * 	cpdef value(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->xmmsvalue(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult._value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_19_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_19_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_value (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_18_value(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":254
 * 		return obj
 * 
 * 	cpdef _value(self):             # <<<<<<<<<<<<<<
 * 		return self.xmmsvalue()
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_18_value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult._value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":257
 * 		return self.xmmsvalue()
 * 
 * 	cpdef value(self):             # <<<<<<<<<<<<<<
 * 		return self.xmmsvalue().value()
 * 
 */

static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_10XmmsResult_value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_21value)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":258
 * 
 * 	cpdef value(self):
 * 		return self.xmmsvalue().value()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->xmmsvalue(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_10XmmsResult_21value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_10XmmsResult_20value(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":257
 * 		return self.xmmsvalue()
 * 
 * 	cpdef value(self):             # <<<<<<<<<<<<<<
 * 		return self.xmmsvalue().value()
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_10XmmsResult_20value(struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsResult.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_13XmmsVisResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_13XmmsVisResult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7xmmsapi_13XmmsVisResult___cinit__(((struct __pyx_obj_7xmmsapi_XmmsVisResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":266
 * 	#cdef xmmsc_connection_t *conn
 * 
 * 	def __cinit__(self):             # <<<<<<<<<<<<<<
 * 		self.command = VIS_RESULT_CMD_NONE
 * 		self.conn = NULL
 */

static int __pyx_pf_7xmmsapi_13XmmsVisResult___cinit__(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":267
 * 
 * 	def __cinit__(self):
 * 		self.command = VIS_RESULT_CMD_NONE             # <<<<<<<<<<<<<<
 * 		self.conn = NULL
 * 
 */
  __pyx_v_self->command = __pyx_e_7xmmsapi_VIS_RESULT_CMD_NONE;

  /* "xmmsapi.pyx":268
 * 	def __cinit__(self):
 * 		self.command = VIS_RESULT_CMD_NONE
 * 		self.conn = NULL             # <<<<<<<<<<<<<<
 * 
 * 	def __dealloc__(self):
 */
  __pyx_v_self->conn = NULL;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_7xmmsapi_13XmmsVisResult_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7xmmsapi_13XmmsVisResult_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7xmmsapi_13XmmsVisResult_2__dealloc__(((struct __pyx_obj_7xmmsapi_XmmsVisResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":270
 * 		self.conn = NULL
 * 
 * 	def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 */

static void __pyx_pf_7xmmsapi_13XmmsVisResult_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "xmmsapi.pyx":271
 * 
 * 	def __dealloc__(self):
 * 		if self.conn != NULL:             # <<<<<<<<<<<<<<
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 */
  __pyx_t_1 = (__pyx_v_self->conn != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":272
 * 	def __dealloc__(self):
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)             # <<<<<<<<<<<<<<
 * 			self.conn = NULL
 * 
 */
    xmmsc_unref(__pyx_v_self->conn);

    /* "xmmsapi.pyx":273
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL             # <<<<<<<<<<<<<<
 * 
 * 	cdef set_command(self, VisResultCommand cmd, xmmsc_connection_t *conn):
 */
    __pyx_v_self->conn = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":275
 * 			self.conn = NULL
 * 
 * 	cdef set_command(self, VisResultCommand cmd, xmmsc_connection_t *conn):             # <<<<<<<<<<<<<<
 * 		self.command = cmd
 * 		if self.conn != NULL:
 */

static PyObject *__pyx_f_7xmmsapi_13XmmsVisResult_set_command(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self, __pyx_t_7xmmsapi_VisResultCommand __pyx_v_cmd, xmmsc_connection_t *__pyx_v_conn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_command", 0);

  /* "xmmsapi.pyx":276
 * 
 * 	cdef set_command(self, VisResultCommand cmd, xmmsc_connection_t *conn):
 * 		self.command = cmd             # <<<<<<<<<<<<<<
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 */
  __pyx_v_self->command = __pyx_v_cmd;

  /* "xmmsapi.pyx":277
 * 	cdef set_command(self, VisResultCommand cmd, xmmsc_connection_t *conn):
 * 		self.command = cmd
 * 		if self.conn != NULL:             # <<<<<<<<<<<<<<
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 */
  __pyx_t_1 = (__pyx_v_self->conn != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":278
 * 		self.command = cmd
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)             # <<<<<<<<<<<<<<
 * 			self.conn = NULL
 * 		if conn != NULL:
 */
    xmmsc_unref(__pyx_v_self->conn);

    /* "xmmsapi.pyx":279
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL             # <<<<<<<<<<<<<<
 * 		if conn != NULL:
 * 			self.conn = xmmsc_ref(conn)
 */
    __pyx_v_self->conn = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":280
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 * 		if conn != NULL:             # <<<<<<<<<<<<<<
 * 			self.conn = xmmsc_ref(conn)
 * 
 */
  __pyx_t_1 = (__pyx_v_conn != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":281
 * 			self.conn = NULL
 * 		if conn != NULL:
 * 			self.conn = xmmsc_ref(conn)             # <<<<<<<<<<<<<<
 * 
 * 	cdef retrieve_error(self):
 */
    __pyx_v_self->conn = xmmsc_ref(__pyx_v_conn);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":283
 * 			self.conn = xmmsc_ref(conn)
 * 
 * 	cdef retrieve_error(self):             # <<<<<<<<<<<<<<
 * 		cdef xmmsv_t *errval
 * 		xval = XmmsResult.xmmsvalue(self)
 */

static PyObject *__pyx_f_7xmmsapi_13XmmsVisResult_retrieve_error(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  xmmsv_t *__pyx_v_errval;
  PyObject *__pyx_v_xval = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("retrieve_error", 0);

  /* "xmmsapi.pyx":285
 * 	cdef retrieve_error(self):
 * 		cdef xmmsv_t *errval
 * 		xval = XmmsResult.xmmsvalue(self)             # <<<<<<<<<<<<<<
 * 		if xval.is_error():
 * 			self._val = xval
 */
  __pyx_t_1 = __pyx_vtabptr_7xmmsapi_XmmsResult->xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xval = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":286
 * 		cdef xmmsv_t *errval
 * 		xval = XmmsResult.xmmsvalue(self)
 * 		if xval.is_error():             # <<<<<<<<<<<<<<
 * 			self._val = xval
 * 		else:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_xval, __pyx_n_s__is_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":287
 * 		xval = XmmsResult.xmmsvalue(self)
 * 		if xval.is_error():
 * 			self._val = xval             # <<<<<<<<<<<<<<
 * 		else:
 * 			self._val = XmmsValue()
 */
    if (!(likely(((__pyx_v_xval) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_xval, __pyx_ptype_9xmmsvalue_XmmsValue))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_xval);
    __Pyx_GIVEREF(__pyx_v_xval);
    __Pyx_GOTREF(__pyx_v_self->_val);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->_val));
    __pyx_v_self->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_v_xval);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":289
 * 			self._val = xval
 * 		else:
 * 			self._val = XmmsValue()             # <<<<<<<<<<<<<<
 * 			errval = xmmsv_new_error("Failed to initialize visualization")
 * 			self._val.set_value(errval)
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9xmmsvalue_XmmsValue)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_val);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->_val));
    __pyx_v_self->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "xmmsapi.pyx":290
 * 		else:
 * 			self._val = XmmsValue()
 * 			errval = xmmsv_new_error("Failed to initialize visualization")             # <<<<<<<<<<<<<<
 * 			self._val.set_value(errval)
 * 			xmmsv_unref(errval)
 */
    __pyx_v_errval = xmmsv_new_error(__pyx_k_14);

    /* "xmmsapi.pyx":291
 * 			self._val = XmmsValue()
 * 			errval = xmmsv_new_error("Failed to initialize visualization")
 * 			self._val.set_value(errval)             # <<<<<<<<<<<<<<
 * 			xmmsv_unref(errval)
 * 
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_9xmmsvalue_XmmsValue *)__pyx_v_self->_val->__pyx_vtab)->set_value(__pyx_v_self->_val, __pyx_v_errval, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "xmmsapi.pyx":292
 * 			errval = xmmsv_new_error("Failed to initialize visualization")
 * 			self._val.set_value(errval)
 * 			xmmsv_unref(errval)             # <<<<<<<<<<<<<<
 * 
 * 	cdef _init_xmmsvalue(self):
 */
    xmmsv_unref(__pyx_v_errval);
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsVisResult.retrieve_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xval);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":294
 * 			xmmsv_unref(errval)
 * 
 * 	cdef _init_xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		if self._val is None:
 * 			if self.res == NULL:
 */

static PyObject *__pyx_f_7xmmsapi_13XmmsVisResult__init_xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  int __pyx_v_hid;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_xmmsvalue", 0);

  /* "xmmsapi.pyx":295
 * 
 * 	cdef _init_xmmsvalue(self):
 * 		if self._val is None:             # <<<<<<<<<<<<<<
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_val) == Py_None);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":296
 * 	cdef _init_xmmsvalue(self):
 * 		if self._val is None:
 * 			if self.res == NULL:             # <<<<<<<<<<<<<<
 * 				raise RuntimeError("Uninitialized result")
 * 			hid = xmmsc_visualization_init_handle(self.res)
 */
    __pyx_t_1 = (__pyx_v_self->__pyx_base.res == NULL);
    if (__pyx_t_1) {

      /* "xmmsapi.pyx":297
 * 		if self._val is None:
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 			hid = xmmsc_visualization_init_handle(self.res)
 * 			if hid == -1:
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "xmmsapi.pyx":298
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")
 * 			hid = xmmsc_visualization_init_handle(self.res)             # <<<<<<<<<<<<<<
 * 			if hid == -1:
 * 				self.retrieve_error()
 */
    __pyx_v_hid = xmmsc_visualization_init_handle(__pyx_v_self->__pyx_base.res);

    /* "xmmsapi.pyx":299
 * 				raise RuntimeError("Uninitialized result")
 * 			hid = xmmsc_visualization_init_handle(self.res)
 * 			if hid == -1:             # <<<<<<<<<<<<<<
 * 				self.retrieve_error()
 * 			else:
 */
    __pyx_t_1 = (__pyx_v_hid == -1);
    if (__pyx_t_1) {

      /* "xmmsapi.pyx":300
 * 			hid = xmmsc_visualization_init_handle(self.res)
 * 			if hid == -1:
 * 				self.retrieve_error()             # <<<<<<<<<<<<<<
 * 			else:
 * 				self._val = XmmsValue(pyval=hid)
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->retrieve_error(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "xmmsapi.pyx":302
 * 				self.retrieve_error()
 * 			else:
 * 				self._val = XmmsValue(pyval=hid)             # <<<<<<<<<<<<<<
 * 		return self._val
 * 
 */
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_3 = PyInt_FromLong(__pyx_v_hid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__pyval), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9xmmsvalue_XmmsValue)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->_val);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->_val));
      __pyx_v_self->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":303
 * 			else:
 * 				self._val = XmmsValue(pyval=hid)
 * 		return self._val             # <<<<<<<<<<<<<<
 * 
 * 	cdef _start_xmmsvalue(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsVisResult._init_xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":305
 * 		return self._val
 * 
 * 	cdef _start_xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		if self._val is None:
 * 			if self.res == NULL:
 */

static PyObject *__pyx_f_7xmmsapi_13XmmsVisResult__start_xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  PyObject *__pyx_v_xval = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_start_xmmsvalue", 0);

  /* "xmmsapi.pyx":306
 * 
 * 	cdef _start_xmmsvalue(self):
 * 		if self._val is None:             # <<<<<<<<<<<<<<
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_val) == Py_None);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":307
 * 	cdef _start_xmmsvalue(self):
 * 		if self._val is None:
 * 			if self.res == NULL:             # <<<<<<<<<<<<<<
 * 				raise RuntimeError("Uninitialized result")
 * 			xval = XmmsResult.xmmsvalue(self)
 */
    __pyx_t_1 = (__pyx_v_self->__pyx_base.res == NULL);
    if (__pyx_t_1) {

      /* "xmmsapi.pyx":308
 * 		if self._val is None:
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 			xval = XmmsResult.xmmsvalue(self)
 * 			if xval.is_error():
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "xmmsapi.pyx":309
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")
 * 			xval = XmmsResult.xmmsvalue(self)             # <<<<<<<<<<<<<<
 * 			if xval.is_error():
 * 				self._val = xval
 */
    __pyx_t_2 = __pyx_vtabptr_7xmmsapi_XmmsResult->xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self), 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xval = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "xmmsapi.pyx":310
 * 				raise RuntimeError("Uninitialized result")
 * 			xval = XmmsResult.xmmsvalue(self)
 * 			if xval.is_error():             # <<<<<<<<<<<<<<
 * 				self._val = xval
 * 			elif self.conn == NULL:
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_xval, __pyx_n_s__is_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "xmmsapi.pyx":311
 * 			xval = XmmsResult.xmmsvalue(self)
 * 			if xval.is_error():
 * 				self._val = xval             # <<<<<<<<<<<<<<
 * 			elif self.conn == NULL:
 * 				raise RuntimeError("Internal connection reference not set")
 */
      if (!(likely(((__pyx_v_xval) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_xval, __pyx_ptype_9xmmsvalue_XmmsValue))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_INCREF(__pyx_v_xval);
      __Pyx_GIVEREF(__pyx_v_xval);
      __Pyx_GOTREF(__pyx_v_self->_val);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->_val));
      __pyx_v_self->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_v_xval);
      goto __pyx_L5;
    }

    /* "xmmsapi.pyx":312
 * 			if xval.is_error():
 * 				self._val = xval
 * 			elif self.conn == NULL:             # <<<<<<<<<<<<<<
 * 				raise RuntimeError("Internal connection reference not set")
 * 			else:
 */
    __pyx_t_1 = (__pyx_v_self->conn == NULL);
    if (__pyx_t_1) {

      /* "xmmsapi.pyx":313
 * 				self._val = xval
 * 			elif self.conn == NULL:
 * 				raise RuntimeError("Internal connection reference not set")             # <<<<<<<<<<<<<<
 * 			else:
 * 				xmmsc_visualization_start_handle(self.conn, self.res)
 */
      __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    /*else*/ {

      /* "xmmsapi.pyx":315
 * 				raise RuntimeError("Internal connection reference not set")
 * 			else:
 * 				xmmsc_visualization_start_handle(self.conn, self.res)             # <<<<<<<<<<<<<<
 * 				self._val = XmmsValue(pyval=None)
 * 		return self._val
 */
      xmmsc_visualization_start_handle(__pyx_v_self->conn, __pyx_v_self->__pyx_base.res);

      /* "xmmsapi.pyx":316
 * 			else:
 * 				xmmsc_visualization_start_handle(self.conn, self.res)
 * 				self._val = XmmsValue(pyval=None)             # <<<<<<<<<<<<<<
 * 		return self._val
 * 
 */
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__pyval), Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9xmmsvalue_XmmsValue)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_val);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->_val));
      __pyx_v_self->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L5:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":317
 * 				xmmsc_visualization_start_handle(self.conn, self.res)
 * 				self._val = XmmsValue(pyval=None)
 * 		return self._val             # <<<<<<<<<<<<<<
 * 
 * 	cpdef xmmsvalue(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->_val));
  __pyx_r = ((PyObject *)__pyx_v_self->_val);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsVisResult._start_xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xval);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":319
 * 		return self._val
 * 
 * 	cpdef xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		if self.command == VIS_RESULT_CMD_INIT:
 * 			return self._init_xmmsvalue()
 */

static PyObject *__pyx_pw_7xmmsapi_13XmmsVisResult_5xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_13XmmsVisResult_xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xmmsvalue", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__xmmsvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_13XmmsVisResult_5xmmsvalue)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":322
 * 		if self.command == VIS_RESULT_CMD_INIT:
 * 			return self._init_xmmsvalue()
 * 		elif self.command == VIS_RESULT_CMD_START:             # <<<<<<<<<<<<<<
 * 			return self._start_xmmsvalue()
 * 		else:
 */
  switch (__pyx_v_self->command) {

    /* "xmmsapi.pyx":320
 * 
 * 	cpdef xmmsvalue(self):
 * 		if self.command == VIS_RESULT_CMD_INIT:             # <<<<<<<<<<<<<<
 * 			return self._init_xmmsvalue()
 * 		elif self.command == VIS_RESULT_CMD_START:
 */
    case __pyx_e_7xmmsapi_VIS_RESULT_CMD_INIT:

    /* "xmmsapi.pyx":321
 * 	cpdef xmmsvalue(self):
 * 		if self.command == VIS_RESULT_CMD_INIT:
 * 			return self._init_xmmsvalue()             # <<<<<<<<<<<<<<
 * 		elif self.command == VIS_RESULT_CMD_START:
 * 			return self._start_xmmsvalue()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->_init_xmmsvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "xmmsapi.pyx":322
 * 		if self.command == VIS_RESULT_CMD_INIT:
 * 			return self._init_xmmsvalue()
 * 		elif self.command == VIS_RESULT_CMD_START:             # <<<<<<<<<<<<<<
 * 			return self._start_xmmsvalue()
 * 		else:
 */
    case __pyx_e_7xmmsapi_VIS_RESULT_CMD_START:

    /* "xmmsapi.pyx":323
 * 			return self._init_xmmsvalue()
 * 		elif self.command == VIS_RESULT_CMD_START:
 * 			return self._start_xmmsvalue()             # <<<<<<<<<<<<<<
 * 		else:
 * 			# XXX Raise an exception ?
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->_start_xmmsvalue(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "xmmsapi.pyx":326
 * 		else:
 * 			# XXX Raise an exception ?
 * 			return XmmsResult.xmmsvalue(self)             # <<<<<<<<<<<<<<
 * 
 * cdef class XmmsVisChunk:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_vtabptr_7xmmsapi_XmmsResult->xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsVisResult.xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_13XmmsVisResult_5xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_13XmmsVisResult_5xmmsvalue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xmmsvalue (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_13XmmsVisResult_4xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsVisResult *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":319
 * 		return self._val
 * 
 * 	cpdef xmmsvalue(self):             # <<<<<<<<<<<<<<
 * 		if self.command == VIS_RESULT_CMD_INIT:
 * 			return self._init_xmmsvalue()
 */

static PyObject *__pyx_pf_7xmmsapi_13XmmsVisResult_4xmmsvalue(struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xmmsvalue", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.xmmsvalue(((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsVisResult.xmmsvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_12XmmsVisChunk_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_12XmmsVisChunk_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7xmmsapi_12XmmsVisChunk___cinit__(((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":332
 * 	#cdef int sample_count
 * 
 * 	def __cinit__(self):             # <<<<<<<<<<<<<<
 * 		self.data = NULL
 * 		self.sample_count = 0
 */

static int __pyx_pf_7xmmsapi_12XmmsVisChunk___cinit__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":333
 * 
 * 	def __cinit__(self):
 * 		self.data = NULL             # <<<<<<<<<<<<<<
 * 		self.sample_count = 0
 * 
 */
  __pyx_v_self->data = NULL;

  /* "xmmsapi.pyx":334
 * 	def __cinit__(self):
 * 		self.data = NULL
 * 		self.sample_count = 0             # <<<<<<<<<<<<<<
 * 
 * 	def __dealloc__(self):
 */
  __pyx_v_self->sample_count = 0;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_7xmmsapi_12XmmsVisChunk_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7xmmsapi_12XmmsVisChunk_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7xmmsapi_12XmmsVisChunk_2__dealloc__(((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":336
 * 		self.sample_count = 0
 * 
 * 	def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 		if self.data != NULL:
 * 			PyMem_Free(self.data)
 */

static void __pyx_pf_7xmmsapi_12XmmsVisChunk_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "xmmsapi.pyx":337
 * 
 * 	def __dealloc__(self):
 * 		if self.data != NULL:             # <<<<<<<<<<<<<<
 * 			PyMem_Free(self.data)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->data != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":338
 * 	def __dealloc__(self):
 * 		if self.data != NULL:
 * 			PyMem_Free(self.data)             # <<<<<<<<<<<<<<
 * 
 * 	cdef set_data(self, short *data, int sample_count):
 */
    PyMem_Free(__pyx_v_self->data);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":340
 * 			PyMem_Free(self.data)
 * 
 * 	cdef set_data(self, short *data, int sample_count):             # <<<<<<<<<<<<<<
 * 		if self.data != NULL:
 * 			PyMem_Free(self.data)
 */

static PyObject *__pyx_f_7xmmsapi_12XmmsVisChunk_set_data(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self, short *__pyx_v_data, int __pyx_v_sample_count) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_data", 0);

  /* "xmmsapi.pyx":341
 * 
 * 	cdef set_data(self, short *data, int sample_count):
 * 		if self.data != NULL:             # <<<<<<<<<<<<<<
 * 			PyMem_Free(self.data)
 * 			self.sample_count = 0
 */
  __pyx_t_1 = (__pyx_v_self->data != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":342
 * 	cdef set_data(self, short *data, int sample_count):
 * 		if self.data != NULL:
 * 			PyMem_Free(self.data)             # <<<<<<<<<<<<<<
 * 			self.sample_count = 0
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)
 */
    PyMem_Free(__pyx_v_self->data);

    /* "xmmsapi.pyx":343
 * 		if self.data != NULL:
 * 			PyMem_Free(self.data)
 * 			self.sample_count = 0             # <<<<<<<<<<<<<<
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)
 * 		if self.data == NULL:
 */
    __pyx_v_self->sample_count = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":344
 * 			PyMem_Free(self.data)
 * 			self.sample_count = 0
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)             # <<<<<<<<<<<<<<
 * 		if self.data == NULL:
 * 			raise RuntimeError("Failed to initialize chunk data")
 */
  __pyx_v_self->data = ((short *)PyMem_Malloc(((sizeof(short)) * __pyx_v_sample_count)));

  /* "xmmsapi.pyx":345
 * 			self.sample_count = 0
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)
 * 		if self.data == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("Failed to initialize chunk data")
 * 		for i in range(sample_count):
 */
  __pyx_t_1 = (__pyx_v_self->data == NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":346
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)
 * 		if self.data == NULL:
 * 			raise RuntimeError("Failed to initialize chunk data")             # <<<<<<<<<<<<<<
 * 		for i in range(sample_count):
 * 			self.data[i] = data[i]
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":347
 * 		if self.data == NULL:
 * 			raise RuntimeError("Failed to initialize chunk data")
 * 		for i in range(sample_count):             # <<<<<<<<<<<<<<
 * 			self.data[i] = data[i]
 * 		self.sample_count = sample_count
 */
  __pyx_t_3 = __pyx_v_sample_count;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "xmmsapi.pyx":348
 * 			raise RuntimeError("Failed to initialize chunk data")
 * 		for i in range(sample_count):
 * 			self.data[i] = data[i]             # <<<<<<<<<<<<<<
 * 		self.sample_count = sample_count
 * 
 */
    (__pyx_v_self->data[__pyx_v_i]) = (__pyx_v_data[__pyx_v_i]);
  }

  /* "xmmsapi.pyx":349
 * 		for i in range(sample_count):
 * 			self.data[i] = data[i]
 * 		self.sample_count = sample_count             # <<<<<<<<<<<<<<
 * 
 * 	def __len__(self):
 */
  __pyx_v_self->sample_count = __pyx_v_sample_count;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsVisChunk.set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static Py_ssize_t __pyx_pw_7xmmsapi_12XmmsVisChunk_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7xmmsapi_12XmmsVisChunk_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_12XmmsVisChunk_4__len__(((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":351
 * 		self.sample_count = sample_count
 * 
 * 	def __len__(self):             # <<<<<<<<<<<<<<
 * 		return self.sample_count
 * 
 */

static Py_ssize_t __pyx_pf_7xmmsapi_12XmmsVisChunk_4__len__(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "xmmsapi.pyx":352
 * 
 * 	def __len__(self):
 * 		return self.sample_count             # <<<<<<<<<<<<<<
 * 
 * 	cpdef get_buffer(self):
 */
  __pyx_r = __pyx_v_self->sample_count;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":354
 * 		return self.sample_count
 * 
 * 	cpdef get_buffer(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_buffer() -> bytes (str in python 2.x)
 */

static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_7get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_12XmmsVisChunk_get_buffer(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_buffer", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_buffer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_12XmmsVisChunk_7get_buffer)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":362
 * 		@return chunk data as a string
 * 		"""
 * 		if self.data == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("chunk data not initialized")
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)
 */
  __pyx_t_3 = (__pyx_v_self->data == NULL);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":363
 * 		"""
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")             # <<<<<<<<<<<<<<
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)
 * 
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":364
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef get_data(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(((char *)__pyx_v_self->data), ((sizeof(short)) * __pyx_v_self->sample_count))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsVisChunk.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_7get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_12XmmsVisChunk_6get_buffer[] = "\n\t\tget_buffer() -> bytes (str in python 2.x)\n\n\t\tGet the chunk buffer\n\t\t@rtype: L{bytes}\n\t\t@return chunk data as a string\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_7get_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_12XmmsVisChunk_6get_buffer(((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":354
 * 		return self.sample_count
 * 
 * 	cpdef get_buffer(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_buffer() -> bytes (str in python 2.x)
 */

static PyObject *__pyx_pf_7xmmsapi_12XmmsVisChunk_6get_buffer(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_buffer", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk *)__pyx_v_self->__pyx_vtab)->get_buffer(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsVisChunk.get_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":366
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)
 * 
 * 	cpdef get_data(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_data() -> list
 */

static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_9get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_12XmmsVisChunk_get_data(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_12XmmsVisChunk_9get_data)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":374
 * 		@return A list of int
 * 		"""
 * 		if self.data == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("chunk data not initialized")
 * 		return [<int>self.data[i] for i in range(self.sample_count)]
 */
  __pyx_t_3 = (__pyx_v_self->data == NULL);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":375
 * 		"""
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")             # <<<<<<<<<<<<<<
 * 		return [<int>self.data[i] for i in range(self.sample_count)]
 * 
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":376
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")
 * 		return [<int>self.data[i] for i in range(self.sample_count)]             # <<<<<<<<<<<<<<
 * 
 * class VisualizationError(Exception):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_v_self->sample_count;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;
    __pyx_t_2 = PyInt_FromLong(((int)(__pyx_v_self->data[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsVisChunk.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_9get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_12XmmsVisChunk_8get_data[] = "\n\t\tget_data() -> list\n\n\t\tGet chunk data as a list.\n\t\t@rtype: L{list}\n\t\t@return A list of int\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_12XmmsVisChunk_9get_data(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_12XmmsVisChunk_8get_data(((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":366
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)
 * 
 * 	cpdef get_data(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_data() -> list
 */

static PyObject *__pyx_pf_7xmmsapi_12XmmsVisChunk_8get_data(struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk *)__pyx_v_self->__pyx_vtab)->get_data(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsVisChunk.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":382
 * 
 * 
 * cdef void python_need_out_fun(int i, void *obj):             # <<<<<<<<<<<<<<
 * 	cdef object o
 * 	o = <object> obj
 */

static void __pyx_f_7xmmsapi_python_need_out_fun(int __pyx_v_i, void *__pyx_v_obj) {
  PyObject *__pyx_v_o = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("python_need_out_fun", 0);

  /* "xmmsapi.pyx":384
 * cdef void python_need_out_fun(int i, void *obj):
 * 	cdef object o
 * 	o = <object> obj             # <<<<<<<<<<<<<<
 * 	o._needout_cb(i)
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_v_o = ((PyObject *)__pyx_v_obj);

  /* "xmmsapi.pyx":385
 * 	cdef object o
 * 	o = <object> obj
 * 	o._needout_cb(i)             # <<<<<<<<<<<<<<
 * 
 * cdef void python_disconnect_fun(void *obj):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s___needout_cb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("xmmsapi.python_need_out_fun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":387
 * 	o._needout_cb(i)
 * 
 * cdef void python_disconnect_fun(void *obj):             # <<<<<<<<<<<<<<
 * 	cdef object o
 * 	o = <object> obj
 */

static void __pyx_f_7xmmsapi_python_disconnect_fun(void *__pyx_v_obj) {
  PyObject *__pyx_v_o = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("python_disconnect_fun", 0);

  /* "xmmsapi.pyx":389
 * cdef void python_disconnect_fun(void *obj):
 * 	cdef object o
 * 	o = <object> obj             # <<<<<<<<<<<<<<
 * 	o._disconnect_cb()
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_v_o = ((PyObject *)__pyx_v_obj);

  /* "xmmsapi.pyx":390
 * 	cdef object o
 * 	o = <object> obj
 * 	o._disconnect_cb()             # <<<<<<<<<<<<<<
 * 
 * cpdef userconfdir_get():
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_o, __pyx_n_s___disconnect_cb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("xmmsapi.python_disconnect_fun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":392
 * 	o._disconnect_cb()
 * 
 * cpdef userconfdir_get():             # <<<<<<<<<<<<<<
 * 	"""
 * 	Get the user configuration directory, where XMMS2 stores its
 */

static PyObject *__pyx_pw_7xmmsapi_3userconfdir_get(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_userconfdir_get(CYTHON_UNUSED int __pyx_skip_dispatch) {
  char __pyx_v_path[XMMS_PATH_MAX];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("userconfdir_get", 0);

  /* "xmmsapi.pyx":400
 * 	"""
 * 	cdef char path[XMMS_PATH_MAX]
 * 	if xmmsc_userconfdir_get (path, XMMS_PATH_MAX) == NULL:             # <<<<<<<<<<<<<<
 * 		return None
 * 	return path
 */
  __pyx_t_1 = (xmmsc_userconfdir_get(__pyx_v_path, XMMS_PATH_MAX) == NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":401
 * 	cdef char path[XMMS_PATH_MAX]
 * 	if xmmsc_userconfdir_get (path, XMMS_PATH_MAX) == NULL:
 * 		return None             # <<<<<<<<<<<<<<
 * 	return path
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":402
 * 	if xmmsc_userconfdir_get (path, XMMS_PATH_MAX) == NULL:
 * 		return None
 * 	return path             # <<<<<<<<<<<<<<
 * 
 * def enforce_unicode(object o):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyBytes_FromString(__pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.userconfdir_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_3userconfdir_get(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_2userconfdir_get[] = "\n\tGet the user configuration directory, where XMMS2 stores its\n\tuser-specific configuration files. Clients may store their\n\tconfiguration under the 'clients' subdirectory. This varies from\n\tplatform to platform so should always be retrieved at runtime.\n\t";
static PyObject *__pyx_pw_7xmmsapi_3userconfdir_get(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("userconfdir_get (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_2userconfdir_get(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":392
 * 	o._disconnect_cb()
 * 
 * cpdef userconfdir_get():             # <<<<<<<<<<<<<<
 * 	"""
 * 	Get the user configuration directory, where XMMS2 stores its
 */

static PyObject *__pyx_pf_7xmmsapi_2userconfdir_get(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("userconfdir_get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7xmmsapi_userconfdir_get(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.userconfdir_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_5enforce_unicode(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static PyMethodDef __pyx_mdef_7xmmsapi_5enforce_unicode = {__Pyx_NAMESTR("enforce_unicode"), (PyCFunction)__pyx_pw_7xmmsapi_5enforce_unicode, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7xmmsapi_5enforce_unicode(PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enforce_unicode (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_4enforce_unicode(__pyx_self, ((PyObject *)__pyx_v_o));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":404
 * 	return path
 * 
 * def enforce_unicode(object o):             # <<<<<<<<<<<<<<
 * 	if isinstance(o, unicode):
 * 		s = o
 */

static PyObject *__pyx_pf_7xmmsapi_4enforce_unicode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enforce_unicode", 0);

  /* "xmmsapi.pyx":405
 * 
 * def enforce_unicode(object o):
 * 	if isinstance(o, unicode):             # <<<<<<<<<<<<<<
 * 		s = o
 * 	else:
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyUnicode_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_o, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":406
 * def enforce_unicode(object o):
 * 	if isinstance(o, unicode):
 * 		s = o             # <<<<<<<<<<<<<<
 * 	else:
 * 		try:
 */
    __Pyx_INCREF(__pyx_v_o);
    __pyx_v_s = __pyx_v_o;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":408
 * 		s = o
 * 	else:
 * 		try:             # <<<<<<<<<<<<<<
 * 			s = unicode(o, "UTF-8")
 * 		except:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "xmmsapi.pyx":409
 * 	else:
 * 		try:
 * 			s = unicode(o, "UTF-8")             # <<<<<<<<<<<<<<
 * 		except:
 * 			s = o
 */
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_o);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_o);
        __Pyx_GIVEREF(__pyx_v_o);
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_24));
        PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_24));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24));
        __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_v_s = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "xmmsapi.pyx":410
 * 		try:
 * 			s = unicode(o, "UTF-8")
 * 		except:             # <<<<<<<<<<<<<<
 * 			s = o
 * 	return s
 */
      /*except:*/ {
        __Pyx_AddTraceback("xmmsapi.enforce_unicode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_7);

        /* "xmmsapi.pyx":411
 * 			s = unicode(o, "UTF-8")
 * 		except:
 * 			s = o             # <<<<<<<<<<<<<<
 * 	return s
 * 
 */
        __Pyx_INCREF(__pyx_v_o);
        __Pyx_XDECREF(__pyx_v_s);
        __pyx_v_s = __pyx_v_o;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L11_try_end:;
    }
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":412
 * 		except:
 * 			s = o
 * 	return s             # <<<<<<<<<<<<<<
 * 
 * cdef object check_playlist(object pls, bint None_is_active):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("xmmsapi.enforce_unicode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":414
 * 	return s
 * 
 * cdef object check_playlist(object pls, bint None_is_active):             # <<<<<<<<<<<<<<
 * 	if pls is None and not None_is_active:
 * 		raise TypeError("expected str, %s found" % pls.__class__.__name__)
 */

static PyObject *__pyx_f_7xmmsapi_check_playlist(PyObject *__pyx_v_pls, int __pyx_v_None_is_active) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_playlist", 0);

  /* "xmmsapi.pyx":415
 * 
 * cdef object check_playlist(object pls, bint None_is_active):
 * 	if pls is None and not None_is_active:             # <<<<<<<<<<<<<<
 * 		raise TypeError("expected str, %s found" % pls.__class__.__name__)
 * 	return from_unicode(pls or ACTIVE_PLAYLIST)
 */
  __pyx_t_1 = (__pyx_v_pls == Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = (!__pyx_v_None_is_active);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":416
 * cdef object check_playlist(object pls, bint None_is_active):
 * 	if pls is None and not None_is_active:
 * 		raise TypeError("expected str, %s found" % pls.__class__.__name__)             # <<<<<<<<<<<<<<
 * 	return from_unicode(pls or ACTIVE_PLAYLIST)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_pls, __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":417
 * 	if pls is None and not None_is_active:
 * 		raise TypeError("expected str, %s found" % pls.__class__.__name__)
 * 	return from_unicode(pls or ACTIVE_PLAYLIST)             # <<<<<<<<<<<<<<
 * 
 * cdef class XmmsCore:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_pls); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ACTIVE_PLAYLIST); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_pls);
    __pyx_t_5 = __pyx_v_pls;
  }
  __pyx_t_4 = __pyx_f_9xmmsutils_from_unicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("xmmsapi.check_playlist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_8XmmsCore_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_8XmmsCore_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
  __pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore___cinit__(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_args, __pyx_v_kargs);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":432
 * 	#cdef readonly object clientname
 * 
 * 	def __cinit__(self, *args, **kargs): #Trick to allow subclass with init arguments             # <<<<<<<<<<<<<<
 * 		"""
 * 		Initiates a connection to the XMMS2 daemon. All operations
 */

static int __pyx_pf_7xmmsapi_8XmmsCore___cinit__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
  PyObject *__pyx_v_clientname = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":437
 * 		involving the daemon are done via this connection.
 * 		"""
 * 		if 'clientname' in kargs:             # <<<<<<<<<<<<<<
 * 			clientname = kargs['clientname']
 * 		elif len(args):
 */
  __pyx_t_1 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_n_s__clientname), ((PyObject *)__pyx_v_kargs), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":438
 * 		"""
 * 		if 'clientname' in kargs:
 * 			clientname = kargs['clientname']             # <<<<<<<<<<<<<<
 * 		elif len(args):
 * 			clientname = args[0]
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_kargs), ((PyObject *)__pyx_n_s__clientname)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_clientname = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "xmmsapi.pyx":439
 * 		if 'clientname' in kargs:
 * 			clientname = kargs['clientname']
 * 		elif len(args):             # <<<<<<<<<<<<<<
 * 			clientname = args[0]
 * 		else:
 */
  __pyx_t_3 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":440
 * 			clientname = kargs['clientname']
 * 		elif len(args):
 * 			clientname = args[0]             # <<<<<<<<<<<<<<
 * 		else:
 * 			clientname = None
 */
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_clientname = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":442
 * 			clientname = args[0]
 * 		else:
 * 			clientname = None             # <<<<<<<<<<<<<<
 * 		if clientname is None:
 * 			clientname = "UnnamedPythonClient"
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_clientname = Py_None;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":443
 * 		else:
 * 			clientname = None
 * 		if clientname is None:             # <<<<<<<<<<<<<<
 * 			clientname = "UnnamedPythonClient"
 * 		self.clientname = clientname
 */
  __pyx_t_1 = (__pyx_v_clientname == Py_None);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":444
 * 			clientname = None
 * 		if clientname is None:
 * 			clientname = "UnnamedPythonClient"             # <<<<<<<<<<<<<<
 * 		self.clientname = clientname
 * 		self.source_preference = XmmsSourcePreference(["client/"+clientname, "server", "plugins/[inserted by cython to avoid comment start]*", "client/[inserted by cython to avoid comment start]*", "*"])
 */
    __Pyx_INCREF(((PyObject *)__pyx_n_s__UnnamedPythonClient));
    __Pyx_DECREF(__pyx_v_clientname);
    __pyx_v_clientname = ((PyObject *)__pyx_n_s__UnnamedPythonClient);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":445
 * 		if clientname is None:
 * 			clientname = "UnnamedPythonClient"
 * 		self.clientname = clientname             # <<<<<<<<<<<<<<
 * 		self.source_preference = XmmsSourcePreference(["client/"+clientname, "server", "plugins/[inserted by cython to avoid comment start]*", "client/[inserted by cython to avoid comment start]*", "*"])
 * 		self.result_tracker = XmmsResultTracker() # Keep track of all results that set a notifier.
 */
  __Pyx_INCREF(__pyx_v_clientname);
  __Pyx_GIVEREF(__pyx_v_clientname);
  __Pyx_GOTREF(__pyx_v_self->clientname);
  __Pyx_DECREF(__pyx_v_self->clientname);
  __pyx_v_self->clientname = __pyx_v_clientname;

  /* "xmmsapi.pyx":446
 * 			clientname = "UnnamedPythonClient"
 * 		self.clientname = clientname
 * 		self.source_preference = XmmsSourcePreference(["client/"+clientname, "server", "plugins/[inserted by cython to avoid comment start]*", "client/[inserted by cython to avoid comment start]*", "*"])             # <<<<<<<<<<<<<<
 * 		self.result_tracker = XmmsResultTracker() # Keep track of all results that set a notifier.
 * 		self.new_connection()
 */
  __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_s_26), __pyx_v_clientname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__server));
  PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__server));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__server));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_27));
  PyList_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_kp_s_27));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
  PyList_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
  PyList_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_kp_s_29));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsSourcePreference)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->source_preference);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->source_preference));
  __pyx_v_self->source_preference = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "xmmsapi.pyx":447
 * 		self.clientname = clientname
 * 		self.source_preference = XmmsSourcePreference(["client/"+clientname, "server", "plugins/[inserted by cython to avoid comment start]*", "client/[inserted by cython to avoid comment start]*", "*"])
 * 		self.result_tracker = XmmsResultTracker() # Keep track of all results that set a notifier.             # <<<<<<<<<<<<<<
 * 		self.new_connection()
 * 
 */
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsResultTracker)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->result_tracker);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->result_tracker));
  __pyx_v_self->result_tracker = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "xmmsapi.pyx":448
 * 		self.source_preference = XmmsSourcePreference(["client/"+clientname, "server", "plugins/[inserted by cython to avoid comment start]*", "client/[inserted by cython to avoid comment start]*", "*"])
 * 		self.result_tracker = XmmsResultTracker() # Keep track of all results that set a notifier.
 * 		self.new_connection()             # <<<<<<<<<<<<<<
 * 
 * 	def __dealloc__(self):
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->new_connection(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_clientname);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_7xmmsapi_8XmmsCore_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7xmmsapi_8XmmsCore_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7xmmsapi_8XmmsCore_2__dealloc__(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "xmmsapi.pyx":450
 * 		self.new_connection()
 * 
 * 	def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 */

static void __pyx_pf_7xmmsapi_8XmmsCore_2__dealloc__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "xmmsapi.pyx":451
 * 
 * 	def __dealloc__(self):
 * 		if self.conn != NULL:             # <<<<<<<<<<<<<<
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 */
  __pyx_t_1 = (__pyx_v_self->conn != NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":452
 * 	def __dealloc__(self):
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)             # <<<<<<<<<<<<<<
 * 			self.conn = NULL
 * 
 */
    xmmsc_unref(__pyx_v_self->conn);

    /* "xmmsapi.pyx":453
 * 		if self.conn != NULL:
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL             # <<<<<<<<<<<<<<
 * 
 * 	def __del__(self):
 */
    __pyx_v_self->conn = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_5__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_5__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_4__del__(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":455
 * 			self.conn = NULL
 * 
 * 	def __del__(self):             # <<<<<<<<<<<<<<
 * 		self.disconnect()
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_4__del__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 0);

  /* "xmmsapi.pyx":456
 * 
 * 	def __del__(self):
 * 		self.disconnect()             # <<<<<<<<<<<<<<
 * 
 * 	cdef new_connection(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->disconnect(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":458
 * 		self.disconnect()
 * 
 * 	cdef new_connection(self):             # <<<<<<<<<<<<<<
 * 		cn = from_unicode(self.clientname)
 * 		self.conn = xmmsc_init(<char *>cn)
 */

static PyObject *__pyx_f_7xmmsapi_8XmmsCore_new_connection(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_v_cn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_connection", 0);

  /* "xmmsapi.pyx":459
 * 
 * 	cdef new_connection(self):
 * 		cn = from_unicode(self.clientname)             # <<<<<<<<<<<<<<
 * 		self.conn = xmmsc_init(<char *>cn)
 * 		if self.conn == NULL:
 */
  __pyx_t_1 = __pyx_v_self->clientname;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_9xmmsutils_from_unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cn = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":460
 * 	cdef new_connection(self):
 * 		cn = from_unicode(self.clientname)
 * 		self.conn = xmmsc_init(<char *>cn)             # <<<<<<<<<<<<<<
 * 		if self.conn == NULL:
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_cn); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->conn = xmmsc_init(((char *)__pyx_t_3));

  /* "xmmsapi.pyx":461
 * 		cn = from_unicode(self.clientname)
 * 		self.conn = xmmsc_init(<char *>cn)
 * 		if self.conn == NULL:             # <<<<<<<<<<<<<<
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")
 * 
 */
  __pyx_t_4 = (__pyx_v_self->conn == NULL);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":462
 * 		self.conn = xmmsc_init(<char *>cn)
 * 		if self.conn == NULL:
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef get_source_preference(self):
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.new_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":464
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")
 * 
 * 	cpdef get_source_preference(self):             # <<<<<<<<<<<<<<
 * 		return self.source_preference.get()
 * 	cpdef set_source_preference(self, sources):
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_7get_source_preference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_get_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_source_preference", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_7get_source_preference)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":465
 * 
 * 	cpdef get_source_preference(self):
 * 		return self.source_preference.get()             # <<<<<<<<<<<<<<
 * 	cpdef set_source_preference(self, sources):
 * 		self.source_preference.set(sources)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->source_preference), __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.get_source_preference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_7get_source_preference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_7get_source_preference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_source_preference (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_6get_source_preference(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":464
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")
 * 
 * 	cpdef get_source_preference(self):             # <<<<<<<<<<<<<<
 * 		return self.source_preference.get()
 * 	cpdef set_source_preference(self, sources):
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_6get_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_source_preference", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->get_source_preference(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.get_source_preference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":466
 * 	cpdef get_source_preference(self):
 * 		return self.source_preference.get()
 * 	cpdef set_source_preference(self, sources):             # <<<<<<<<<<<<<<
 * 		self.source_preference.set(sources)
 * 
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_9set_source_preference(PyObject *__pyx_v_self, PyObject *__pyx_v_sources); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_set_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_sources, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_source_preference", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_33); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_9set_source_preference)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_sources);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sources);
      __Pyx_GIVEREF(__pyx_v_sources);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":467
 * 		return self.source_preference.get()
 * 	cpdef set_source_preference(self, sources):
 * 		self.source_preference.set(sources)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef _needout_cb(self, int i):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->source_preference), __pyx_n_s__set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_sources);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sources);
  __Pyx_GIVEREF(__pyx_v_sources);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.set_source_preference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_9set_source_preference(PyObject *__pyx_v_self, PyObject *__pyx_v_sources); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_9set_source_preference(PyObject *__pyx_v_self, PyObject *__pyx_v_sources) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_source_preference (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_8set_source_preference(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), ((PyObject *)__pyx_v_sources));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":466
 * 	cpdef get_source_preference(self):
 * 		return self.source_preference.get()
 * 	cpdef set_source_preference(self, sources):             # <<<<<<<<<<<<<<
 * 		self.source_preference.set(sources)
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_8set_source_preference(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_sources) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_source_preference", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->set_source_preference(__pyx_v_self, __pyx_v_sources, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.set_source_preference", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":469
 * 		self.source_preference.set(sources)
 * 
 * 	cpdef _needout_cb(self, int i):             # <<<<<<<<<<<<<<
 * 		if self.needout_fun is not None:
 * 			self.needout_fun(i)
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_11_needout_cb(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore__needout_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_v_i, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_needout_cb", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___needout_cb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_11_needout_cb)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":470
 * 
 * 	cpdef _needout_cb(self, int i):
 * 		if self.needout_fun is not None:             # <<<<<<<<<<<<<<
 * 			self.needout_fun(i)
 * 	cpdef _disconnect_cb(self):
 */
  __pyx_t_4 = (__pyx_v_self->needout_fun != Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":471
 * 	cpdef _needout_cb(self, int i):
 * 		if self.needout_fun is not None:
 * 			self.needout_fun(i)             # <<<<<<<<<<<<<<
 * 	cpdef _disconnect_cb(self):
 * 		if self.disconnect_fun is not None:
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_v_self->needout_fun, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsCore._needout_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_11_needout_cb(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_11_needout_cb(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  int __pyx_v_i;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_needout_cb (wrapper)", 0);
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyInt_AsInt(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsCore._needout_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_10_needout_cb(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), ((int)__pyx_v_i));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":469
 * 		self.source_preference.set(sources)
 * 
 * 	cpdef _needout_cb(self, int i):             # <<<<<<<<<<<<<<
 * 		if self.needout_fun is not None:
 * 			self.needout_fun(i)
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_10_needout_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_needout_cb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->_needout_cb(__pyx_v_self, __pyx_v_i, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore._needout_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":472
 * 		if self.needout_fun is not None:
 * 			self.needout_fun(i)
 * 	cpdef _disconnect_cb(self):             # <<<<<<<<<<<<<<
 * 		if self.disconnect_fun is not None:
 * 			self.disconnect_fun(self)
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_13_disconnect_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore__disconnect_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_disconnect_cb", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___disconnect_cb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_13_disconnect_cb)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":473
 * 			self.needout_fun(i)
 * 	cpdef _disconnect_cb(self):
 * 		if self.disconnect_fun is not None:             # <<<<<<<<<<<<<<
 * 			self.disconnect_fun(self)
 * 
 */
  __pyx_t_3 = (__pyx_v_self->disconnect_fun != Py_None);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":474
 * 	cpdef _disconnect_cb(self):
 * 		if self.disconnect_fun is not None:
 * 			self.disconnect_fun(self)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef disconnect(self):
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_2 = PyObject_Call(__pyx_v_self->disconnect_fun, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore._disconnect_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_13_disconnect_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_13_disconnect_cb(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_disconnect_cb (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_12_disconnect_cb(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":472
 * 		if self.needout_fun is not None:
 * 			self.needout_fun(i)
 * 	cpdef _disconnect_cb(self):             # <<<<<<<<<<<<<<
 * 		if self.disconnect_fun is not None:
 * 			self.disconnect_fun(self)
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_12_disconnect_cb(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_disconnect_cb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->_disconnect_cb(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore._disconnect_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":476
 * 			self.disconnect_fun(self)
 * 
 * 	cpdef disconnect(self):             # <<<<<<<<<<<<<<
 * 		# Disconnect all results.
 * 		self.result_tracker.disconnect_all(True)
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_15disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_disconnect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disconnect", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__disconnect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_15disconnect)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":478
 * 	cpdef disconnect(self):
 * 		# Disconnect all results.
 * 		self.result_tracker.disconnect_all(True)             # <<<<<<<<<<<<<<
 * 		if self.conn is not NULL:
 * 			xmmsc_unref(self.conn)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker *)__pyx_v_self->result_tracker->__pyx_vtab)->disconnect_all(__pyx_v_self->result_tracker, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "xmmsapi.pyx":479
 * 		# Disconnect all results.
 * 		self.result_tracker.disconnect_all(True)
 * 		if self.conn is not NULL:             # <<<<<<<<<<<<<<
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 */
  __pyx_t_3 = (__pyx_v_self->conn != NULL);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":480
 * 		self.result_tracker.disconnect_all(True)
 * 		if self.conn is not NULL:
 * 			xmmsc_unref(self.conn)             # <<<<<<<<<<<<<<
 * 			self.conn = NULL
 * 		self.new_connection()
 */
    xmmsc_unref(__pyx_v_self->conn);

    /* "xmmsapi.pyx":481
 * 		if self.conn is not NULL:
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL             # <<<<<<<<<<<<<<
 * 		self.new_connection()
 * 
 */
    __pyx_v_self->conn = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":482
 * 			xmmsc_unref(self.conn)
 * 			self.conn = NULL
 * 		self.new_connection()             # <<<<<<<<<<<<<<
 * 
 * 	cpdef ioin(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->new_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_15disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_15disconnect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disconnect (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_14disconnect(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":476
 * 			self.disconnect_fun(self)
 * 
 * 	cpdef disconnect(self):             # <<<<<<<<<<<<<<
 * 		# Disconnect all results.
 * 		self.result_tracker.disconnect_all(True)
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_14disconnect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disconnect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->disconnect(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":484
 * 		self.new_connection()
 * 
 * 	cpdef ioin(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		ioin() -> bool
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_17ioin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_ioin(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ioin", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__ioin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_17ioin)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":492
 * 		certain circumstances. e.g. a custom event loop
 * 		"""
 * 		return xmmsc_io_in_handle(self.conn)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef ioout(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(xmmsc_io_in_handle(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.ioin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_17ioin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_16ioin[] = "\n\t\tioin() -> bool\n\n\t\tRead data from the daemon, when available.\n\t\tNote: This is a low level function that should only be used in\n\t\tcertain circumstances. e.g. a custom event loop\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_17ioin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ioin (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_16ioin(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":484
 * 		self.new_connection()
 * 
 * 	cpdef ioin(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		ioin() -> bool
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_16ioin(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ioin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->ioin(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.ioin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":494
 * 		return xmmsc_io_in_handle(self.conn)
 * 
 * 	cpdef ioout(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		ioout() -> bool
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_19ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ioout", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__ioout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_19ioout)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":502
 * 		circumstances. e.g. a custom event loop
 * 		"""
 * 		return xmmsc_io_out_handle(self.conn)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef want_ioout(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(xmmsc_io_out_handle(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.ioout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_19ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_18ioout[] = "\n\t\tioout() -> bool\n\n\t\tWrite data out to the daemon, when available. Note: This is a\n\t\tlow level function that should only be used in certain\n\t\tcircumstances. e.g. a custom event loop\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_19ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ioout (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_18ioout(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":494
 * 		return xmmsc_io_in_handle(self.conn)
 * 
 * 	cpdef ioout(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		ioout() -> bool
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_18ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ioout", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->ioout(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.ioout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":504
 * 		return xmmsc_io_out_handle(self.conn)
 * 
 * 	cpdef want_ioout(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		want_ioout() -> bool
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_21want_ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_want_ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("want_ioout", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__want_ioout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_21want_ioout)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":508
 * 		want_ioout() -> bool
 * 		"""
 * 		return xmmsc_io_want_out(self.conn)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef set_need_out_fun(self, fun):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(xmmsc_io_want_out(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.want_ioout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_21want_ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_20want_ioout[] = "\n\t\twant_ioout() -> bool\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_21want_ioout(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("want_ioout (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_20want_ioout(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":504
 * 		return xmmsc_io_out_handle(self.conn)
 * 
 * 	cpdef want_ioout(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		want_ioout() -> bool
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_20want_ioout(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("want_ioout", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->want_ioout(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.want_ioout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":510
 * 		return xmmsc_io_want_out(self.conn)
 * 
 * 	cpdef set_need_out_fun(self, fun):             # <<<<<<<<<<<<<<
 * 		"""
 * 		set_need_out_fun(fun)
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_23set_need_out_fun(PyObject *__pyx_v_self, PyObject *__pyx_v_fun); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_set_need_out_fun(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_fun, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_need_out_fun", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_need_out_fun); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_23set_need_out_fun)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_fun);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fun);
      __Pyx_GIVEREF(__pyx_v_fun);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":514
 * 		set_need_out_fun(fun)
 * 		"""
 * 		self.needout_fun = fun             # <<<<<<<<<<<<<<
 * 
 * 	cpdef get_fd(self):
 */
  __Pyx_INCREF(__pyx_v_fun);
  __Pyx_GIVEREF(__pyx_v_fun);
  __Pyx_GOTREF(__pyx_v_self->needout_fun);
  __Pyx_DECREF(__pyx_v_self->needout_fun);
  __pyx_v_self->needout_fun = __pyx_v_fun;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.set_need_out_fun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_23set_need_out_fun(PyObject *__pyx_v_self, PyObject *__pyx_v_fun); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_22set_need_out_fun[] = "\n\t\tset_need_out_fun(fun)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_23set_need_out_fun(PyObject *__pyx_v_self, PyObject *__pyx_v_fun) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_need_out_fun (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_22set_need_out_fun(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), ((PyObject *)__pyx_v_fun));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":510
 * 		return xmmsc_io_want_out(self.conn)
 * 
 * 	cpdef set_need_out_fun(self, fun):             # <<<<<<<<<<<<<<
 * 		"""
 * 		set_need_out_fun(fun)
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_22set_need_out_fun(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_fun) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_need_out_fun", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->set_need_out_fun(__pyx_v_self, __pyx_v_fun, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.set_need_out_fun", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":516
 * 		self.needout_fun = fun
 * 
 * 	cpdef get_fd(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_fd() -> int
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_25get_fd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_get_fd(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fd", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_25get_fd)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":527
 * 		@return: IPC file descriptor
 * 		"""
 * 		return xmmsc_io_fd_get(self.conn)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef connect(self, path=None, disconnect_func=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(xmmsc_io_fd_get(__pyx_v_self->conn)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.get_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_25get_fd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_24get_fd[] = "\n\t\tget_fd() -> int\n\n\t\tGet the underlying file descriptor used for communication with\n\t\tthe XMMS2 daemon. You can use this in a client to ensure that\n\t\tthe IPC link is still active and safe to use.(e.g by calling\n\t\tselect() or poll())\n\t\t@rtype: int\n\t\t@return: IPC file descriptor\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_25get_fd(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fd (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_24get_fd(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":516
 * 		self.needout_fun = fun
 * 
 * 	cpdef get_fd(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		get_fd() -> int
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_24get_fd(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fd", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->get_fd(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.get_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":529
 * 		return xmmsc_io_fd_get(self.conn)
 * 
 * 	cpdef connect(self, path=None, disconnect_func=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		connect(path=None, disconnect_func=None)
 */

static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_27connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7xmmsapi_8XmmsCore_connect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect *__pyx_optional_args) {
  PyObject *__pyx_v_path = ((PyObject *)Py_None);
  PyObject *__pyx_v_disconnect_func = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_path = __pyx_optional_args->path;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_disconnect_func = __pyx_optional_args->disconnect_func;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__connect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_27connect)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_disconnect_func);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_disconnect_func);
      __Pyx_GIVEREF(__pyx_v_disconnect_func);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":551
 * 		L{exit_loop} at some point.
 * 		"""
 * 		if path:             # <<<<<<<<<<<<<<
 * 			p = from_unicode(path)
 * 			ret = xmmsc_connect(self.conn, <char *>p)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_path); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":552
 * 		"""
 * 		if path:
 * 			p = from_unicode(path)             # <<<<<<<<<<<<<<
 * 			ret = xmmsc_connect(self.conn, <char *>p)
 * 		else:
 */
    __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_p = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "xmmsapi.pyx":553
 * 		if path:
 * 			p = from_unicode(path)
 * 			ret = xmmsc_connect(self.conn, <char *>p)             # <<<<<<<<<<<<<<
 * 		else:
 * 			ret = xmmsc_connect(self.conn, NULL)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ret = xmmsc_connect(__pyx_v_self->conn, ((char *)__pyx_t_5));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":555
 * 			ret = xmmsc_connect(self.conn, <char *>p)
 * 		else:
 * 			ret = xmmsc_connect(self.conn, NULL)             # <<<<<<<<<<<<<<
 * 
 * 		if not ret:
 */
    __pyx_v_ret = xmmsc_connect(__pyx_v_self->conn, NULL);
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":557
 * 			ret = xmmsc_connect(self.conn, NULL)
 * 
 * 		if not ret:             # <<<<<<<<<<<<<<
 * 			raise IOError("Couldn't connect to the server")
 * 		self.isconnected = 1
 */
  __pyx_t_4 = (!__pyx_v_ret);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":558
 * 
 * 		if not ret:
 * 			raise IOError("Couldn't connect to the server")             # <<<<<<<<<<<<<<
 * 		self.isconnected = 1
 * 
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":559
 * 		if not ret:
 * 			raise IOError("Couldn't connect to the server")
 * 		self.isconnected = 1             # <<<<<<<<<<<<<<
 * 
 * 		self.disconnect_fun = disconnect_func
 */
  __pyx_v_self->isconnected = 1;

  /* "xmmsapi.pyx":561
 * 		self.isconnected = 1
 * 
 * 		self.disconnect_fun = disconnect_func             # <<<<<<<<<<<<<<
 * 		xmmsc_disconnect_callback_set_full(self.conn, python_disconnect_fun, <void *>self, NULL)
 * 		xmmsc_io_need_out_callback_set_full(self.conn, python_need_out_fun, <void *> self, NULL)
 */
  __Pyx_INCREF(__pyx_v_disconnect_func);
  __Pyx_GIVEREF(__pyx_v_disconnect_func);
  __Pyx_GOTREF(__pyx_v_self->disconnect_fun);
  __Pyx_DECREF(__pyx_v_self->disconnect_fun);
  __pyx_v_self->disconnect_fun = __pyx_v_disconnect_func;

  /* "xmmsapi.pyx":562
 * 
 * 		self.disconnect_fun = disconnect_func
 * 		xmmsc_disconnect_callback_set_full(self.conn, python_disconnect_fun, <void *>self, NULL)             # <<<<<<<<<<<<<<
 * 		xmmsc_io_need_out_callback_set_full(self.conn, python_need_out_fun, <void *> self, NULL)
 * 
 */
  xmmsc_disconnect_callback_set_full(__pyx_v_self->conn, __pyx_f_7xmmsapi_python_disconnect_fun, ((void *)__pyx_v_self), NULL);

  /* "xmmsapi.pyx":563
 * 		self.disconnect_fun = disconnect_func
 * 		xmmsc_disconnect_callback_set_full(self.conn, python_disconnect_fun, <void *>self, NULL)
 * 		xmmsc_io_need_out_callback_set_full(self.conn, python_need_out_fun, <void *> self, NULL)             # <<<<<<<<<<<<<<
 * 
 * 	def is_connected(self):
 */
  xmmsc_io_need_out_callback_set_full(__pyx_v_self->conn, __pyx_f_7xmmsapi_python_need_out_fun, ((void *)__pyx_v_self), NULL);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_27connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsCore_26connect[] = "\n\t\tconnect(path=None, disconnect_func=None)\n\n\t\tConnect to the appropriate IPC path, for communication with the\n\t\tXMMS2 daemon. This path defaults to /tmp/xmms-ipc-<username> if\n\t\tnot specified. Call this once you have instantiated the object:\n\n\t\tC{import xmmsclient}\n\n\t\tC{xmms = xmmsclient.XMMS()}\n\n\t\tC{xmms.connect()}\n\n\t\t...\n\n\t\tYou can provide a disconnect callback function to be activated\n\t\twhen the daemon disconnects.(e.g. daemon quit) This function\n\t\ttypically has to exit the main loop used by your application.\n\t\tFor example, if using L{loop}, your callback should call\n\t\tL{exit_loop} at some point.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_27connect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_disconnect_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__disconnect_func,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":529
 * 		return xmmsc_io_fd_get(self.conn)
 * 
 * 	cpdef connect(self, path=None, disconnect_func=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		connect(path=None, disconnect_func=None)
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__disconnect_func);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_disconnect_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connect", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsCore.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_26connect(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_path, __pyx_v_disconnect_func);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_26connect(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_disconnect_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.path = __pyx_v_path;
  __pyx_t_2.disconnect_func = __pyx_v_disconnect_func;
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->connect(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_29is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_29is_connected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_connected (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_28is_connected(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":565
 * 		xmmsc_io_need_out_callback_set_full(self.conn, python_need_out_fun, <void *> self, NULL)
 * 
 * 	def is_connected(self):             # <<<<<<<<<<<<<<
 * 		return self.isconnected != 0
 * 
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_28is_connected(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_connected", 0);

  /* "xmmsapi.pyx":566
 * 
 * 	def is_connected(self):
 * 		return self.isconnected != 0             # <<<<<<<<<<<<<<
 * 
 * 	cdef XmmsResult _create_result(self, cb, xmmsc_result_t *res, Cls):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->isconnected != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.is_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":568
 * 		return self.isconnected != 0
 * 
 * 	cdef XmmsResult _create_result(self, cb, xmmsc_result_t *res, Cls):             # <<<<<<<<<<<<<<
 * 		cdef XmmsResult ret
 * 		if res == NULL:
 */

static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_8XmmsCore__create_result(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_cb, xmmsc_result_t *__pyx_v_res, PyObject *__pyx_v_Cls) {
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_ret = 0;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_result", 0);

  /* "xmmsapi.pyx":570
 * 	cdef XmmsResult _create_result(self, cb, xmmsc_result_t *res, Cls):
 * 		cdef XmmsResult ret
 * 		if res == NULL:             # <<<<<<<<<<<<<<
 * 			raise RuntimeError("xmmsc_result_t couldn't be allocated")
 * 		ret = Cls()
 */
  __pyx_t_1 = (__pyx_v_res == NULL);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":571
 * 		cdef XmmsResult ret
 * 		if res == NULL:
 * 			raise RuntimeError("xmmsc_result_t couldn't be allocated")             # <<<<<<<<<<<<<<
 * 		ret = Cls()
 * 		ret.set_sourcepref(self.source_preference)
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":572
 * 		if res == NULL:
 * 			raise RuntimeError("xmmsc_result_t couldn't be allocated")
 * 		ret = Cls()             # <<<<<<<<<<<<<<
 * 		ret.set_sourcepref(self.source_preference)
 * 		ret.set_result(res)
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_Cls, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ret = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":573
 * 			raise RuntimeError("xmmsc_result_t couldn't be allocated")
 * 		ret = Cls()
 * 		ret.set_sourcepref(self.source_preference)             # <<<<<<<<<<<<<<
 * 		ret.set_result(res)
 * 		if cb is not None:
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->source_preference);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_ret->__pyx_vtab)->set_sourcepref(__pyx_v_ret, ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "xmmsapi.pyx":574
 * 		ret = Cls()
 * 		ret.set_sourcepref(self.source_preference)
 * 		ret.set_result(res)             # <<<<<<<<<<<<<<
 * 		if cb is not None:
 * 			ret.set_callback(self.result_tracker, cb) # property that setup all.
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_ret->__pyx_vtab)->set_result(__pyx_v_ret, __pyx_v_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "xmmsapi.pyx":575
 * 		ret.set_sourcepref(self.source_preference)
 * 		ret.set_result(res)
 * 		if cb is not None:             # <<<<<<<<<<<<<<
 * 			ret.set_callback(self.result_tracker, cb) # property that setup all.
 * 		return ret
 */
  __pyx_t_1 = (__pyx_v_cb != Py_None);
  if (__pyx_t_1) {

    /* "xmmsapi.pyx":576
 * 		ret.set_result(res)
 * 		if cb is not None:
 * 			ret.set_callback(self.result_tracker, cb) # property that setup all.             # <<<<<<<<<<<<<<
 * 		return ret
 * 
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_self->result_tracker);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsResult *)__pyx_v_ret->__pyx_vtab)->set_callback(__pyx_v_ret, ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)__pyx_t_3), __pyx_v_cb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":577
 * 		if cb is not None:
 * 			ret.set_callback(self.result_tracker, cb) # property that setup all.
 * 		return ret             # <<<<<<<<<<<<<<
 * 
 * 	cdef XmmsResult create_result(self, cb, xmmsc_result_t *res):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsCore._create_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ret);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":579
 * 		return ret
 * 
 * 	cdef XmmsResult create_result(self, cb, xmmsc_result_t *res):             # <<<<<<<<<<<<<<
 * 		return self._create_result(cb, res, XmmsResult)
 * 
 */

static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_8XmmsCore_create_result(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_cb, xmmsc_result_t *__pyx_v_res) {
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_result", 0);

  /* "xmmsapi.pyx":580
 * 
 * 	cdef XmmsResult create_result(self, cb, xmmsc_result_t *res):
 * 		return self._create_result(cb, res, XmmsResult)             # <<<<<<<<<<<<<<
 * 
 * 	cdef XmmsResult create_vis_result(self, cb, xmmsc_result_t *res, VisResultCommand cmd):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsResult));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->_create_result(__pyx_v_self, __pyx_v_cb, __pyx_v_res, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.create_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":582
 * 		return self._create_result(cb, res, XmmsResult)
 * 
 * 	cdef XmmsResult create_vis_result(self, cb, xmmsc_result_t *res, VisResultCommand cmd):             # <<<<<<<<<<<<<<
 * 		cdef XmmsVisResult vres = self._create_result(cb, res, XmmsVisResult)
 * 		vres.set_command(cmd, self.conn)
 */

static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_8XmmsCore_create_vis_result(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self, PyObject *__pyx_v_cb, xmmsc_result_t *__pyx_v_res, __pyx_t_7xmmsapi_VisResultCommand __pyx_v_cmd) {
  struct __pyx_obj_7xmmsapi_XmmsVisResult *__pyx_v_vres = 0;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_vis_result", 0);

  /* "xmmsapi.pyx":583
 * 
 * 	cdef XmmsResult create_vis_result(self, cb, xmmsc_result_t *res, VisResultCommand cmd):
 * 		cdef XmmsVisResult vres = self._create_result(cb, res, XmmsVisResult)             # <<<<<<<<<<<<<<
 * 		vres.set_command(cmd, self.conn)
 * 		return vres
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsVisResult));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsCore *)__pyx_v_self->__pyx_vtab)->_create_result(__pyx_v_self, __pyx_v_cb, __pyx_v_res, __pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsVisResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vres = ((struct __pyx_obj_7xmmsapi_XmmsVisResult *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":584
 * 	cdef XmmsResult create_vis_result(self, cb, xmmsc_result_t *res, VisResultCommand cmd):
 * 		cdef XmmsVisResult vres = self._create_result(cb, res, XmmsVisResult)
 * 		vres.set_command(cmd, self.conn)             # <<<<<<<<<<<<<<
 * 		return vres
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult *)__pyx_v_vres->__pyx_base.__pyx_vtab)->set_command(__pyx_v_vres, __pyx_v_cmd, __pyx_v_self->conn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":585
 * 		cdef XmmsVisResult vres = self._create_result(cb, res, XmmsVisResult)
 * 		vres.set_command(cmd, self.conn)
 * 		return vres             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_vres));
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_v_vres);
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsCore.create_vis_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_vres);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_17source_preference_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_17source_preference_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_17source_preference___get__(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pxd":70
 * 	cdef object disconnect_fun
 * 	cdef object needout_fun
 * 	cdef readonly XmmsSourcePreference source_preference             # <<<<<<<<<<<<<<
 * 	cdef XmmsResultTracker result_tracker
 * 	cdef readonly object clientname
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_17source_preference___get__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->source_preference));
  __pyx_r = ((PyObject *)__pyx_v_self->source_preference);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_10clientname_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsCore_10clientname_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsCore_10clientname___get__(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pxd":72
 * 	cdef readonly XmmsSourcePreference source_preference
 * 	cdef XmmsResultTracker result_tracker
 * 	cdef readonly object clientname             # <<<<<<<<<<<<<<
 * 
 * 	cdef new_connection(self)
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsCore_10clientname___get__(struct __pyx_obj_7xmmsapi_XmmsCore *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->clientname);
  __pyx_r = __pyx_v_self->clientname;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":589
 * 
 * cdef class XmmsApi(XmmsCore):
 * 	cpdef XmmsResult quit(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		quit(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_1quit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_quit(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__quit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_1quit)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":597
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_quit(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult plugin_list(self, typ, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_quit(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.quit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_1quit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_quit[] = "\n\t\tquit(cb=None) -> XmmsResult\n\n\t\tTell the XMMS2 daemon to quit.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_1quit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":589
 * 
 * cdef class XmmsApi(XmmsCore):
 * 	cpdef XmmsResult quit(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		quit(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "quit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("quit", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.quit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_quit(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_quit(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->quit(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.quit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":599
 * 		return self.create_result(cb, xmmsc_quit(self.conn))
 * 
 * 	cpdef XmmsResult plugin_list(self, typ, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		plugin_list(typ, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_3plugin_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_plugin_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_typ, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  xmms_plugin_type_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plugin_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__plugin_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_3plugin_list)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_typ);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_typ);
      __Pyx_GIVEREF(__pyx_v_typ);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":607
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_main_list_plugins(self.conn, typ))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_start(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = ((xmms_plugin_type_t)PyInt_AsLong(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_main_list_plugins(__pyx_v_self->__pyx_base.conn, __pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.plugin_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_3plugin_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_2plugin_list[] = "\n\t\tplugin_list(typ, cb=None) -> XmmsResult\n\n\t\tGet a list of loaded plugins from the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_3plugin_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_typ = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plugin_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__typ,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":599
 * 		return self.create_result(cb, xmmsc_quit(self.conn))
 * 
 * 	cpdef XmmsResult plugin_list(self, typ, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		plugin_list(typ, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__typ)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "plugin_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_typ = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plugin_list", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.plugin_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_2plugin_list(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_typ, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_2plugin_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plugin_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->plugin_list(__pyx_v_self, __pyx_v_typ, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.plugin_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":609
 * 		return self.create_result(cb, xmmsc_main_list_plugins(self.conn, typ))
 * 
 * 	cpdef XmmsResult playback_start(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_start(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_5playback_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_start", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_5playback_start)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":618
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_start(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_stop(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_start(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_5playback_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_4playback_start[] = "\n\t\tplayback_start(cb=None) -> XmmsResult\n\n\t\tInstruct the XMMS2 daemon to start playing the currently\n\t\tselected file from the playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_5playback_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":609
 * 		return self.create_result(cb, xmmsc_main_list_plugins(self.conn, typ))
 * 
 * 	cpdef XmmsResult playback_start(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_start(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_start", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_4playback_start(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_4playback_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_start(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":620
 * 		return self.create_result(cb, xmmsc_playback_start(self.conn))
 * 
 * 	cpdef XmmsResult playback_stop(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_stop(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_7playback_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_stop(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_stop", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_stop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_7playback_stop)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":629
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_stop(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_tickle(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_stop(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_7playback_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_6playback_stop[] = "\n\t\tplayback_stop(cb=None) -> XmmsResult\n\n\t\tInstruct the XMMS2 daemon to stop playing the file\n\t\tcurrently being played.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_7playback_stop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_stop (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":620
 * 		return self.create_result(cb, xmmsc_playback_start(self.conn))
 * 
 * 	cpdef XmmsResult playback_stop(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_stop(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_stop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_stop", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_6playback_stop(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_6playback_stop(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_stop", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_stop(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":631
 * 		return self.create_result(cb, xmmsc_playback_stop(self.conn))
 * 
 * 	cpdef XmmsResult playback_tickle(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_tickle(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_9playback_tickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_tickle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_tickle", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_tickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_9playback_tickle)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":639
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_tickle(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_pause(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_tickle(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_tickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_9playback_tickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_8playback_tickle[] = "\n\t\tplayback_tickle(cb=None) -> XmmsResult\n\n\t\tInstruct the XMMS2 daemon to move on to the next playlist item.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_9playback_tickle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_tickle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":631
 * 		return self.create_result(cb, xmmsc_playback_stop(self.conn))
 * 
 * 	cpdef XmmsResult playback_tickle(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_tickle(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_tickle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_tickle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_tickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_8playback_tickle(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_8playback_tickle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_tickle", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_tickle(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_tickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":641
 * 		return self.create_result(cb, xmmsc_playback_tickle(self.conn))
 * 
 * 	cpdef XmmsResult playback_pause(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_pause(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_11playback_pause(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_pause(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_pause", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_pause); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_11playback_pause)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":649
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_pause(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_current_id(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_pause(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_pause", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_11playback_pause(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_10playback_pause[] = "\n\t\tplayback_pause(cb=None) -> XmmsResult\n\n\t\tInstruct the XMMS2 daemon to pause playback.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_11playback_pause(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_pause (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":641
 * 		return self.create_result(cb, xmmsc_playback_tickle(self.conn))
 * 
 * 	cpdef XmmsResult playback_pause(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_pause(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_pause") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_pause", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_pause", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_10playback_pause(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_10playback_pause(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_pause", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_pause(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_pause", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":651
 * 		return self.create_result(cb, xmmsc_playback_pause(self.conn))
 * 
 * 	cpdef XmmsResult playback_current_id(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_current_id(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_13playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_current_id", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_current_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_13playback_current_id)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":658
 * 		@return: The medialib id of the item currently selected.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_current_id(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence = PLAYBACK_SEEK_SET, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_current_id(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_13playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_12playback_current_id[] = "\n\t\tplayback_current_id(cb=None) -> XmmsResult\n\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t@return: The medialib id of the item currently selected.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_13playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_current_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":651
 * 		return self.create_result(cb, xmmsc_playback_pause(self.conn))
 * 
 * 	cpdef XmmsResult playback_current_id(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_current_id(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_current_id") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_current_id", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_12playback_current_id(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_12playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_current_id", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_current_id(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":660
 * 		return self.create_result(cb, xmmsc_playback_current_id(self.conn))
 * 
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence = PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_ms(ms, whence=PLAYBACK_SEEK_SET, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_15playback_seek_ms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_seek_ms(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_ms, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms *__pyx_optional_args) {
  xmms_playback_seek_mode_t __pyx_v_whence = __pyx_k_38;
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_seek_ms", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_whence = __pyx_optional_args->whence;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_seek_ms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_15playback_seek_ms)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_ms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":668
 * 		@return: The result of the operation.
 * 		"""
 * 		if whence == PLAYBACK_SEEK_SET or whence == PLAYBACK_SEEK_CUR:             # <<<<<<<<<<<<<<
 * 			return self.create_result(cb, xmmsc_playback_seek_ms(self.conn, ms, whence))
 * 		else:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_SET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_5) {
    __pyx_t_4 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_CUR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_5;
  }
  if (__pyx_t_7) {

    /* "xmmsapi.pyx":669
 * 		"""
 * 		if whence == PLAYBACK_SEEK_SET or whence == PLAYBACK_SEEK_CUR:
 * 			return self.create_result(cb, xmmsc_playback_seek_ms(self.conn, ms, whence))             # <<<<<<<<<<<<<<
 * 		else:
 * 			raise ValueError("Bad whence parameter")
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_seek_ms(__pyx_v_self->__pyx_base.conn, __pyx_v_ms, __pyx_v_whence))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":671
 * 			return self.create_result(cb, xmmsc_playback_seek_ms(self.conn, ms, whence))
 * 		else:
 * 			raise ValueError("Bad whence parameter")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=PLAYBACK_SEEK_SET, cb = None):
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_15playback_seek_ms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_14playback_seek_ms[] = "\n\t\tplayback_seek_ms(ms, whence=PLAYBACK_SEEK_SET, cb=None) -> XmmsResult\n\n\t\tSeek to a time position in the current file or stream in playback.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_15playback_seek_ms(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_ms;
  xmms_playback_seek_mode_t __pyx_v_whence;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_seek_ms (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ms,&__pyx_n_s__whence,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":660
 * 		return self.create_result(cb, xmmsc_playback_current_id(self.conn))
 * 
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence = PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_ms(ms, whence=PLAYBACK_SEEK_SET, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ms)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__whence);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_seek_ms") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ms = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_ms == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_whence = ((xmms_playback_seek_mode_t)PyInt_AsLong(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_whence = __pyx_k_38;
    }
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_seek_ms", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_14playback_seek_ms(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_ms, __pyx_v_whence, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_14playback_seek_ms(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_ms, xmms_playback_seek_mode_t __pyx_v_whence, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_seek_ms", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.whence = __pyx_v_whence;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_seek_ms(__pyx_v_self, __pyx_v_ms, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_ms", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":673
 * 			raise ValueError("Bad whence parameter")
 * 
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_samples(samples, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_17playback_seek_samples(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_seek_samples(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_samples, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples *__pyx_optional_args) {
  xmms_playback_seek_mode_t __pyx_v_whence = __pyx_k_41;
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_seek_samples", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_whence = __pyx_optional_args->whence;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_42); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_17playback_seek_samples)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":681
 * 		@return: The result of the operation.
 * 		"""
 * 		if whence == PLAYBACK_SEEK_SET or whence == PLAYBACK_SEEK_CUR:             # <<<<<<<<<<<<<<
 * 			return self.create_result(cb, xmmsc_playback_seek_samples(self.conn, samples, whence))
 * 		else:
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_SET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_5) {
    __pyx_t_4 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_CUR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_5;
  }
  if (__pyx_t_7) {

    /* "xmmsapi.pyx":682
 * 		"""
 * 		if whence == PLAYBACK_SEEK_SET or whence == PLAYBACK_SEEK_CUR:
 * 			return self.create_result(cb, xmmsc_playback_seek_samples(self.conn, samples, whence))             # <<<<<<<<<<<<<<
 * 		else:
 * 			raise ValueError("Bad whence parameter")
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_seek_samples(__pyx_v_self->__pyx_base.conn, __pyx_v_samples, __pyx_v_whence))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":684
 * 			return self.create_result(cb, xmmsc_playback_seek_samples(self.conn, samples, whence))
 * 		else:
 * 			raise ValueError("Bad whence parameter")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_status(self, cb = None):
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_17playback_seek_samples(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_16playback_seek_samples[] = "\n\t\tplayback_seek_samples(samples, cb=None) -> XmmsResult\n\n\t\tSeek to a number of samples in the current file or stream in playback.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_17playback_seek_samples(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_samples;
  xmms_playback_seek_mode_t __pyx_v_whence;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_seek_samples (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__samples,&__pyx_n_s__whence,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":673
 * 			raise ValueError("Bad whence parameter")
 * 
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_samples(samples, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__samples)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__whence);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_seek_samples") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_samples = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_samples == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_whence = ((xmms_playback_seek_mode_t)PyInt_AsLong(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_whence = __pyx_k_41;
    }
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_seek_samples", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_16playback_seek_samples(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_samples, __pyx_v_whence, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_16playback_seek_samples(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_samples, xmms_playback_seek_mode_t __pyx_v_whence, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_seek_samples", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.whence = __pyx_v_whence;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_seek_samples(__pyx_v_self, __pyx_v_samples, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_seek_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":686
 * 			raise ValueError("Bad whence parameter")
 * 
 * 	cpdef XmmsResult playback_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_status(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_19playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_status", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_19playback_status)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":698
 * 		@return: Current playback status(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_status(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playback_status(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_status(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_19playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_18playback_status[] = "\n\t\tplayback_status(cb=None) -> XmmsResult\n\n\t\tGet current playback status from XMMS2 daemon. This is\n\t\tessentially the more direct version of\n\t\tL{broadcast_playback_status}. Possible return values are:\n\t\tL{PLAYBACK_STATUS_STOP}, L{PLAYBACK_STATUS_PLAY},\n\t\tL{PLAYBACK_STATUS_PAUSE}\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t@return: Current playback status(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_19playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_status (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":686
 * 			raise ValueError("Bad whence parameter")
 * 
 * 	cpdef XmmsResult playback_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_status(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_18playback_status(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_18playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_status", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_status(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":700
 * 		return self.create_result(cb, xmmsc_playback_status(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_status(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_21broadcast_playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_status", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_44); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_21broadcast_playback_status)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":708
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playback_status(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playback_status(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_21broadcast_playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_20broadcast_playback_status[] = "\n\t\tbroadcast_playback_status(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the playback status broadcast from the\n\t\tXMMS2 daemon.\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_21broadcast_playback_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playback_status (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":700
 * 		return self.create_result(cb, xmmsc_playback_status(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_status(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playback_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playback_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_20broadcast_playback_status(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_20broadcast_playback_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_status", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playback_status(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":710
 * 		return self.create_result(cb, xmmsc_broadcast_playback_status(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_current_id(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_23broadcast_playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_current_id", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_45); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_23broadcast_playback_current_id)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":718
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playback_current_id(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_playtime(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playback_current_id(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_23broadcast_playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_22broadcast_playback_current_id[] = "\n\t\tbroadcast_playback_current_id(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the playback id broadcast from the\n\t\tXMMS2 daemon.\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_23broadcast_playback_current_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playback_current_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":710
 * 		return self.create_result(cb, xmmsc_broadcast_playback_status(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_current_id(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_current_id(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playback_current_id") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playback_current_id", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_22broadcast_playback_current_id(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_22broadcast_playback_current_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_current_id", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playback_current_id(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_current_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":720
 * 		return self.create_result(cb, xmmsc_broadcast_playback_current_id(self.conn))
 * 
 * 	cpdef XmmsResult playback_playtime(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_playtime(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_25playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_playtime", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_playtime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_25playback_playtime)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":729
 * 		@return: The result of the operation.(playtime in milliseconds)
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_playtime(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult signal_playback_playtime(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_playtime(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_25playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_24playback_playtime[] = "\n\t\tplayback_playtime(cb=None) -> XmmsResult\n\n\t\tReturn playtime on current file/stream. This is essentially a\n\t\tmore direct version of L{signal_playback_playtime}\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t@return: The result of the operation.(playtime in milliseconds)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_25playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_playtime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":720
 * 		return self.create_result(cb, xmmsc_broadcast_playback_current_id(self.conn))
 * 
 * 	cpdef XmmsResult playback_playtime(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_playtime(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_playtime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_playtime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_24playback_playtime(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_24playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_playtime", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_playtime(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":731
 * 		return self.create_result(cb, xmmsc_playback_playtime(self.conn))
 * 
 * 	cpdef XmmsResult signal_playback_playtime(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		signal_playback_playtime(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_27signal_playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_signal_playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signal_playback_playtime", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_46); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_27signal_playback_playtime)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __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;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":739
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_signal_playback_playtime(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_signal_playback_playtime(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_27signal_playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_26signal_playback_playtime[] = "\n\t\tsignal_playback_playtime(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the playback playtime signal from the\n\t\tXMMS2 daemon.\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_27signal_playback_playtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("signal_playback_playtime (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":731
 * 		return self.create_result(cb, xmmsc_playback_playtime(self.conn))
 * 
 * 	cpdef XmmsResult signal_playback_playtime(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		signal_playback_playtime(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal_playback_playtime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("signal_playback_playtime", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_26signal_playback_playtime(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_26signal_playback_playtime(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signal_playback_playtime", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->signal_playback_playtime(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_playback_playtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":741
 * 		return self.create_result(cb, xmmsc_signal_playback_playtime(self.conn))
 * 
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_volume_set(channel, volume, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_29playback_volume_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_volume_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_channel, int __pyx_v_volume, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_c = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_volume_set", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_volume_set); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_29playback_volume_set)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_volume); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_channel);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_channel);
      __Pyx_GIVEREF(__pyx_v_channel);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":748
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		c = from_unicode(channel)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playback_volume_set(self.conn, c, volume))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_channel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":749
 * 		"""
 * 		c = from_unicode(channel)
 * 		return self.create_result(cb, xmmsc_playback_volume_set(self.conn, c, volume))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_volume_get(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_volume_set(__pyx_v_self->__pyx_base.conn, __pyx_t_4, __pyx_v_volume))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_29playback_volume_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_28playback_volume_set[] = "\n\t\tplayback_volume_set(channel, volume, cb=None) -> XmmsResult\n\n\t\tSet the playback volume for specified channel\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_29playback_volume_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  int __pyx_v_volume;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_volume_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__channel,&__pyx_n_s__volume,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":741
 * 		return self.create_result(cb, xmmsc_signal_playback_playtime(self.conn))
 * 
 * 	cpdef XmmsResult playback_volume_set(self, channel, int volume, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_volume_set(channel, volume, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__channel)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__volume)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playback_volume_set", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_volume_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_channel = values[0];
    __pyx_v_volume = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_volume == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_volume_set", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_28playback_volume_set(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_channel, __pyx_v_volume, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_28playback_volume_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_channel, int __pyx_v_volume, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_volume_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_volume_set(__pyx_v_self, __pyx_v_channel, __pyx_v_volume, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":751
 * 		return self.create_result(cb, xmmsc_playback_volume_set(self.conn, c, volume))
 * 
 * 	cpdef XmmsResult playback_volume_get(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_volume_get(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_31playback_volume_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playback_volume_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_volume_get", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playback_volume_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_31playback_volume_get)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":758
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_playback_volume_get(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playback_volume_get(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_31playback_volume_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_30playback_volume_get[] = "\n\t\tplayback_volume_get(cb=None) -> XmmsResult\n\n\t\tGet the playback for all channels\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_31playback_volume_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playback_volume_get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":751
 * 		return self.create_result(cb, xmmsc_playback_volume_set(self.conn, c, volume))
 * 
 * 	cpdef XmmsResult playback_volume_get(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_volume_get(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playback_volume_get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playback_volume_get", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_30playback_volume_get(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_30playback_volume_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playback_volume_get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playback_volume_get(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playback_volume_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":760
 * 		return self.create_result(cb, xmmsc_playback_volume_get(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_volume_changed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_33broadcast_playback_volume_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_volume_changed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_47); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_33broadcast_playback_volume_changed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":767
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playback_volume_changed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playback_volume_changed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_volume_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_33broadcast_playback_volume_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_32broadcast_playback_volume_changed[] = "\n\t\tbroadcast_playback_volume_changed(cb=None) -> XmmsResult\n\n\t\tSet a broadcast callback for volume updates\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_33broadcast_playback_volume_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playback_volume_changed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":760
 * 		return self.create_result(cb, xmmsc_playback_volume_get(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playback_volume_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playback_volume_changed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playback_volume_changed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playback_volume_changed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_volume_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_32broadcast_playback_volume_changed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_32broadcast_playback_volume_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playback_volume_changed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playback_volume_changed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playback_volume_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":769
 * 		return self.create_result(cb, xmmsc_broadcast_playback_volume_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_loaded(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_35broadcast_playlist_loaded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_loaded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_loaded", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_48); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_35broadcast_playlist_loaded)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":776
 * 		@rtype: L{XmmsResult}(UInt)
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_loaded(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_load(self, playlist, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playlist_loaded(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_loaded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_35broadcast_playlist_loaded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_34broadcast_playlist_loaded[] = "\n\t\tbroadcast_playlist_loaded(cb=None) -> XmmsResult\n\n\t\tSet a broadcast callback for loaded playlist event\n\t\t@rtype: L{XmmsResult}(UInt)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_35broadcast_playlist_loaded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playlist_loaded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":769
 * 		return self.create_result(cb, xmmsc_broadcast_playback_volume_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_loaded(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_loaded(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playlist_loaded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playlist_loaded", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_loaded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_34broadcast_playlist_loaded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_34broadcast_playlist_loaded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_loaded", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playlist_loaded(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_loaded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":778
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_loaded(self.conn))
 * 
 * 	cpdef XmmsResult playlist_load(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_load(playlist, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_37playlist_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_load(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_load", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_load); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_37playlist_load)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":786
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, False)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_load(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":787
 * 		"""
 * 		p = check_playlist(playlist, False)
 * 		return self.create_result(cb, xmmsc_playlist_load(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_list(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_load(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_37playlist_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_36playlist_load[] = "\n\t\tplaylist_load(playlist, cb=None) -> XmmsResult\n\n\t\tLoad the playlist as current playlist\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_37playlist_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_load (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":778
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_loaded(self.conn))
 * 
 * 	cpdef XmmsResult playlist_load(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_load(playlist, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_load") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_load", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_36playlist_load(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_36playlist_load(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_load", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_load(__pyx_v_self, __pyx_v_playlist, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_load", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":789
 * 		return self.create_result(cb, xmmsc_playlist_load(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_list(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_list(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_39playlist_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_39playlist_list)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":797
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_playlist_list(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_list(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_39playlist_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_38playlist_list[] = "\n\t\tplaylist_list(cb=None) -> XmmsResult\n\n\t\tLists the playlists\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_39playlist_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":789
 * 		return self.create_result(cb, xmmsc_playlist_load(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_list(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_list(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_list", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_38playlist_list(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_38playlist_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_list(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":799
 * 		return self.create_result(cb, xmmsc_playlist_list(self.conn))
 * 
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_remove(playlist, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_41playlist_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_remove", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_41playlist_remove)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":807
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, False)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_remove(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":808
 * 		"""
 * 		p = check_playlist(playlist, False)
 * 		return self.create_result(cb, xmmsc_playlist_remove(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_shuffle(self, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_remove(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_41playlist_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_40playlist_remove[] = "\n\t\tplaylist_remove(playlist, cb=None) -> XmmsResult\n\n\t\tRemove the playlist from the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_41playlist_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_remove (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":799
 * 		return self.create_result(cb, xmmsc_playlist_list(self.conn))
 * 
 * 	cpdef XmmsResult playlist_remove(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_remove(playlist, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_remove", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_40playlist_remove(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_40playlist_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_remove", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_remove(__pyx_v_self, __pyx_v_playlist, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":810
 * 		return self.create_result(cb, xmmsc_playlist_remove(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_shuffle(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_shuffle(playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_43playlist_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_shuffle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_shuffle", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_43playlist_shuffle)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":818
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_shuffle(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":819
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_shuffle(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist = None, cb = None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_shuffle(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_43playlist_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_42playlist_shuffle[] = "\n\t\tplaylist_shuffle(playlist=None, cb=None) -> XmmsResult\n\n\t\tInstruct the XMMS2 daemon to shuffle the playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_43playlist_shuffle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_shuffle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":810
 * 		return self.create_result(cb, xmmsc_playlist_remove(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_shuffle(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_shuffle(playlist=None, cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_shuffle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_shuffle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_42playlist_shuffle(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_42playlist_shuffle(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_shuffle", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_shuffle(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":821
 * 		return self.create_result(cb, xmmsc_playlist_shuffle(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_rinsert(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_45playlist_rinsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_rinsert(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_49;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_rinsert", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_encoded = __pyx_optional_args->encoded;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_rinsert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_45playlist_rinsert)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":832
 * 		cdef xmmsc_result_t *res
 * 
 * 		c = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		p = check_playlist(playlist, True)
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":833
 * 
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 
 * 		if encoded:
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":835
 * 		p = check_playlist(playlist, True)
 * 
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_playlist_rinsert_encoded(self.conn, <char *>p, pos, <char *>c)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":836
 * 
 * 		if encoded:
 * 			res = xmmsc_playlist_rinsert_encoded(self.conn, <char *>p, pos, <char *>c)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_playlist_rinsert(self.conn, <char *>p, pos, <char *>c)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_rinsert_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), __pyx_v_pos, ((char *)__pyx_t_6));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":838
 * 			res = xmmsc_playlist_rinsert_encoded(self.conn, <char *>p, pos, <char *>c)
 * 		else:
 * 			res = xmmsc_playlist_rinsert(self.conn, <char *>p, pos, <char *>c)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_rinsert(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), __pyx_v_pos, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":839
 * 		else:
 * 			res = xmmsc_playlist_rinsert(self.conn, <char *>p, pos, <char *>c)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_rinsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_45playlist_rinsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_44playlist_rinsert[] = "\n\t\tplaylist_rinsert(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult\n\n\t\tInsert a directory in the playlist.\n\t\tRequires an int 'pos' and a string 'url' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_45playlist_rinsert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_rinsert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "xmmsapi.pyx":821
 * 		return self.create_result(cb, xmmsc_playlist_shuffle(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_rinsert(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_49;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_rinsert", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_rinsert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_url = values[1];
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
    __pyx_v_encoded = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_rinsert", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_rinsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_44playlist_rinsert(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_url, __pyx_v_playlist, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_44playlist_rinsert(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_rinsert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_rinsert(__pyx_v_self, __pyx_v_pos, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_rinsert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_47playlist_rinsert_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_46playlist_rinsert_encoded[] = "\n\t\t@deprecated\n\t\tUse playlist_rinsert(pos, url, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_47playlist_rinsert_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_rinsert_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":842
 * 
 * 	@deprecated
 * 	def playlist_rinsert_encoded(self, int pos, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_rinsert_encoded", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_rinsert_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_url = values[1];
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_rinsert_encoded", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_rinsert_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_46playlist_rinsert_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_url, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_46playlist_rinsert_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_rinsert_encoded", 0);

  /* "xmmsapi.pyx":847
 * 		Use playlist_rinsert(pos, url, ..., encoded=True) instead
 * 		"""
 * 		return self.playlist_rinsert(pos, url, playlist, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist = None, cb = None, encoded = False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_rinsert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_url);
  __Pyx_GIVEREF(__pyx_v_url);
  __Pyx_INCREF(__pyx_v_playlist);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_playlist);
  __Pyx_GIVEREF(__pyx_v_playlist);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_rinsert_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":849
 * 		return self.playlist_rinsert(pos, url, playlist, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist = None, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_url(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_49playlist_insert_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_50;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_url", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_encoded = __pyx_optional_args->encoded;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_insert_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_49playlist_insert_url)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":861
 * 		cdef xmmsc_result_t *res
 * 
 * 		c = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		p = check_playlist(playlist, True)
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":862
 * 
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 
 * 		if encoded:
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":864
 * 		p = check_playlist(playlist, True)
 * 
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_playlist_insert_encoded(self.conn, <char *>p, pos, <char *>c)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":865
 * 
 * 		if encoded:
 * 			res = xmmsc_playlist_insert_encoded(self.conn, <char *>p, pos, <char *>c)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_playlist_insert_url(self.conn, <char *>p, pos, <char *>c)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_insert_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), __pyx_v_pos, ((char *)__pyx_t_6));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":867
 * 			res = xmmsc_playlist_insert_encoded(self.conn, <char *>p, pos, <char *>c)
 * 		else:
 * 			res = xmmsc_playlist_insert_url(self.conn, <char *>p, pos, <char *>c)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_insert_url(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), __pyx_v_pos, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":868
 * 		else:
 * 			res = xmmsc_playlist_insert_url(self.conn, <char *>p, pos, <char *>c)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_49playlist_insert_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_48playlist_insert_url[] = "\n\t\tplaylist_insert_url(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult\n\n\t\tInsert a path or URL to a playable media item to the playlist.\n\t\tPlayable media items may be files or streams.\n\t\tRequires an int 'pos' and a string 'url' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_49playlist_insert_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_insert_url (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "xmmsapi.pyx":849
 * 		return self.playlist_rinsert(pos, url, playlist, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist = None, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_url(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_50;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_insert_url", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_insert_url") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_url = values[1];
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
    __pyx_v_encoded = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_insert_url", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_48playlist_insert_url(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_url, __pyx_v_playlist, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_48playlist_insert_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_url", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_insert_url(__pyx_v_self, __pyx_v_pos, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_51playlist_insert_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_50playlist_insert_encoded[] = "\n\t\t@deprecated\n\t\tUse playlist_insert_url(pos, url, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_51playlist_insert_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_insert_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":871
 * 
 * 	@deprecated
 * 	def playlist_insert_encoded(self, int pos, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_insert_encoded", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_insert_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_url = values[1];
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_insert_encoded", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_50playlist_insert_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_url, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_50playlist_insert_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_encoded", 0);

  /* "xmmsapi.pyx":876
 * 		Use playlist_insert_url(pos, url, ..., encoded=True) instead
 * 		"""
 * 		return self.playlist_insert_url(pos, url, playlist, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_insert_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_url);
  __Pyx_GIVEREF(__pyx_v_url);
  __Pyx_INCREF(__pyx_v_playlist);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_playlist);
  __Pyx_GIVEREF(__pyx_v_playlist);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":879
 * 
 * 
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_id(pos, id, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_53playlist_insert_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, int __pyx_v_id, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_id", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_insert_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_53playlist_insert_id)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":888
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_insert_id(self.conn, <char *>p, pos, id))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":889
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_insert_id(self.conn, <char *>p, pos, id))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_insert_id(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), __pyx_v_pos, __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_53playlist_insert_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_52playlist_insert_id[] = "\n\t\tplaylist_insert_id(pos, id, playlist=None, cb=None) -> XmmsResult\n\n\t\tInsert a medialib to the playlist.\n\t\tRequires an int 'pos' and an int 'id' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_53playlist_insert_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  int __pyx_v_id;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_insert_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__id,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":879
 * 
 * 
 * 	cpdef XmmsResult playlist_insert_id(self, int pos, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_id(pos, id, playlist=None, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_insert_id", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_insert_id") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_id = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_insert_id", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_52playlist_insert_id(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_id, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_52playlist_insert_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_id", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_insert_id(__pyx_v_self, __pyx_v_pos, __pyx_v_id, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":892
 * 
 * 
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order = None, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_collection(pos, coll, order=None, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_55playlist_insert_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection *__pyx_optional_args) {
  PyObject *__pyx_v_order = ((PyObject *)Py_None);
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_order_val;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  xmmsv_t *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_collection", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_order = __pyx_optional_args->order;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_playlist = __pyx_optional_args->playlist;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_cb = __pyx_optional_args->cb;
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_order);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_51); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_55playlist_insert_collection)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_order);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_order);
      __Pyx_GIVEREF(__pyx_v_order);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":904
 * 		cdef xmmsc_result_t *res
 * 
 * 		if order is None:             # <<<<<<<<<<<<<<
 * 			order = []
 * 		p = check_playlist(playlist, True)
 */
  __pyx_t_4 = (__pyx_v_order == Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":905
 * 
 * 		if order is None:
 * 			order = []             # <<<<<<<<<<<<<<
 * 		p = check_playlist(playlist, True)
 * 		order_val = create_native_value(order)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_order);
    __pyx_v_order = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":906
 * 		if order is None:
 * 			order = []
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_insert_collection(self.conn, <char *>p, pos, coll.coll, order_val)
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":907
 * 			order = []
 * 		p = check_playlist(playlist, True)
 * 		order_val = create_native_value(order)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_playlist_insert_collection(self.conn, <char *>p, pos, coll.coll, order_val)
 * 		xmmsv_unref(order_val)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_order); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_order_val = __pyx_t_5;

  /* "xmmsapi.pyx":908
 * 		p = check_playlist(playlist, True)
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_insert_collection(self.conn, <char *>p, pos, coll.coll, order_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)
 */
  __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = xmmsc_playlist_insert_collection(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), __pyx_v_pos, __pyx_v_coll->__pyx_base.coll, __pyx_v_order_val);

  /* "xmmsapi.pyx":909
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_insert_collection(self.conn, <char *>p, pos, coll.coll, order_val)
 * 		xmmsv_unref(order_val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v_order_val);

  /* "xmmsapi.pyx":910
 * 		res = xmmsc_playlist_insert_collection(self.conn, <char *>p, pos, coll.coll, order_val)
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_radd(self, url, playlist = None, cb = None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_order);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_55playlist_insert_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_54playlist_insert_collection[] = "\n\t\tplaylist_insert_collection(pos, coll, order=None, playlist=None, cb=None) -> XmmsResult\n\n\t\tInsert the content of a collection to the playlist.\n\t\tRequires an int 'pos' and an int 'id' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_55playlist_insert_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pos;
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_insert_collection (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pos,&__pyx_n_s__coll,&__pyx_n_s__order,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "xmmsapi.pyx":892
 * 
 * 
 * 	cpdef XmmsResult playlist_insert_collection(self, int pos, Collection coll, order = None, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_collection(pos, coll, order=None, playlist=None, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_insert_collection", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_insert_collection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[1]);
    __pyx_v_order = values[2];
    __pyx_v_playlist = values[3];
    __pyx_v_cb = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_insert_collection", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_54playlist_insert_collection(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_pos, __pyx_v_coll, __pyx_v_order, __pyx_v_playlist, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_54playlist_insert_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_pos, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_order, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_insert_collection", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.order = __pyx_v_order;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_insert_collection(__pyx_v_self, __pyx_v_pos, __pyx_v_coll, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_insert_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":912
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_radd(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_radd(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_57playlist_radd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_radd(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_52;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_radd", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_encoded = __pyx_optional_args->encoded;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_radd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_57playlist_radd)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":923
 * 		cdef xmmsc_result_t *res
 * 
 * 		c = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		p = check_playlist(playlist, True)
 * 		if encoded:
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":924
 * 
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_playlist_radd_encoded(self.conn, <char *>p, <char *>c)
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":925
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_playlist_radd_encoded(self.conn, <char *>p, <char *>c)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":926
 * 		p = check_playlist(playlist, True)
 * 		if encoded:
 * 			res = xmmsc_playlist_radd_encoded(self.conn, <char *>p, <char *>c)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_playlist_radd(self.conn, <char *>p, <char *>c)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_radd_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), ((char *)__pyx_t_6));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":928
 * 			res = xmmsc_playlist_radd_encoded(self.conn, <char *>p, <char *>c)
 * 		else:
 * 			res = xmmsc_playlist_radd(self.conn, <char *>p, <char *>c)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_radd(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":929
 * 		else:
 * 			res = xmmsc_playlist_radd(self.conn, <char *>p, <char *>c)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_radd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_57playlist_radd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_56playlist_radd[] = "\n\t\tplaylist_radd(url, playlist=None, cb=None, encoded=False) -> XmmsResult\n\n\t\tAdd a directory to the playlist.\n\t\tRequires a string 'url' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_57playlist_radd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_radd (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":912
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_radd(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_radd(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = __pyx_k_52;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_radd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
    __pyx_v_encoded = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_radd", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_radd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_56playlist_radd(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_playlist, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_56playlist_radd(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_radd", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_radd(__pyx_v_self, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_radd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_59playlist_radd_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_58playlist_radd_encoded[] = "\n\t\t@deprecated\n\t\tUse playlist_radd(url, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_59playlist_radd_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_radd_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":932
 * 
 * 	@deprecated
 * 	def playlist_radd_encoded(self, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_radd_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_radd_encoded", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_radd_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_58playlist_radd_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_58playlist_radd_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_radd_encoded", 0);

  /* "xmmsapi.pyx":937
 * 		Use playlist_radd(url, ..., encoded=True) instead
 * 		"""
 * 		return self.playlist_radd(url, playlist, cb = cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist = None, cb = None, encoded=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_radd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
  __Pyx_GIVEREF(__pyx_v_url);
  __Pyx_INCREF(__pyx_v_playlist);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_playlist);
  __Pyx_GIVEREF(__pyx_v_playlist);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_radd_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":939
 * 		return self.playlist_radd(url, playlist, cb = cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_url(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_61playlist_add_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_add_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_53;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_url", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_encoded = __pyx_optional_args->encoded;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_add_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_61playlist_add_url)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":951
 * 		cdef xmmsc_result_t *res
 * 
 * 		c = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		p = check_playlist(playlist, True)
 * 		if encoded:
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":952
 * 
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_playlist_add_encoded(self.conn, <char *>p, <char *>c)
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":953
 * 		c = from_unicode(url)
 * 		p = check_playlist(playlist, True)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_playlist_add_encoded(self.conn, <char *>p, <char *>c)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":954
 * 		p = check_playlist(playlist, True)
 * 		if encoded:
 * 			res = xmmsc_playlist_add_encoded(self.conn, <char *>p, <char *>c)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_playlist_add_url(self.conn, <char *>p, <char *>c)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_add_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), ((char *)__pyx_t_6));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":956
 * 			res = xmmsc_playlist_add_encoded(self.conn, <char *>p, <char *>c)
 * 		else:
 * 			res = xmmsc_playlist_add_url(self.conn, <char *>p, <char *>c)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyBytes_AsString(__pyx_v_c); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_playlist_add_url(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":957
 * 		else:
 * 			res = xmmsc_playlist_add_url(self.conn, <char *>p, <char *>c)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_61playlist_add_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_60playlist_add_url[] = "\n\t\tplaylist_add_url(url, playlist=None, cb=None, encoded=False) -> XmmsResult\n\n\t\tAdd a path or URL to a playable media item to the playlist.\n\t\tPlayable media items may be files or streams.\n\t\tRequires a string 'url' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_61playlist_add_url(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_add_url (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":939
 * 		return self.playlist_radd(url, playlist, cb = cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_url(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = __pyx_k_53;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_add_url") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
    __pyx_v_encoded = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_add_url", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_60playlist_add_url(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_playlist, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_60playlist_add_url(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_url", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_add_url(__pyx_v_self, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_63playlist_add_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_62playlist_add_encoded[] = "\n\t\t@deprecated\n\t\tUse playlist_add_url(url, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_63playlist_add_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_add_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":960
 * 
 * 	@deprecated
 * 	def playlist_add_encoded(self, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_add_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_add_encoded", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_62playlist_add_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_62playlist_add_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_encoded", 0);

  /* "xmmsapi.pyx":965
 * 		Use playlist_add_url(url, ..., encoded=True) instead
 * 		"""
 * 		return self.playlist_add_url(url, playlist, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist = None, cb = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_add_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
  __Pyx_GIVEREF(__pyx_v_url);
  __Pyx_INCREF(__pyx_v_playlist);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_playlist);
  __Pyx_GIVEREF(__pyx_v_playlist);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":967
 * 		return self.playlist_add_url(url, playlist, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_id(id, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_65playlist_add_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_add_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_id", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_add_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_65playlist_add_id)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":975
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_add_id(self.conn, <char *>p, id))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":976
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_add_id(self.conn, <char *>p, id))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order = None, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_add_id(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_65playlist_add_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_64playlist_add_id[] = "\n\t\tplaylist_add_id(id, playlist=None, cb=None) -> XmmsResult\n\n\t\tAdd a medialib id to the playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_65playlist_add_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_add_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":967
 * 		return self.playlist_add_url(url, playlist, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_add_id(self, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_id(id, playlist=None, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_add_id") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_add_id", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_64playlist_add_id(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_64playlist_add_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_id", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_add_id(__pyx_v_self, __pyx_v_id, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":978
 * 		return self.create_result(cb, xmmsc_playlist_add_id(self.conn, <char *>p, id))
 * 
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order = None, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_collection(coll, order, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_67playlist_add_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_add_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection *__pyx_optional_args) {
  PyObject *__pyx_v_order = ((PyObject *)Py_None);
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_order_val;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  xmmsv_t *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_collection", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_order = __pyx_optional_args->order;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_playlist = __pyx_optional_args->playlist;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_cb = __pyx_optional_args->cb;
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_order);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_67playlist_add_collection)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_order);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_order);
      __Pyx_GIVEREF(__pyx_v_order);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":989
 * 		cdef xmmsc_result_t *res
 * 
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		if order is None:
 * 			order = []
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":990
 * 
 * 		p = check_playlist(playlist, True)
 * 		if order is None:             # <<<<<<<<<<<<<<
 * 			order = []
 * 		order_val = create_native_value(order)
 */
  __pyx_t_4 = (__pyx_v_order == Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":991
 * 		p = check_playlist(playlist, True)
 * 		if order is None:
 * 			order = []             # <<<<<<<<<<<<<<
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_add_collection(self.conn, <char *>p, coll.coll, order_val)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_order);
    __pyx_v_order = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":992
 * 		if order is None:
 * 			order = []
 * 		order_val = create_native_value(order)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_playlist_add_collection(self.conn, <char *>p, coll.coll, order_val)
 * 		xmmsv_unref(order_val)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_order); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_order_val = __pyx_t_5;

  /* "xmmsapi.pyx":993
 * 			order = []
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_add_collection(self.conn, <char *>p, coll.coll, order_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)
 */
  __pyx_t_6 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = xmmsc_playlist_add_collection(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_6), __pyx_v_coll->__pyx_base.coll, __pyx_v_order_val);

  /* "xmmsapi.pyx":994
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_playlist_add_collection(self.conn, <char *>p, coll.coll, order_val)
 * 		xmmsv_unref(order_val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v_order_val);

  /* "xmmsapi.pyx":995
 * 		res = xmmsc_playlist_add_collection(self.conn, <char *>p, coll.coll, order_val)
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_order);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_67playlist_add_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_66playlist_add_collection[] = "\n\t\tplaylist_add_collection(coll, order, playlist=None, cb=None) -> XmmsResult\n\n\t\tAdd the content of a collection to the playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_67playlist_add_collection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_add_collection (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__coll,&__pyx_n_s__order,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":978
 * 		return self.create_result(cb, xmmsc_playlist_add_id(self.conn, <char *>p, id))
 * 
 * 	cpdef XmmsResult playlist_add_collection(self, Collection coll, order = None, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_collection(coll, order, playlist=None, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_add_collection") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[0]);
    __pyx_v_order = values[1];
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_add_collection", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_66playlist_add_collection(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_coll, __pyx_v_order, __pyx_v_playlist, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_66playlist_add_collection(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_order, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_add_collection", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.order = __pyx_v_order;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_add_collection(__pyx_v_self, __pyx_v_coll, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_add_collection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":997
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_remove_entry(id, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_69playlist_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_remove_entry", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_55); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_69playlist_remove_entry)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1006
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_remove_entry(self.conn, <char *>p, id))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1007
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_remove_entry(self.conn, <char *>p, id))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_clear(self, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_remove_entry(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_69playlist_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_68playlist_remove_entry[] = "\n\t\tplaylist_remove_entry(id, playlist=None, cb=None) -> XmmsResult\n\n\t\tRemove a certain media item from the playlist.\n\t\tRequires a number 'id' as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_69playlist_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_remove_entry (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":997
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_remove_entry(self, int id, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_remove_entry(id, playlist=None, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_remove_entry") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_remove_entry", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_68playlist_remove_entry(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_68playlist_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_remove_entry", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_remove_entry(__pyx_v_self, __pyx_v_id, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1009
 * 		return self.create_result(cb, xmmsc_playlist_remove_entry(self.conn, <char *>p, id))
 * 
 * 	cpdef XmmsResult playlist_clear(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_clear(playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_71playlist_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_clear(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_clear", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_71playlist_clear)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1017
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_clear(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1018
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_clear(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_list_entries(self, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_clear(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_71playlist_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_70playlist_clear[] = "\n\t\tplaylist_clear(playlist=None, cb=None) -> XmmsResult\n\n\t\tClear the playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_71playlist_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_clear (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1009
 * 		return self.create_result(cb, xmmsc_playlist_remove_entry(self.conn, <char *>p, id))
 * 
 * 	cpdef XmmsResult playlist_clear(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_clear(playlist=None, cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_clear") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_clear", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_70playlist_clear(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_70playlist_clear(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_clear(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1020
 * 		return self.create_result(cb, xmmsc_playlist_clear(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_list_entries(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_list_entries(playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_73playlist_list_entries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_list_entries(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_list_entries", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_73playlist_list_entries)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1030
 * 		@return: The current playlist.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_list_entries(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1031
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_list_entries(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_sort(self, props, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_list_entries(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list_entries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_73playlist_list_entries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_72playlist_list_entries[] = "\n\t\tplaylist_list_entries(playlist=None, cb=None) -> XmmsResult\n\n\t\tGet the current playlist. This function returns a list of IDs\n\t\tof the files/streams currently in the playlist. Use\n\t\tL{medialib_get_info} to retrieve more specific information.\n\t\t@rtype: L{XmmsResult}(UIntList)\n\t\t@return: The current playlist.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_73playlist_list_entries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_list_entries (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1020
 * 		return self.create_result(cb, xmmsc_playlist_clear(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_list_entries(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_list_entries(playlist=None, cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_list_entries") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_list_entries", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list_entries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_72playlist_list_entries(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_72playlist_list_entries(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_list_entries", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_list_entries(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_list_entries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1033
 * 		return self.create_result(cb, xmmsc_playlist_list_entries(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_sort(self, props, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_sort(props, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_75playlist_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_sort(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_props, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_props_val;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  xmmsv_t *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_sort", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_75playlist_sort)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_props);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_props);
      __Pyx_GIVEREF(__pyx_v_props);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1044
 * 		cdef xmmsc_result_t *res
 * 
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		props_val = create_native_value(props)
 * 		res = xmmsc_playlist_sort(self.conn, <char *>p, props_val)
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1045
 * 
 * 		p = check_playlist(playlist, True)
 * 		props_val = create_native_value(props)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_playlist_sort(self.conn, <char *>p, props_val)
 * 		xmmsv_unref(props_val)
 */
  __pyx_t_4 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_props); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_props_val = __pyx_t_4;

  /* "xmmsapi.pyx":1046
 * 		p = check_playlist(playlist, True)
 * 		props_val = create_native_value(props)
 * 		res = xmmsc_playlist_sort(self.conn, <char *>p, props_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(props_val)
 * 		return self.create_result(cb, res)
 */
  __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = xmmsc_playlist_sort(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), __pyx_v_props_val);

  /* "xmmsapi.pyx":1047
 * 		props_val = create_native_value(props)
 * 		res = xmmsc_playlist_sort(self.conn, <char *>p, props_val)
 * 		xmmsv_unref(props_val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v_props_val);

  /* "xmmsapi.pyx":1048
 * 		res = xmmsc_playlist_sort(self.conn, <char *>p, props_val)
 * 		xmmsv_unref(props_val)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_sort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_75playlist_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_74playlist_sort[] = "\n\t\tplaylist_sort(props, playlist=None, cb=None) -> XmmsResult\n\n\t\tSorts the playlist according to the properties specified.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_75playlist_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_sort (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__props,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1033
 * 		return self.create_result(cb, xmmsc_playlist_list_entries(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_sort(self, props, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_sort(props, playlist=None, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__props)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_sort") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_props = values[0];
    __pyx_v_playlist = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_sort", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_sort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_74playlist_sort(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_props, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_74playlist_sort(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_sort", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_sort(__pyx_v_self, __pyx_v_props, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_sort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1050
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_set_next_rel(position, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_77playlist_set_next_rel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_set_next_rel(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_set_next_rel", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_77playlist_set_next_rel)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_position); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1059
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_playlist_set_next_rel(self.conn, position))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_set_next_rel(__pyx_v_self->__pyx_base.conn, __pyx_v_position))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next_rel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_77playlist_set_next_rel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_76playlist_set_next_rel[] = "\n\t\tplaylist_set_next_rel(position, cb=None) -> XmmsResult\n\n\t\tSets the position in the playlist. Same as L{playlist_set_next}\n\t\tbut sets the next position relative to the current position.\n\t\tYou can do set_next_rel(-1) to move backwards for example.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_77playlist_set_next_rel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_position;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_set_next_rel (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__position,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1050
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_set_next_rel(self, int position, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_set_next_rel(position, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__position)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_set_next_rel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_position = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_position == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_set_next_rel", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next_rel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_76playlist_set_next_rel(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_position, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_76playlist_set_next_rel(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_set_next_rel", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_set_next_rel(__pyx_v_self, __pyx_v_position, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next_rel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1061
 * 		return self.create_result(cb, xmmsc_playlist_set_next_rel(self.conn, position))
 * 
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_set_next(position, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_79playlist_set_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_set_next(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_set_next", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_set_next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_79playlist_set_next)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_position); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1069
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_playlist_set_next(self.conn, position))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_set_next(__pyx_v_self->__pyx_base.conn, __pyx_v_position))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_79playlist_set_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_78playlist_set_next[] = "\n\t\tplaylist_set_next(position, cb=None) -> XmmsResult\n\n\t\tSets the position to move to, next, in the playlist. Calling\n\t\tL{playback_tickle} will perform the jump to that position.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_79playlist_set_next(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_position;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_set_next (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__position,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1061
 * 		return self.create_result(cb, xmmsc_playlist_set_next_rel(self.conn, position))
 * 
 * 	cpdef XmmsResult playlist_set_next(self, int position, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_set_next(position, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__position)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_set_next") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_position = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_position == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_set_next", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_78playlist_set_next(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_position, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_78playlist_set_next(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_position, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_set_next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_set_next(__pyx_v_self, __pyx_v_position, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_set_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1071
 * 		return self.create_result(cb, xmmsc_playlist_set_next(self.conn, position))
 * 
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_move(cur_pos, new_pos, playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_81playlist_move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_move(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_cur_pos, int __pyx_v_new_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_move", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_move); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_81playlist_move)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_cur_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_new_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1079
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_move_entry(self.conn, <char *>p, cur_pos, new_pos))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1080
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_move_entry(self.conn, <char *>p, cur_pos, new_pos))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_create(self, playlist, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_move_entry(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5), __pyx_v_cur_pos, __pyx_v_new_pos))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_81playlist_move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_80playlist_move[] = "\n\t\tplaylist_move(cur_pos, new_pos, playlist=None, cb=None) -> XmmsResult\n\n\t\tMoves a playlist entry to a new position.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_81playlist_move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_cur_pos;
  int __pyx_v_new_pos;
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_move (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cur_pos,&__pyx_n_s__new_pos,&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":1071
 * 		return self.create_result(cb, xmmsc_playlist_set_next(self.conn, position))
 * 
 * 	cpdef XmmsResult playlist_move(self, int cur_pos, int new_pos, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_move(cur_pos, new_pos, playlist=None, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cur_pos)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__new_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("playlist_move", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_move") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cur_pos = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_cur_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_new_pos = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_new_pos == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_playlist = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_move", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_80playlist_move(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cur_pos, __pyx_v_new_pos, __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_80playlist_move(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_cur_pos, int __pyx_v_new_pos, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_move", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_move(__pyx_v_self, __pyx_v_cur_pos, __pyx_v_new_pos, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1082
 * 		return self.create_result(cb, xmmsc_playlist_move_entry(self.conn, <char *>p, cur_pos, new_pos))
 * 
 * 	cpdef XmmsResult playlist_create(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_create(playlist, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_83playlist_create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_create(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_create", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__playlist_create); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_83playlist_create)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1090
 * 		@return: The result of the operation.
 * 		"""
 * 		p = check_playlist(playlist, False)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_create(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1091
 * 		"""
 * 		p = check_playlist(playlist, False)
 * 		return self.create_result(cb, xmmsc_playlist_create(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_current_pos(self, playlist = None, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_create(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_83playlist_create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_82playlist_create[] = "\n\t\tplaylist_create(playlist, cb=None) -> XmmsResult\n\n\t\tCreate a new playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_83playlist_create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_create (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1082
 * 		return self.create_result(cb, xmmsc_playlist_move_entry(self.conn, <char *>p, cur_pos, new_pos))
 * 
 * 	cpdef XmmsResult playlist_create(self, playlist, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_create(playlist, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_create") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_create", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_82playlist_create(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_82playlist_create(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_create", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_create(__pyx_v_self, __pyx_v_playlist, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1093
 * 		return self.create_result(cb, xmmsc_playlist_create(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_current_pos(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_current_pos(playlist=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_85playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos *__pyx_optional_args) {
  PyObject *__pyx_v_playlist = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_current_pos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_playlist = __pyx_optional_args->playlist;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_58); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_85playlist_current_pos)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_playlist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_playlist);
      __Pyx_GIVEREF(__pyx_v_playlist);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1102
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		p = check_playlist(playlist, True)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_playlist_current_pos(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_7xmmsapi_check_playlist(__pyx_v_playlist, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1103
 * 		"""
 * 		p = check_playlist(playlist, True)
 * 		return self.create_result(cb, xmmsc_playlist_current_pos(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playlist_current_active(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_current_pos(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_85playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_84playlist_current_pos[] = "\n\t\tplaylist_current_pos(playlist=None, cb=None) -> XmmsResult\n\n\t\tReturns the current position in the playlist. This value will\n\t\talways be equal to, or larger than 0. The first entry in the\n\t\tlist is 0.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_85playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_playlist = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_current_pos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__playlist,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1093
 * 		return self.create_result(cb, xmmsc_playlist_create(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_current_pos(self, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_current_pos(playlist=None, cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__playlist);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_current_pos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_playlist = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_current_pos", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_84playlist_current_pos(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_playlist, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_84playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_playlist, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_current_pos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.playlist = __pyx_v_playlist;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_current_pos(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1105
 * 		return self.create_result(cb, xmmsc_playlist_current_pos(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_current_active(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_current_active(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_87playlist_current_active(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_playlist_current_active(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_current_active", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_59); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_87playlist_current_active)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1112
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_playlist_current_active(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_playlist_current_active(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_87playlist_current_active(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_86playlist_current_active[] = "\n\t\tplaylist_current_active(cb=None) -> XmmsResult\n\n\t\tReturns the name of the current active playlist\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_87playlist_current_active(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("playlist_current_active (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1105
 * 		return self.create_result(cb, xmmsc_playlist_current_pos(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_current_active(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_current_active(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "playlist_current_active") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("playlist_current_active", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_86playlist_current_active(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_86playlist_current_active(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("playlist_current_active", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->playlist_current_active(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.playlist_current_active", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1114
 * 		return self.create_result(cb, xmmsc_playlist_current_active(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_current_pos(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_89broadcast_playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_current_pos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_60); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_89broadcast_playlist_current_pos)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1124
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_current_pos(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playlist_current_pos(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_89broadcast_playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_88broadcast_playlist_current_pos[] = "\n\t\tbroadcast_playlist_current_pos(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the playlist current position updates\n\t\tfrom the XMMS2 daemon. This is triggered whenever the daemon\n\t\tjumps from one playlist position to another. (not when moving\n\t\ta playlist item from one position to another)\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_89broadcast_playlist_current_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playlist_current_pos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1114
 * 		return self.create_result(cb, xmmsc_playlist_current_active(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_current_pos(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_current_pos(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playlist_current_pos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playlist_current_pos", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_88broadcast_playlist_current_pos(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_88broadcast_playlist_current_pos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_current_pos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playlist_current_pos(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_current_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1126
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_current_pos(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_changed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_91broadcast_playlist_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_changed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_61); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_91broadcast_playlist_changed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1135
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_changed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_playlist_changed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_91broadcast_playlist_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_90broadcast_playlist_changed[] = "\n\t\tbroadcast_playlist_changed(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the playlist changed broadcast from the\n\t\tXMMS2 daemon. Updated data is sent whenever the daemon's\n\t\tplaylist changes.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_91broadcast_playlist_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_playlist_changed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1126
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_current_pos(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_playlist_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_playlist_changed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_playlist_changed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_playlist_changed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_90broadcast_playlist_changed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_90broadcast_playlist_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_playlist_changed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_playlist_changed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_playlist_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1137
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_config_value_changed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_93broadcast_config_value_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_config_value_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_config_value_changed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_93broadcast_config_value_changed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1147
 * 		@rtype: L{XmmsResult} (the modified config key and its value)
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_config_value_changed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult config_set_value(self, key, val, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_config_value_changed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_config_value_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_93broadcast_config_value_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_92broadcast_config_value_changed[] = "\n\t\tbroadcast_config_value_changed(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the config value changed broadcast\n\t\tfrom the XMMS2 daemon.(i.e. some configuration value has\n\t\tbeen modified) Updated data is sent whenever a config\n\t\tvalue is modified.\n\t\t@rtype: L{XmmsResult} (the modified config key and its value)\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_93broadcast_config_value_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_config_value_changed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1137
 * 		return self.create_result(cb, xmmsc_broadcast_playlist_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_config_value_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_config_value_changed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_config_value_changed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_config_value_changed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_config_value_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_92broadcast_config_value_changed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_92broadcast_config_value_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_config_value_changed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_config_value_changed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_config_value_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1149
 * 		return self.create_result(cb, xmmsc_broadcast_config_value_changed(self.conn))
 * 
 * 	cpdef XmmsResult config_set_value(self, key, val, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_set_value(key, val, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_95config_set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_config_set_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_set_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__config_set_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_95config_set_value)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1157
 * 		@return: The result of the operation.
 * 		"""
 * 		k = from_unicode(key)             # <<<<<<<<<<<<<<
 * 		v = from_unicode(val)
 * 		return self.create_result(cb, xmmsc_config_set_value(self.conn, <char *>k, <char *>v))
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_k = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1158
 * 		"""
 * 		k = from_unicode(key)
 * 		v = from_unicode(val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_config_set_value(self.conn, <char *>k, <char *>v))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_v = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1159
 * 		k = from_unicode(key)
 * 		v = from_unicode(val)
 * 		return self.create_result(cb, xmmsc_config_set_value(self.conn, <char *>k, <char *>v))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult config_get_value(self, key, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_config_set_value(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), ((char *)__pyx_t_5)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_95config_set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_94config_set_value[] = "\n\t\tconfig_set_value(key, val, cb=None) -> XmmsResult\n\n\t\tSet a configuration value on the daemon, given a key.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_95config_set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("config_set_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__val,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1149
 * 		return self.create_result(cb, xmmsc_broadcast_config_value_changed(self.conn))
 * 
 * 	cpdef XmmsResult config_set_value(self, key, val, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_set_value(key, val, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("config_set_value", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "config_set_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key = values[0];
    __pyx_v_val = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("config_set_value", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_94config_set_value(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_key, __pyx_v_val, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_94config_set_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_set_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->config_set_value(__pyx_v_self, __pyx_v_key, __pyx_v_val, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1161
 * 		return self.create_result(cb, xmmsc_config_set_value(self.conn, <char *>k, <char *>v))
 * 
 * 	cpdef XmmsResult config_get_value(self, key, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_get_value(key, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_97config_get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_config_get_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_k = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__config_get_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_97config_get_value)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1169
 * 		@return: The result of the operation.
 * 		"""
 * 		k = from_unicode(key)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_config_get_value(self.conn, <char *>k))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_k = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1170
 * 		"""
 * 		k = from_unicode(key)
 * 		return self.create_result(cb, xmmsc_config_get_value(self.conn, <char *>k))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult config_list_values(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_config_get_value(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_97config_get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_96config_get_value[] = "\n\t\tconfig_get_value(key, cb=None) -> XmmsResult\n\n\t\tGet the configuration value of a given key, from the daemon.\n\t\t@rtype: L{XmmsResult}(String)\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_97config_get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("config_get_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1161
 * 		return self.create_result(cb, xmmsc_config_set_value(self.conn, <char *>k, <char *>v))
 * 
 * 	cpdef XmmsResult config_get_value(self, key, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_get_value(key, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "config_get_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("config_get_value", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_96config_get_value(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_key, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_96config_get_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_get_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->config_get_value(__pyx_v_self, __pyx_v_key, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1172
 * 		return self.create_result(cb, xmmsc_config_get_value(self.conn, <char *>k))
 * 
 * 	cpdef XmmsResult config_list_values(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_list_values(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_99config_list_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_config_list_values(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_list_values", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__config_list_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_99config_list_values)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1182
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_config_list_values(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_config_list_values(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_list_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_99config_list_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_98config_list_values[] = "\n\t\tconfig_list_values(cb=None) -> XmmsResult\n\n\t\tGet list of configuration keys on the daemon. Use\n\t\tL{config_get_value} to retrieve the values corresponding to the\n\t\tconfiguration keys.\n\t\t@rtype: L{XmmsResult}(StringList)\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_99config_list_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("config_list_values (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1172
 * 		return self.create_result(cb, xmmsc_config_get_value(self.conn, <char *>k))
 * 
 * 	cpdef XmmsResult config_list_values(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_list_values(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "config_list_values") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("config_list_values", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_list_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_98config_list_values(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_98config_list_values(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_list_values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->config_list_values(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_list_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1184
 * 		return self.create_result(cb, xmmsc_config_list_values(self.conn))
 * 
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_register_value(valuename, defaultvalue, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_101config_register_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_config_register_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_valuename, PyObject *__pyx_v_defaultvalue, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_dv = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_register_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_63); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_101config_register_value)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_valuename);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_valuename);
      __Pyx_GIVEREF(__pyx_v_valuename);
      __Pyx_INCREF(__pyx_v_defaultvalue);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_defaultvalue);
      __Pyx_GIVEREF(__pyx_v_defaultvalue);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1194
 * 		@return: The result of the operation.
 * 		"""
 * 		v = from_unicode(valuename)             # <<<<<<<<<<<<<<
 * 		dv = from_unicode(defaultvalue)
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_valuename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_v = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1195
 * 		"""
 * 		v = from_unicode(valuename)
 * 		dv = from_unicode(defaultvalue)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_defaultvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1196
 * 		v = from_unicode(valuename)
 * 		dv = from_unicode(defaultvalue)
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb = None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyBytes_AsString(__pyx_v_dv); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_config_register_value(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), ((char *)__pyx_t_5)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_register_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_dv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_101config_register_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_100config_register_value[] = "\n\t\tconfig_register_value(valuename, defaultvalue, cb=None) -> XmmsResult\n\n\t\tRegister a new configvalue.\n\t\tThis should be called in the initcode as XMMS2 won't allow\n\t\tset/get on values that haven't been registered.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_101config_register_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_valuename = 0;
  PyObject *__pyx_v_defaultvalue = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("config_register_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__valuename,&__pyx_n_s__defaultvalue,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1184
 * 		return self.create_result(cb, xmmsc_config_list_values(self.conn))
 * 
 * 	cpdef XmmsResult config_register_value(self, valuename, defaultvalue, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		config_register_value(valuename, defaultvalue, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__valuename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__defaultvalue)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("config_register_value", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "config_register_value") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_valuename = values[0];
    __pyx_v_defaultvalue = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("config_register_value", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_register_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_100config_register_value(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_valuename, __pyx_v_defaultvalue, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_100config_register_value(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_valuename, PyObject *__pyx_v_defaultvalue, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_register_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->config_register_value(__pyx_v_self, __pyx_v_valuename, __pyx_v_defaultvalue, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.config_register_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1198
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))
 * 
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_add_entry(file, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_103medialib_add_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_add_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_64;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_add_entry", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encoded = __pyx_optional_args->encoded;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_add_entry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_103medialib_add_entry)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1207
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		p = from_unicode(path)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_medialib_add_entry_encoded(self.conn, <char *>p)
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1208
 * 		cdef xmmsc_result_t *res
 * 		p = from_unicode(path)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_medialib_add_entry_encoded(self.conn, <char *>p)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1209
 * 		p = from_unicode(path)
 * 		if encoded:
 * 			res = xmmsc_medialib_add_entry_encoded(self.conn, <char *>p)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_medialib_add_entry(self.conn, <char *>p)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_add_entry_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1211
 * 			res = xmmsc_medialib_add_entry_encoded(self.conn, <char *>p)
 * 		else:
 * 			res = xmmsc_medialib_add_entry(self.conn, <char *>p)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_add_entry(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1212
 * 		else:
 * 			res = xmmsc_medialib_add_entry(self.conn, <char *>p)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_add_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_103medialib_add_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_102medialib_add_entry[] = "\n\t\tmedialib_add_entry(file, cb=None, encoded=False) -> XmmsResult\n\n\t\tAdd an entry to the MediaLib.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_103medialib_add_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_add_entry (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1198
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))
 * 
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_add_entry(file, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_64;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_add_entry") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
    __pyx_v_encoded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_add_entry", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_add_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_102medialib_add_entry(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_102medialib_add_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_add_entry", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_add_entry(__pyx_v_self, __pyx_v_path, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_add_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_105medialib_add_entry_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_104medialib_add_entry_encoded[] = "\n\t\t@deprecated\n\t\tUse medialib_add_entry(file, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_105medialib_add_entry_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_add_entry_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1215
 * 
 * 	@deprecated
 * 	def medialib_add_entry_encoded(self, path, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_add_entry_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_add_entry_encoded", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_add_entry_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_104medialib_add_entry_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_104medialib_add_entry_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_add_entry_encoded", 0);

  /* "xmmsapi.pyx":1220
 * 		Use medialib_add_entry(file, ..., encoded=True) instead
 * 		"""
 * 		return self.medialib_add_entry(path, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_add_entry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_add_entry_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1222
 * 		return self.medialib_add_entry(path, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_remove_entry(id, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_107medialib_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_remove_entry", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_65); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_107medialib_remove_entry)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1230
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_medialib_remove_entry(self.conn, id))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_move_entry(self, int id,  url, cb = None, encoded = False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_medialib_remove_entry(__pyx_v_self->__pyx_base.conn, __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_107medialib_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_106medialib_remove_entry[] = "\n\t\tmedialib_remove_entry(id, cb=None) -> XmmsResult\n\n\t\tRemove an entry from the medialib.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_107medialib_remove_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_remove_entry (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1222
 * 		return self.medialib_add_entry(path, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult medialib_remove_entry(self, int id, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_remove_entry(id, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_remove_entry") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_remove_entry", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_106medialib_remove_entry(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_106medialib_remove_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_remove_entry", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_remove_entry(__pyx_v_self, __pyx_v_id, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_remove_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1232
 * 		return self.create_result(cb, xmmsc_medialib_remove_entry(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_move_entry(self, int id,  url, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_move_entry(id, url, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_109medialib_move_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_move_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_66;
  PyObject *__pyx_v_unquote_plus = NULL;
  PyObject *__pyx_v_u = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  char *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_move_entry", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encoded = __pyx_optional_args->encoded;
      }
    }
  }
  __Pyx_INCREF(__pyx_v_url);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_move_entry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_109medialib_move_entry)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1240
 * 		@return The result of the operation.
 * 		"""
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			try:
 * 				from urllib import unquote_plus
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1241
 * 		"""
 * 		if encoded:
 * 			try:             # <<<<<<<<<<<<<<
 * 				from urllib import unquote_plus
 * 			except ImportError: #Py3k
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "xmmsapi.pyx":1242
 * 		if encoded:
 * 			try:
 * 				from urllib import unquote_plus             # <<<<<<<<<<<<<<
 * 			except ImportError: #Py3k
 * 				from urllib.parse import unquote_plus
 */
        __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(((PyObject *)__pyx_n_s__unquote_plus));
        PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__unquote_plus));
        __Pyx_GIVEREF(((PyObject *)__pyx_n_s__unquote_plus));
        __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__urllib), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__unquote_plus);
        if (__pyx_t_1 == NULL) {
          if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__unquote_plus);
          if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_unquote_plus = __pyx_t_1;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "xmmsapi.pyx":1243
 * 			try:
 * 				from urllib import unquote_plus
 * 			except ImportError: #Py3k             # <<<<<<<<<<<<<<
 * 				from urllib.parse import unquote_plus
 * 			url = unquote_plus(url)
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_move_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_3);

        /* "xmmsapi.pyx":1244
 * 				from urllib import unquote_plus
 * 			except ImportError: #Py3k
 * 				from urllib.parse import unquote_plus             # <<<<<<<<<<<<<<
 * 			url = unquote_plus(url)
 * 		u = from_unicode(url)
 */
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(((PyObject *)__pyx_n_s__unquote_plus));
        PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_n_s__unquote_plus));
        __Pyx_GIVEREF(((PyObject *)__pyx_n_s__unquote_plus));
        __pyx_t_10 = __Pyx_Import(((PyObject *)__pyx_n_s_67), ((PyObject *)__pyx_t_9), -1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__unquote_plus);
        if (__pyx_t_9 == NULL) {
          if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__unquote_plus);
          if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_XDECREF(__pyx_v_unquote_plus);
        __pyx_v_unquote_plus = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_L11_try_end:;
    }

    /* "xmmsapi.pyx":1245
 * 			except ImportError: #Py3k
 * 				from urllib.parse import unquote_plus
 * 			url = unquote_plus(url)             # <<<<<<<<<<<<<<
 * 		u = from_unicode(url)
 * 		return self.create_result(cb, xmmsc_medialib_move_entry(self.conn, id, <char *>u))
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_url);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_url);
    __Pyx_GIVEREF(__pyx_v_url);
    __pyx_t_1 = PyObject_Call(__pyx_v_unquote_plus, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_url);
    __pyx_v_url = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1246
 * 				from urllib.parse import unquote_plus
 * 			url = unquote_plus(url)
 * 		u = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_medialib_move_entry(self.conn, id, <char *>u))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_u = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1247
 * 			url = unquote_plus(url)
 * 		u = from_unicode(url)
 * 		return self.create_result(cb, xmmsc_medialib_move_entry(self.conn, id, <char *>u))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_11 = PyBytes_AsString(__pyx_v_u); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_medialib_move_entry(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_11)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_move_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unquote_plus);
  __Pyx_XDECREF(__pyx_v_u);
  __Pyx_XDECREF(__pyx_v_url);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_109medialib_move_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_108medialib_move_entry[] = "\n\t\tmedialib_move_entry(id, url, cb=None, encoded=False) -> XmmsResult\n\n\t\tSet a new url for an entry in the medialib.\n\t\t@rtype: L{XmmsResult}\n\t\t@return The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_109medialib_move_entry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_move_entry (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__url,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":1232
 * 		return self.create_result(cb, xmmsc_medialib_remove_entry(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_move_entry(self, int id,  url, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_move_entry(id, url, cb=None, encoded=False) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = __pyx_k_66;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("medialib_move_entry", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_move_entry") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_url = values[1];
    __pyx_v_cb = values[2];
    __pyx_v_encoded = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_move_entry", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_move_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_108medialib_move_entry(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_url, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_108medialib_move_entry(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_move_entry", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_move_entry(__pyx_v_self, __pyx_v_id, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_move_entry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1249
 * 		return self.create_result(cb, xmmsc_medialib_move_entry(self.conn, id, <char *>u))
 * 
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_get_info(id, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_111medialib_get_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_get_info(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_res = 0;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_get_info", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_get_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_111medialib_get_info)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1258
 * 		"""
 * 		cdef XmmsResult res
 * 		res = self.create_result(cb, xmmsc_medialib_get_info(self.conn, id))             # <<<<<<<<<<<<<<
 * 		res.ispropdict = 1
 * 		return res
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_medialib_get_info(__pyx_v_self->__pyx_base.conn, __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1259
 * 		cdef XmmsResult res
 * 		res = self.create_result(cb, xmmsc_medialib_get_info(self.conn, id))
 * 		res.ispropdict = 1             # <<<<<<<<<<<<<<
 * 		return res
 * 
 */
  __pyx_v_res->ispropdict = 1;

  /* "xmmsapi.pyx":1260
 * 		res = self.create_result(cb, xmmsc_medialib_get_info(self.conn, id))
 * 		res.ispropdict = 1
 * 		return res             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_rehash(self, int id = 0, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_res));
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_111medialib_get_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_110medialib_get_info[] = "\n\t\tmedialib_get_info(id, cb=None) -> XmmsResult\n\n\t\t@rtype: L{XmmsResult}(HashTable)\n\t\t@return: Information about the medialib entry position\n\t\tspecified.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_111medialib_get_info(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_get_info (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1249
 * 		return self.create_result(cb, xmmsc_medialib_move_entry(self.conn, id, <char *>u))
 * 
 * 	cpdef XmmsResult medialib_get_info(self, int id, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_get_info(id, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_get_info") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_get_info", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_110medialib_get_info(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_110medialib_get_info(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_get_info", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_get_info(__pyx_v_self, __pyx_v_id, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1262
 * 		return res
 * 
 * 	cpdef XmmsResult medialib_rehash(self, int id = 0, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_rehash(id=0, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_113medialib_rehash(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_rehash(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash *__pyx_optional_args) {
  int __pyx_v_id = ((int)0);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_rehash", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_id = __pyx_optional_args->id;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_rehash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_113medialib_rehash)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1271
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_medialib_rehash(self.conn, id))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_get_id(self, url, cb = None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_medialib_rehash(__pyx_v_self->__pyx_base.conn, __pyx_v_id))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_rehash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_113medialib_rehash(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_112medialib_rehash[] = "\n\t\tmedialib_rehash(id=0, cb=None) -> XmmsResult\n\n\t\tForce the medialib to check that metadata stored is up to\n\t\tdate.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_113medialib_rehash(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_rehash (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1262
 * 		return res
 * 
 * 	cpdef XmmsResult medialib_rehash(self, int id = 0, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_rehash(id=0, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_rehash") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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 (values[0]) {
      __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_id = ((int)0);
    }
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_rehash", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_rehash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_112medialib_rehash(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_112medialib_rehash(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_rehash", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.id = __pyx_v_id;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_rehash(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_rehash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1273
 * 		return self.create_result(cb, xmmsc_medialib_rehash(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_get_id(self, url, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_get_id(url, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_115medialib_get_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_get_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_68;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_u = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_get_id", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encoded = __pyx_optional_args->encoded;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__medialib_get_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_115medialib_get_id)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1283
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		u = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_medialib_get_id_encoded(self.conn, <char *>u)
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_u = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1284
 * 		cdef xmmsc_result_t *res
 * 		u = from_unicode(url)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_medialib_get_id_encoded(self.conn, <char *>u)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1285
 * 		u = from_unicode(url)
 * 		if encoded:
 * 			res = xmmsc_medialib_get_id_encoded(self.conn, <char *>u)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_medialib_get_id(self.conn, <char *>u)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_u); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_get_id_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1287
 * 			res = xmmsc_medialib_get_id_encoded(self.conn, <char *>u)
 * 		else:
 * 			res = xmmsc_medialib_get_id(self.conn, <char *>u)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_u); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_get_id(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1288
 * 		else:
 * 			res = xmmsc_medialib_get_id(self.conn, <char *>u)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_import_path(self, path, cb = None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_u);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_115medialib_get_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_114medialib_get_id[] = "\n\t\tmedialib_get_id(url, cb=None, encoded=False) -> XmmsResult\n\n\t\tSearch for an entry (URL) in the medialib and return its ID\n\t\tnumber.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_115medialib_get_id(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_get_id (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1273
 * 		return self.create_result(cb, xmmsc_medialib_rehash(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_get_id(self, url, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_get_id(url, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_68;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_get_id") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_cb = values[1];
    __pyx_v_encoded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_get_id", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_114medialib_get_id(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_114medialib_get_id(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_get_id", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_get_id(__pyx_v_self, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_get_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1290
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult medialib_import_path(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_import_path(path, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_117medialib_import_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_import_path(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_69;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_import_path", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encoded = __pyx_optional_args->encoded;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_70); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_117medialib_import_path)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1300
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		p = from_unicode(path)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_medialib_import_path_encoded(self.conn, <char *>p)
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1301
 * 		cdef xmmsc_result_t *res
 * 		p = from_unicode(path)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_medialib_import_path_encoded(self.conn, <char *>p)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1302
 * 		p = from_unicode(path)
 * 		if encoded:
 * 			res = xmmsc_medialib_import_path_encoded(self.conn, <char *>p)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_medialib_import_path(self.conn, <char *>p)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_import_path_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1304
 * 			res = xmmsc_medialib_import_path_encoded(self.conn, <char *>p)
 * 		else:
 * 			res = xmmsc_medialib_import_path(self.conn, <char *>p)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_import_path(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1305
 * 		else:
 * 			res = xmmsc_medialib_import_path(self.conn, <char *>p)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_import_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_117medialib_import_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_116medialib_import_path[] = "\n\t\tmedialib_import_path(path, cb=None, encoded=False) -> XmmsResult\n\n\t\tImport metadata from all files recursively from the directory\n\t\tpassed as argument.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_117medialib_import_path(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_import_path (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1290
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult medialib_import_path(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_import_path(path, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_69;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_import_path") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
    __pyx_v_encoded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_import_path", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_import_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_116medialib_import_path(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_116medialib_import_path(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_import_path", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_import_path(__pyx_v_self, __pyx_v_path, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_import_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_119medialib_path_import(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_118medialib_path_import[] = "\n\t\t@deprecated\n\t\tUse medialib_import_path(path, ...) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_119medialib_path_import(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_path_import (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1308
 * 
 * 	@deprecated
 * 	def medialib_path_import(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_71;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_path_import") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
    __pyx_v_encoded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_path_import", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_path_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_118medialib_path_import(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_118medialib_path_import(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_path_import", 0);

  /* "xmmsapi.pyx":1313
 * 		Use medialib_import_path(path, ...) instead
 * 		"""
 * 		return self.medialib_import_path(self, path, cb=cb, encoded=encoded)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_70); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_v_encoded) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_path_import", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_121medialib_path_import_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_120medialib_path_import_encoded[] = "\n\t\t@deprecated\n\t\tUse medialib_import_path(path, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_121medialib_path_import_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_path_import_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1316
 * 
 * 	@deprecated
 * 	def medialib_path_import_encoded(self, path, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_path_import_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_path_import_encoded", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_path_import_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_120medialib_path_import_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_120medialib_path_import_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_path_import_encoded", 0);

  /* "xmmsapi.pyx":1321
 * 		Use medialib_import_path(path, ..., encoded=True) instead
 * 		"""
 * 		return self.medialib_import_path(self, path, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=None, cb=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_70); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_path_import_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1323
 * 		return self.medialib_import_path(self, path, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_property_set(id, key, value, source=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_123medialib_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set *__pyx_optional_args) {
  PyObject *__pyx_v_source = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_v = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_t_7;
  char *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_property_set", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_source = __pyx_optional_args->source;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_72); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_123medialib_property_set)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_INCREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1332
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		k = from_unicode(key)             # <<<<<<<<<<<<<<
 * 		if isinstance(value, int):
 * 			if source:
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_k = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1333
 * 		cdef xmmsc_result_t *res
 * 		k = from_unicode(key)
 * 		if isinstance(value, int):             # <<<<<<<<<<<<<<
 * 			if source:
 * 				s = from_unicode(source)
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyInt_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_value, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1334
 * 		k = from_unicode(key)
 * 		if isinstance(value, int):
 * 			if source:             # <<<<<<<<<<<<<<
 * 				s = from_unicode(source)
 * 				res = xmmsc_medialib_entry_property_set_int_with_source(self.conn, id, <char *>s, <char *>k, value)
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_source); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "xmmsapi.pyx":1335
 * 		if isinstance(value, int):
 * 			if source:
 * 				s = from_unicode(source)             # <<<<<<<<<<<<<<
 * 				res = xmmsc_medialib_entry_property_set_int_with_source(self.conn, id, <char *>s, <char *>k, value)
 * 			else:
 */
      __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_source); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_s = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "xmmsapi.pyx":1336
 * 			if source:
 * 				s = from_unicode(source)
 * 				res = xmmsc_medialib_entry_property_set_int_with_source(self.conn, id, <char *>s, <char *>k, value)             # <<<<<<<<<<<<<<
 * 			else:
 * 				res = xmmsc_medialib_entry_property_set_int(self.conn, id, <char *>k, value)
 */
      __pyx_t_5 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_res = xmmsc_medialib_entry_property_set_int_with_source(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_5), ((char *)__pyx_t_6), __pyx_t_7);
      goto __pyx_L4;
    }
    /*else*/ {

      /* "xmmsapi.pyx":1338
 * 				res = xmmsc_medialib_entry_property_set_int_with_source(self.conn, id, <char *>s, <char *>k, value)
 * 			else:
 * 				res = xmmsc_medialib_entry_property_set_int(self.conn, id, <char *>k, value)             # <<<<<<<<<<<<<<
 * 		else:
 * 			v = from_unicode(value)
 */
      __pyx_t_6 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_res = xmmsc_medialib_entry_property_set_int(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_6), __pyx_t_7);
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1340
 * 				res = xmmsc_medialib_entry_property_set_int(self.conn, id, <char *>k, value)
 * 		else:
 * 			v = from_unicode(value)             # <<<<<<<<<<<<<<
 * 			if source:
 * 				s = from_unicode(source)
 */
    __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_v = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "xmmsapi.pyx":1341
 * 		else:
 * 			v = from_unicode(value)
 * 			if source:             # <<<<<<<<<<<<<<
 * 				s = from_unicode(source)
 * 				res = xmmsc_medialib_entry_property_set_str_with_source(self.conn, id, <char *>s, <char *>k, <char *>v)
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_source); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "xmmsapi.pyx":1342
 * 			v = from_unicode(value)
 * 			if source:
 * 				s = from_unicode(source)             # <<<<<<<<<<<<<<
 * 				res = xmmsc_medialib_entry_property_set_str_with_source(self.conn, id, <char *>s, <char *>k, <char *>v)
 * 			else:
 */
      __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_source); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_s = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "xmmsapi.pyx":1343
 * 			if source:
 * 				s = from_unicode(source)
 * 				res = xmmsc_medialib_entry_property_set_str_with_source(self.conn, id, <char *>s, <char *>k, <char *>v)             # <<<<<<<<<<<<<<
 * 			else:
 * 				res = xmmsc_medialib_entry_property_set_str(self.conn, id, <char *>k, <char *>v)
 */
      __pyx_t_6 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_res = xmmsc_medialib_entry_property_set_str_with_source(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_6), ((char *)__pyx_t_5), ((char *)__pyx_t_8));
      goto __pyx_L5;
    }
    /*else*/ {

      /* "xmmsapi.pyx":1345
 * 				res = xmmsc_medialib_entry_property_set_str_with_source(self.conn, id, <char *>s, <char *>k, <char *>v)
 * 			else:
 * 				res = xmmsc_medialib_entry_property_set_str(self.conn, id, <char *>k, <char *>v)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
      __pyx_t_8 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_res = xmmsc_medialib_entry_property_set_str(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_8), ((char *)__pyx_t_5));
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1346
 * 			else:
 * 				res = xmmsc_medialib_entry_property_set_str(self.conn, id, <char *>k, <char *>v)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=None, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_123medialib_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_122medialib_property_set[] = "\n\t\tmedialib_property_set(id, key, value, source=None, cb=None) -> XmmsResult\n\n\t\tAssociate a value with a medialib entry. Source is optional.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_123medialib_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_property_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__key,&__pyx_n_s__value,&__pyx_n_s__source,&__pyx_n_s__cb,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "xmmsapi.pyx":1323
 * 		return self.medialib_import_path(self, path, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult medialib_property_set(self, int id, key, value, source=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_property_set(id, key, value, source=None, cb=None) -> XmmsResult
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("medialib_property_set", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("medialib_property_set", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__source);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_property_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_source = values[3];
    __pyx_v_cb = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_property_set", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_122medialib_property_set(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_key, __pyx_v_value, __pyx_v_source, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_122medialib_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_source, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_property_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.source = __pyx_v_source;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_property_set(__pyx_v_self, __pyx_v_id, __pyx_v_key, __pyx_v_value, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1348
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_property_remove(id, key, source=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_125medialib_property_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_medialib_property_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove *__pyx_optional_args) {
  PyObject *__pyx_v_source = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_s = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_property_remove", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_source = __pyx_optional_args->source;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_73); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_125medialib_property_remove)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1357
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		k = from_unicode(key)             # <<<<<<<<<<<<<<
 * 		if source:
 * 			s = from_unicode(source)
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_k = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1358
 * 		cdef xmmsc_result_t *res
 * 		k = from_unicode(key)
 * 		if source:             # <<<<<<<<<<<<<<
 * 			s = from_unicode(source)
 * 			res = xmmsc_medialib_entry_property_remove_with_source(self.conn, id, <char *>s, <char *>k)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_source); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1359
 * 		k = from_unicode(key)
 * 		if source:
 * 			s = from_unicode(source)             # <<<<<<<<<<<<<<
 * 			res = xmmsc_medialib_entry_property_remove_with_source(self.conn, id, <char *>s, <char *>k)
 * 		else:
 */
    __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_source); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_s = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "xmmsapi.pyx":1360
 * 		if source:
 * 			s = from_unicode(source)
 * 			res = xmmsc_medialib_entry_property_remove_with_source(self.conn, id, <char *>s, <char *>k)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_medialib_entry_property_remove(self.conn, id, <char *>k)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_entry_property_remove_with_source(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_5), ((char *)__pyx_t_6));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1362
 * 			res = xmmsc_medialib_entry_property_remove_with_source(self.conn, id, <char *>s, <char *>k)
 * 		else:
 * 			res = xmmsc_medialib_entry_property_remove(self.conn, id, <char *>k)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_6 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_medialib_entry_property_remove(__pyx_v_self->__pyx_base.conn, __pyx_v_id, ((char *)__pyx_t_6));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1363
 * 		else:
 * 			res = xmmsc_medialib_entry_property_remove(self.conn, id, <char *>k)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_125medialib_property_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_124medialib_property_remove[] = "\n\t\tmedialib_property_remove(id, key, source=None, cb=None) -> XmmsResult\n\n\t\tRemove a value from a medialib entry. Source is optional.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_125medialib_property_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_id;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("medialib_property_remove (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__id,&__pyx_n_s__key,&__pyx_n_s__source,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":1348
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult medialib_property_remove(self, int id, key, source=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_property_remove(id, key, source=None, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("medialib_property_remove", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__source);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medialib_property_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_id = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_id == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_key = values[1];
    __pyx_v_source = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("medialib_property_remove", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_124medialib_property_remove(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_id, __pyx_v_key, __pyx_v_source, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_124medialib_property_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_id, PyObject *__pyx_v_key, PyObject *__pyx_v_source, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("medialib_property_remove", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.source = __pyx_v_source;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->medialib_property_remove(__pyx_v_self, __pyx_v_id, __pyx_v_key, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.medialib_property_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1365
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_medialib_entry_added(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_127broadcast_medialib_entry_added(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_added", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_74); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_127broadcast_medialib_entry_added)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1373
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_added(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_medialib_entry_added(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_added", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_127broadcast_medialib_entry_added(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_126broadcast_medialib_entry_added[] = "\n\t\tbroadcast_medialib_entry_added(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the medialib entry added broadcast\n\t\tfrom the XMMS2 daemon. (i.e. a new entry has been added)\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_127broadcast_medialib_entry_added(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_added (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1365
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_added(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_medialib_entry_added(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_medialib_entry_added") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_medialib_entry_added", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_added", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_126broadcast_medialib_entry_added(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_126broadcast_medialib_entry_added(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_added", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_medialib_entry_added(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_added", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1375
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_added(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_medialib_entry_changed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_129broadcast_medialib_entry_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_changed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_75); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_129broadcast_medialib_entry_changed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1385
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_changed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_medialib_entry_changed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_129broadcast_medialib_entry_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_128broadcast_medialib_entry_changed[] = "\n\t\tbroadcast_medialib_entry_changed(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the medialib entry changed broadcast\n\t\tfrom the XMMS2 daemon.\n\t\tUpdated data is sent when the metadata for a song is updated\n\t\tin the medialib.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_129broadcast_medialib_entry_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_changed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1375
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_added(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_medialib_entry_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_medialib_entry_changed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_medialib_entry_changed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_medialib_entry_changed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_128broadcast_medialib_entry_changed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_128broadcast_medialib_entry_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_medialib_entry_changed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_medialib_entry_changed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_medialib_entry_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1387
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_collection_changed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_131broadcast_collection_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_collection_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_collection_changed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_76); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_131broadcast_collection_changed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1395
 * 		@rtype: L{XmmsResult}
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_collection_changed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_collection_changed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_collection_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_131broadcast_collection_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_130broadcast_collection_changed[] = "\n\t\tbroadcast_collection_changed(cb=None) -> XmmsResult\n\n\t\tSet a method to handle the collection changed broadcast\n\t\tfrom the XMMS2 daemon.\n\t\t@rtype: L{XmmsResult}\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_131broadcast_collection_changed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_collection_changed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1387
 * 		return self.create_result(cb, xmmsc_broadcast_medialib_entry_changed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_collection_changed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_collection_changed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_collection_changed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_collection_changed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_collection_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_130broadcast_collection_changed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_130broadcast_collection_changed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_collection_changed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_collection_changed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_collection_changed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1397
 * 		return self.create_result(cb, xmmsc_broadcast_collection_changed(self.conn))
 * 
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		signal_mediainfo_reader_unindexed(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_133signal_mediainfo_reader_unindexed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signal_mediainfo_reader_unindexed", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_77); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_133signal_mediainfo_reader_unindexed)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1405
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_signal_mediainfo_reader_unindexed(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb = None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_signal_mediainfo_reader_unindexed(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_mediainfo_reader_unindexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_133signal_mediainfo_reader_unindexed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_132signal_mediainfo_reader_unindexed[] = "\n\t\tsignal_mediainfo_reader_unindexed(cb=None) -> XmmsResult\n\n\t\tTell daemon to send you the number of unindexed files in the mlib\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_133signal_mediainfo_reader_unindexed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("signal_mediainfo_reader_unindexed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1397
 * 		return self.create_result(cb, xmmsc_broadcast_collection_changed(self.conn))
 * 
 * 	cpdef XmmsResult signal_mediainfo_reader_unindexed(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		signal_mediainfo_reader_unindexed(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal_mediainfo_reader_unindexed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("signal_mediainfo_reader_unindexed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_mediainfo_reader_unindexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_132signal_mediainfo_reader_unindexed(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_132signal_mediainfo_reader_unindexed(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signal_mediainfo_reader_unindexed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->signal_mediainfo_reader_unindexed(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.signal_mediainfo_reader_unindexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1407
 * 		return self.create_result(cb, xmmsc_signal_mediainfo_reader_unindexed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_mediainfo_reader_status(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_135broadcast_mediainfo_reader_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_mediainfo_reader_status", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_78); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_135broadcast_mediainfo_reader_status)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1415
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_broadcast_mediainfo_reader_status(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=None, encoded=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_broadcast_mediainfo_reader_status(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_mediainfo_reader_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_135broadcast_mediainfo_reader_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_134broadcast_mediainfo_reader_status[] = "\n\t\tbroadcast_mediainfo_reader_status(cb=None) -> XmmsResult\n\n\t\tTell daemon to send you the status of the mediainfo reader\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_135broadcast_mediainfo_reader_status(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("broadcast_mediainfo_reader_status (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1407
 * 		return self.create_result(cb, xmmsc_signal_mediainfo_reader_unindexed(self.conn))
 * 
 * 	cpdef XmmsResult broadcast_mediainfo_reader_status(self, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		broadcast_mediainfo_reader_status(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "broadcast_mediainfo_reader_status") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("broadcast_mediainfo_reader_status", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_mediainfo_reader_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_134broadcast_mediainfo_reader_status(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_134broadcast_mediainfo_reader_status(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("broadcast_mediainfo_reader_status", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->broadcast_mediainfo_reader_status(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.broadcast_mediainfo_reader_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1417
 * 		return self.create_result(cb, xmmsc_broadcast_mediainfo_reader_status(self.conn))
 * 
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xform_media_browse(url, cb=None, encoded=False) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_137xform_media_browse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_xform_media_browse(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_encoded = __pyx_k_79;
  xmmsc_result_t *__pyx_v_res;
  PyObject *__pyx_v_u = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xform_media_browse", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_encoded = __pyx_optional_args->encoded;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__xform_media_browse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_137xform_media_browse)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_url);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
      __Pyx_GIVEREF(__pyx_v_url);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __Pyx_INCREF(__pyx_v_encoded);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_encoded);
      __Pyx_GIVEREF(__pyx_v_encoded);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1426
 * 		"""
 * 		cdef xmmsc_result_t *res
 * 		u = from_unicode(url)             # <<<<<<<<<<<<<<
 * 		if encoded:
 * 			res = xmmsc_xform_media_browse_encoded(self.conn, <char *>u)
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_u = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1427
 * 		cdef xmmsc_result_t *res
 * 		u = from_unicode(url)
 * 		if encoded:             # <<<<<<<<<<<<<<
 * 			res = xmmsc_xform_media_browse_encoded(self.conn, <char *>u)
 * 		else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_encoded); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1428
 * 		u = from_unicode(url)
 * 		if encoded:
 * 			res = xmmsc_xform_media_browse_encoded(self.conn, <char *>u)             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = xmmsc_xform_media_browse(self.conn, <char *>u)
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_u); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_xform_media_browse_encoded(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1430
 * 			res = xmmsc_xform_media_browse_encoded(self.conn, <char *>u)
 * 		else:
 * 			res = xmmsc_xform_media_browse(self.conn, <char *>u)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
    __pyx_t_5 = PyBytes_AsString(__pyx_v_u); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res = xmmsc_xform_media_browse(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_5));
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1431
 * 		else:
 * 			res = xmmsc_xform_media_browse(self.conn, <char *>u)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	@deprecated
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.xform_media_browse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_u);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_137xform_media_browse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_136xform_media_browse[] = "\n\t\txform_media_browse(url, cb=None, encoded=False) -> XmmsResult\n\n\t\tBrowse files from xform plugins.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_137xform_media_browse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_encoded = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xform_media_browse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__cb,&__pyx_n_s__encoded,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1417
 * 		return self.create_result(cb, xmmsc_broadcast_mediainfo_reader_status(self.conn))
 * 
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xform_media_browse(url, cb=None, encoded=False) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_79;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__encoded);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xform_media_browse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_cb = values[1];
    __pyx_v_encoded = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xform_media_browse", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.xform_media_browse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_136xform_media_browse(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_cb, __pyx_v_encoded);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_136xform_media_browse(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb, PyObject *__pyx_v_encoded) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xform_media_browse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_2.encoded = __pyx_v_encoded;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->xform_media_browse(__pyx_v_self, __pyx_v_url, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.xform_media_browse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_139xform_media_browse_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_138xform_media_browse_encoded[] = "\n\t\t@deprecated\n\t\tUse xform_media_browse(url, ..., encoded=True) instead\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_139xform_media_browse_encoded(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("xform_media_browse_encoded (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__url,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1434
 * 
 * 	@deprecated
 * 	def xform_media_browse_encoded(self, url, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xform_media_browse_encoded") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_url = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("xform_media_browse_encoded", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.xform_media_browse_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_138xform_media_browse_encoded(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_url, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_138xform_media_browse_encoded(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_url, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("xform_media_browse_encoded", 0);

  /* "xmmsapi.pyx":1439
 * 		Use xform_media_browse(url, ..., encoded=True) instead
 * 		"""
 * 		return self.xform_media_browse(url, cb=cb, encoded=True)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_get(self, name, ns="Collections", cb=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__xform_media_browse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_url);
  __Pyx_GIVEREF(__pyx_v_url);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__cb), __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__encoded), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.xform_media_browse_encoded", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1441
 * 		return self.xform_media_browse(url, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult coll_get(self, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_get(name, ns="Collections", cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_141coll_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get *__pyx_optional_args) {
  PyObject *__pyx_v_ns = ((PyObject *)__pyx_n_s__Collections);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_n;
  PyObject *__pyx_v_nam = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_get", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ns = __pyx_optional_args->ns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_141coll_get)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      __Pyx_INCREF(__pyx_v_ns);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ns);
      __Pyx_GIVEREF(__pyx_v_ns);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1450
 * 		"""
 * 		cdef char *n
 * 		n = check_namespace(ns, False)             # <<<<<<<<<<<<<<
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_get(self.conn, nam, n))
 */
  __pyx_t_4 = __pyx_f_7xmmsapi_check_namespace(__pyx_v_ns, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "xmmsapi.pyx":1451
 * 		cdef char *n
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_get(self.conn, nam, n))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nam = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1452
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_get(self.conn, nam, n))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_list(self, ns="Collections", cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_nam); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_get(__pyx_v_self->__pyx_base.conn, __pyx_t_4, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nam);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_141coll_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_140coll_get[] = "\n\t\tcoll_get(name, ns=\"Collections\", cb=None) -> XmmsResult\n\n\t\tRetrieve a Collection\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_141coll_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_ns = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__ns,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_s__Collections);

    /* "xmmsapi.pyx":1441
 * 		return self.xform_media_browse(url, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult coll_get(self, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_get(name, ns="Collections", cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ns);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_ns = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_140coll_get(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_name, __pyx_v_ns, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_140coll_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.ns = __pyx_v_ns;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_get(__pyx_v_self, __pyx_v_name, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1454
 * 		return self.create_result(cb, xmmsc_coll_get(self.conn, nam, n))
 * 
 * 	cpdef XmmsResult coll_list(self, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_list(name, ns="Collections", cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_143coll_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list *__pyx_optional_args) {
  PyObject *__pyx_v_ns = ((PyObject *)__pyx_n_s__Collections);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_n;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ns = __pyx_optional_args->ns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_143coll_list)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_ns);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ns);
      __Pyx_GIVEREF(__pyx_v_ns);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1463
 * 		"""
 * 		cdef char *n
 * 		n = check_namespace(ns, False)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_list(self.conn, n))
 * 
 */
  __pyx_t_4 = __pyx_f_7xmmsapi_check_namespace(__pyx_v_ns, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "xmmsapi.pyx":1464
 * 		cdef char *n
 * 		n = check_namespace(ns, False)
 * 		return self.create_result(cb, xmmsc_coll_list(self.conn, n))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns="Collections", cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_list(__pyx_v_self->__pyx_base.conn, __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_143coll_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_142coll_list[] = "\n\t\tcoll_list(name, ns=\"Collections\", cb=None) -> XmmsResult\n\n\t\tList collections\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_143coll_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ns = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ns,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_n_s__Collections);

    /* "xmmsapi.pyx":1454
 * 		return self.create_result(cb, xmmsc_coll_get(self.conn, nam, n))
 * 
 * 	cpdef XmmsResult coll_list(self, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_list(name, ns="Collections", cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ns);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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;
      }
    }
    __pyx_v_ns = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_list", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_142coll_list(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_ns, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_142coll_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.ns = __pyx_v_ns;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_list(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1466
 * 		return self.create_result(cb, xmmsc_coll_list(self.conn, n))
 * 
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_save(coll, name, ns="Collections", cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_145coll_save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_save(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_name, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save *__pyx_optional_args) {
  PyObject *__pyx_v_ns = ((PyObject *)__pyx_n_s__Collections);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_n;
  PyObject *__pyx_v_nam = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_save", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ns = __pyx_optional_args->ns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_save); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_145coll_save)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      __Pyx_INCREF(__pyx_v_ns);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ns);
      __Pyx_GIVEREF(__pyx_v_ns);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1475
 * 		"""
 * 		cdef char *n
 * 		n = check_namespace(ns, False)             # <<<<<<<<<<<<<<
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_save(self.conn, coll.coll, <char *>nam, n))
 */
  __pyx_t_4 = __pyx_f_7xmmsapi_check_namespace(__pyx_v_ns, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "xmmsapi.pyx":1476
 * 		cdef char *n
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_save(self.conn, coll.coll, <char *>nam, n))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nam = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1477
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_save(self.conn, coll.coll, <char *>nam, n))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_remove(self, name, ns="Collections", cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_nam); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_save(__pyx_v_self->__pyx_base.conn, __pyx_v_coll->__pyx_base.coll, ((char *)__pyx_t_4), __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nam);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_145coll_save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_144coll_save[] = "\n\t\tcoll_save(coll, name, ns=\"Collections\", cb=None) -> XmmsResult\n\n\t\tSave a collection on server.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_145coll_save(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_ns = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_save (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__coll,&__pyx_n_s__name,&__pyx_n_s__ns,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_s__Collections);

    /* "xmmsapi.pyx":1466
 * 		return self.create_result(cb, xmmsc_coll_list(self.conn, n))
 * 
 * 	cpdef XmmsResult coll_save(self, Collection coll, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_save(coll, name, ns="Collections", cb=None) -> XmmsResult
 */
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("coll_save", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ns);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_save") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[0]);
    __pyx_v_name = values[1];
    __pyx_v_ns = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_save", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_144coll_save(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_coll, __pyx_v_name, __pyx_v_ns, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_144coll_save(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_save", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.ns = __pyx_v_ns;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_save(__pyx_v_self, __pyx_v_coll, __pyx_v_name, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1479
 * 		return self.create_result(cb, xmmsc_coll_save(self.conn, coll.coll, <char *>nam, n))
 * 
 * 	cpdef XmmsResult coll_remove(self, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_remove(name, ns="Collections", cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_147coll_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove *__pyx_optional_args) {
  PyObject *__pyx_v_ns = ((PyObject *)__pyx_n_s__Collections);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_n;
  PyObject *__pyx_v_nam = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_remove", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ns = __pyx_optional_args->ns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_147coll_remove)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      __Pyx_INCREF(__pyx_v_ns);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ns);
      __Pyx_GIVEREF(__pyx_v_ns);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1488
 * 		"""
 * 		cdef char *n
 * 		n = check_namespace(ns, False)             # <<<<<<<<<<<<<<
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_remove(self.conn, <char *>nam, n))
 */
  __pyx_t_4 = __pyx_f_7xmmsapi_check_namespace(__pyx_v_ns, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "xmmsapi.pyx":1489
 * 		cdef char *n
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_remove(self.conn, <char *>nam, n))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nam = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1490
 * 		n = check_namespace(ns, False)
 * 		nam = from_unicode(name)
 * 		return self.create_result(cb, xmmsc_coll_remove(self.conn, <char *>nam, n))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns="Collections", cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_nam); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_remove(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nam);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_147coll_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_146coll_remove[] = "\n\t\tcoll_remove(name, ns=\"Collections\", cb=None) -> XmmsResult\n\n\t\tRemove a collection on server.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_147coll_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_ns = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_remove (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__ns,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_s__Collections);

    /* "xmmsapi.pyx":1479
 * 		return self.create_result(cb, xmmsc_coll_save(self.conn, coll.coll, <char *>nam, n))
 * 
 * 	cpdef XmmsResult coll_remove(self, name, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_remove(name, ns="Collections", cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ns);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_ns = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_remove", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_146coll_remove(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_name, __pyx_v_ns, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_146coll_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_remove", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.ns = __pyx_v_ns;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_remove(__pyx_v_self, __pyx_v_name, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1492
 * 		return self.create_result(cb, xmmsc_coll_remove(self.conn, <char *>nam, n))
 * 
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_rename(oldname, newname, ns="Collections", cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_149coll_rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_rename(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename *__pyx_optional_args) {
  PyObject *__pyx_v_ns = ((PyObject *)__pyx_n_s__Collections);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_n;
  PyObject *__pyx_v_oldnam = NULL;
  PyObject *__pyx_v_newnam = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_rename", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ns = __pyx_optional_args->ns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_rename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_149coll_rename)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      __Pyx_INCREF(__pyx_v_ns);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ns);
      __Pyx_GIVEREF(__pyx_v_ns);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1501
 * 		"""
 * 		cdef char *n
 * 		n = check_namespace(ns, False)             # <<<<<<<<<<<<<<
 * 
 * 		oldnam = from_unicode(oldname)
 */
  __pyx_t_4 = __pyx_f_7xmmsapi_check_namespace(__pyx_v_ns, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "xmmsapi.pyx":1503
 * 		n = check_namespace(ns, False)
 * 
 * 		oldnam = from_unicode(oldname)             # <<<<<<<<<<<<<<
 * 		newnam = from_unicode(newname)
 * 		return self.create_result(cb, xmmsc_coll_rename(self.conn, <char *>oldnam, <char *>newnam, n))
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_oldname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_oldnam = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1504
 * 
 * 		oldnam = from_unicode(oldname)
 * 		newnam = from_unicode(newname)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_rename(self.conn, <char *>oldnam, <char *>newnam, n))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_newname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_newnam = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1505
 * 		oldnam = from_unicode(oldname)
 * 		newnam = from_unicode(newname)
 * 		return self.create_result(cb, xmmsc_coll_rename(self.conn, <char *>oldnam, <char *>newnam, n))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_oldnam); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyBytes_AsString(__pyx_v_newnam); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_rename(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4), ((char *)__pyx_t_5), __pyx_v_n))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oldnam);
  __Pyx_XDECREF(__pyx_v_newnam);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_149coll_rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_148coll_rename[] = "\n\t\tcoll_rename(oldname, newname, ns=\"Collections\", cb=None) -> XmmsResult\n\n\t\tRename a collection.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_149coll_rename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  PyObject *__pyx_v_ns = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_rename (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__oldname,&__pyx_n_s__newname,&__pyx_n_s__ns,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_s__Collections);

    /* "xmmsapi.pyx":1492
 * 		return self.create_result(cb, xmmsc_coll_remove(self.conn, <char *>nam, n))
 * 
 * 	cpdef XmmsResult coll_rename(self, oldname, newname, ns="Collections", cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_rename(oldname, newname, ns="Collections", cb=None) -> XmmsResult
 */
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__oldname)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("coll_rename", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ns);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_rename") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_oldname = values[0];
    __pyx_v_newname = values[1];
    __pyx_v_ns = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_rename", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_148coll_rename(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname, __pyx_v_ns, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_148coll_rename(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname, PyObject *__pyx_v_ns, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_rename", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.ns = __pyx_v_ns;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_rename(__pyx_v_self, __pyx_v_oldname, __pyx_v_newname, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_rename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1507
 * 		return self.create_result(cb, xmmsc_coll_rename(self.conn, <char *>oldnam, <char *>newnam, n))
 * 
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_idlist_from_playlist_file(path, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_151coll_idlist_from_playlist_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_p = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_idlist_from_playlist_file", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_80); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_151coll_idlist_from_playlist_file)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1515
 * 		@return: The result of the operation.
 * 		"""
 * 		p = from_unicode(path)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_coll_idlist_from_playlist_file(self.conn, <char *>p))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1516
 * 		"""
 * 		p = from_unicode(path)
 * 		return self.create_result(cb, xmmsc_coll_idlist_from_playlist_file(self.conn, <char *>p))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_p); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_idlist_from_playlist_file(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_idlist_from_playlist_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_151coll_idlist_from_playlist_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_150coll_idlist_from_playlist_file[] = "\n\t\tcoll_idlist_from_playlist_file(path, cb=None) -> XmmsResult\n\n\t\tCreate an idlist from a playlist.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_151coll_idlist_from_playlist_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_idlist_from_playlist_file (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1507
 * 		return self.create_result(cb, xmmsc_coll_rename(self.conn, <char *>oldnam, <char *>newnam, n))
 * 
 * 	cpdef XmmsResult coll_idlist_from_playlist_file(self, path, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_idlist_from_playlist_file(path, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_idlist_from_playlist_file") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_idlist_from_playlist_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_idlist_from_playlist_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_150coll_idlist_from_playlist_file(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_path, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_150coll_idlist_from_playlist_file(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_idlist_from_playlist_file", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_idlist_from_playlist_file(__pyx_v_self, __pyx_v_path, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_idlist_from_playlist_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1518
 * 		return self.create_result(cb, xmmsc_coll_idlist_from_playlist_file(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query(coll, fetch, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_153coll_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_query(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fetch, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_fetch_val;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_v_res = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  xmmsv_t *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_query); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_153coll_query)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_fetch);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fetch);
      __Pyx_GIVEREF(__pyx_v_fetch);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1527
 * 		"""
 * 		cdef xmmsv_t *fetch_val
 * 		fetch_val = create_native_value(fetch)             # <<<<<<<<<<<<<<
 * 		res = self.create_result(cb, xmmsc_coll_query(self.conn, coll.coll, fetch_val))
 * 		return res
 */
  __pyx_t_4 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_fetch); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fetch_val = __pyx_t_4;

  /* "xmmsapi.pyx":1528
 * 		cdef xmmsv_t *fetch_val
 * 		fetch_val = create_native_value(fetch)
 * 		res = self.create_result(cb, xmmsc_coll_query(self.conn, coll.coll, fetch_val))             # <<<<<<<<<<<<<<
 * 		return res
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_coll_query(__pyx_v_self->__pyx_base.conn, __pyx_v_coll->__pyx_base.coll, __pyx_v_fetch_val))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1529
 * 		fetch_val = create_native_value(fetch)
 * 		res = self.create_result(cb, xmmsc_coll_query(self.conn, coll.coll, fetch_val))
 * 		return res             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=0, leng=0, order=None, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_res));
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_153coll_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_152coll_query[] = "\n\t\tcoll_query(coll, fetch, cb=None) -> XmmsResult\n\n\t\tRetrive a list of ids of the media matching the collection\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_153coll_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_fetch = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_query (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__coll,&__pyx_n_s__fetch,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};

    /* "xmmsapi.pyx":1518
 * 		return self.create_result(cb, xmmsc_coll_idlist_from_playlist_file(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult coll_query(self, Collection coll, fetch, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query(coll, fetch, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fetch)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("coll_query", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_query") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[0]);
    __pyx_v_fetch = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_query", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_152coll_query(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_coll, __pyx_v_fetch, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_152coll_query(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fetch, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_query(__pyx_v_self, __pyx_v_coll, __pyx_v_fetch, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1531
 * 		return res
 * 
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=0, leng=0, order=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query_ids(coll, start=0, leng=0, order=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_155coll_query_ids(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_query_ids(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids *__pyx_optional_args) {
  PyObject *__pyx_v_start = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_leng = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_order = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_order_val;
  xmmsc_result_t *__pyx_v_res;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  xmmsv_t *__pyx_t_5;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query_ids", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_start = __pyx_optional_args->start;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_leng = __pyx_optional_args->leng;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_order = __pyx_optional_args->order;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_cb = __pyx_optional_args->cb;
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_order);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_query_ids); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_155coll_query_ids)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      __Pyx_INCREF(__pyx_v_leng);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_leng);
      __Pyx_GIVEREF(__pyx_v_leng);
      __Pyx_INCREF(__pyx_v_order);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_order);
      __Pyx_GIVEREF(__pyx_v_order);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1542
 * 		cdef xmmsc_result_t *res
 * 
 * 		if order is None:             # <<<<<<<<<<<<<<
 * 			order = []
 * 		order_val = create_native_value(order)
 */
  __pyx_t_4 = (__pyx_v_order == Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1543
 * 
 * 		if order is None:
 * 			order = []             # <<<<<<<<<<<<<<
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_coll_query_ids(self.conn, coll.coll, order_val, start, leng)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_order);
    __pyx_v_order = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1544
 * 		if order is None:
 * 			order = []
 * 		order_val = create_native_value(order)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_coll_query_ids(self.conn, coll.coll, order_val, start, leng)
 * 		xmmsv_unref(order_val)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_order); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_order_val = __pyx_t_5;

  /* "xmmsapi.pyx":1545
 * 			order = []
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_coll_query_ids(self.conn, coll.coll, order_val, start, leng)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_start); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_leng); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = xmmsc_coll_query_ids(__pyx_v_self->__pyx_base.conn, __pyx_v_coll->__pyx_base.coll, __pyx_v_order_val, __pyx_t_6, __pyx_t_7);

  /* "xmmsapi.pyx":1546
 * 		order_val = create_native_value(order)
 * 		res = xmmsc_coll_query_ids(self.conn, coll.coll, order_val, start, leng)
 * 		xmmsv_unref(order_val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v_order_val);

  /* "xmmsapi.pyx":1547
 * 		res = xmmsc_coll_query_ids(self.conn, coll.coll, order_val, start, leng)
 * 		xmmsv_unref(order_val)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=0, leng=0, order=None, groupby=None, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_order);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_155coll_query_ids(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_154coll_query_ids[] = "\n\t\tcoll_query_ids(coll, start=0, leng=0, order=None, cb=None) -> XmmsResult\n\n\t\tRetrive a list of ids of the media matching the collection\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_155coll_query_ids(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_leng = 0;
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_query_ids (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__coll,&__pyx_n_s__start,&__pyx_n_s__leng,&__pyx_n_s__order,&__pyx_n_s__cb,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);

    /* "xmmsapi.pyx":1531
 * 		return res
 * 
 * 	cpdef XmmsResult coll_query_ids(self, Collection coll, start=0, leng=0, order=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query_ids(coll, start=0, leng=0, order=None, cb=None) -> XmmsResult
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__leng);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_query_ids") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[0]);
    __pyx_v_start = values[1];
    __pyx_v_leng = values[2];
    __pyx_v_order = values[3];
    __pyx_v_cb = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_query_ids", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_154coll_query_ids(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_coll, __pyx_v_start, __pyx_v_leng, __pyx_v_order, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_154coll_query_ids(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_start, PyObject *__pyx_v_leng, PyObject *__pyx_v_order, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query_ids", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.start = __pyx_v_start;
  __pyx_t_2.leng = __pyx_v_leng;
  __pyx_t_2.order = __pyx_v_order;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_query_ids(__pyx_v_self, __pyx_v_coll, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1549
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=0, leng=0, order=None, groupby=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query_infos(coll, fields, start=0, leng=0, order=None, groupby=None, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_157coll_query_infos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_coll_query_infos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fields, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos *__pyx_optional_args) {
  PyObject *__pyx_v_start = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_leng = ((PyObject *)__pyx_int_0);
  PyObject *__pyx_v_order = ((PyObject *)Py_None);
  PyObject *__pyx_v_groupby = ((PyObject *)Py_None);
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v_order_val;
  xmmsv_t *__pyx_v_fields_val;
  xmmsv_t *__pyx_v_groupby_val;
  xmmsc_result_t *__pyx_v_res;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  xmmsv_t *__pyx_t_5;
  unsigned int __pyx_t_6;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query_infos", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_start = __pyx_optional_args->start;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_leng = __pyx_optional_args->leng;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_order = __pyx_optional_args->order;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_groupby = __pyx_optional_args->groupby;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_cb = __pyx_optional_args->cb;
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_order);
  __Pyx_INCREF(__pyx_v_groupby);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__coll_query_infos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_157coll_query_infos)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_coll));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_coll));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_coll));
      __Pyx_INCREF(__pyx_v_fields);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_fields);
      __Pyx_GIVEREF(__pyx_v_fields);
      __Pyx_INCREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      __Pyx_INCREF(__pyx_v_leng);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_leng);
      __Pyx_GIVEREF(__pyx_v_leng);
      __Pyx_INCREF(__pyx_v_order);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_order);
      __Pyx_GIVEREF(__pyx_v_order);
      __Pyx_INCREF(__pyx_v_groupby);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_groupby);
      __Pyx_GIVEREF(__pyx_v_groupby);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1562
 * 		cdef xmmsc_result_t *res
 * 
 * 		if order is None:             # <<<<<<<<<<<<<<
 * 			order = []
 * 		if groupby is None:
 */
  __pyx_t_4 = (__pyx_v_order == Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1563
 * 
 * 		if order is None:
 * 			order = []             # <<<<<<<<<<<<<<
 * 		if groupby is None:
 * 			groupby = []
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_order);
    __pyx_v_order = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1564
 * 		if order is None:
 * 			order = []
 * 		if groupby is None:             # <<<<<<<<<<<<<<
 * 			groupby = []
 * 		order_val = create_native_value(order)
 */
  __pyx_t_4 = (__pyx_v_groupby == Py_None);
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":1565
 * 			order = []
 * 		if groupby is None:
 * 			groupby = []             # <<<<<<<<<<<<<<
 * 		order_val = create_native_value(order)
 * 		fields_val = create_native_value(fields)
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_groupby);
    __pyx_v_groupby = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":1566
 * 		if groupby is None:
 * 			groupby = []
 * 		order_val = create_native_value(order)             # <<<<<<<<<<<<<<
 * 		fields_val = create_native_value(fields)
 * 		groupby_val = create_native_value(groupby)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_order); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_order_val = __pyx_t_5;

  /* "xmmsapi.pyx":1567
 * 			groupby = []
 * 		order_val = create_native_value(order)
 * 		fields_val = create_native_value(fields)             # <<<<<<<<<<<<<<
 * 		groupby_val = create_native_value(groupby)
 * 		res = xmmsc_coll_query_infos(self.conn, coll.coll, order_val, start, leng, fields_val, groupby_val)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_fields); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_fields_val = __pyx_t_5;

  /* "xmmsapi.pyx":1568
 * 		order_val = create_native_value(order)
 * 		fields_val = create_native_value(fields)
 * 		groupby_val = create_native_value(groupby)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_coll_query_infos(self.conn, coll.coll, order_val, start, leng, fields_val, groupby_val)
 * 		xmmsv_unref(order_val)
 */
  __pyx_t_5 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_groupby); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_groupby_val = __pyx_t_5;

  /* "xmmsapi.pyx":1569
 * 		fields_val = create_native_value(fields)
 * 		groupby_val = create_native_value(groupby)
 * 		res = xmmsc_coll_query_infos(self.conn, coll.coll, order_val, start, leng, fields_val, groupby_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(order_val)
 * 		xmmsv_unref(fields_val)
 */
  __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_start); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_leng); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = xmmsc_coll_query_infos(__pyx_v_self->__pyx_base.conn, __pyx_v_coll->__pyx_base.coll, __pyx_v_order_val, __pyx_t_6, __pyx_t_7, __pyx_v_fields_val, __pyx_v_groupby_val);

  /* "xmmsapi.pyx":1570
 * 		groupby_val = create_native_value(groupby)
 * 		res = xmmsc_coll_query_infos(self.conn, coll.coll, order_val, start, leng, fields_val, groupby_val)
 * 		xmmsv_unref(order_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(fields_val)
 * 		xmmsv_unref(groupby_val)
 */
  xmmsv_unref(__pyx_v_order_val);

  /* "xmmsapi.pyx":1571
 * 		res = xmmsc_coll_query_infos(self.conn, coll.coll, order_val, start, leng, fields_val, groupby_val)
 * 		xmmsv_unref(order_val)
 * 		xmmsv_unref(fields_val)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(groupby_val)
 * 		return self.create_result(cb, res)
 */
  xmmsv_unref(__pyx_v_fields_val);

  /* "xmmsapi.pyx":1572
 * 		xmmsv_unref(order_val)
 * 		xmmsv_unref(fields_val)
 * 		xmmsv_unref(groupby_val)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v_groupby_val);

  /* "xmmsapi.pyx":1573
 * 		xmmsv_unref(fields_val)
 * 		xmmsv_unref(groupby_val)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult bindata_add(self, data, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_infos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_order);
  __Pyx_XDECREF(__pyx_v_groupby);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_157coll_query_infos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_156coll_query_infos[] = "\n\t\tcoll_query_infos(coll, fields, start=0, leng=0, order=None, groupby=None, cb=None) -> XmmsResult\n\n\t\tRetrive a list of mediainfo of the media matching the collection\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_157coll_query_infos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_leng = 0;
  PyObject *__pyx_v_order = 0;
  PyObject *__pyx_v_groupby = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("coll_query_infos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__coll,&__pyx_n_s__fields,&__pyx_n_s__start,&__pyx_n_s__leng,&__pyx_n_s__order,&__pyx_n_s__groupby,&__pyx_n_s__cb,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_0);

    /* "xmmsapi.pyx":1549
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult coll_query_infos(self, Collection coll, fields, start=0, leng=0, order=None, groupby=None, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		coll_query_infos(coll, fields, start=0, leng=0, order=None, groupby=None, cb=None) -> XmmsResult
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);
    values[6] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coll)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fields)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("coll_query_infos", 0, 2, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__leng);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__order);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__groupby);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coll_query_infos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_coll = ((struct __pyx_obj_9xmmsvalue_Collection *)values[0]);
    __pyx_v_fields = values[1];
    __pyx_v_start = values[2];
    __pyx_v_leng = values[3];
    __pyx_v_order = values[4];
    __pyx_v_groupby = values[5];
    __pyx_v_cb = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coll_query_infos", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_infos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coll), __pyx_ptype_9xmmsvalue_Collection, 1, "coll", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_156coll_query_infos(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_coll, __pyx_v_fields, __pyx_v_start, __pyx_v_leng, __pyx_v_order, __pyx_v_groupby, __pyx_v_cb);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_156coll_query_infos(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, struct __pyx_obj_9xmmsvalue_Collection *__pyx_v_coll, PyObject *__pyx_v_fields, PyObject *__pyx_v_start, PyObject *__pyx_v_leng, PyObject *__pyx_v_order, PyObject *__pyx_v_groupby, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coll_query_infos", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.start = __pyx_v_start;
  __pyx_t_2.leng = __pyx_v_leng;
  __pyx_t_2.order = __pyx_v_order;
  __pyx_t_2.groupby = __pyx_v_groupby;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->coll_query_infos(__pyx_v_self, __pyx_v_coll, __pyx_v_fields, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.coll_query_infos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1575
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult bindata_add(self, data, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_add(data, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_159bindata_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_bindata_add(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  char *__pyx_v_t;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_add", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__bindata_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_159bindata_add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1584
 * 		"""
 * 		cdef char *t
 * 		t = <char *>data             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_bindata_add(self.conn,<unsigned char *>t,len(data)))
 * 
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_t = ((char *)__pyx_t_4);

  /* "xmmsapi.pyx":1585
 * 		cdef char *t
 * 		t = <char *>data
 * 		return self.create_result(cb, xmmsc_bindata_add(self.conn,<unsigned char *>t,len(data)))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_bindata_add(__pyx_v_self->__pyx_base.conn, ((unsigned char *)__pyx_v_t), __pyx_t_5))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_159bindata_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_158bindata_add[] = "\n\t\tbindata_add(data, cb=None) -> XmmsResult\n\n\t\tAdd a datafile to the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_159bindata_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bindata_add (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1575
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult bindata_add(self, data, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_add(data, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindata_add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_data = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindata_add", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_158bindata_add(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_data, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_158bindata_add(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->bindata_add(__pyx_v_self, __pyx_v_data, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1587
 * 		return self.create_result(cb, xmmsc_bindata_add(self.conn,<unsigned char *>t,len(data)))
 * 
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_retrieve(hash, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_161bindata_retrieve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_bindata_retrieve(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_h = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_retrieve", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__bindata_retrieve); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_161bindata_retrieve)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_hash);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_hash);
      __Pyx_GIVEREF(__pyx_v_hash);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1595
 * 		@return: The result of the operation.
 * 		"""
 * 		h = from_unicode(hash)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_bindata_retrieve(self.conn, <char *>h))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_h = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1596
 * 		"""
 * 		h = from_unicode(hash)
 * 		return self.create_result(cb, xmmsc_bindata_retrieve(self.conn, <char *>h))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_h); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_bindata_retrieve(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_retrieve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_161bindata_retrieve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_160bindata_retrieve[] = "\n\t\tbindata_retrieve(hash, cb=None) -> XmmsResult\n\n\t\tRetrieve a datafile from the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_161bindata_retrieve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hash = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bindata_retrieve (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__hash,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1587
 * 		return self.create_result(cb, xmmsc_bindata_add(self.conn,<unsigned char *>t,len(data)))
 * 
 * 	cpdef XmmsResult bindata_retrieve(self, hash, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_retrieve(hash, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hash)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindata_retrieve") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hash = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindata_retrieve", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_retrieve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_160bindata_retrieve(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_hash, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_160bindata_retrieve(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_retrieve", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->bindata_retrieve(__pyx_v_self, __pyx_v_hash, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_retrieve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1598
 * 		return self.create_result(cb, xmmsc_bindata_retrieve(self.conn, <char *>h))
 * 
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_remove(hash, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_163bindata_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_bindata_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_h = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_remove", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__bindata_remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_163bindata_remove)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_hash);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_hash);
      __Pyx_GIVEREF(__pyx_v_hash);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1606
 * 		@return: The result of the operation.
 * 		"""
 * 		h = from_unicode(hash)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_bindata_remove(self.conn, <char *>h))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_hash); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_h = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1607
 * 		"""
 * 		h = from_unicode(hash)
 * 		return self.create_result(cb, xmmsc_bindata_remove(self.conn, <char *>h))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult bindata_list(self, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_h); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_bindata_remove(__pyx_v_self->__pyx_base.conn, ((char *)__pyx_t_4)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_163bindata_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_162bindata_remove[] = "\n\t\tbindata_remove(hash, cb=None) -> XmmsResult\n\n\t\tRemove a datafile from the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_163bindata_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hash = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bindata_remove (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__hash,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1598
 * 		return self.create_result(cb, xmmsc_bindata_retrieve(self.conn, <char *>h))
 * 
 * 	cpdef XmmsResult bindata_remove(self, hash, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_remove(hash, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hash)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindata_remove") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hash = values[0];
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindata_remove", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_162bindata_remove(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_hash, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_162bindata_remove(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_hash, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_remove", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->bindata_remove(__pyx_v_self, __pyx_v_hash, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1609
 * 		return self.create_result(cb, xmmsc_bindata_remove(self.conn, <char *>h))
 * 
 * 	cpdef XmmsResult bindata_list(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_list(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_165bindata_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_bindata_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_list", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__bindata_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_165bindata_list)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1617
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_bindata_list(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult stats(self, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_bindata_list(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_165bindata_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_164bindata_list[] = "\n\t\tbindata_list(cb=None) -> XmmsResult\n\n\t\tList all bindata hashes stored on the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_165bindata_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bindata_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1609
 * 		return self.create_result(cb, xmmsc_bindata_remove(self.conn, <char *>h))
 * 
 * 	cpdef XmmsResult bindata_list(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		bindata_list(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindata_list") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindata_list", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_164bindata_list(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_164bindata_list(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bindata_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->bindata_list(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.bindata_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1619
 * 		return self.create_result(cb, xmmsc_bindata_list(self.conn))
 * 
 * 	cpdef XmmsResult stats(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		stats(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_167stats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_stats(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stats", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__stats); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_167stats)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1627
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_main_stats(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult visualization_version(self, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_main_stats(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_167stats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_166stats[] = "\n\t\tstats(cb=None) -> XmmsResult\n\n\t\tGet statistics information from the server\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_167stats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stats (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1619
 * 		return self.create_result(cb, xmmsc_bindata_list(self.conn))
 * 
 * 	cpdef XmmsResult stats(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		stats(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stats") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stats", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_166stats(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_166stats(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stats", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->stats(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1629
 * 		return self.create_result(cb, xmmsc_main_stats(self.conn))
 * 
 * 	cpdef XmmsResult visualization_version(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_version(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_169visualization_version(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_visualization_version(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_version", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_81); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_169visualization_version)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1637
 * 		@return: The result of the operation.
 * 		"""
 * 		return self.create_result(cb, xmmsc_visualization_version(self.conn))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult visualization_init(self, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_visualization_version(__pyx_v_self->__pyx_base.conn))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_169visualization_version(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_168visualization_version[] = "\n\t\txmmsc_visualization_version(cb=None) -> XmmsResult\n\n\t\tGet the version of the visualization plugin installed on the server.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_169visualization_version(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_version (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1629
 * 		return self.create_result(cb, xmmsc_main_stats(self.conn))
 * 
 * 	cpdef XmmsResult visualization_version(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_version(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_version") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_version", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_168visualization_version(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_168visualization_version(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_version", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_version(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1639
 * 		return self.create_result(cb, xmmsc_visualization_version(self.conn))
 * 
 * 	cpdef XmmsResult visualization_init(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_init(cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_171visualization_init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_visualization_init(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_init", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__visualization_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_171visualization_init)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1647
 * 		@return: The result of the operation
 * 		"""
 * 		return self.create_vis_result(cb, xmmsc_visualization_init(self.conn), VIS_RESULT_CMD_INIT)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_vis_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_visualization_init(__pyx_v_self->__pyx_base.conn), __pyx_e_7xmmsapi_VIS_RESULT_CMD_INIT)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_171visualization_init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_170visualization_init[] = "\n\t\txmmsc_visualization_init(cb=None) -> XmmsResult\n\n\t\tGet a new visualization handle.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_171visualization_init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_init (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cb,0};
    PyObject* values[1] = {0};

    /* "xmmsapi.pyx":1639
 * 		return self.create_result(cb, xmmsc_visualization_version(self.conn))
 * 
 * 	cpdef XmmsResult visualization_init(self, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_init(cb=None) -> XmmsResult
 */
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_init") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cb = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_init", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_170visualization_init(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_170visualization_init(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_init", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_init(__pyx_v_self, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1649
 * 		return self.create_vis_result(cb, xmmsc_visualization_init(self.conn), VIS_RESULT_CMD_INIT)
 * 
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_start(handle, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_173visualization_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_visualization_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_start", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__visualization_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_173visualization_start)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1657
 * 		@return: The result of the operation
 * 		"""
 * 		return self.create_vis_result(cb, xmmsc_visualization_start(self.conn, handle), VIS_RESULT_CMD_START)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef bint visualization_started(self, int handle):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_vis_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_visualization_start(__pyx_v_self->__pyx_base.conn, __pyx_v_handle), __pyx_e_7xmmsapi_VIS_RESULT_CMD_START)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_173visualization_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_172visualization_start[] = "\n\t\txmmsc_visualization_start(handle, cb=None) -> XmmsResult\n\n\t\tStarts the visualization.\n\t\t@rtype: L{XmmsResult}\n\t\t@return: The result of the operation\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_173visualization_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_handle;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s__cb,0};
    PyObject* values[2] = {0,0};

    /* "xmmsapi.pyx":1649
 * 		return self.create_vis_result(cb, xmmsc_visualization_init(self.conn), VIS_RESULT_CMD_INIT)
 * 
 * 	cpdef XmmsResult visualization_start(self, int handle, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_start(handle, cb=None) -> XmmsResult
 */
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_cb = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_start", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_172visualization_start(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_handle, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_172visualization_start(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_start(__pyx_v_self, __pyx_v_handle, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1659
 * 		return self.create_vis_result(cb, xmmsc_visualization_start(self.conn, handle), VIS_RESULT_CMD_START)
 * 
 * 	cpdef bint visualization_started(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_started(handle) -> bool
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_175visualization_started(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static int __pyx_f_7xmmsapi_7XmmsApi_visualization_started(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_started", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_82); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_175visualization_started)) {
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1667
 * 		@return: True if the visualization is started, False otherwise.
 * 		"""
 * 		return xmmsc_visualization_started(self.conn, handle)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef bint visualization_errored(self, int handle):
 */
  __pyx_r = xmmsc_visualization_started(__pyx_v_self->__pyx_base.conn, __pyx_v_handle);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("xmmsapi.XmmsApi.visualization_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_175visualization_started(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_174visualization_started[] = "\n\t\txmmsc_visualization_started(handle) -> bool\n\n\t\tWhether the visualization is started or not.\n\t\t@rtype: L{bool}\n\t\t@return: True if the visualization is started, False otherwise.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_175visualization_started(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle) {
  int __pyx_v_handle;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_started (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_AsInt(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_174visualization_started(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), ((int)__pyx_v_handle));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1659
 * 		return self.create_vis_result(cb, xmmsc_visualization_start(self.conn, handle), VIS_RESULT_CMD_START)
 * 
 * 	cpdef bint visualization_started(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_started(handle) -> bool
 */

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_174visualization_started(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_started", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_started(__pyx_v_self, __pyx_v_handle, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1669
 * 		return xmmsc_visualization_started(self.conn, handle)
 * 
 * 	cpdef bint visualization_errored(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_errored(handle) -> bool
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_177visualization_errored(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static int __pyx_f_7xmmsapi_7XmmsApi_visualization_errored(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_errored", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_83); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_177visualization_errored)) {
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1677
 * 		@return: True if the visualization got an error, False otherwise.
 * 		"""
 * 		return xmmsc_visualization_errored(self.conn, handle)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=None):
 */
  __pyx_r = xmmsc_visualization_errored(__pyx_v_self->__pyx_base.conn, __pyx_v_handle);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("xmmsapi.XmmsApi.visualization_errored", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_177visualization_errored(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_176visualization_errored[] = "\n\t\txmmsc_visualization_errored(handle) -> bool\n\n\t\tWhether the visualization got an error.\n\t\t@rtype: L{bool}\n\t\t@return: True if the visualization got an error, False otherwise.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_177visualization_errored(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle) {
  int __pyx_v_handle;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_errored (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_AsInt(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_errored", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_176visualization_errored(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), ((int)__pyx_v_handle));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1669
 * 		return xmmsc_visualization_started(self.conn, handle)
 * 
 * 	cpdef bint visualization_errored(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_errored(handle) -> bool
 */

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_176visualization_errored(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_errored", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_errored(__pyx_v_self, __pyx_v_handle, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_errored", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1679
 * 		return xmmsc_visualization_errored(self.conn, handle)
 * 
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_property_set(handle, key, value, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_179visualization_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_visualization_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set *__pyx_optional_args) {
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_property_set", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_cb = __pyx_optional_args->cb;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_84); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_179visualization_property_set)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1687
 * 		@return: The result of the operation
 * 		"""
 * 		k = from_unicode(key)             # <<<<<<<<<<<<<<
 * 		v = from_unicode(value)
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_k = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1688
 * 		"""
 * 		k = from_unicode(key)
 * 		v = from_unicode(value)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))
 * 
 */
  __pyx_t_1 = __pyx_f_9xmmsutils_from_unicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_v = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1689
 * 		k = from_unicode(key)
 * 		v = from_unicode(value)
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props={}, cb=None):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_4 = PyBytes_AsString(__pyx_v_k); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyBytes_AsString(__pyx_v_v); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, xmmsc_visualization_property_set(__pyx_v_self->__pyx_base.conn, __pyx_v_handle, ((char *)__pyx_t_4), ((char *)__pyx_t_5)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_179visualization_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_178visualization_property_set[] = "\n\t\txmmsc_visualization_property_set(handle, key, value, cb=None) -> XmmsResult\n\n\t\tSet a visualization's property.\n\t\t@rtype: L{bool}\n\t\t@return: The result of the operation\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_179visualization_property_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_handle;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_property_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s__key,&__pyx_n_s__value,&__pyx_n_s__cb,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":1679
 * 		return xmmsc_visualization_errored(self.conn, handle)
 * 
 * 	cpdef XmmsResult visualization_property_set(self, int handle, key, value, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_property_set(handle, key, value, cb=None) -> XmmsResult
 */
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("visualization_property_set", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("visualization_property_set", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_property_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
    __pyx_v_cb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_property_set", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_178visualization_property_set(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_handle, __pyx_v_key, __pyx_v_value, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_178visualization_property_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_property_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_property_set(__pyx_v_self, __pyx_v_handle, __pyx_v_key, __pyx_v_value, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_property_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1691
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))
 * 
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props={}, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_properties_set(handle, props={}, cb=None) -> XmmsResult
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_181visualization_properties_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_f_7xmmsapi_7XmmsApi_visualization_properties_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set *__pyx_optional_args) {
  PyObject *__pyx_v_props = __pyx_k_85;
  PyObject *__pyx_v_cb = ((PyObject *)Py_None);
  xmmsv_t *__pyx_v__props;
  xmmsc_result_t *__pyx_v_res;
  struct __pyx_obj_7xmmsapi_XmmsResult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  xmmsv_t *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_properties_set", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_props = __pyx_optional_args->props;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_cb = __pyx_optional_args->cb;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_86); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_181visualization_properties_set)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_props);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_props);
      __Pyx_GIVEREF(__pyx_v_props);
      __Pyx_INCREF(__pyx_v_cb);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_cb);
      __Pyx_GIVEREF(__pyx_v_cb);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7xmmsapi_XmmsResult))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1702
 * 		cdef xmmsc_result_t *res
 * 
 * 		_props = create_native_value(props)             # <<<<<<<<<<<<<<
 * 		res = xmmsc_visualization_properties_set(self.conn, handle, _props)
 * 		xmmsv_unref(_props)
 */
  __pyx_t_4 = __pyx_f_9xmmsvalue_create_native_value(__pyx_v_props); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v__props = __pyx_t_4;

  /* "xmmsapi.pyx":1703
 * 
 * 		_props = create_native_value(props)
 * 		res = xmmsc_visualization_properties_set(self.conn, handle, _props)             # <<<<<<<<<<<<<<
 * 		xmmsv_unref(_props)
 * 		return self.create_result(cb, res)
 */
  __pyx_v_res = xmmsc_visualization_properties_set(__pyx_v_self->__pyx_base.conn, __pyx_v_handle, __pyx_v__props);

  /* "xmmsapi.pyx":1704
 * 		_props = create_native_value(props)
 * 		res = xmmsc_visualization_properties_set(self.conn, handle, _props)
 * 		xmmsv_unref(_props)             # <<<<<<<<<<<<<<
 * 		return self.create_result(cb, res)
 * 
 */
  xmmsv_unref(__pyx_v__props);

  /* "xmmsapi.pyx":1705
 * 		res = xmmsc_visualization_properties_set(self.conn, handle, _props)
 * 		xmmsv_unref(_props)
 * 		return self.create_result(cb, res)             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=0, bint blocking=False):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.create_result(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), __pyx_v_cb, __pyx_v_res)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsResult *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_properties_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_181visualization_properties_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_180visualization_properties_set[] = "\n\t\txmmsc_visualization_properties_set(handle, props={}, cb=None) -> XmmsResult\n\n\t\tSet visualization's properties.\n\t\t@rtype: L{bool}\n\t\t@return: The result of the operation\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_181visualization_properties_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_handle;
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_properties_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s__props,&__pyx_n_s__cb,0};
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_85;

    /* "xmmsapi.pyx":1691
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))
 * 
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props={}, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_properties_set(handle, props={}, cb=None) -> XmmsResult
 */
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__props);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cb);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_properties_set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_props = values[1];
    __pyx_v_cb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_properties_set", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_properties_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_180visualization_properties_set(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_handle, __pyx_v_props, __pyx_v_cb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_180visualization_properties_set(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, PyObject *__pyx_v_props, PyObject *__pyx_v_cb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_properties_set", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.props = __pyx_v_props;
  __pyx_t_2.cb = __pyx_v_cb;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_properties_set(__pyx_v_self, __pyx_v_handle, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_properties_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1707
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=0, bint blocking=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsv_visualization_chunk_get(handle, drawtime=0, blocking=False)
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_183visualization_chunk_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_f_7xmmsapi_7XmmsApi_visualization_chunk_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get *__pyx_optional_args) {
  int __pyx_v_drawtime = ((int)0);
  int __pyx_v_blocking = ((int)0);
  short *__pyx_v_buf;
  int __pyx_v_size;
  struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_v_chunk = 0;
  struct __pyx_obj_7xmmsapi_XmmsVisChunk *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_chunk_get", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_drawtime = __pyx_optional_args->drawtime;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_blocking = __pyx_optional_args->blocking;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_87); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_183visualization_chunk_get)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_drawtime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_blocking); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7xmmsapi_XmmsVisChunk))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1719
 * 		cdef XmmsVisChunk chunk
 * 
 * 		buf = <short *>PyMem_Malloc(2 * XMMSC_VISUALIZATION_WINDOW_SIZE * sizeof (short))             # <<<<<<<<<<<<<<
 * 		size = xmmsc_visualization_chunk_get (self.conn, handle, buf, drawtime, blocking)
 * 		if size < 0:
 */
  __pyx_v_buf = ((short *)PyMem_Malloc(((2 * XMMSC_VISUALIZATION_WINDOW_SIZE) * (sizeof(short)))));

  /* "xmmsapi.pyx":1720
 * 
 * 		buf = <short *>PyMem_Malloc(2 * XMMSC_VISUALIZATION_WINDOW_SIZE * sizeof (short))
 * 		size = xmmsc_visualization_chunk_get (self.conn, handle, buf, drawtime, blocking)             # <<<<<<<<<<<<<<
 * 		if size < 0:
 * 			PyMem_Free(buf)
 */
  __pyx_v_size = xmmsc_visualization_chunk_get(__pyx_v_self->__pyx_base.conn, __pyx_v_handle, __pyx_v_buf, __pyx_v_drawtime, __pyx_v_blocking);

  /* "xmmsapi.pyx":1721
 * 		buf = <short *>PyMem_Malloc(2 * XMMSC_VISUALIZATION_WINDOW_SIZE * sizeof (short))
 * 		size = xmmsc_visualization_chunk_get (self.conn, handle, buf, drawtime, blocking)
 * 		if size < 0:             # <<<<<<<<<<<<<<
 * 			PyMem_Free(buf)
 * 			raise VisualizationError("Unrecoverable error in visualization")
 */
  __pyx_t_6 = (__pyx_v_size < 0);
  if (__pyx_t_6) {

    /* "xmmsapi.pyx":1722
 * 		size = xmmsc_visualization_chunk_get (self.conn, handle, buf, drawtime, blocking)
 * 		if size < 0:
 * 			PyMem_Free(buf)             # <<<<<<<<<<<<<<
 * 			raise VisualizationError("Unrecoverable error in visualization")
 * 		chunk = XmmsVisChunk()
 */
    PyMem_Free(__pyx_v_buf);

    /* "xmmsapi.pyx":1723
 * 		if size < 0:
 * 			PyMem_Free(buf)
 * 			raise VisualizationError("Unrecoverable error in visualization")             # <<<<<<<<<<<<<<
 * 		chunk = XmmsVisChunk()
 * 		chunk.set_data(buf, size)
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__VisualizationError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1724
 * 			PyMem_Free(buf)
 * 			raise VisualizationError("Unrecoverable error in visualization")
 * 		chunk = XmmsVisChunk()             # <<<<<<<<<<<<<<
 * 		chunk.set_data(buf, size)
 * 		PyMem_Free(buf)
 */
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsVisChunk)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_chunk = ((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "xmmsapi.pyx":1725
 * 			raise VisualizationError("Unrecoverable error in visualization")
 * 		chunk = XmmsVisChunk()
 * 		chunk.set_data(buf, size)             # <<<<<<<<<<<<<<
 * 		PyMem_Free(buf)
 * 		return chunk
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk *)__pyx_v_chunk->__pyx_vtab)->set_data(__pyx_v_chunk, __pyx_v_buf, __pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "xmmsapi.pyx":1726
 * 		chunk = XmmsVisChunk()
 * 		chunk.set_data(buf, size)
 * 		PyMem_Free(buf)             # <<<<<<<<<<<<<<
 * 		return chunk
 * 
 */
  PyMem_Free(__pyx_v_buf);

  /* "xmmsapi.pyx":1727
 * 		chunk.set_data(buf, size)
 * 		PyMem_Free(buf)
 * 		return chunk             # <<<<<<<<<<<<<<
 * 
 * 	cpdef visualization_shutdown(self, int handle):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_chunk));
  __pyx_r = __pyx_v_chunk;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_chunk_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_183visualization_chunk_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_182visualization_chunk_get[] = "\n\t\txmmsv_visualization_chunk_get(handle, drawtime=0, blocking=False)\n\n\t\tFetches the next available data chunk\n\t\t@rtype: L{XmmsVisChunk}\n\t\t@return: Visualization chunk.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_183visualization_chunk_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_handle;
  int __pyx_v_drawtime;
  int __pyx_v_blocking;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_chunk_get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s__drawtime,&__pyx_n_s__blocking,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__drawtime);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__blocking);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "visualization_chunk_get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_drawtime = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_drawtime == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_drawtime = ((int)0);
    }
    if (values[2]) {
      __pyx_v_blocking = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "xmmsapi.pyx":1707
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsVisChunk visualization_chunk_get(self, int handle, int drawtime=0, bint blocking=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsv_visualization_chunk_get(handle, drawtime=0, blocking=False)
 */
      __pyx_v_blocking = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("visualization_chunk_get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_chunk_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_182visualization_chunk_get(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), __pyx_v_handle, __pyx_v_drawtime, __pyx_v_blocking);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_182visualization_chunk_get(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_v_drawtime, int __pyx_v_blocking) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_chunk_get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.drawtime = __pyx_v_drawtime;
  __pyx_t_2.blocking = __pyx_v_blocking;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_chunk_get(__pyx_v_self, __pyx_v_handle, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_chunk_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1729
 * 		return chunk
 * 
 * 	cpdef visualization_shutdown(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_shutdown(handle) -> None
 */

static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_185visualization_shutdown(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static PyObject *__pyx_f_7xmmsapi_7XmmsApi_visualization_shutdown(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_shutdown", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_90); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_185visualization_shutdown)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "xmmsapi.pyx":1735
 * 		Shutdown and destroy a visualization. After this, handle is no longer valid.
 * 		"""
 * 		xmmsc_visualization_shutdown(self.conn, handle)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  xmmsc_visualization_shutdown(__pyx_v_self->__pyx_base.conn, __pyx_v_handle);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_185visualization_shutdown(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle); /*proto*/
static char __pyx_doc_7xmmsapi_7XmmsApi_184visualization_shutdown[] = "\n\t\txmmsc_visualization_shutdown(handle) -> None\n\n\t\tShutdown and destroy a visualization. After this, handle is no longer valid.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_7XmmsApi_185visualization_shutdown(PyObject *__pyx_v_self, PyObject *__pyx_arg_handle) {
  int __pyx_v_handle;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("visualization_shutdown (wrapper)", 0);
  assert(__pyx_arg_handle); {
    __pyx_v_handle = __Pyx_PyInt_AsInt(__pyx_arg_handle); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_7XmmsApi_184visualization_shutdown(((struct __pyx_obj_7xmmsapi_XmmsApi *)__pyx_v_self), ((int)__pyx_v_handle));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1729
 * 		return chunk
 * 
 * 	cpdef visualization_shutdown(self, int handle):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_shutdown(handle) -> None
 */

static PyObject *__pyx_pf_7xmmsapi_7XmmsApi_184visualization_shutdown(struct __pyx_obj_7xmmsapi_XmmsApi *__pyx_v_self, int __pyx_v_handle) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("visualization_shutdown", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsApi *)__pyx_v_self->__pyx_base.__pyx_vtab)->visualization_shutdown(__pyx_v_self, __pyx_v_handle, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsapi.XmmsApi.visualization_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7xmmsapi_8XmmsLoop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7xmmsapi_8XmmsLoop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop___cinit__(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1747
 * 	#cdef object wakeup
 * 
 * 	def __cinit__(self):             # <<<<<<<<<<<<<<
 * 		self.do_loop = 0
 * 
 */

static int __pyx_pf_7xmmsapi_8XmmsLoop___cinit__(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "xmmsapi.pyx":1748
 * 
 * 	def __cinit__(self):
 * 		self.do_loop = 0             # <<<<<<<<<<<<<<
 * 
 * 	def _loop_set_wakeup(self, fd):
 */
  __pyx_v_self->do_loop = 0;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_3_loop_set_wakeup(PyObject *__pyx_v_self, PyObject *__pyx_v_fd); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsLoop_2_loop_set_wakeup[] = "\n\t\tSet the file descriptor for wakeup operations.\n\t\tThis method should not be used outside the XmmsLoop class implementation.\n\t\tIt is provided to allow subclasses to add some locking on it in\n\t\tmultithreaded applications.\n\n\t\tUse a Rlock if you want to synchronize other methods using the same lock.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_3_loop_set_wakeup(PyObject *__pyx_v_self, PyObject *__pyx_v_fd) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_loop_set_wakeup (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_2_loop_set_wakeup(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self), ((PyObject *)__pyx_v_fd));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1750
 * 		self.do_loop = 0
 * 
 * 	def _loop_set_wakeup(self, fd):             # <<<<<<<<<<<<<<
 * 		"""
 * 		Set the file descriptor for wakeup operations.
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_2_loop_set_wakeup(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self, PyObject *__pyx_v_fd) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_loop_set_wakeup", 0);

  /* "xmmsapi.pyx":1759
 * 		Use a Rlock if you want to synchronize other methods using the same lock.
 * 		"""
 * 		self.wakeup = fd             # <<<<<<<<<<<<<<
 * 	def _loop_get_wakeup(self):
 * 		"""
 */
  __Pyx_INCREF(__pyx_v_fd);
  __Pyx_GIVEREF(__pyx_v_fd);
  __Pyx_GOTREF(__pyx_v_self->wakeup);
  __Pyx_DECREF(__pyx_v_self->wakeup);
  __pyx_v_self->wakeup = __pyx_v_fd;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_5_loop_get_wakeup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsLoop_4_loop_get_wakeup[] = "\n\t\tGet the file descriptor for wakeup operations.\n\t\tThis method should not be used outside the XmmsLoop class implementation.\n\t\tIt is provided to allow subclasses to add some locking on it in\n\t\tmultithreaded applications.\n\n\t\tUse a Rlock if you want to synchronize other methods using the same lock.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_5_loop_get_wakeup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_loop_get_wakeup (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_4_loop_get_wakeup(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1760
 * 		"""
 * 		self.wakeup = fd
 * 	def _loop_get_wakeup(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		Get the file descriptor for wakeup operations.
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_4_loop_get_wakeup(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_loop_get_wakeup", 0);

  /* "xmmsapi.pyx":1769
 * 		Use a Rlock if you want to synchronize other methods using the same lock.
 * 		"""
 * 		return self.wakeup             # <<<<<<<<<<<<<<
 * 
 * 	def exit_loop(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->wakeup);
  __pyx_r = __pyx_v_self->wakeup;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_7exit_loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsLoop_6exit_loop[] = "\n\t\texit_loop()\n\n\t\tExits from the L{loop} call\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_7exit_loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exit_loop (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_6exit_loop(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1771
 * 		return self.wakeup
 * 
 * 	def exit_loop(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		exit_loop()
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_6exit_loop(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exit_loop", 0);

  /* "xmmsapi.pyx":1777
 * 		Exits from the L{loop} call
 * 		"""
 * 		self.do_loop = False             # <<<<<<<<<<<<<<
 * 		self.loop_tickle()
 * 
 */
  __pyx_v_self->do_loop = 0;

  /* "xmmsapi.pyx":1778
 * 		"""
 * 		self.do_loop = False
 * 		self.loop_tickle()             # <<<<<<<<<<<<<<
 * 
 * 	def loop_tickle(self):
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loop_tickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("xmmsapi.XmmsLoop.exit_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_9loop_tickle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_9loop_tickle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("loop_tickle (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_8loop_tickle(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1780
 * 		self.loop_tickle()
 * 
 * 	def loop_tickle(self):             # <<<<<<<<<<<<<<
 * 		w = self._loop_get_wakeup()
 * 		if w is not None:
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_8loop_tickle(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self) {
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("loop_tickle", 0);

  /* "xmmsapi.pyx":1781
 * 
 * 	def loop_tickle(self):
 * 		w = self._loop_get_wakeup()             # <<<<<<<<<<<<<<
 * 		if w is not None:
 * 			write(w, "1".encode('ascii'))
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___loop_get_wakeup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_w = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":1782
 * 	def loop_tickle(self):
 * 		w = self._loop_get_wakeup()
 * 		if w is not None:             # <<<<<<<<<<<<<<
 * 			write(w, "1".encode('ascii'))
 * 
 */
  __pyx_t_3 = (__pyx_v_w != Py_None);
  if (__pyx_t_3) {

    /* "xmmsapi.pyx":1783
 * 		w = self._loop_get_wakeup()
 * 		if w is not None:
 * 			write(w, "1".encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 * 	def loop_iter(self, infd=None, outfd=None, errfd=None, timeout=-1):
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s__1), __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("xmmsapi.XmmsLoop.loop_tickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_11loop_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsLoop_10loop_iter[] = "\n\t\tloop_iter(infd=None, outfd=None, errfd=None, timeout=-1)\n\t\tRun one iteration of the main loop. Should be overridden to add\n\t\tcustom operations in the main loop.\n\t\t@return The tuple returned by select.select() to be used by overridding\n\t\tmethods in subclasses.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_11loop_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_infd = 0;
  PyObject *__pyx_v_outfd = 0;
  PyObject *__pyx_v_errfd = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("loop_iter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__infd,&__pyx_n_s__outfd,&__pyx_n_s__errfd,&__pyx_n_s__timeout,0};
    PyObject* values[4] = {0,0,0,0};

    /* "xmmsapi.pyx":1785
 * 			write(w, "1".encode('ascii'))
 * 
 * 	def loop_iter(self, infd=None, outfd=None, errfd=None, timeout=-1):             # <<<<<<<<<<<<<<
 * 		"""
 * 		loop_iter(infd=None, outfd=None, errfd=None, timeout=-1)
 */
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__infd);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__outfd);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__errfd);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "loop_iter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        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;
      }
    }
    __pyx_v_infd = values[0];
    __pyx_v_outfd = values[1];
    __pyx_v_errfd = values[2];
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("loop_iter", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("xmmsapi.XmmsLoop.loop_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_10loop_iter(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self), __pyx_v_infd, __pyx_v_outfd, __pyx_v_errfd, __pyx_v_timeout);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_10loop_iter(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self, PyObject *__pyx_v_infd, PyObject *__pyx_v_outfd, PyObject *__pyx_v_errfd, PyObject *__pyx_v_timeout) {
  int __pyx_v_fd;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_o = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("loop_iter", 0);

  /* "xmmsapi.pyx":1794
 * 		"""
 * 		cdef int fd
 * 		fd = xmmsc_io_fd_get(self.conn)             # <<<<<<<<<<<<<<
 * 		if self.want_ioout():
 * 			w = [fd]
 */
  __pyx_v_fd = xmmsc_io_fd_get(__pyx_v_self->__pyx_base.__pyx_base.conn);

  /* "xmmsapi.pyx":1795
 * 		cdef int fd
 * 		fd = xmmsc_io_fd_get(self.conn)
 * 		if self.want_ioout():             # <<<<<<<<<<<<<<
 * 			w = [fd]
 * 		else:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7xmmsapi_XmmsLoop *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.want_ioout(((struct __pyx_obj_7xmmsapi_XmmsCore *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1796
 * 		fd = xmmsc_io_fd_get(self.conn)
 * 		if self.want_ioout():
 * 			w = [fd]             # <<<<<<<<<<<<<<
 * 		else:
 * 			w = []
 */
    __pyx_t_1 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_w = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1798
 * 			w = [fd]
 * 		else:
 * 			w = []             # <<<<<<<<<<<<<<
 * 		r = [fd]
 * 		err = [fd]
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_w = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "xmmsapi.pyx":1799
 * 		else:
 * 			w = []
 * 		r = [fd]             # <<<<<<<<<<<<<<
 * 		err = [fd]
 * 		if infd:
 */
  __pyx_t_3 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1800
 * 			w = []
 * 		r = [fd]
 * 		err = [fd]             # <<<<<<<<<<<<<<
 * 		if infd:
 * 			r += infd
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_err = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "xmmsapi.pyx":1801
 * 		r = [fd]
 * 		err = [fd]
 * 		if infd:             # <<<<<<<<<<<<<<
 * 			r += infd
 * 		if outfd:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_infd); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1802
 * 		err = [fd]
 * 		if infd:
 * 			r += infd             # <<<<<<<<<<<<<<
 * 		if outfd:
 * 			w += outfd
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_r, __pyx_v_infd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_r);
    __pyx_v_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "xmmsapi.pyx":1803
 * 		if infd:
 * 			r += infd
 * 		if outfd:             # <<<<<<<<<<<<<<
 * 			w += outfd
 * 		if errfd:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_outfd); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1804
 * 			r += infd
 * 		if outfd:
 * 			w += outfd             # <<<<<<<<<<<<<<
 * 		if errfd:
 * 			err += errfd
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_w, __pyx_v_outfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_w);
    __pyx_v_w = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "xmmsapi.pyx":1805
 * 		if outfd:
 * 			w += outfd
 * 		if errfd:             # <<<<<<<<<<<<<<
 * 			err += errfd
 * 		if timeout < 0:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_errfd); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1806
 * 			w += outfd
 * 		if errfd:
 * 			err += errfd             # <<<<<<<<<<<<<<
 * 		if timeout < 0:
 * 			(i, o, e) = select(r, w, err)
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_err, __pyx_v_errfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_err);
    __pyx_v_err = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "xmmsapi.pyx":1807
 * 		if errfd:
 * 			err += errfd
 * 		if timeout < 0:             # <<<<<<<<<<<<<<
 * 			(i, o, e) = select(r, w, err)
 * 		else:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_timeout, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1808
 * 			err += errfd
 * 		if timeout < 0:
 * 			(i, o, e) = select(r, w, err)             # <<<<<<<<<<<<<<
 * 		else:
 * 			(i, o, e) = select(r, w, err, timeout)
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_r);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_r);
    __Pyx_GIVEREF(__pyx_v_r);
    __Pyx_INCREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    __Pyx_INCREF(__pyx_v_err);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_err);
    __Pyx_GIVEREF(__pyx_v_err);
    __pyx_t_1 = PyObject_Call(__pyx_v_7xmmsapi_select, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_o = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_e = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "xmmsapi.pyx":1810
 * 			(i, o, e) = select(r, w, err)
 * 		else:
 * 			(i, o, e) = select(r, w, err, timeout)             # <<<<<<<<<<<<<<
 * 		if e and fd in e:
 * 			xmmsc_io_disconnect(self.conn)
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_r);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_r);
    __Pyx_GIVEREF(__pyx_v_r);
    __Pyx_INCREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    __Pyx_INCREF(__pyx_v_err);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_err);
    __Pyx_GIVEREF(__pyx_v_err);
    __Pyx_INCREF(__pyx_v_timeout);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_timeout);
    __Pyx_GIVEREF(__pyx_v_timeout);
    __pyx_t_5 = PyObject_Call(__pyx_v_7xmmsapi_select, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L11_unpacking_done:;
    }
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_o = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_e = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L7:;

  /* "xmmsapi.pyx":1811
 * 		else:
 * 			(i, o, e) = select(r, w, err, timeout)
 * 		if e and fd in e:             # <<<<<<<<<<<<<<
 * 			xmmsc_io_disconnect(self.conn)
 * 			raise XmmsDisconnectException()
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_e); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __pyx_t_5 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_5, __pyx_v_e, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __pyx_t_8;
  } else {
    __pyx_t_9 = __pyx_t_2;
  }
  if (__pyx_t_9) {

    /* "xmmsapi.pyx":1812
 * 			(i, o, e) = select(r, w, err, timeout)
 * 		if e and fd in e:
 * 			xmmsc_io_disconnect(self.conn)             # <<<<<<<<<<<<<<
 * 			raise XmmsDisconnectException()
 * 		if i and fd in i:
 */
    xmmsc_io_disconnect(__pyx_v_self->__pyx_base.__pyx_base.conn);

    /* "xmmsapi.pyx":1813
 * 		if e and fd in e:
 * 			xmmsc_io_disconnect(self.conn)
 * 			raise XmmsDisconnectException()             # <<<<<<<<<<<<<<
 * 		if i and fd in i:
 * 			if not xmmsc_io_in_handle(self.conn):
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_92); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "xmmsapi.pyx":1814
 * 			xmmsc_io_disconnect(self.conn)
 * 			raise XmmsDisconnectException()
 * 		if i and fd in i:             # <<<<<<<<<<<<<<
 * 			if not xmmsc_io_in_handle(self.conn):
 * 				raise XmmsDisconnectException()
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_i); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {
    __pyx_t_3 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_t_3, __pyx_v_i, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __pyx_t_2;
  } else {
    __pyx_t_8 = __pyx_t_9;
  }
  if (__pyx_t_8) {

    /* "xmmsapi.pyx":1815
 * 			raise XmmsDisconnectException()
 * 		if i and fd in i:
 * 			if not xmmsc_io_in_handle(self.conn):             # <<<<<<<<<<<<<<
 * 				raise XmmsDisconnectException()
 * 		if o and fd in o:
 */
    __pyx_t_8 = (!xmmsc_io_in_handle(__pyx_v_self->__pyx_base.__pyx_base.conn));
    if (__pyx_t_8) {

      /* "xmmsapi.pyx":1816
 * 		if i and fd in i:
 * 			if not xmmsc_io_in_handle(self.conn):
 * 				raise XmmsDisconnectException()             # <<<<<<<<<<<<<<
 * 		if o and fd in o:
 * 			if not xmmsc_io_out_handle(self.conn):
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_92); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "xmmsapi.pyx":1817
 * 			if not xmmsc_io_in_handle(self.conn):
 * 				raise XmmsDisconnectException()
 * 		if o and fd in o:             # <<<<<<<<<<<<<<
 * 			if not xmmsc_io_out_handle(self.conn):
 * 				raise XmmsDisconnectException()
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_o); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {
    __pyx_t_5 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_5, __pyx_v_o, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_9;
  } else {
    __pyx_t_2 = __pyx_t_8;
  }
  if (__pyx_t_2) {

    /* "xmmsapi.pyx":1818
 * 				raise XmmsDisconnectException()
 * 		if o and fd in o:
 * 			if not xmmsc_io_out_handle(self.conn):             # <<<<<<<<<<<<<<
 * 				raise XmmsDisconnectException()
 * 		return (i, o, e) #Can be used by overridding methods for extra handling.
 */
    __pyx_t_2 = (!xmmsc_io_out_handle(__pyx_v_self->__pyx_base.__pyx_base.conn));
    if (__pyx_t_2) {

      /* "xmmsapi.pyx":1819
 * 		if o and fd in o:
 * 			if not xmmsc_io_out_handle(self.conn):
 * 				raise XmmsDisconnectException()             # <<<<<<<<<<<<<<
 * 		return (i, o, e) #Can be used by overridding methods for extra handling.
 * 
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_92); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L16;
    }
    __pyx_L16:;
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "xmmsapi.pyx":1820
 * 			if not xmmsc_io_out_handle(self.conn):
 * 				raise XmmsDisconnectException()
 * 		return (i, o, e) #Can be used by overridding methods for extra handling.             # <<<<<<<<<<<<<<
 * 
 * 	def loop(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_i);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_i);
  __Pyx_GIVEREF(__pyx_v_i);
  __Pyx_INCREF(__pyx_v_o);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  __Pyx_INCREF(__pyx_v_e);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_e);
  __Pyx_GIVEREF(__pyx_v_e);
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("xmmsapi.XmmsLoop.loop_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_13loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7xmmsapi_8XmmsLoop_12loop[] = "\n\t\tloop()\n\n\t\tMain client loop for most python clients. Call this to run the\n\t\tclient once everything has been set up. This function blocks\n\t\tuntil L{exit_loop} is called. One can override L {loop_iter} to\n\t\tperform extra processing.\n\t\t";
static PyObject *__pyx_pw_7xmmsapi_8XmmsLoop_13loop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("loop (wrapper)", 0);
  __pyx_r = __pyx_pf_7xmmsapi_8XmmsLoop_12loop(((struct __pyx_obj_7xmmsapi_XmmsLoop *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsapi.pyx":1822
 * 		return (i, o, e) #Can be used by overridding methods for extra handling.
 * 
 * 	def loop(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		loop()
 */

static PyObject *__pyx_pf_7xmmsapi_8XmmsLoop_12loop(struct __pyx_obj_7xmmsapi_XmmsLoop *__pyx_v_self) {
  PyObject *__pyx_v_pipe = NULL;
  PyObject *__pyx_v_read = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_i = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_o = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("loop", 0);

  /* "xmmsapi.pyx":1831
 * 		perform extra processing.
 * 		"""
 * 		from os import pipe, read             # <<<<<<<<<<<<<<
 * 		(r, w) = pipe()
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pipe));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__pipe));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pipe));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__read));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__read));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__read));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__os), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pipe);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__pipe);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_pipe = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__read);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_read = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":1832
 * 		"""
 * 		from os import pipe, read
 * 		(r, w) = pipe()             # <<<<<<<<<<<<<<
 * 
 * 		self.do_loop = True
 */
  __pyx_t_2 = PyObject_Call(__pyx_v_pipe, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_r = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_w = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "xmmsapi.pyx":1834
 * 		(r, w) = pipe()
 * 
 * 		self.do_loop = True             # <<<<<<<<<<<<<<
 * 		self._loop_set_wakeup(w)
 * 
 */
  __pyx_v_self->do_loop = 1;

  /* "xmmsapi.pyx":1835
 * 
 * 		self.do_loop = True
 * 		self._loop_set_wakeup(w)             # <<<<<<<<<<<<<<
 * 
 * 		while self.do_loop:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___loop_set_wakeup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "xmmsapi.pyx":1837
 * 		self._loop_set_wakeup(w)
 * 
 * 		while self.do_loop:             # <<<<<<<<<<<<<<
 * 			try:
 * 				(i, o, e) = self.loop_iter(infd=[r])
 */
  while (1) {
    if (!__pyx_v_self->do_loop) break;

    /* "xmmsapi.pyx":1838
 * 
 * 		while self.do_loop:
 * 			try:             # <<<<<<<<<<<<<<
 * 				(i, o, e) = self.loop_iter(infd=[r])
 * 				if r in i:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "xmmsapi.pyx":1839
 * 		while self.do_loop:
 * 			try:
 * 				(i, o, e) = self.loop_iter(infd=[r])             # <<<<<<<<<<<<<<
 * 				if r in i:
 * 					read(r, 1) # Purge wakeup stream (each wakeup signal should not write more than one byte)
 */
        __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loop_iter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_r);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_r);
        __Pyx_GIVEREF(__pyx_v_r);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__infd), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
          PyObject* sequence = __pyx_t_2;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          #else
          __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          #endif
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else
        {
          Py_ssize_t index = -1;
          __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_5 = Py_TYPE(__pyx_t_9)->tp_iternext;
          index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_3);
          index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          index = 2; __pyx_t_4 = __pyx_t_5(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_4);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __pyx_t_5 = NULL;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L16_unpacking_done;
          __pyx_L15_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_5 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __pyx_L16_unpacking_done:;
        }
        __Pyx_XDECREF(__pyx_v_i);
        __pyx_v_i = __pyx_t_3;
        __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_v_o);
        __pyx_v_o = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_v_e);
        __pyx_v_e = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "xmmsapi.pyx":1840
 * 			try:
 * 				(i, o, e) = self.loop_iter(infd=[r])
 * 				if r in i:             # <<<<<<<<<<<<<<
 * 					read(r, 1) # Purge wakeup stream (each wakeup signal should not write more than one byte)
 * 			except XmmsDisconnectException:
 */
        __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_v_r, __pyx_v_i, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        if (__pyx_t_10) {

          /* "xmmsapi.pyx":1841
 * 				(i, o, e) = self.loop_iter(infd=[r])
 * 				if r in i:
 * 					read(r, 1) # Purge wakeup stream (each wakeup signal should not write more than one byte)             # <<<<<<<<<<<<<<
 * 			except XmmsDisconnectException:
 * 				self.do_loop = False
 */
          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_r);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_r);
          __Pyx_GIVEREF(__pyx_v_r);
          __Pyx_INCREF(__pyx_int_1);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
          __Pyx_GIVEREF(__pyx_int_1);
          __pyx_t_4 = PyObject_Call(__pyx_v_read, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L17;
        }
        __pyx_L17:;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "xmmsapi.pyx":1842
 * 				if r in i:
 * 					read(r, 1) # Purge wakeup stream (each wakeup signal should not write more than one byte)
 * 			except XmmsDisconnectException:             # <<<<<<<<<<<<<<
 * 				self.do_loop = False
 * 
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_92); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyErr_ExceptionMatches(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_11) {
        __Pyx_AddTraceback("xmmsapi.XmmsLoop.loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_1);

        /* "xmmsapi.pyx":1843
 * 					read(r, 1) # Purge wakeup stream (each wakeup signal should not write more than one byte)
 * 			except XmmsDisconnectException:
 * 				self.do_loop = False             # <<<<<<<<<<<<<<
 * 
 * 		self._loop_set_wakeup(None)
 */
        __pyx_v_self->do_loop = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L8_exception_handled;
      }
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L14_try_end:;
    }
  }

  /* "xmmsapi.pyx":1845
 * 				self.do_loop = False
 * 
 * 		self._loop_set_wakeup(None)             # <<<<<<<<<<<<<<
 * 
 * # Compatibility
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___loop_set_wakeup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("xmmsapi.XmmsLoop.loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pipe);
  __Pyx_XDECREF(__pyx_v_read);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsutils.pxd":4
 * from libc.string cimport const_char, strlen
 * 
 * cdef inline to_unicode(const_char *s):             # <<<<<<<<<<<<<<
 * 	return PyUnicode_DecodeUTF8(s, strlen(s), "replace")
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_9xmmsutils_to_unicode(const char *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_unicode", 0);

  /* "xmmsutils.pxd":5
 * 
 * cdef inline to_unicode(const_char *s):
 * 	return PyUnicode_DecodeUTF8(s, strlen(s), "replace")             # <<<<<<<<<<<<<<
 * 
 * cdef inline from_unicode(object o):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_s, strlen(__pyx_v_s), __pyx_k__replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsutils.to_unicode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "xmmsutils.pxd":7
 * 	return PyUnicode_DecodeUTF8(s, strlen(s), "replace")
 * 
 * cdef inline from_unicode(object o):             # <<<<<<<<<<<<<<
 * 	if isinstance(o, unicode):
 * 		return PyUnicode_AsUTF8String(o)
 */

static CYTHON_INLINE PyObject *__pyx_f_9xmmsutils_from_unicode(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_unicode", 0);

  /* "xmmsutils.pxd":8
 * 
 * cdef inline from_unicode(object o):
 * 	if isinstance(o, unicode):             # <<<<<<<<<<<<<<
 * 		return PyUnicode_AsUTF8String(o)
 * 	else:
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyUnicode_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_o, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "xmmsutils.pxd":9
 * cdef inline from_unicode(object o):
 * 	if isinstance(o, unicode):
 * 		return PyUnicode_AsUTF8String(o)             # <<<<<<<<<<<<<<
 * 	else:
 * 		return o
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "xmmsutils.pxd":11
 * 		return PyUnicode_AsUTF8String(o)
 * 	else:
 * 		return o             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_o);
    __pyx_r = __pyx_v_o;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("xmmsutils.from_unicode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_7xmmsapi_XmmsSourcePreference(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)o);
  p->sources = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsSourcePreference(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *p = (struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)o;
  Py_CLEAR(p->sources);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsSourcePreference(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *p = (struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)o;
  if (p->sources) {
    e = (*v)(p->sources, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsSourcePreference(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsSourcePreference *p = (struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->sources);
  p->sources = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsSourcePreference[] = {
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_7xmmsapi_20XmmsSourcePreference_3get, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pw_7xmmsapi_20XmmsSourcePreference_5set, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsSourcePreference = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsSourcePreference = {
  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_XmmsSourcePreference = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsSourcePreference = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsSourcePreference = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsSourcePreference"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsSourcePreference), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsSourcePreference, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsSourcePreference, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsSourcePreference, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsSourcePreference, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsSourcePreference, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n\tSource preference manager\n\t"), /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsSourcePreference, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsSourcePreference, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsSourcePreference, /*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_pw_7xmmsapi_20XmmsSourcePreference_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsSourcePreference, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsResult __pyx_vtable_7xmmsapi_XmmsResult;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsResult(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsResult *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsResult *)o);
  p->__pyx_vtab = __pyx_vtabptr_7xmmsapi_XmmsResult;
  p->_cb = Py_None; Py_INCREF(Py_None);
  p->_exc = Py_None; Py_INCREF(Py_None);
  p->source_pref = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)Py_None); Py_INCREF(Py_None);
  p->result_tracker = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pw_7xmmsapi_10XmmsResult_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsResult(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsResult *p = (struct __pyx_obj_7xmmsapi_XmmsResult *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7xmmsapi_10XmmsResult_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_cb);
  Py_CLEAR(p->_exc);
  Py_CLEAR(p->source_pref);
  Py_CLEAR(p->result_tracker);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsResult(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsResult *p = (struct __pyx_obj_7xmmsapi_XmmsResult *)o;
  if (p->_cb) {
    e = (*v)(p->_cb, a); if (e) return e;
  }
  if (p->_exc) {
    e = (*v)(p->_exc, a); if (e) return e;
  }
  if (p->source_pref) {
    e = (*v)(((PyObject*)p->source_pref), a); if (e) return e;
  }
  if (p->result_tracker) {
    e = (*v)(((PyObject*)p->result_tracker), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsResult(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsResult *p = (struct __pyx_obj_7xmmsapi_XmmsResult *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_cb);
  p->_cb = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_exc);
  p->_exc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->source_pref);
  p->source_pref = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result_tracker);
  p->result_tracker = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7xmmsapi_10XmmsResult_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7xmmsapi_10XmmsResult_8callback_1__get__(o);
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsResult[] = {
  {__Pyx_NAMESTR("disconnect"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_5disconnect, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_callback"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_7_callback, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_10XmmsResult_6_callback)},
  {__Pyx_NAMESTR("wait"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_11wait, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_10XmmsResult_10wait)},
  {__Pyx_NAMESTR("is_error"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_13is_error, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_10XmmsResult_12is_error)},
  {__Pyx_NAMESTR("iserror"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_15iserror, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("xmmsvalue"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_17xmmsvalue, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_value"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_19_value, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("value"), (PyCFunction)__pyx_pw_7xmmsapi_10XmmsResult_21value, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7xmmsapi_XmmsResult[] = {
  {(char *)"callback", __pyx_getprop_7xmmsapi_10XmmsResult_callback, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsResult = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsResult = {
  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_XmmsResult = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsResult = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsResult = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsResult"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsResult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsResult, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsResult, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsResult, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsResult, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_7xmmsapi_10XmmsResult_9__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsResult, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n\tClass containing the results of some operation\n\t"), /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsResult, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsResult, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsResult, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7xmmsapi_XmmsResult, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsResult, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsResultTracker __pyx_vtable_7xmmsapi_XmmsResultTracker;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsResultTracker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)o);
  p->__pyx_vtab = __pyx_vtabptr_7xmmsapi_XmmsResultTracker;
  p->results = Py_None; Py_INCREF(Py_None);
  if (__pyx_pw_7xmmsapi_17XmmsResultTracker_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsResultTracker(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *p = (struct __pyx_obj_7xmmsapi_XmmsResultTracker *)o;
  Py_CLEAR(p->results);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsResultTracker(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *p = (struct __pyx_obj_7xmmsapi_XmmsResultTracker *)o;
  if (p->results) {
    e = (*v)(p->results, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsResultTracker(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsResultTracker *p = (struct __pyx_obj_7xmmsapi_XmmsResultTracker *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->results);
  p->results = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsResultTracker[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsResultTracker = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsResultTracker = {
  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_XmmsResultTracker = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsResultTracker = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsResultTracker = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsResultTracker"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsResultTracker), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsResultTracker, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsResultTracker, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsResultTracker, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsResultTracker, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsResultTracker, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n\tClass used by XmmsCore to track results that set a notifier.\n\t"), /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsResultTracker, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsResultTracker, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsResultTracker, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsResultTracker, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsVisResult __pyx_vtable_7xmmsapi_XmmsVisResult;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsVisResult(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsVisResult *p;
  PyObject *o = __pyx_tp_new_7xmmsapi_XmmsResult(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsVisResult *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7xmmsapi_XmmsResult*)__pyx_vtabptr_7xmmsapi_XmmsVisResult;
  p->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pw_7xmmsapi_13XmmsVisResult_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsVisResult(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsVisResult *p = (struct __pyx_obj_7xmmsapi_XmmsVisResult *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7xmmsapi_13XmmsVisResult_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_val);
  __pyx_tp_dealloc_7xmmsapi_XmmsResult(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsVisResult(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsVisResult *p = (struct __pyx_obj_7xmmsapi_XmmsVisResult *)o;
  e = __pyx_tp_traverse_7xmmsapi_XmmsResult(o, v, a); if (e) return e;
  if (p->_val) {
    e = (*v)(((PyObject*)p->_val), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsVisResult(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsVisResult *p = (struct __pyx_obj_7xmmsapi_XmmsVisResult *)o;
  PyObject* tmp;
  __pyx_tp_clear_7xmmsapi_XmmsResult(o);
  tmp = ((PyObject*)p->_val);
  p->_val = ((struct __pyx_obj_9xmmsvalue_XmmsValue *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsVisResult[] = {
  {__Pyx_NAMESTR("xmmsvalue"), (PyCFunction)__pyx_pw_7xmmsapi_13XmmsVisResult_5xmmsvalue, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsVisResult = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsVisResult = {
  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_XmmsVisResult = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsVisResult = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsVisResult = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsVisResult"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsVisResult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsVisResult, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsVisResult, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsVisResult, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsVisResult, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7xmmsapi_10XmmsResult_9__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsVisResult, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsVisResult, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsVisResult, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsVisResult, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsVisResult, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsVisChunk __pyx_vtable_7xmmsapi_XmmsVisChunk;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsVisChunk(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsVisChunk *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsVisChunk *)o);
  p->__pyx_vtab = __pyx_vtabptr_7xmmsapi_XmmsVisChunk;
  if (__pyx_pw_7xmmsapi_12XmmsVisChunk_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsVisChunk(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7xmmsapi_12XmmsVisChunk_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsVisChunk[] = {
  {__Pyx_NAMESTR("get_buffer"), (PyCFunction)__pyx_pw_7xmmsapi_12XmmsVisChunk_7get_buffer, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_12XmmsVisChunk_6get_buffer)},
  {__Pyx_NAMESTR("get_data"), (PyCFunction)__pyx_pw_7xmmsapi_12XmmsVisChunk_9get_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_12XmmsVisChunk_8get_data)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsVisChunk = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsVisChunk = {
  __pyx_pw_7xmmsapi_12XmmsVisChunk_5__len__, /*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_XmmsVisChunk = {
  __pyx_pw_7xmmsapi_12XmmsVisChunk_5__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsVisChunk = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsVisChunk = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsVisChunk"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsVisChunk), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsVisChunk, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsVisChunk, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsVisChunk, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsVisChunk, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsVisChunk, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*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_7xmmsapi_XmmsVisChunk, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsVisChunk, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsCore __pyx_vtable_7xmmsapi_XmmsCore;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsCore(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsCore *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsCore *)o);
  p->__pyx_vtab = __pyx_vtabptr_7xmmsapi_XmmsCore;
  p->disconnect_fun = Py_None; Py_INCREF(Py_None);
  p->needout_fun = Py_None; Py_INCREF(Py_None);
  p->source_preference = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)Py_None); Py_INCREF(Py_None);
  p->result_tracker = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)Py_None); Py_INCREF(Py_None);
  p->clientname = Py_None; Py_INCREF(Py_None);
  if (__pyx_pw_7xmmsapi_8XmmsCore_1__cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsCore(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsCore *p = (struct __pyx_obj_7xmmsapi_XmmsCore *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7xmmsapi_8XmmsCore_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->disconnect_fun);
  Py_CLEAR(p->needout_fun);
  Py_CLEAR(p->source_preference);
  Py_CLEAR(p->result_tracker);
  Py_CLEAR(p->clientname);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsCore(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsCore *p = (struct __pyx_obj_7xmmsapi_XmmsCore *)o;
  if (p->disconnect_fun) {
    e = (*v)(p->disconnect_fun, a); if (e) return e;
  }
  if (p->needout_fun) {
    e = (*v)(p->needout_fun, a); if (e) return e;
  }
  if (p->source_preference) {
    e = (*v)(((PyObject*)p->source_preference), a); if (e) return e;
  }
  if (p->result_tracker) {
    e = (*v)(((PyObject*)p->result_tracker), a); if (e) return e;
  }
  if (p->clientname) {
    e = (*v)(p->clientname, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsCore(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsCore *p = (struct __pyx_obj_7xmmsapi_XmmsCore *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->disconnect_fun);
  p->disconnect_fun = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->needout_fun);
  p->needout_fun = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->source_preference);
  p->source_preference = ((struct __pyx_obj_7xmmsapi_XmmsSourcePreference *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result_tracker);
  p->result_tracker = ((struct __pyx_obj_7xmmsapi_XmmsResultTracker *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->clientname);
  p->clientname = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7xmmsapi_8XmmsCore_source_preference(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7xmmsapi_8XmmsCore_17source_preference_1__get__(o);
}

static PyObject *__pyx_getprop_7xmmsapi_8XmmsCore_clientname(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7xmmsapi_8XmmsCore_10clientname_1__get__(o);
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsCore[] = {
  {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_5__del__, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_source_preference"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_7get_source_preference, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_source_preference"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_9set_source_preference, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_needout_cb"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_11_needout_cb, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_disconnect_cb"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_13_disconnect_cb, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("disconnect"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_15disconnect, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ioin"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_17ioin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_16ioin)},
  {__Pyx_NAMESTR("ioout"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_19ioout, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_18ioout)},
  {__Pyx_NAMESTR("want_ioout"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_21want_ioout, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_20want_ioout)},
  {__Pyx_NAMESTR("set_need_out_fun"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_23set_need_out_fun, METH_O, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_22set_need_out_fun)},
  {__Pyx_NAMESTR("get_fd"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_25get_fd, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_24get_fd)},
  {__Pyx_NAMESTR("connect"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_27connect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsCore_26connect)},
  {__Pyx_NAMESTR("is_connected"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsCore_29is_connected, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7xmmsapi_XmmsCore[] = {
  {(char *)"source_preference", __pyx_getprop_7xmmsapi_8XmmsCore_source_preference, 0, 0, 0},
  {(char *)"clientname", __pyx_getprop_7xmmsapi_8XmmsCore_clientname, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsCore = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsCore = {
  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_XmmsCore = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsCore = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsCore = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsCore"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsCore), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsCore, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsCore, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsCore, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsCore, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsCore, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n\tThis is the class representing the XMMS2 client itself. The methods in\n\tthis class may be used to control and interact with XMMS2.\n\t"), /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsCore, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsCore, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsCore, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7xmmsapi_XmmsCore, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsCore, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsApi __pyx_vtable_7xmmsapi_XmmsApi;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsApi(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsApi *p;
  PyObject *o = __pyx_tp_new_7xmmsapi_XmmsCore(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsApi *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7xmmsapi_XmmsCore*)__pyx_vtabptr_7xmmsapi_XmmsApi;
  return o;
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsApi[] = {
  {__Pyx_NAMESTR("quit"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_1quit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_quit)},
  {__Pyx_NAMESTR("plugin_list"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_3plugin_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_2plugin_list)},
  {__Pyx_NAMESTR("playback_start"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_5playback_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_4playback_start)},
  {__Pyx_NAMESTR("playback_stop"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_7playback_stop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_6playback_stop)},
  {__Pyx_NAMESTR("playback_tickle"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_9playback_tickle, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_8playback_tickle)},
  {__Pyx_NAMESTR("playback_pause"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_11playback_pause, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_10playback_pause)},
  {__Pyx_NAMESTR("playback_current_id"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_13playback_current_id, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_12playback_current_id)},
  {__Pyx_NAMESTR("playback_seek_ms"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_15playback_seek_ms, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_14playback_seek_ms)},
  {__Pyx_NAMESTR("playback_seek_samples"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_17playback_seek_samples, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_16playback_seek_samples)},
  {__Pyx_NAMESTR("playback_status"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_19playback_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_18playback_status)},
  {__Pyx_NAMESTR("broadcast_playback_status"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_21broadcast_playback_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_20broadcast_playback_status)},
  {__Pyx_NAMESTR("broadcast_playback_current_id"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_23broadcast_playback_current_id, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_22broadcast_playback_current_id)},
  {__Pyx_NAMESTR("playback_playtime"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_25playback_playtime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_24playback_playtime)},
  {__Pyx_NAMESTR("signal_playback_playtime"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_27signal_playback_playtime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_26signal_playback_playtime)},
  {__Pyx_NAMESTR("playback_volume_set"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_29playback_volume_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_28playback_volume_set)},
  {__Pyx_NAMESTR("playback_volume_get"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_31playback_volume_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_30playback_volume_get)},
  {__Pyx_NAMESTR("broadcast_playback_volume_changed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_33broadcast_playback_volume_changed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_32broadcast_playback_volume_changed)},
  {__Pyx_NAMESTR("broadcast_playlist_loaded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_35broadcast_playlist_loaded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_34broadcast_playlist_loaded)},
  {__Pyx_NAMESTR("playlist_load"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_37playlist_load, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_36playlist_load)},
  {__Pyx_NAMESTR("playlist_list"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_39playlist_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_38playlist_list)},
  {__Pyx_NAMESTR("playlist_remove"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_41playlist_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_40playlist_remove)},
  {__Pyx_NAMESTR("playlist_shuffle"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_43playlist_shuffle, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_42playlist_shuffle)},
  {__Pyx_NAMESTR("playlist_rinsert"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_45playlist_rinsert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_44playlist_rinsert)},
  {__Pyx_NAMESTR("playlist_rinsert_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_47playlist_rinsert_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_46playlist_rinsert_encoded)},
  {__Pyx_NAMESTR("playlist_insert_url"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_49playlist_insert_url, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_48playlist_insert_url)},
  {__Pyx_NAMESTR("playlist_insert_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_51playlist_insert_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_50playlist_insert_encoded)},
  {__Pyx_NAMESTR("playlist_insert_id"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_53playlist_insert_id, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_52playlist_insert_id)},
  {__Pyx_NAMESTR("playlist_insert_collection"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_55playlist_insert_collection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_54playlist_insert_collection)},
  {__Pyx_NAMESTR("playlist_radd"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_57playlist_radd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_56playlist_radd)},
  {__Pyx_NAMESTR("playlist_radd_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_59playlist_radd_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_58playlist_radd_encoded)},
  {__Pyx_NAMESTR("playlist_add_url"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_61playlist_add_url, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_60playlist_add_url)},
  {__Pyx_NAMESTR("playlist_add_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_63playlist_add_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_62playlist_add_encoded)},
  {__Pyx_NAMESTR("playlist_add_id"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_65playlist_add_id, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_64playlist_add_id)},
  {__Pyx_NAMESTR("playlist_add_collection"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_67playlist_add_collection, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_66playlist_add_collection)},
  {__Pyx_NAMESTR("playlist_remove_entry"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_69playlist_remove_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_68playlist_remove_entry)},
  {__Pyx_NAMESTR("playlist_clear"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_71playlist_clear, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_70playlist_clear)},
  {__Pyx_NAMESTR("playlist_list_entries"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_73playlist_list_entries, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_72playlist_list_entries)},
  {__Pyx_NAMESTR("playlist_sort"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_75playlist_sort, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_74playlist_sort)},
  {__Pyx_NAMESTR("playlist_set_next_rel"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_77playlist_set_next_rel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_76playlist_set_next_rel)},
  {__Pyx_NAMESTR("playlist_set_next"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_79playlist_set_next, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_78playlist_set_next)},
  {__Pyx_NAMESTR("playlist_move"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_81playlist_move, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_80playlist_move)},
  {__Pyx_NAMESTR("playlist_create"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_83playlist_create, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_82playlist_create)},
  {__Pyx_NAMESTR("playlist_current_pos"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_85playlist_current_pos, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_84playlist_current_pos)},
  {__Pyx_NAMESTR("playlist_current_active"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_87playlist_current_active, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_86playlist_current_active)},
  {__Pyx_NAMESTR("broadcast_playlist_current_pos"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_89broadcast_playlist_current_pos, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_88broadcast_playlist_current_pos)},
  {__Pyx_NAMESTR("broadcast_playlist_changed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_91broadcast_playlist_changed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_90broadcast_playlist_changed)},
  {__Pyx_NAMESTR("broadcast_config_value_changed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_93broadcast_config_value_changed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_92broadcast_config_value_changed)},
  {__Pyx_NAMESTR("config_set_value"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_95config_set_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_94config_set_value)},
  {__Pyx_NAMESTR("config_get_value"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_97config_get_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_96config_get_value)},
  {__Pyx_NAMESTR("config_list_values"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_99config_list_values, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_98config_list_values)},
  {__Pyx_NAMESTR("config_register_value"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_101config_register_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_100config_register_value)},
  {__Pyx_NAMESTR("medialib_add_entry"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_103medialib_add_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_102medialib_add_entry)},
  {__Pyx_NAMESTR("medialib_add_entry_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_105medialib_add_entry_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_104medialib_add_entry_encoded)},
  {__Pyx_NAMESTR("medialib_remove_entry"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_107medialib_remove_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_106medialib_remove_entry)},
  {__Pyx_NAMESTR("medialib_move_entry"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_109medialib_move_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_108medialib_move_entry)},
  {__Pyx_NAMESTR("medialib_get_info"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_111medialib_get_info, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_110medialib_get_info)},
  {__Pyx_NAMESTR("medialib_rehash"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_113medialib_rehash, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_112medialib_rehash)},
  {__Pyx_NAMESTR("medialib_get_id"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_115medialib_get_id, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_114medialib_get_id)},
  {__Pyx_NAMESTR("medialib_import_path"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_117medialib_import_path, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_116medialib_import_path)},
  {__Pyx_NAMESTR("medialib_path_import"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_119medialib_path_import, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_118medialib_path_import)},
  {__Pyx_NAMESTR("medialib_path_import_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_121medialib_path_import_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_120medialib_path_import_encoded)},
  {__Pyx_NAMESTR("medialib_property_set"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_123medialib_property_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_122medialib_property_set)},
  {__Pyx_NAMESTR("medialib_property_remove"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_125medialib_property_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_124medialib_property_remove)},
  {__Pyx_NAMESTR("broadcast_medialib_entry_added"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_127broadcast_medialib_entry_added, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_126broadcast_medialib_entry_added)},
  {__Pyx_NAMESTR("broadcast_medialib_entry_changed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_129broadcast_medialib_entry_changed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_128broadcast_medialib_entry_changed)},
  {__Pyx_NAMESTR("broadcast_collection_changed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_131broadcast_collection_changed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_130broadcast_collection_changed)},
  {__Pyx_NAMESTR("signal_mediainfo_reader_unindexed"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_133signal_mediainfo_reader_unindexed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_132signal_mediainfo_reader_unindexed)},
  {__Pyx_NAMESTR("broadcast_mediainfo_reader_status"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_135broadcast_mediainfo_reader_status, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_134broadcast_mediainfo_reader_status)},
  {__Pyx_NAMESTR("xform_media_browse"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_137xform_media_browse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_136xform_media_browse)},
  {__Pyx_NAMESTR("xform_media_browse_encoded"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_139xform_media_browse_encoded, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_138xform_media_browse_encoded)},
  {__Pyx_NAMESTR("coll_get"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_141coll_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_140coll_get)},
  {__Pyx_NAMESTR("coll_list"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_143coll_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_142coll_list)},
  {__Pyx_NAMESTR("coll_save"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_145coll_save, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_144coll_save)},
  {__Pyx_NAMESTR("coll_remove"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_147coll_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_146coll_remove)},
  {__Pyx_NAMESTR("coll_rename"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_149coll_rename, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_148coll_rename)},
  {__Pyx_NAMESTR("coll_idlist_from_playlist_file"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_151coll_idlist_from_playlist_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_150coll_idlist_from_playlist_file)},
  {__Pyx_NAMESTR("coll_query"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_153coll_query, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_152coll_query)},
  {__Pyx_NAMESTR("coll_query_ids"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_155coll_query_ids, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_154coll_query_ids)},
  {__Pyx_NAMESTR("coll_query_infos"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_157coll_query_infos, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_156coll_query_infos)},
  {__Pyx_NAMESTR("bindata_add"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_159bindata_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_158bindata_add)},
  {__Pyx_NAMESTR("bindata_retrieve"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_161bindata_retrieve, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_160bindata_retrieve)},
  {__Pyx_NAMESTR("bindata_remove"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_163bindata_remove, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_162bindata_remove)},
  {__Pyx_NAMESTR("bindata_list"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_165bindata_list, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_164bindata_list)},
  {__Pyx_NAMESTR("stats"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_167stats, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_166stats)},
  {__Pyx_NAMESTR("visualization_version"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_169visualization_version, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_168visualization_version)},
  {__Pyx_NAMESTR("visualization_init"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_171visualization_init, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_170visualization_init)},
  {__Pyx_NAMESTR("visualization_start"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_173visualization_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_172visualization_start)},
  {__Pyx_NAMESTR("visualization_started"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_175visualization_started, METH_O, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_174visualization_started)},
  {__Pyx_NAMESTR("visualization_errored"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_177visualization_errored, METH_O, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_176visualization_errored)},
  {__Pyx_NAMESTR("visualization_property_set"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_179visualization_property_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_178visualization_property_set)},
  {__Pyx_NAMESTR("visualization_properties_set"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_181visualization_properties_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_180visualization_properties_set)},
  {__Pyx_NAMESTR("visualization_chunk_get"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_183visualization_chunk_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_182visualization_chunk_get)},
  {__Pyx_NAMESTR("visualization_shutdown"), (PyCFunction)__pyx_pw_7xmmsapi_7XmmsApi_185visualization_shutdown, METH_O, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_7XmmsApi_184visualization_shutdown)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsApi = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsApi = {
  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_XmmsApi = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsApi = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsApi = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsApi"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsApi), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsCore, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsApi, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsApi, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsApi, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsApi, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsCore, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsCore, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsApi, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsApi, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_7xmmsapi_XmmsLoop __pyx_vtable_7xmmsapi_XmmsLoop;

static PyObject *__pyx_tp_new_7xmmsapi_XmmsLoop(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7xmmsapi_XmmsLoop *p;
  PyObject *o = __pyx_tp_new_7xmmsapi_XmmsCore(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi_XmmsLoop *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7xmmsapi_XmmsCore*)__pyx_vtabptr_7xmmsapi_XmmsLoop;
  p->wakeup = Py_None; Py_INCREF(Py_None);
  if (__pyx_pw_7xmmsapi_8XmmsLoop_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi_XmmsLoop(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsLoop *p = (struct __pyx_obj_7xmmsapi_XmmsLoop *)o;
  Py_CLEAR(p->wakeup);
  __pyx_tp_dealloc_7xmmsapi_XmmsCore(o);
}

static int __pyx_tp_traverse_7xmmsapi_XmmsLoop(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi_XmmsLoop *p = (struct __pyx_obj_7xmmsapi_XmmsLoop *)o;
  e = __pyx_tp_traverse_7xmmsapi_XmmsCore(o, v, a); if (e) return e;
  if (p->wakeup) {
    e = (*v)(p->wakeup, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi_XmmsLoop(PyObject *o) {
  struct __pyx_obj_7xmmsapi_XmmsLoop *p = (struct __pyx_obj_7xmmsapi_XmmsLoop *)o;
  PyObject* tmp;
  __pyx_tp_clear_7xmmsapi_XmmsCore(o);
  tmp = ((PyObject*)p->wakeup);
  p->wakeup = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7xmmsapi_XmmsLoop[] = {
  {__Pyx_NAMESTR("_loop_set_wakeup"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_3_loop_set_wakeup, METH_O, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsLoop_2_loop_set_wakeup)},
  {__Pyx_NAMESTR("_loop_get_wakeup"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_5_loop_get_wakeup, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsLoop_4_loop_get_wakeup)},
  {__Pyx_NAMESTR("exit_loop"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_7exit_loop, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsLoop_6exit_loop)},
  {__Pyx_NAMESTR("loop_tickle"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_9loop_tickle, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("loop_iter"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_11loop_iter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsLoop_10loop_iter)},
  {__Pyx_NAMESTR("loop"), (PyCFunction)__pyx_pw_7xmmsapi_8XmmsLoop_13loop, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_8XmmsLoop_12loop)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XmmsLoop = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_XmmsLoop = {
  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_XmmsLoop = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XmmsLoop = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi_XmmsLoop = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.XmmsLoop"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi_XmmsLoop), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi_XmmsLoop, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_XmmsLoop, /*tp_as_number*/
  &__pyx_tp_as_sequence_XmmsLoop, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_XmmsLoop, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_XmmsLoop, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi_XmmsLoop, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi_XmmsLoop, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi_XmmsLoop, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi_XmmsLoop, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_7xmmsapi___pyx_scope_struct__deprecated(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *)o);
  p->__pyx_v_f = 0;
  return o;
}

static void __pyx_tp_dealloc_7xmmsapi___pyx_scope_struct__deprecated(PyObject *o) {
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *p = (struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *)o;
  Py_CLEAR(p->__pyx_v_f);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7xmmsapi___pyx_scope_struct__deprecated(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *p = (struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *)o;
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7xmmsapi___pyx_scope_struct__deprecated(PyObject *o) {
  struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *p = (struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_f);
  p->__pyx_v_f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7xmmsapi___pyx_scope_struct__deprecated[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__deprecated = {
  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*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  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_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct__deprecated = {
  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___pyx_scope_struct__deprecated = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__deprecated = {
  #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
};

static PyTypeObject __pyx_type_7xmmsapi___pyx_scope_struct__deprecated = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("xmmsapi.__pyx_scope_struct__deprecated"), /*tp_name*/
  sizeof(struct __pyx_obj_7xmmsapi___pyx_scope_struct__deprecated), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7xmmsapi___pyx_scope_struct__deprecated, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct__deprecated, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__deprecated, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__deprecated, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct__deprecated, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7xmmsapi___pyx_scope_struct__deprecated, /*tp_traverse*/
  __pyx_tp_clear_7xmmsapi___pyx_scope_struct__deprecated, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7xmmsapi___pyx_scope_struct__deprecated, /*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*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7xmmsapi___pyx_scope_struct__deprecated, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("userconfdir_get"), (PyCFunction)__pyx_pw_7xmmsapi_3userconfdir_get, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7xmmsapi_2userconfdir_get)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("xmmsapi"),
    __Pyx_DOCSTR(__pyx_k_94), /* 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_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_n_s_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 1, 1},
  {&__pyx_n_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 1},
  {&__pyx_n_s_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 1, 1},
  {&__pyx_n_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 1},
  {&__pyx_n_s_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 1, 1},
  {&__pyx_n_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 1},
  {&__pyx_n_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 1},
  {&__pyx_n_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 1},
  {&__pyx_n_s_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 1, 1},
  {&__pyx_n_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 1},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_n_s_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 1, 1},
  {&__pyx_n_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 1},
  {&__pyx_n_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 1},
  {&__pyx_n_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 1},
  {&__pyx_n_s_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 1, 1},
  {&__pyx_n_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 1},
  {&__pyx_n_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 1},
  {&__pyx_n_s_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 1, 1},
  {&__pyx_n_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 1},
  {&__pyx_n_s_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 1, 1},
  {&__pyx_n_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 1},
  {&__pyx_n_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 1},
  {&__pyx_n_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 1},
  {&__pyx_n_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 1},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_n_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 1},
  {&__pyx_n_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 1},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_n_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 1},
  {&__pyx_n_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 1},
  {&__pyx_n_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 1},
  {&__pyx_n_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 1},
  {&__pyx_n_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 1},
  {&__pyx_n_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 1},
  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_n_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 1},
  {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1},
  {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1},
  {&__pyx_n_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 1},
  {&__pyx_n_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 1},
  {&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1},
  {&__pyx_n_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 1},
  {&__pyx_n_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 1},
  {&__pyx_n_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 1},
  {&__pyx_n_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 1},
  {&__pyx_n_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 1},
  {&__pyx_n_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 1},
  {&__pyx_n_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 1},
  {&__pyx_n_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 1},
  {&__pyx_n_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 1},
  {&__pyx_n_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 1},
  {&__pyx_n_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 1},
  {&__pyx_n_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 1},
  {&__pyx_n_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 1},
  {&__pyx_n_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 1},
  {&__pyx_n_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 1},
  {&__pyx_n_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 1},
  {&__pyx_n_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 1},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 1},
  {&__pyx_n_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 1},
  {&__pyx_n_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 1},
  {&__pyx_n_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 1},
  {&__pyx_n_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 1},
  {&__pyx_n_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 1},
  {&__pyx_n_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 1},
  {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
  {&__pyx_n_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 1},
  {&__pyx_n_s_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 1, 1},
  {&__pyx_n_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 1},
  {&__pyx_n_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 1},
  {&__pyx_n_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 1},
  {&__pyx_n_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 1},
  {&__pyx_n_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 1},
  {&__pyx_kp_s__1, __pyx_k__1, sizeof(__pyx_k__1), 0, 0, 1, 0},
  {&__pyx_n_s__ACTIVE_PLAYLIST, __pyx_k__ACTIVE_PLAYLIST, sizeof(__pyx_k__ACTIVE_PLAYLIST), 0, 0, 1, 1},
  {&__pyx_n_s__COLLECTION_NS_ALL, __pyx_k__COLLECTION_NS_ALL, sizeof(__pyx_k__COLLECTION_NS_ALL), 0, 0, 1, 1},
  {&__pyx_n_s__Collections, __pyx_k__Collections, sizeof(__pyx_k__Collections), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
  {&__pyx_n_s__PLAYBACK_SEEK_CUR, __pyx_k__PLAYBACK_SEEK_CUR, sizeof(__pyx_k__PLAYBACK_SEEK_CUR), 0, 0, 1, 1},
  {&__pyx_n_s__PLAYBACK_SEEK_SET, __pyx_k__PLAYBACK_SEEK_SET, sizeof(__pyx_k__PLAYBACK_SEEK_SET), 0, 0, 1, 1},
  {&__pyx_n_s__PLUGIN_TYPE_ALL, __pyx_k__PLUGIN_TYPE_ALL, sizeof(__pyx_k__PLUGIN_TYPE_ALL), 0, 0, 1, 1},
  {&__pyx_n_s__PLUGIN_TYPE_OUTPUT, __pyx_k__PLUGIN_TYPE_OUTPUT, sizeof(__pyx_k__PLUGIN_TYPE_OUTPUT), 0, 0, 1, 1},
  {&__pyx_n_s__PLUGIN_TYPE_XFORM, __pyx_k__PLUGIN_TYPE_XFORM, sizeof(__pyx_k__PLUGIN_TYPE_XFORM), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__UnnamedPythonClient, __pyx_k__UnnamedPythonClient, sizeof(__pyx_k__UnnamedPythonClient), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__VisualizationError, __pyx_k__VisualizationError, sizeof(__pyx_k__VisualizationError), 0, 0, 1, 1},
  {&__pyx_n_s__XMMS, __pyx_k__XMMS, sizeof(__pyx_k__XMMS), 0, 0, 1, 1},
  {&__pyx_n_s__XMMSResult, __pyx_k__XMMSResult, sizeof(__pyx_k__XMMSResult), 0, 0, 1, 1},
  {&__pyx_n_s____call__, __pyx_k____call__, sizeof(__pyx_k____call__), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___callback, __pyx_k___callback, sizeof(__pyx_k___callback), 0, 0, 1, 1},
  {&__pyx_n_s___disconnect_cb, __pyx_k___disconnect_cb, sizeof(__pyx_k___disconnect_cb), 0, 0, 1, 1},
  {&__pyx_n_s___loop_get_wakeup, __pyx_k___loop_get_wakeup, sizeof(__pyx_k___loop_get_wakeup), 0, 0, 1, 1},
  {&__pyx_n_s___loop_set_wakeup, __pyx_k___loop_set_wakeup, sizeof(__pyx_k___loop_set_wakeup), 0, 0, 1, 1},
  {&__pyx_n_s___needout_cb, __pyx_k___needout_cb, sizeof(__pyx_k___needout_cb), 0, 0, 1, 1},
  {&__pyx_n_s___value, __pyx_k___value, sizeof(__pyx_k___value), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__pyx_n_s__ascii, __pyx_k__ascii, sizeof(__pyx_k__ascii), 0, 0, 1, 1},
  {&__pyx_n_s__bindata_add, __pyx_k__bindata_add, sizeof(__pyx_k__bindata_add), 0, 0, 1, 1},
  {&__pyx_n_s__bindata_list, __pyx_k__bindata_list, sizeof(__pyx_k__bindata_list), 0, 0, 1, 1},
  {&__pyx_n_s__bindata_remove, __pyx_k__bindata_remove, sizeof(__pyx_k__bindata_remove), 0, 0, 1, 1},
  {&__pyx_n_s__bindata_retrieve, __pyx_k__bindata_retrieve, sizeof(__pyx_k__bindata_retrieve), 0, 0, 1, 1},
  {&__pyx_n_s__blocking, __pyx_k__blocking, sizeof(__pyx_k__blocking), 0, 0, 1, 1},
  {&__pyx_n_s__callback, __pyx_k__callback, sizeof(__pyx_k__callback), 0, 0, 1, 1},
  {&__pyx_n_s__cb, __pyx_k__cb, sizeof(__pyx_k__cb), 0, 0, 1, 1},
  {&__pyx_n_s__channel, __pyx_k__channel, sizeof(__pyx_k__channel), 0, 0, 1, 1},
  {&__pyx_n_s__clientname, __pyx_k__clientname, sizeof(__pyx_k__clientname), 0, 0, 1, 1},
  {&__pyx_n_s__coll, __pyx_k__coll, sizeof(__pyx_k__coll), 0, 0, 1, 1},
  {&__pyx_n_s__coll_get, __pyx_k__coll_get, sizeof(__pyx_k__coll_get), 0, 0, 1, 1},
  {&__pyx_n_s__coll_list, __pyx_k__coll_list, sizeof(__pyx_k__coll_list), 0, 0, 1, 1},
  {&__pyx_n_s__coll_query, __pyx_k__coll_query, sizeof(__pyx_k__coll_query), 0, 0, 1, 1},
  {&__pyx_n_s__coll_query_ids, __pyx_k__coll_query_ids, sizeof(__pyx_k__coll_query_ids), 0, 0, 1, 1},
  {&__pyx_n_s__coll_query_infos, __pyx_k__coll_query_infos, sizeof(__pyx_k__coll_query_infos), 0, 0, 1, 1},
  {&__pyx_n_s__coll_remove, __pyx_k__coll_remove, sizeof(__pyx_k__coll_remove), 0, 0, 1, 1},
  {&__pyx_n_s__coll_rename, __pyx_k__coll_rename, sizeof(__pyx_k__coll_rename), 0, 0, 1, 1},
  {&__pyx_n_s__coll_save, __pyx_k__coll_save, sizeof(__pyx_k__coll_save), 0, 0, 1, 1},
  {&__pyx_n_s__config_get_value, __pyx_k__config_get_value, sizeof(__pyx_k__config_get_value), 0, 0, 1, 1},
  {&__pyx_n_s__config_list_values, __pyx_k__config_list_values, sizeof(__pyx_k__config_list_values), 0, 0, 1, 1},
  {&__pyx_n_s__config_set_value, __pyx_k__config_set_value, sizeof(__pyx_k__config_set_value), 0, 0, 1, 1},
  {&__pyx_n_s__connect, __pyx_k__connect, sizeof(__pyx_k__connect), 0, 0, 1, 1},
  {&__pyx_n_s__cur_pos, __pyx_k__cur_pos, sizeof(__pyx_k__cur_pos), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__defaultvalue, __pyx_k__defaultvalue, sizeof(__pyx_k__defaultvalue), 0, 0, 1, 1},
  {&__pyx_n_s__deprecated, __pyx_k__deprecated, sizeof(__pyx_k__deprecated), 0, 0, 1, 1},
  {&__pyx_n_s__disconnect, __pyx_k__disconnect, sizeof(__pyx_k__disconnect), 0, 0, 1, 1},
  {&__pyx_n_s__disconnect_func, __pyx_k__disconnect_func, sizeof(__pyx_k__disconnect_func), 0, 0, 1, 1},
  {&__pyx_n_s__drawtime, __pyx_k__drawtime, sizeof(__pyx_k__drawtime), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__encoded, __pyx_k__encoded, sizeof(__pyx_k__encoded), 0, 0, 1, 1},
  {&__pyx_n_s__enforce_unicode, __pyx_k__enforce_unicode, sizeof(__pyx_k__enforce_unicode), 0, 0, 1, 1},
  {&__pyx_n_s__errfd, __pyx_k__errfd, sizeof(__pyx_k__errfd), 0, 0, 1, 1},
  {&__pyx_n_s__exc_info, __pyx_k__exc_info, sizeof(__pyx_k__exc_info), 0, 0, 1, 1},
  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__fetch, __pyx_k__fetch, sizeof(__pyx_k__fetch), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__get_buffer, __pyx_k__get_buffer, sizeof(__pyx_k__get_buffer), 0, 0, 1, 1},
  {&__pyx_n_s__get_data, __pyx_k__get_data, sizeof(__pyx_k__get_data), 0, 0, 1, 1},
  {&__pyx_n_s__get_fd, __pyx_k__get_fd, sizeof(__pyx_k__get_fd), 0, 0, 1, 1},
  {&__pyx_n_s__getenv, __pyx_k__getenv, sizeof(__pyx_k__getenv), 0, 0, 1, 1},
  {&__pyx_n_s__groupby, __pyx_k__groupby, sizeof(__pyx_k__groupby), 0, 0, 1, 1},
  {&__pyx_n_s__handle, __pyx_k__handle, sizeof(__pyx_k__handle), 0, 0, 1, 1},
  {&__pyx_n_s__hash, __pyx_k__hash, sizeof(__pyx_k__hash), 0, 0, 1, 1},
  {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
  {&__pyx_n_s__infd, __pyx_k__infd, sizeof(__pyx_k__infd), 0, 0, 1, 1},
  {&__pyx_n_s__ioin, __pyx_k__ioin, sizeof(__pyx_k__ioin), 0, 0, 1, 1},
  {&__pyx_n_s__ioout, __pyx_k__ioout, sizeof(__pyx_k__ioout), 0, 0, 1, 1},
  {&__pyx_n_s__is_error, __pyx_k__is_error, sizeof(__pyx_k__is_error), 0, 0, 1, 1},
  {&__pyx_n_s__iserror, __pyx_k__iserror, sizeof(__pyx_k__iserror), 0, 0, 1, 1},
  {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
  {&__pyx_n_s__kw, __pyx_k__kw, sizeof(__pyx_k__kw), 0, 0, 1, 1},
  {&__pyx_n_s__leng, __pyx_k__leng, sizeof(__pyx_k__leng), 0, 0, 1, 1},
  {&__pyx_n_s__loop_iter, __pyx_k__loop_iter, sizeof(__pyx_k__loop_iter), 0, 0, 1, 1},
  {&__pyx_n_s__loop_tickle, __pyx_k__loop_tickle, sizeof(__pyx_k__loop_tickle), 0, 0, 1, 1},
  {&__pyx_n_s__medialib_add_entry, __pyx_k__medialib_add_entry, sizeof(__pyx_k__medialib_add_entry), 0, 0, 1, 1},
  {&__pyx_n_s__medialib_get_id, __pyx_k__medialib_get_id, sizeof(__pyx_k__medialib_get_id), 0, 0, 1, 1},
  {&__pyx_n_s__medialib_get_info, __pyx_k__medialib_get_info, sizeof(__pyx_k__medialib_get_info), 0, 0, 1, 1},
  {&__pyx_n_s__medialib_move_entry, __pyx_k__medialib_move_entry, sizeof(__pyx_k__medialib_move_entry), 0, 0, 1, 1},
  {&__pyx_n_s__medialib_rehash, __pyx_k__medialib_rehash, sizeof(__pyx_k__medialib_rehash), 0, 0, 1, 1},
  {&__pyx_n_s__ms, __pyx_k__ms, sizeof(__pyx_k__ms), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__new_pos, __pyx_k__new_pos, sizeof(__pyx_k__new_pos), 0, 0, 1, 1},
  {&__pyx_n_s__newname, __pyx_k__newname, sizeof(__pyx_k__newname), 0, 0, 1, 1},
  {&__pyx_n_s__ns, __pyx_k__ns, sizeof(__pyx_k__ns), 0, 0, 1, 1},
  {&__pyx_n_s__o, __pyx_k__o, sizeof(__pyx_k__o), 0, 0, 1, 1},
  {&__pyx_n_s__oldname, __pyx_k__oldname, sizeof(__pyx_k__oldname), 0, 0, 1, 1},
  {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
  {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1},
  {&__pyx_n_s__outfd, __pyx_k__outfd, sizeof(__pyx_k__outfd), 0, 0, 1, 1},
  {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
  {&__pyx_n_s__pipe, __pyx_k__pipe, sizeof(__pyx_k__pipe), 0, 0, 1, 1},
  {&__pyx_n_s__playback_current_id, __pyx_k__playback_current_id, sizeof(__pyx_k__playback_current_id), 0, 0, 1, 1},
  {&__pyx_n_s__playback_pause, __pyx_k__playback_pause, sizeof(__pyx_k__playback_pause), 0, 0, 1, 1},
  {&__pyx_n_s__playback_playtime, __pyx_k__playback_playtime, sizeof(__pyx_k__playback_playtime), 0, 0, 1, 1},
  {&__pyx_n_s__playback_seek_ms, __pyx_k__playback_seek_ms, sizeof(__pyx_k__playback_seek_ms), 0, 0, 1, 1},
  {&__pyx_n_s__playback_start, __pyx_k__playback_start, sizeof(__pyx_k__playback_start), 0, 0, 1, 1},
  {&__pyx_n_s__playback_status, __pyx_k__playback_status, sizeof(__pyx_k__playback_status), 0, 0, 1, 1},
  {&__pyx_n_s__playback_stop, __pyx_k__playback_stop, sizeof(__pyx_k__playback_stop), 0, 0, 1, 1},
  {&__pyx_n_s__playback_tickle, __pyx_k__playback_tickle, sizeof(__pyx_k__playback_tickle), 0, 0, 1, 1},
  {&__pyx_n_s__playback_volume_get, __pyx_k__playback_volume_get, sizeof(__pyx_k__playback_volume_get), 0, 0, 1, 1},
  {&__pyx_n_s__playback_volume_set, __pyx_k__playback_volume_set, sizeof(__pyx_k__playback_volume_set), 0, 0, 1, 1},
  {&__pyx_n_s__playlist, __pyx_k__playlist, sizeof(__pyx_k__playlist), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_add_id, __pyx_k__playlist_add_id, sizeof(__pyx_k__playlist_add_id), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_add_url, __pyx_k__playlist_add_url, sizeof(__pyx_k__playlist_add_url), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_clear, __pyx_k__playlist_clear, sizeof(__pyx_k__playlist_clear), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_create, __pyx_k__playlist_create, sizeof(__pyx_k__playlist_create), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_insert_id, __pyx_k__playlist_insert_id, sizeof(__pyx_k__playlist_insert_id), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_insert_url, __pyx_k__playlist_insert_url, sizeof(__pyx_k__playlist_insert_url), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_list, __pyx_k__playlist_list, sizeof(__pyx_k__playlist_list), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_load, __pyx_k__playlist_load, sizeof(__pyx_k__playlist_load), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_move, __pyx_k__playlist_move, sizeof(__pyx_k__playlist_move), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_radd, __pyx_k__playlist_radd, sizeof(__pyx_k__playlist_radd), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_remove, __pyx_k__playlist_remove, sizeof(__pyx_k__playlist_remove), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_rinsert, __pyx_k__playlist_rinsert, sizeof(__pyx_k__playlist_rinsert), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_set_next, __pyx_k__playlist_set_next, sizeof(__pyx_k__playlist_set_next), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_shuffle, __pyx_k__playlist_shuffle, sizeof(__pyx_k__playlist_shuffle), 0, 0, 1, 1},
  {&__pyx_n_s__playlist_sort, __pyx_k__playlist_sort, sizeof(__pyx_k__playlist_sort), 0, 0, 1, 1},
  {&__pyx_n_s__plugin_list, __pyx_k__plugin_list, sizeof(__pyx_k__plugin_list), 0, 0, 1, 1},
  {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
  {&__pyx_n_s__position, __pyx_k__position, sizeof(__pyx_k__position), 0, 0, 1, 1},
  {&__pyx_n_s__print_exception, __pyx_k__print_exception, sizeof(__pyx_k__print_exception), 0, 0, 1, 1},
  {&__pyx_n_s__props, __pyx_k__props, sizeof(__pyx_k__props), 0, 0, 1, 1},
  {&__pyx_n_s__pyval, __pyx_k__pyval, sizeof(__pyx_k__pyval), 0, 0, 1, 1},
  {&__pyx_n_s__quit, __pyx_k__quit, sizeof(__pyx_k__quit), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__remove, __pyx_k__remove, sizeof(__pyx_k__remove), 0, 0, 1, 1},
  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
  {&__pyx_n_s__samples, __pyx_k__samples, sizeof(__pyx_k__samples), 0, 0, 1, 1},
  {&__pyx_n_s__select, __pyx_k__select, sizeof(__pyx_k__select), 0, 0, 1, 1},
  {&__pyx_n_s__server, __pyx_k__server, sizeof(__pyx_k__server), 0, 0, 1, 1},
  {&__pyx_n_s__set, __pyx_k__set, sizeof(__pyx_k__set), 0, 0, 1, 1},
  {&__pyx_n_s__set_need_out_fun, __pyx_k__set_need_out_fun, sizeof(__pyx_k__set_need_out_fun), 0, 0, 1, 1},
  {&__pyx_n_s__source, __pyx_k__source, sizeof(__pyx_k__source), 0, 0, 1, 1},
  {&__pyx_n_s__sources, __pyx_k__sources, sizeof(__pyx_k__sources), 0, 0, 1, 1},
  {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
  {&__pyx_n_s__stats, __pyx_k__stats, sizeof(__pyx_k__stats), 0, 0, 1, 1},
  {&__pyx_n_s__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__timeout, __pyx_k__timeout, sizeof(__pyx_k__timeout), 0, 0, 1, 1},
  {&__pyx_n_s__traceback, __pyx_k__traceback, sizeof(__pyx_k__traceback), 0, 0, 1, 1},
  {&__pyx_n_s__typ, __pyx_k__typ, sizeof(__pyx_k__typ), 0, 0, 1, 1},
  {&__pyx_n_s__unquote_plus, __pyx_k__unquote_plus, sizeof(__pyx_k__unquote_plus), 0, 0, 1, 1},
  {&__pyx_n_s__url, __pyx_k__url, sizeof(__pyx_k__url), 0, 0, 1, 1},
  {&__pyx_n_s__urllib, __pyx_k__urllib, sizeof(__pyx_k__urllib), 0, 0, 1, 1},
  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__valuename, __pyx_k__valuename, sizeof(__pyx_k__valuename), 0, 0, 1, 1},
  {&__pyx_n_s__visualization_init, __pyx_k__visualization_init, sizeof(__pyx_k__visualization_init), 0, 0, 1, 1},
  {&__pyx_n_s__visualization_start, __pyx_k__visualization_start, sizeof(__pyx_k__visualization_start), 0, 0, 1, 1},
  {&__pyx_n_s__volume, __pyx_k__volume, sizeof(__pyx_k__volume), 0, 0, 1, 1},
  {&__pyx_n_s__wait, __pyx_k__wait, sizeof(__pyx_k__wait), 0, 0, 1, 1},
  {&__pyx_n_s__want_ioout, __pyx_k__want_ioout, sizeof(__pyx_k__want_ioout), 0, 0, 1, 1},
  {&__pyx_n_s__whence, __pyx_k__whence, sizeof(__pyx_k__whence), 0, 0, 1, 1},
  {&__pyx_n_s__write, __pyx_k__write, sizeof(__pyx_k__write), 0, 0, 1, 1},
  {&__pyx_n_s__xform_media_browse, __pyx_k__xform_media_browse, sizeof(__pyx_k__xform_media_browse), 0, 0, 1, 1},
  {&__pyx_n_s__xmmsapi, __pyx_k__xmmsapi, sizeof(__pyx_k__xmmsapi), 0, 0, 1, 1},
  {&__pyx_n_s__xmmsvalue, __pyx_k__xmmsvalue, sizeof(__pyx_k__xmmsvalue), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "xmmsapi.pyx":62
 * 
 * def deprecated(f):
 * 	def deprecated_decorator(*a, **kw):             # <<<<<<<<<<<<<<
 * 		if show_deprecated:
 * 			from sys import stderr
 */
  __pyx_k_tuple_2 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__a));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__a));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kw));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, ((PyObject *)__pyx_n_s__kw));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kw));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__a));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 2, ((PyObject *)__pyx_n_s__a));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kw));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 3, ((PyObject *)__pyx_n_s__kw));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kw));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__stderr));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 4, ((PyObject *)__pyx_n_s__stderr));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__stderr));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
  __pyx_k_codeobj_3 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s_4, 62, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "xmmsapi.pyx":87
 * 		n = <char *>XMMS_COLLECTION_NS_ALL
 * 	else:
 * 		raise ValueError("Bad namespace")             # <<<<<<<<<<<<<<
 * 	return n
 * 
 */
  __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_9);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_8));
  PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));

  /* "xmmsapi.pyx":226
 * 		"""
 * 		if self.res == NULL:
 * 			raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 
 * 		xmmsc_result_wait(self.res)
 */
  __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_12);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));

  /* "xmmsapi.pyx":248
 * 		cdef xmmsv_t *value
 * 		if self.res == NULL:
 * 			raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 		value = xmmsc_result_get_value(self.res)
 * 		obj = XmmsValue(self.source_pref.get())
 */
  __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_13);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));

  /* "xmmsapi.pyx":297
 * 		if self._val is None:
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 			hid = xmmsc_visualization_init_handle(self.res)
 * 			if hid == -1:
 */
  __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "xmmsapi.pyx":308
 * 		if self._val is None:
 * 			if self.res == NULL:
 * 				raise RuntimeError("Uninitialized result")             # <<<<<<<<<<<<<<
 * 			xval = XmmsResult.xmmsvalue(self)
 * 			if xval.is_error():
 */
  __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_16);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "xmmsapi.pyx":313
 * 				self._val = xval
 * 			elif self.conn == NULL:
 * 				raise RuntimeError("Internal connection reference not set")             # <<<<<<<<<<<<<<
 * 			else:
 * 				xmmsc_visualization_start_handle(self.conn, self.res)
 */
  __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_18);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_17));
  PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, ((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

  /* "xmmsapi.pyx":346
 * 		self.data = <short *>PyMem_Malloc(sizeof (short) * sample_count)
 * 		if self.data == NULL:
 * 			raise RuntimeError("Failed to initialize chunk data")             # <<<<<<<<<<<<<<
 * 		for i in range(sample_count):
 * 			self.data[i] = data[i]
 */
  __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_20);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
  PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_19));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));

  /* "xmmsapi.pyx":363
 * 		"""
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")             # <<<<<<<<<<<<<<
 * 		return PyBytes_FromStringAndSize(<char *>self.data, sizeof (short) * self.sample_count)
 * 
 */
  __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_22);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
  PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

  /* "xmmsapi.pyx":375
 * 		"""
 * 		if self.data == NULL:
 * 			raise RuntimeError("chunk data not initialized")             # <<<<<<<<<<<<<<
 * 		return [<int>self.data[i] for i in range(self.sample_count)]
 * 
 */
  __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
  PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

  /* "xmmsapi.pyx":462
 * 		self.conn = xmmsc_init(<char *>cn)
 * 		if self.conn == NULL:
 * 			raise ValueError("Failed to initialize xmmsclient library! Probably due to broken name.")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef get_source_preference(self):
 */
  __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_31);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
  PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_30));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));

  /* "xmmsapi.pyx":558
 * 
 * 		if not ret:
 * 			raise IOError("Couldn't connect to the server")             # <<<<<<<<<<<<<<
 * 		self.isconnected = 1
 * 
 */
  __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_35);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "xmmsapi.pyx":571
 * 		cdef XmmsResult ret
 * 		if res == NULL:
 * 			raise RuntimeError("xmmsc_result_t couldn't be allocated")             # <<<<<<<<<<<<<<
 * 		ret = Cls()
 * 		ret.set_sourcepref(self.source_preference)
 */
  __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_37);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
  PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));

  /* "xmmsapi.pyx":671
 * 			return self.create_result(cb, xmmsc_playback_seek_ms(self.conn, ms, whence))
 * 		else:
 * 			raise ValueError("Bad whence parameter")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=PLAYBACK_SEEK_SET, cb = None):
 */
  __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_40);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "xmmsapi.pyx":684
 * 			return self.create_result(cb, xmmsc_playback_seek_samples(self.conn, samples, whence))
 * 		else:
 * 			raise ValueError("Bad whence parameter")             # <<<<<<<<<<<<<<
 * 
 * 	cpdef XmmsResult playback_status(self, cb = None):
 */
  __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_43);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_39));
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));

  /* "xmmsapi.pyx":1723
 * 		if size < 0:
 * 			PyMem_Free(buf)
 * 			raise VisualizationError("Unrecoverable error in visualization")             # <<<<<<<<<<<<<<
 * 		chunk = XmmsVisChunk()
 * 		chunk.set_data(buf, size)
 */
  __pyx_k_tuple_89 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_89);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_88));
  PyTuple_SET_ITEM(__pyx_k_tuple_89, 0, ((PyObject *)__pyx_kp_s_88));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_88));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_89));

  /* "xmmsapi.pyx":1783
 * 		w = self._loop_get_wakeup()
 * 		if w is not None:
 * 			write(w, "1".encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 * 	def loop_iter(self, infd=None, outfd=None, errfd=None, timeout=-1):
 */
  __pyx_k_tuple_91 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_91);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ascii));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 0, ((PyObject *)__pyx_n_s__ascii));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ascii));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_91));

  /* "xmmsapi.pyx":1845
 * 				self.do_loop = False
 * 
 * 		self._loop_set_wakeup(None)             # <<<<<<<<<<<<<<
 * 
 * # Compatibility
 */
  __pyx_k_tuple_93 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_93);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_93, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93));

  /* "xmmsapi.pyx":57
 * cdef int show_deprecated = 0
 * from os import getenv
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):             # <<<<<<<<<<<<<<
 * 	show_deprecated = 1
 * del getenv
 */
  __pyx_k_tuple_116 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_116);
  __Pyx_INCREF(((PyObject *)__pyx_n_s_115));
  PyTuple_SET_ITEM(__pyx_k_tuple_116, 0, ((PyObject *)__pyx_n_s_115));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_115));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

  /* "xmmsapi.pyx":61
 * del getenv
 * 
 * def deprecated(f):             # <<<<<<<<<<<<<<
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:
 */
  __pyx_k_tuple_117 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__f));
  PyTuple_SET_ITEM(__pyx_k_tuple_117, 0, ((PyObject *)__pyx_n_s__f));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_4));
  PyTuple_SET_ITEM(__pyx_k_tuple_117, 1, ((PyObject *)__pyx_n_s_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_4));
  PyTuple_SET_ITEM(__pyx_k_tuple_117, 2, ((PyObject *)__pyx_n_s_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));
  __pyx_k_codeobj_118 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s__deprecated, 61, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "xmmsapi.pyx":404
 * 	return path
 * 
 * def enforce_unicode(object o):             # <<<<<<<<<<<<<<
 * 	if isinstance(o, unicode):
 * 		s = o
 */
  __pyx_k_tuple_119 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_119);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__o));
  PyTuple_SET_ITEM(__pyx_k_tuple_119, 0, ((PyObject *)__pyx_n_s__o));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__o));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__s));
  PyTuple_SET_ITEM(__pyx_k_tuple_119, 1, ((PyObject *)__pyx_n_s__s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__s));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));
  __pyx_k_codeobj_120 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s__enforce_unicode, 404, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  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;};
  __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;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__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 initxmmsapi(void); /*proto*/
PyMODINIT_FUNC initxmmsapi(void)
#else
PyMODINIT_FUNC PyInit_xmmsapi(void); /*proto*/
PyMODINIT_FUNC PyInit_xmmsapi(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  xmms_playback_seek_mode_t __pyx_t_6;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_xmmsapi(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("xmmsapi"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_94), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- 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;}
  if (__pyx_module_is_main_xmmsapi) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 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;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_7xmmsapi_select = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("ResultNotifier", (void (*)(void))__pyx_f_7xmmsapi_ResultNotifier, "int (xmmsv_t *, void *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("ResultDestroyNotifier", (void (*)(void))__pyx_f_7xmmsapi_ResultDestroyNotifier, "void (void *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("python_need_out_fun", (void (*)(void))__pyx_f_7xmmsapi_python_need_out_fun, "void (int, void *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("python_disconnect_fun", (void (*)(void))__pyx_f_7xmmsapi_python_disconnect_fun, "void (void *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("userconfdir_get", (void (*)(void))__pyx_f_7xmmsapi_userconfdir_get, "PyObject *(int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsSourcePreference) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsSourcePreference", (PyObject *)&__pyx_type_7xmmsapi_XmmsSourcePreference) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsSourcePreference = &__pyx_type_7xmmsapi_XmmsSourcePreference;
  __pyx_vtabptr_7xmmsapi_XmmsResult = &__pyx_vtable_7xmmsapi_XmmsResult;
  __pyx_vtable_7xmmsapi_XmmsResult.set_sourcepref = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, struct __pyx_obj_7xmmsapi_XmmsSourcePreference *))__pyx_f_7xmmsapi_10XmmsResult_set_sourcepref;
  __pyx_vtable_7xmmsapi_XmmsResult.set_result = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, xmmsc_result_t *))__pyx_f_7xmmsapi_10XmmsResult_set_result;
  __pyx_vtable_7xmmsapi_XmmsResult.set_callback = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, struct __pyx_obj_7xmmsapi_XmmsResultTracker *, PyObject *))__pyx_f_7xmmsapi_10XmmsResult_set_callback;
  __pyx_vtable_7xmmsapi_XmmsResult.disconnect = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_disconnect;
  __pyx_vtable_7xmmsapi_XmmsResult.wait = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_wait;
  __pyx_vtable_7xmmsapi_XmmsResult.is_error = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_is_error;
  __pyx_vtable_7xmmsapi_XmmsResult.iserror = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_iserror;
  __pyx_vtable_7xmmsapi_XmmsResult.xmmsvalue = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_xmmsvalue;
  __pyx_vtable_7xmmsapi_XmmsResult._value = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult__value;
  __pyx_vtable_7xmmsapi_XmmsResult.value = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_10XmmsResult_value;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsResult.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsResult", (PyObject *)&__pyx_type_7xmmsapi_XmmsResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsResult = &__pyx_type_7xmmsapi_XmmsResult;
  __pyx_vtabptr_7xmmsapi_XmmsResultTracker = &__pyx_vtable_7xmmsapi_XmmsResultTracker;
  __pyx_vtable_7xmmsapi_XmmsResultTracker.track_result = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, struct __pyx_obj_7xmmsapi_XmmsResult *))__pyx_f_7xmmsapi_17XmmsResultTracker_track_result;
  __pyx_vtable_7xmmsapi_XmmsResultTracker.release_result = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, struct __pyx_obj_7xmmsapi_XmmsResult *))__pyx_f_7xmmsapi_17XmmsResultTracker_release_result;
  __pyx_vtable_7xmmsapi_XmmsResultTracker.disconnect_all = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResultTracker *, int))__pyx_f_7xmmsapi_17XmmsResultTracker_disconnect_all;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsResultTracker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsResultTracker.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsResultTracker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsResultTracker", (PyObject *)&__pyx_type_7xmmsapi_XmmsResultTracker) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsResultTracker = &__pyx_type_7xmmsapi_XmmsResultTracker;
  __pyx_vtabptr_7xmmsapi_XmmsVisResult = &__pyx_vtable_7xmmsapi_XmmsVisResult;
  __pyx_vtable_7xmmsapi_XmmsVisResult.__pyx_base = *__pyx_vtabptr_7xmmsapi_XmmsResult;
  __pyx_vtable_7xmmsapi_XmmsVisResult.__pyx_base.xmmsvalue = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsResult *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_13XmmsVisResult_xmmsvalue;
  __pyx_vtable_7xmmsapi_XmmsVisResult.set_command = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisResult *, __pyx_t_7xmmsapi_VisResultCommand, xmmsc_connection_t *))__pyx_f_7xmmsapi_13XmmsVisResult_set_command;
  __pyx_vtable_7xmmsapi_XmmsVisResult.retrieve_error = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisResult *))__pyx_f_7xmmsapi_13XmmsVisResult_retrieve_error;
  __pyx_vtable_7xmmsapi_XmmsVisResult._init_xmmsvalue = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisResult *))__pyx_f_7xmmsapi_13XmmsVisResult__init_xmmsvalue;
  __pyx_vtable_7xmmsapi_XmmsVisResult._start_xmmsvalue = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisResult *))__pyx_f_7xmmsapi_13XmmsVisResult__start_xmmsvalue;
  __pyx_type_7xmmsapi_XmmsVisResult.tp_base = __pyx_ptype_7xmmsapi_XmmsResult;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsVisResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsVisResult.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsVisResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsVisResult", (PyObject *)&__pyx_type_7xmmsapi_XmmsVisResult) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsVisResult = &__pyx_type_7xmmsapi_XmmsVisResult;
  __pyx_vtabptr_7xmmsapi_XmmsVisChunk = &__pyx_vtable_7xmmsapi_XmmsVisChunk;
  __pyx_vtable_7xmmsapi_XmmsVisChunk.set_data = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, short *, int))__pyx_f_7xmmsapi_12XmmsVisChunk_set_data;
  __pyx_vtable_7xmmsapi_XmmsVisChunk.get_buffer = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_12XmmsVisChunk_get_buffer;
  __pyx_vtable_7xmmsapi_XmmsVisChunk.get_data = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsVisChunk *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_12XmmsVisChunk_get_data;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsVisChunk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsVisChunk.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsVisChunk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsVisChunk", (PyObject *)&__pyx_type_7xmmsapi_XmmsVisChunk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsVisChunk = &__pyx_type_7xmmsapi_XmmsVisChunk;
  __pyx_vtabptr_7xmmsapi_XmmsCore = &__pyx_vtable_7xmmsapi_XmmsCore;
  __pyx_vtable_7xmmsapi_XmmsCore.new_connection = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *))__pyx_f_7xmmsapi_8XmmsCore_new_connection;
  __pyx_vtable_7xmmsapi_XmmsCore.get_source_preference = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_get_source_preference;
  __pyx_vtable_7xmmsapi_XmmsCore.set_source_preference = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_set_source_preference;
  __pyx_vtable_7xmmsapi_XmmsCore._needout_cb = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore__needout_cb;
  __pyx_vtable_7xmmsapi_XmmsCore._disconnect_cb = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore__disconnect_cb;
  __pyx_vtable_7xmmsapi_XmmsCore.disconnect = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_disconnect;
  __pyx_vtable_7xmmsapi_XmmsCore.ioin = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_ioin;
  __pyx_vtable_7xmmsapi_XmmsCore.ioout = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_ioout;
  __pyx_vtable_7xmmsapi_XmmsCore.want_ioout = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_want_ioout;
  __pyx_vtable_7xmmsapi_XmmsCore.set_need_out_fun = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_set_need_out_fun;
  __pyx_vtable_7xmmsapi_XmmsCore.get_fd = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_8XmmsCore_get_fd;
  __pyx_vtable_7xmmsapi_XmmsCore.connect = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_8XmmsCore_connect *__pyx_optional_args))__pyx_f_7xmmsapi_8XmmsCore_connect;
  __pyx_vtable_7xmmsapi_XmmsCore._create_result = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *, PyObject *))__pyx_f_7xmmsapi_8XmmsCore__create_result;
  __pyx_vtable_7xmmsapi_XmmsCore.create_result = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *))__pyx_f_7xmmsapi_8XmmsCore_create_result;
  __pyx_vtable_7xmmsapi_XmmsCore.create_vis_result = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsCore *, PyObject *, xmmsc_result_t *, __pyx_t_7xmmsapi_VisResultCommand))__pyx_f_7xmmsapi_8XmmsCore_create_vis_result;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsCore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsCore.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsCore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsCore", (PyObject *)&__pyx_type_7xmmsapi_XmmsCore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsCore = &__pyx_type_7xmmsapi_XmmsCore;
  __pyx_vtabptr_7xmmsapi_XmmsApi = &__pyx_vtable_7xmmsapi_XmmsApi;
  __pyx_vtable_7xmmsapi_XmmsApi.__pyx_base = *__pyx_vtabptr_7xmmsapi_XmmsCore;
  __pyx_vtable_7xmmsapi_XmmsApi.quit = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_quit *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_quit;
  __pyx_vtable_7xmmsapi_XmmsApi.plugin_list = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_plugin_list *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_plugin_list;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_start = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_start *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_start;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_stop = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_stop *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_stop;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_tickle = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_tickle *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_tickle;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_pause = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_pause *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_pause;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_current_id = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_current_id *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_current_id;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_seek_ms = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_ms *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_seek_ms;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_seek_samples = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_seek_samples *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_seek_samples;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_status = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_status *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_status;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playback_status = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_status *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_status;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playback_current_id = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_current_id *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_current_id;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_playtime = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_playtime *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_playtime;
  __pyx_vtable_7xmmsapi_XmmsApi.signal_playback_playtime = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_playback_playtime *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_signal_playback_playtime;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_volume_set = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_set *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_volume_set;
  __pyx_vtable_7xmmsapi_XmmsApi.playback_volume_get = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playback_volume_get *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playback_volume_get;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playback_volume_changed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playback_volume_changed;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playlist_loaded = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_loaded *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_loaded;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_load = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_load *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_load;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_list = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_list;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_remove = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_remove;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_shuffle = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_shuffle *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_shuffle;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_rinsert = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_rinsert *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_rinsert;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_insert_url = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_url *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_url;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_insert_id = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_id *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_id;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_insert_collection = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_insert_collection *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_insert_collection;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_radd = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_radd *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_radd;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_add_url = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_url *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_add_url;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_add_id = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_id *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_add_id;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_add_collection = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_add_collection *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_add_collection;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_remove_entry = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_remove_entry *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_remove_entry;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_clear = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_clear *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_clear;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_list_entries = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_list_entries *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_list_entries;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_sort = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_sort *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_sort;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_set_next_rel = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next_rel *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_set_next_rel;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_set_next = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_set_next *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_set_next;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_move = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_move *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_move;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_create = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_create *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_create;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_current_pos = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_pos *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_current_pos;
  __pyx_vtable_7xmmsapi_XmmsApi.playlist_current_active = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_playlist_current_active *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_playlist_current_active;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playlist_current_pos = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_current_pos;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_playlist_changed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_playlist_changed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_playlist_changed;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_config_value_changed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_config_value_changed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_config_value_changed;
  __pyx_vtable_7xmmsapi_XmmsApi.config_set_value = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_set_value *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_config_set_value;
  __pyx_vtable_7xmmsapi_XmmsApi.config_get_value = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_get_value *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_config_get_value;
  __pyx_vtable_7xmmsapi_XmmsApi.config_list_values = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_list_values *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_config_list_values;
  __pyx_vtable_7xmmsapi_XmmsApi.config_register_value = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_config_register_value *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_config_register_value;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_add_entry = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_add_entry *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_add_entry;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_remove_entry = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_remove_entry *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_remove_entry;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_move_entry = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_move_entry *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_move_entry;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_get_info = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_info *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_get_info;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_rehash = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_rehash *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_rehash;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_get_id = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_get_id *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_get_id;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_import_path = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_import_path *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_import_path;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_property_set = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_set *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_property_set;
  __pyx_vtable_7xmmsapi_XmmsApi.medialib_property_remove = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_medialib_property_remove *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_medialib_property_remove;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_medialib_entry_added = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_medialib_entry_added;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_medialib_entry_changed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_medialib_entry_changed;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_collection_changed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_collection_changed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_collection_changed;
  __pyx_vtable_7xmmsapi_XmmsApi.signal_mediainfo_reader_unindexed = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_signal_mediainfo_reader_unindexed;
  __pyx_vtable_7xmmsapi_XmmsApi.broadcast_mediainfo_reader_status = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_broadcast_mediainfo_reader_status;
  __pyx_vtable_7xmmsapi_XmmsApi.xform_media_browse = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_xform_media_browse *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_xform_media_browse;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_get = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_get *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_get;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_list = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_list *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_list;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_save = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_save *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_save;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_remove = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_remove *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_remove;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_rename = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_rename *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_rename;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_idlist_from_playlist_file = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_idlist_from_playlist_file;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_query = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_query;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_query_ids = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_ids *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_query_ids;
  __pyx_vtable_7xmmsapi_XmmsApi.coll_query_infos = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, struct __pyx_obj_9xmmsvalue_Collection *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_coll_query_infos *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_coll_query_infos;
  __pyx_vtable_7xmmsapi_XmmsApi.bindata_add = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_add *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_bindata_add;
  __pyx_vtable_7xmmsapi_XmmsApi.bindata_retrieve = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_retrieve *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_bindata_retrieve;
  __pyx_vtable_7xmmsapi_XmmsApi.bindata_remove = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_remove *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_bindata_remove;
  __pyx_vtable_7xmmsapi_XmmsApi.bindata_list = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_bindata_list *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_bindata_list;
  __pyx_vtable_7xmmsapi_XmmsApi.stats = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_stats *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_stats;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_version = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_version *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_version;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_init = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_init *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_init;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_start = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_start *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_start;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_started = (int (*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_7XmmsApi_visualization_started;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_errored = (int (*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_7XmmsApi_visualization_errored;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_property_set = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_property_set *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_property_set;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_properties_set = (struct __pyx_obj_7xmmsapi_XmmsResult *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_properties_set *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_properties_set;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_chunk_get = (struct __pyx_obj_7xmmsapi_XmmsVisChunk *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_7xmmsapi_7XmmsApi_visualization_chunk_get *__pyx_optional_args))__pyx_f_7xmmsapi_7XmmsApi_visualization_chunk_get;
  __pyx_vtable_7xmmsapi_XmmsApi.visualization_shutdown = (PyObject *(*)(struct __pyx_obj_7xmmsapi_XmmsApi *, int, int __pyx_skip_dispatch))__pyx_f_7xmmsapi_7XmmsApi_visualization_shutdown;
  __pyx_type_7xmmsapi_XmmsApi.tp_base = __pyx_ptype_7xmmsapi_XmmsCore;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsApi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsApi.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsApi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsApi", (PyObject *)&__pyx_type_7xmmsapi_XmmsApi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsApi = &__pyx_type_7xmmsapi_XmmsApi;
  __pyx_vtabptr_7xmmsapi_XmmsLoop = &__pyx_vtable_7xmmsapi_XmmsLoop;
  __pyx_vtable_7xmmsapi_XmmsLoop.__pyx_base = *__pyx_vtabptr_7xmmsapi_XmmsApi;
  __pyx_type_7xmmsapi_XmmsLoop.tp_base = __pyx_ptype_7xmmsapi_XmmsApi;
  if (PyType_Ready(&__pyx_type_7xmmsapi_XmmsLoop) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_7xmmsapi_XmmsLoop.tp_dict, __pyx_vtabptr_7xmmsapi_XmmsLoop) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "XmmsLoop", (PyObject *)&__pyx_type_7xmmsapi_XmmsLoop) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi_XmmsLoop = &__pyx_type_7xmmsapi_XmmsLoop;
  if (PyType_Ready(&__pyx_type_7xmmsapi___pyx_scope_struct__deprecated) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7xmmsapi___pyx_scope_struct__deprecated = &__pyx_type_7xmmsapi___pyx_scope_struct__deprecated;
  /*--- Type import code ---*/
  __pyx_ptype_9xmmsvalue_XmmsValue = __Pyx_ImportType("xmmsvalue", "XmmsValue", sizeof(struct __pyx_obj_9xmmsvalue_XmmsValue), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_XmmsValue)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_XmmsValue = (struct __pyx_vtabstruct_9xmmsvalue_XmmsValue*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_XmmsValue->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_XmmsValue)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_XmmsListIter = __Pyx_ImportType("xmmsvalue", "XmmsListIter", sizeof(struct __pyx_obj_9xmmsvalue_XmmsListIter), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_XmmsListIter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_XmmsDictIter = __Pyx_ImportType("xmmsvalue", "XmmsDictIter", sizeof(struct __pyx_obj_9xmmsvalue_XmmsDictIter), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_XmmsDictIter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_CollectionRef = __Pyx_ImportType("xmmsvalue", "CollectionRef", sizeof(struct __pyx_obj_9xmmsvalue_CollectionRef), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_CollectionRef)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_CollectionRef = (struct __pyx_vtabstruct_9xmmsvalue_CollectionRef*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_CollectionRef->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_CollectionRef)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_Collection = __Pyx_ImportType("xmmsvalue", "Collection", sizeof(struct __pyx_obj_9xmmsvalue_Collection), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_Collection)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_Collection = (struct __pyx_vtabstruct_9xmmsvalue_Collection*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_Collection->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_Collection)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_CollectionAttributes = __Pyx_ImportType("xmmsvalue", "CollectionAttributes", sizeof(struct __pyx_obj_9xmmsvalue_CollectionAttributes), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_CollectionAttributes)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_CollectionAttributes = (struct __pyx_vtabstruct_9xmmsvalue_CollectionAttributes*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_CollectionAttributes->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_CollectionAttributes)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_AttributesIterator = __Pyx_ImportType("xmmsvalue", "AttributesIterator", sizeof(struct __pyx_obj_9xmmsvalue_AttributesIterator), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_AttributesIterator)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_AttributesIterator = (struct __pyx_vtabstruct_9xmmsvalue_AttributesIterator*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_AttributesIterator->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_AttributesIterator)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_CollectionOperands = __Pyx_ImportType("xmmsvalue", "CollectionOperands", sizeof(struct __pyx_obj_9xmmsvalue_CollectionOperands), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_CollectionOperands)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_CollectionOperands = (struct __pyx_vtabstruct_9xmmsvalue_CollectionOperands*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_CollectionOperands->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_CollectionOperands)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9xmmsvalue_CollectionIDList = __Pyx_ImportType("xmmsvalue", "CollectionIDList", sizeof(struct __pyx_obj_9xmmsvalue_CollectionIDList), 1); if (unlikely(!__pyx_ptype_9xmmsvalue_CollectionIDList)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9xmmsvalue_CollectionIDList = (struct __pyx_vtabstruct_9xmmsvalue_CollectionIDList*)__Pyx_GetVtable(__pyx_ptype_9xmmsvalue_CollectionIDList->tp_dict); if (unlikely(!__pyx_vtabptr_9xmmsvalue_CollectionIDList)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("xmmsvalue"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "create_native_value", (void (**)(void))&__pyx_f_9xmmsvalue_create_native_value, "xmmsv_t *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Execution code ---*/

  /* "xmmsapi.pyx":16
 * # The following constants are meant for interpreting the return value of
 * # XMMS.playback_status ()
 * PLAYBACK_STATUS_STOP  = XMMS_PLAYBACK_STATUS_STOP             # <<<<<<<<<<<<<<
 * PLAYBACK_STATUS_PLAY  = XMMS_PLAYBACK_STATUS_PLAY
 * PLAYBACK_STATUS_PAUSE = XMMS_PLAYBACK_STATUS_PAUSE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYBACK_STATUS_STOP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_95, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":17
 * # XMMS.playback_status ()
 * PLAYBACK_STATUS_STOP  = XMMS_PLAYBACK_STATUS_STOP
 * PLAYBACK_STATUS_PLAY  = XMMS_PLAYBACK_STATUS_PLAY             # <<<<<<<<<<<<<<
 * PLAYBACK_STATUS_PAUSE = XMMS_PLAYBACK_STATUS_PAUSE
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYBACK_STATUS_PLAY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_96, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":18
 * PLAYBACK_STATUS_STOP  = XMMS_PLAYBACK_STATUS_STOP
 * PLAYBACK_STATUS_PLAY  = XMMS_PLAYBACK_STATUS_PLAY
 * PLAYBACK_STATUS_PAUSE = XMMS_PLAYBACK_STATUS_PAUSE             # <<<<<<<<<<<<<<
 * 
 * PLAYLIST_CHANGED_ADD     = XMMS_PLAYLIST_CHANGED_ADD
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYBACK_STATUS_PAUSE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_97, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":20
 * PLAYBACK_STATUS_PAUSE = XMMS_PLAYBACK_STATUS_PAUSE
 * 
 * PLAYLIST_CHANGED_ADD     = XMMS_PLAYLIST_CHANGED_ADD             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_INSERT  = XMMS_PLAYLIST_CHANGED_INSERT
 * PLAYLIST_CHANGED_SHUFFLE = XMMS_PLAYLIST_CHANGED_SHUFFLE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_ADD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_98, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":21
 * 
 * PLAYLIST_CHANGED_ADD     = XMMS_PLAYLIST_CHANGED_ADD
 * PLAYLIST_CHANGED_INSERT  = XMMS_PLAYLIST_CHANGED_INSERT             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_SHUFFLE = XMMS_PLAYLIST_CHANGED_SHUFFLE
 * PLAYLIST_CHANGED_REMOVE  = XMMS_PLAYLIST_CHANGED_REMOVE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_INSERT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_99, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":22
 * PLAYLIST_CHANGED_ADD     = XMMS_PLAYLIST_CHANGED_ADD
 * PLAYLIST_CHANGED_INSERT  = XMMS_PLAYLIST_CHANGED_INSERT
 * PLAYLIST_CHANGED_SHUFFLE = XMMS_PLAYLIST_CHANGED_SHUFFLE             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_REMOVE  = XMMS_PLAYLIST_CHANGED_REMOVE
 * PLAYLIST_CHANGED_CLEAR   = XMMS_PLAYLIST_CHANGED_CLEAR
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_SHUFFLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":23
 * PLAYLIST_CHANGED_INSERT  = XMMS_PLAYLIST_CHANGED_INSERT
 * PLAYLIST_CHANGED_SHUFFLE = XMMS_PLAYLIST_CHANGED_SHUFFLE
 * PLAYLIST_CHANGED_REMOVE  = XMMS_PLAYLIST_CHANGED_REMOVE             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_CLEAR   = XMMS_PLAYLIST_CHANGED_CLEAR
 * PLAYLIST_CHANGED_MOVE    = XMMS_PLAYLIST_CHANGED_MOVE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_REMOVE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_101, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":24
 * PLAYLIST_CHANGED_SHUFFLE = XMMS_PLAYLIST_CHANGED_SHUFFLE
 * PLAYLIST_CHANGED_REMOVE  = XMMS_PLAYLIST_CHANGED_REMOVE
 * PLAYLIST_CHANGED_CLEAR   = XMMS_PLAYLIST_CHANGED_CLEAR             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_MOVE    = XMMS_PLAYLIST_CHANGED_MOVE
 * PLAYLIST_CHANGED_SORT    = XMMS_PLAYLIST_CHANGED_SORT
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_CLEAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_102, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":25
 * PLAYLIST_CHANGED_REMOVE  = XMMS_PLAYLIST_CHANGED_REMOVE
 * PLAYLIST_CHANGED_CLEAR   = XMMS_PLAYLIST_CHANGED_CLEAR
 * PLAYLIST_CHANGED_MOVE    = XMMS_PLAYLIST_CHANGED_MOVE             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_SORT    = XMMS_PLAYLIST_CHANGED_SORT
 * PLAYLIST_CHANGED_UPDATE  = XMMS_PLAYLIST_CHANGED_UPDATE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_MOVE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_103, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":26
 * PLAYLIST_CHANGED_CLEAR   = XMMS_PLAYLIST_CHANGED_CLEAR
 * PLAYLIST_CHANGED_MOVE    = XMMS_PLAYLIST_CHANGED_MOVE
 * PLAYLIST_CHANGED_SORT    = XMMS_PLAYLIST_CHANGED_SORT             # <<<<<<<<<<<<<<
 * PLAYLIST_CHANGED_UPDATE  = XMMS_PLAYLIST_CHANGED_UPDATE
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_SORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_104, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":27
 * PLAYLIST_CHANGED_MOVE    = XMMS_PLAYLIST_CHANGED_MOVE
 * PLAYLIST_CHANGED_SORT    = XMMS_PLAYLIST_CHANGED_SORT
 * PLAYLIST_CHANGED_UPDATE  = XMMS_PLAYLIST_CHANGED_UPDATE             # <<<<<<<<<<<<<<
 * 
 * PLUGIN_TYPE_ALL    = XMMS_PLUGIN_TYPE_ALL
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYLIST_CHANGED_UPDATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_105, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":29
 * PLAYLIST_CHANGED_UPDATE  = XMMS_PLAYLIST_CHANGED_UPDATE
 * 
 * PLUGIN_TYPE_ALL    = XMMS_PLUGIN_TYPE_ALL             # <<<<<<<<<<<<<<
 * PLUGIN_TYPE_XFORM  = XMMS_PLUGIN_TYPE_XFORM
 * PLUGIN_TYPE_OUTPUT = XMMS_PLUGIN_TYPE_OUTPUT
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLUGIN_TYPE_ALL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PLUGIN_TYPE_ALL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":30
 * 
 * PLUGIN_TYPE_ALL    = XMMS_PLUGIN_TYPE_ALL
 * PLUGIN_TYPE_XFORM  = XMMS_PLUGIN_TYPE_XFORM             # <<<<<<<<<<<<<<
 * PLUGIN_TYPE_OUTPUT = XMMS_PLUGIN_TYPE_OUTPUT
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLUGIN_TYPE_XFORM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PLUGIN_TYPE_XFORM, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":31
 * PLUGIN_TYPE_ALL    = XMMS_PLUGIN_TYPE_ALL
 * PLUGIN_TYPE_XFORM  = XMMS_PLUGIN_TYPE_XFORM
 * PLUGIN_TYPE_OUTPUT = XMMS_PLUGIN_TYPE_OUTPUT             # <<<<<<<<<<<<<<
 * 
 * MEDIALIB_ENTRY_STATUS_NEW           = XMMS_MEDIALIB_ENTRY_STATUS_NEW
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLUGIN_TYPE_OUTPUT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PLUGIN_TYPE_OUTPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":33
 * PLUGIN_TYPE_OUTPUT = XMMS_PLUGIN_TYPE_OUTPUT
 * 
 * MEDIALIB_ENTRY_STATUS_NEW           = XMMS_MEDIALIB_ENTRY_STATUS_NEW             # <<<<<<<<<<<<<<
 * MEDIALIB_ENTRY_STATUS_OK            = XMMS_MEDIALIB_ENTRY_STATUS_OK
 * MEDIALIB_ENTRY_STATUS_RESOLVING     = XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_MEDIALIB_ENTRY_STATUS_NEW); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_106, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":34
 * 
 * MEDIALIB_ENTRY_STATUS_NEW           = XMMS_MEDIALIB_ENTRY_STATUS_NEW
 * MEDIALIB_ENTRY_STATUS_OK            = XMMS_MEDIALIB_ENTRY_STATUS_OK             # <<<<<<<<<<<<<<
 * MEDIALIB_ENTRY_STATUS_RESOLVING     = XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING
 * MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE = XMMS_MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_MEDIALIB_ENTRY_STATUS_OK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_107, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":35
 * MEDIALIB_ENTRY_STATUS_NEW           = XMMS_MEDIALIB_ENTRY_STATUS_NEW
 * MEDIALIB_ENTRY_STATUS_OK            = XMMS_MEDIALIB_ENTRY_STATUS_OK
 * MEDIALIB_ENTRY_STATUS_RESOLVING     = XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING             # <<<<<<<<<<<<<<
 * MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE = XMMS_MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE
 * MEDIALIB_ENTRY_STATUS_REHASH        = XMMS_MEDIALIB_ENTRY_STATUS_REHASH
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_108, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":36
 * MEDIALIB_ENTRY_STATUS_OK            = XMMS_MEDIALIB_ENTRY_STATUS_OK
 * MEDIALIB_ENTRY_STATUS_RESOLVING     = XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING
 * MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE = XMMS_MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE             # <<<<<<<<<<<<<<
 * MEDIALIB_ENTRY_STATUS_REHASH        = XMMS_MEDIALIB_ENTRY_STATUS_REHASH
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_109, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":37
 * MEDIALIB_ENTRY_STATUS_RESOLVING     = XMMS_MEDIALIB_ENTRY_STATUS_RESOLVING
 * MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE = XMMS_MEDIALIB_ENTRY_STATUS_NOT_AVAILABLE
 * MEDIALIB_ENTRY_STATUS_REHASH        = XMMS_MEDIALIB_ENTRY_STATUS_REHASH             # <<<<<<<<<<<<<<
 * 
 * COLLECTION_CHANGED_ADD    = XMMS_COLLECTION_CHANGED_ADD
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_MEDIALIB_ENTRY_STATUS_REHASH); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_110, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":39
 * MEDIALIB_ENTRY_STATUS_REHASH        = XMMS_MEDIALIB_ENTRY_STATUS_REHASH
 * 
 * COLLECTION_CHANGED_ADD    = XMMS_COLLECTION_CHANGED_ADD             # <<<<<<<<<<<<<<
 * COLLECTION_CHANGED_UPDATE = XMMS_COLLECTION_CHANGED_UPDATE
 * COLLECTION_CHANGED_RENAME = XMMS_COLLECTION_CHANGED_RENAME
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_COLLECTION_CHANGED_ADD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_111, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":40
 * 
 * COLLECTION_CHANGED_ADD    = XMMS_COLLECTION_CHANGED_ADD
 * COLLECTION_CHANGED_UPDATE = XMMS_COLLECTION_CHANGED_UPDATE             # <<<<<<<<<<<<<<
 * COLLECTION_CHANGED_RENAME = XMMS_COLLECTION_CHANGED_RENAME
 * COLLECTION_CHANGED_REMOVE = XMMS_COLLECTION_CHANGED_REMOVE
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_COLLECTION_CHANGED_UPDATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_112, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":41
 * COLLECTION_CHANGED_ADD    = XMMS_COLLECTION_CHANGED_ADD
 * COLLECTION_CHANGED_UPDATE = XMMS_COLLECTION_CHANGED_UPDATE
 * COLLECTION_CHANGED_RENAME = XMMS_COLLECTION_CHANGED_RENAME             # <<<<<<<<<<<<<<
 * COLLECTION_CHANGED_REMOVE = XMMS_COLLECTION_CHANGED_REMOVE
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_COLLECTION_CHANGED_RENAME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_113, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":42
 * COLLECTION_CHANGED_UPDATE = XMMS_COLLECTION_CHANGED_UPDATE
 * COLLECTION_CHANGED_RENAME = XMMS_COLLECTION_CHANGED_RENAME
 * COLLECTION_CHANGED_REMOVE = XMMS_COLLECTION_CHANGED_REMOVE             # <<<<<<<<<<<<<<
 * 
 * PLAYBACK_SEEK_CUR = XMMS_PLAYBACK_SEEK_CUR
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_COLLECTION_CHANGED_REMOVE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_114, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":44
 * COLLECTION_CHANGED_REMOVE = XMMS_COLLECTION_CHANGED_REMOVE
 * 
 * PLAYBACK_SEEK_CUR = XMMS_PLAYBACK_SEEK_CUR             # <<<<<<<<<<<<<<
 * PLAYBACK_SEEK_SET = XMMS_PLAYBACK_SEEK_SET
 * 
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYBACK_SEEK_CUR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_CUR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":45
 * 
 * PLAYBACK_SEEK_CUR = XMMS_PLAYBACK_SEEK_CUR
 * PLAYBACK_SEEK_SET = XMMS_PLAYBACK_SEEK_SET             # <<<<<<<<<<<<<<
 * 
 * COLLECTION_NS_COLLECTIONS = to_unicode(<char *>XMMS_COLLECTION_NS_COLLECTIONS)
 */
  __pyx_t_2 = PyInt_FromLong(XMMS_PLAYBACK_SEEK_SET); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_SET, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":47
 * PLAYBACK_SEEK_SET = XMMS_PLAYBACK_SEEK_SET
 * 
 * COLLECTION_NS_COLLECTIONS = to_unicode(<char *>XMMS_COLLECTION_NS_COLLECTIONS)             # <<<<<<<<<<<<<<
 * COLLECTION_NS_PLAYLISTS = to_unicode(<char *>XMMS_COLLECTION_NS_PLAYLISTS)
 * COLLECTION_NS_ALL = to_unicode(<char *>XMMS_COLLECTION_NS_ALL)
 */
  __pyx_t_2 = __pyx_f_9xmmsutils_to_unicode(((char *)XMMS_COLLECTION_NS_COLLECTIONS)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_6, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":48
 * 
 * COLLECTION_NS_COLLECTIONS = to_unicode(<char *>XMMS_COLLECTION_NS_COLLECTIONS)
 * COLLECTION_NS_PLAYLISTS = to_unicode(<char *>XMMS_COLLECTION_NS_PLAYLISTS)             # <<<<<<<<<<<<<<
 * COLLECTION_NS_ALL = to_unicode(<char *>XMMS_COLLECTION_NS_ALL)
 * 
 */
  __pyx_t_2 = __pyx_f_9xmmsutils_to_unicode(((char *)XMMS_COLLECTION_NS_PLAYLISTS)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_7, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":49
 * COLLECTION_NS_COLLECTIONS = to_unicode(<char *>XMMS_COLLECTION_NS_COLLECTIONS)
 * COLLECTION_NS_PLAYLISTS = to_unicode(<char *>XMMS_COLLECTION_NS_PLAYLISTS)
 * COLLECTION_NS_ALL = to_unicode(<char *>XMMS_COLLECTION_NS_ALL)             # <<<<<<<<<<<<<<
 * 
 * ACTIVE_PLAYLIST = to_unicode(<char *>XMMS_ACTIVE_PLAYLIST)
 */
  __pyx_t_2 = __pyx_f_9xmmsutils_to_unicode(((char *)XMMS_COLLECTION_NS_ALL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__COLLECTION_NS_ALL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":51
 * COLLECTION_NS_ALL = to_unicode(<char *>XMMS_COLLECTION_NS_ALL)
 * 
 * ACTIVE_PLAYLIST = to_unicode(<char *>XMMS_ACTIVE_PLAYLIST)             # <<<<<<<<<<<<<<
 * 
 * #####################################################################
 */
  __pyx_t_2 = __pyx_f_9xmmsutils_to_unicode(((char *)XMMS_ACTIVE_PLAYLIST)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ACTIVE_PLAYLIST, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":55
 * #####################################################################
 * 
 * cdef int show_deprecated = 0             # <<<<<<<<<<<<<<
 * from os import getenv
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):
 */
  __pyx_v_7xmmsapi_show_deprecated = 0;

  /* "xmmsapi.pyx":56
 * 
 * cdef int show_deprecated = 0
 * from os import getenv             # <<<<<<<<<<<<<<
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):
 * 	show_deprecated = 1
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__getenv));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__getenv));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__getenv));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__os), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__getenv);
  if (__pyx_t_2 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__getenv);
    if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__getenv, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "xmmsapi.pyx":57
 * cdef int show_deprecated = 0
 * from os import getenv
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):             # <<<<<<<<<<<<<<
 * 	show_deprecated = 1
 * del getenv
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__getenv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "xmmsapi.pyx":58
 * from os import getenv
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):
 * 	show_deprecated = 1             # <<<<<<<<<<<<<<
 * del getenv
 * 
 */
    __pyx_v_7xmmsapi_show_deprecated = 1;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "xmmsapi.pyx":59
 * if getenv('XMMS_PYTHON_SHOW_DEPRECATED'):
 * 	show_deprecated = 1
 * del getenv             # <<<<<<<<<<<<<<
 * 
 * def deprecated(f):
 */
  if (__Pyx_DelAttrString(__pyx_m, "getenv") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "xmmsapi.pyx":61
 * del getenv
 * 
 * def deprecated(f):             # <<<<<<<<<<<<<<
 * 	def deprecated_decorator(*a, **kw):
 * 		if show_deprecated:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7xmmsapi_1deprecated, NULL, __pyx_n_s__xmmsapi); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__deprecated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":76
 * 	from select import select as _sel
 * 	select = _sel
 * _install_select()             # <<<<<<<<<<<<<<
 * 
 * cdef char *check_namespace(object ns, bint can_be_all) except NULL:
 */
  __pyx_t_2 = __pyx_f_7xmmsapi__install_select(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":199
 * 
 * 	# XXX Kept for compatibility.
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def _callback(self):
 * 		"""
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "xmmsapi.pyx":200
 * 	# XXX Kept for compatibility.
 * 	@deprecated
 * 	def _callback(self):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsResult, __pyx_n_s___callback); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsResult->tp_dict, __pyx_n_s___callback, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsResult);

  /* "xmmsapi.pyx":378
 * 		return [<int>self.data[i] for i in range(self.sample_count)]
 * 
 * class VisualizationError(Exception):             # <<<<<<<<<<<<<<
 * 	pass
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3), __pyx_n_s__VisualizationError, __pyx_n_s__xmmsapi); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__VisualizationError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "xmmsapi.pyx":404
 * 	return path
 * 
 * def enforce_unicode(object o):             # <<<<<<<<<<<<<<
 * 	if isinstance(o, unicode):
 * 		s = o
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_7xmmsapi_5enforce_unicode, NULL, __pyx_n_s__xmmsapi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__enforce_unicode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "xmmsapi.pyx":660
 * 		return self.create_result(cb, xmmsc_playback_current_id(self.conn))
 * 
 * 	cpdef XmmsResult playback_seek_ms(self, int ms, xmms_playback_seek_mode_t whence = PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_ms(ms, whence=PLAYBACK_SEEK_SET, cb=None) -> XmmsResult
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_SET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = ((xmms_playback_seek_mode_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_k_38 = __pyx_t_6;

  /* "xmmsapi.pyx":673
 * 			raise ValueError("Bad whence parameter")
 * 
 * 	cpdef XmmsResult playback_seek_samples(self, int samples, xmms_playback_seek_mode_t whence=PLAYBACK_SEEK_SET, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playback_seek_samples(samples, cb=None) -> XmmsResult
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__PLAYBACK_SEEK_SET); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = ((xmms_playback_seek_mode_t)PyInt_AsLong(__pyx_t_3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_k_41 = __pyx_t_6;

  /* "xmmsapi.pyx":821
 * 		return self.create_result(cb, xmmsc_playlist_shuffle(self.conn, <char *>p))
 * 
 * 	cpdef XmmsResult playlist_rinsert(self, int pos, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_rinsert(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_49 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "xmmsapi.pyx":841
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def playlist_rinsert_encoded(self, int pos, url, playlist = None, cb = None):
 * 		"""
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "xmmsapi.pyx":842
 * 
 * 	@deprecated
 * 	def playlist_rinsert_encoded(self, int pos, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_121); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_121, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":849
 * 		return self.playlist_rinsert(pos, url, playlist, cb=cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_insert_url(self, int pos, url, playlist = None, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_insert_url(pos, url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_50 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":870
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def playlist_insert_encoded(self, int pos, url, playlist = None, cb = None):
 * 		"""
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "xmmsapi.pyx":871
 * 
 * 	@deprecated
 * 	def playlist_insert_encoded(self, int pos, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_5 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_122); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_122, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":912
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult playlist_radd(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_radd(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_52 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":931
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def playlist_radd_encoded(self, url, playlist = None, cb = None):
 * 		"""
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);

  /* "xmmsapi.pyx":932
 * 
 * 	@deprecated
 * 	def playlist_radd_encoded(self, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_123); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_123, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":939
 * 		return self.playlist_radd(url, playlist, cb = cb, encoded=True)
 * 
 * 	cpdef XmmsResult playlist_add_url(self, url, playlist = None, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		playlist_add_url(url, playlist=None, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k_53 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "xmmsapi.pyx":959
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def playlist_add_encoded(self, url, playlist = None, cb = None):
 * 		"""
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "xmmsapi.pyx":960
 * 
 * 	@deprecated
 * 	def playlist_add_encoded(self, url, playlist = None, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_124); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_124, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":1198
 * 		return self.create_result(cb, xmmsc_config_register_value(self.conn, <char *>v, <char *>dv))
 * 
 * 	cpdef XmmsResult medialib_add_entry(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_add_entry(file, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_64 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":1214
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def medialib_add_entry_encoded(self, path, cb = None):
 * 		"""
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "xmmsapi.pyx":1215
 * 
 * 	@deprecated
 * 	def medialib_add_entry_encoded(self, path, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_5 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_125); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_125, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":1232
 * 		return self.create_result(cb, xmmsc_medialib_remove_entry(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_move_entry(self, int id,  url, cb = None, encoded = False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_move_entry(id, url, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_66 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1273
 * 		return self.create_result(cb, xmmsc_medialib_rehash(self.conn, id))
 * 
 * 	cpdef XmmsResult medialib_get_id(self, url, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_get_id(url, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_68 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1290
 * 		return self.create_result(cb, res)
 * 
 * 	cpdef XmmsResult medialib_import_path(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		medialib_import_path(path, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_69 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1308
 * 
 * 	@deprecated
 * 	def medialib_path_import(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_k_71 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1307
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def medialib_path_import(self, path, cb = None, encoded=False):
 * 		"""
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);

  /* "xmmsapi.pyx":1308
 * 
 * 	@deprecated
 * 	def medialib_path_import(self, path, cb = None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_3 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_126); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_126, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":1315
 * 		return self.medialib_import_path(self, path, cb=cb, encoded=encoded)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def medialib_path_import_encoded(self, path, cb = None):
 * 		"""
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);

  /* "xmmsapi.pyx":1316
 * 
 * 	@deprecated
 * 	def medialib_path_import_encoded(self, path, cb = None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_2 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_127); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_127, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":1417
 * 		return self.create_result(cb, xmmsc_broadcast_mediainfo_reader_status(self.conn))
 * 
 * 	cpdef XmmsResult xform_media_browse(self, url, cb=None, encoded=False):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xform_media_browse(url, cb=None, encoded=False) -> XmmsResult
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_79 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "xmmsapi.pyx":1433
 * 		return self.create_result(cb, res)
 * 
 * 	@deprecated             # <<<<<<<<<<<<<<
 * 	def xform_media_browse_encoded(self, url, cb=None):
 * 		"""
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__deprecated); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "xmmsapi.pyx":1434
 * 
 * 	@deprecated
 * 	def xform_media_browse_encoded(self, url, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		@deprecated
 */
  __pyx_t_5 = __Pyx_GetName((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi, __pyx_n_s_128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7xmmsapi_XmmsApi->tp_dict, __pyx_n_s_128, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_7xmmsapi_XmmsApi);

  /* "xmmsapi.pyx":1691
 * 		return self.create_result(cb, xmmsc_visualization_property_set(self.conn, handle, <char *>k, <char *>v))
 * 
 * 	cpdef XmmsResult visualization_properties_set(self, int handle, props={}, cb=None):             # <<<<<<<<<<<<<<
 * 		"""
 * 		xmmsc_visualization_properties_set(handle, props={}, cb=None) -> XmmsResult
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_k_85 = ((PyObject *)__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1739
 * 
 * 
 * class XmmsDisconnectException(Exception):             # <<<<<<<<<<<<<<
 * 	pass
 * 
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5), __pyx_n_s_92, __pyx_n_s__xmmsapi); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_92, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "xmmsapi.pyx":1742
 * 	pass
 * 
 * from os import write             # <<<<<<<<<<<<<<
 * cdef class XmmsLoop(XmmsApi):
 * 	#cdef bint do_loop
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__write));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__write));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__write));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__os), ((PyObject *)__pyx_t_5), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__write);
  if (__pyx_t_5 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__write);
    if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__write, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "xmmsapi.pyx":1848
 * 
 * # Compatibility
 * XMMS = XmmsLoop             # <<<<<<<<<<<<<<
 * XMMSResult = XmmsResult
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__XMMS, ((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsLoop))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "xmmsapi.pyx":1849
 * # Compatibility
 * XMMS = XmmsLoop
 * XMMSResult = XmmsResult             # <<<<<<<<<<<<<<
 */
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__XMMSResult, ((PyObject *)((PyObject*)__pyx_ptype_7xmmsapi_XmmsResult))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "xmmsapi.pyx":1
 * """             # <<<<<<<<<<<<<<
 * Python bindings for XMMS2.
 * """
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "xmmsutils.pxd":7
 * 	return PyUnicode_DecodeUTF8(s, strlen(s), "replace")
 * 
 * cdef inline from_unicode(object o):             # <<<<<<<<<<<<<<
 * 	if isinstance(o, unicode):
 * 		return PyUnicode_AsUTF8String(o)
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    __Pyx_AddTraceback("init xmmsapi", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init xmmsapi");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
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
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    #if PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        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;
}
#else /* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *args;
        if (!value)
            args = PyTuple_New(0);
        else if (PyTuple_Check(value)) {
            Py_INCREF(value);
            args = value;
        }
        else
            args = PyTuple_Pack(1, value);
        if (!args)
            goto bad;
        owned_instance = PyEval_CallObject(type, args);
        Py_DECREF(args);
        if (!owned_instance)
            goto bad;
        value = owned_instance;
        if (!PyExceptionInstance_Check(value)) {
            PyErr_Format(PyExc_TypeError,
                         "calling %R should have returned an instance of "
                         "BaseException, not %R",
                         type, Py_TYPE(value));
            goto bad;
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause && cause != Py_None) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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_AsString(kw_name));
        #endif
}

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)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    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 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 *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";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 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;
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    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);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_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;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (op->func_doc == NULL && op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
        op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
        op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
    }
    if (op->func_doc == 0) {
        Py_INCREF(Py_None);
        return Py_None;
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL)
        op->func_doc = Py_None; /* Mark as deleted */
    else
        op->func_doc = value;
    Py_INCREF(op->func_doc);
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (op->func_name == NULL) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (value == NULL || !PyUnicode_Check(value)) {
#else
    if (value == NULL || !PyString_Check(value)) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (op->func_dict == NULL) {
        op->func_dict = PyDict_New();
        if (op->func_dict == NULL)
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    PyObject* dict = PyModule_GetDict(__pyx_m);
    Py_XINCREF(dict);
    return dict;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op)
{
    if (op->defaults_tuple) {
        Py_INCREF(op->defaults_tuple);
        return op->defaults_tuple;
    }
    if (op->defaults_getter) {
        PyObject *res = op->defaults_getter((PyObject *) op);
        if (res) {
            Py_INCREF(res);
            op->defaults_tuple = res;
        }
        return res;
    }
    Py_INCREF(Py_None);
    return Py_None;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
                                      PyObject *closure, PyObject *module, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    op->func_weakreflist = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_getter = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (m->func_weakreflist != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return PyMethod_New(func,
                            type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *func_name = __Pyx_CyFunction_get_name(op);
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                func_name, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(func_name), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
    sizeof(__pyx_CyFunctionObject),   /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    (reprfunc) __Pyx_CyFunction_repr,   /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    __Pyx_CyFunction_Call,              /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_CyFunction_traverse,   /*tp_traverse*/
    (inquiry) __Pyx_CyFunction_clear,   /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    0,                                  /*tp_iternext*/
    __pyx_CyFunction_methods,           /*tp_methods*/
    __pyx_CyFunction_members,           /*tp_members*/
    __pyx_CyFunction_getsets,           /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    __Pyx_CyFunction_descr_get,         /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    0,                                  /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    if (PyType_Ready(&__pyx_CyFunctionType_type) < 0)
        return -1;
    __pyx_CyFunctionType = &__pyx_CyFunctionType_type;
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, sizeof(size));
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        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)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else /* Python 3 has a print function */
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!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 (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else /* Python 3 has a print function */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    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_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#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;
    py_name = __Pyx_PyIdentifier_FromString(name);
    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

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    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 (!strict && (size_t)((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if ((size_t)((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C function %s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3 && PY_MINOR_VERSION==0)
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #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_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*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,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) 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 = py_line;
    PyTraceBack_Here(py_frame);
bad:
    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->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_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *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 CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_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 CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
