/* Generated by Cython 0.29.21 */

#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_21"
#define CYTHON_HEX_VERSION 0x001D15F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#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
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#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_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#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
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif 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

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #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
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #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
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#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_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #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_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#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
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#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
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  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
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__mpfmc__core__audio__audio_interface
#define __PYX_HAVE_API__mpfmc__core__audio__audio_interface
/* Early includes */
#include <string.h>
#include <stdio.h>
#include "stdio.h"
#include "SDL.h"
#include "sdl2_helper.h"
#include "SDL_mixer.h"
#include "gst/gst.h"
#include "glib.h"
#include "gstreamer_helper.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 1
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING "utf-8"
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#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))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
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[] = {
  "mpfmc\\core\\audio\\audio_interface.pyx",
  "stringsource",
  "mpfmc\\core\\audio\\track.pxd",
  "mpfmc\\core\\audio\\sound_file.pxd",
  "mpfmc\\core\\audio\\track_standard.pxd",
  "mpfmc\\core\\audio\\track_sound_loop.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_5mpfmc_4core_5audio_5track_Track;
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundFile;
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile;
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile;
struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard;
struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr;
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr;
struct __pyx_t_5mpfmc_4core_5audio_4sdl2_Sample16Bytes;
union __pyx_t_5mpfmc_4core_5audio_4sdl2_Sample16;
struct __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData;
typedef struct __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData;

/* "mpfmc/core/audio/sdl2.pxd":231
 * # specific data structures used in the MPF media controller audio library:
 * 
 * cdef struct Sample16Bytes:             # <<<<<<<<<<<<<<
 *     # Structure that represents two bytes of a 16-bit sample.  This is used in
 *     # the union below (nested structs are not permitted in Cython so it is
 */
struct __pyx_t_5mpfmc_4core_5audio_4sdl2_Sample16Bytes {
  Uint8 byte0;
  Uint8 byte1;
};

/* "mpfmc/core/audio/sdl2.pxd":238
 *     Uint8 byte1
 * 
 * cdef union Sample16:             # <<<<<<<<<<<<<<
 *     # Union structure that represents a single 16-bit sample value.  A union is
 *     # utilized to make it easy to access the individual bytes in the sample.
 */
union __pyx_t_5mpfmc_4core_5audio_4sdl2_Sample16 {
  Sint16 value;
  struct __pyx_t_5mpfmc_4core_5audio_4sdl2_Sample16Bytes bytes;
};

/* "mpfmc/core/audio/sdl2.pxd":251
 * # ---------------------------------------------------------------------------
 * 
 * ctypedef struct AudioCallbackData:             # <<<<<<<<<<<<<<
 *     # A pointer to this struct is passed to the main audio callback function and
 *     # is the only way data is made available to the main audio thread.  Must not
 */
struct __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData {
  SDL_AudioFormat format;
  int sample_rate;
  int channels;
  Uint16 buffer_samples;
  Uint32 buffer_size;
  Uint16 bytes_per_control_point;
  Uint8 bytes_per_sample;
  double seconds_to_bytes_factor;
  Uint8 quick_fade_steps;
  Uint8 master_volume;
  Uint8 silence;
  Uint8 track_count;
  void **tracks;
  FILE *c_log_file;
};
struct __pyx_t_5mpfmc_4core_5audio_5track_TrackState;
typedef struct __pyx_t_5mpfmc_4core_5audio_5track_TrackState __pyx_t_5mpfmc_4core_5audio_5track_TrackState;

/* "mpfmc/core/audio/track.pxd":10
 * 
 * # The number of control points per audio buffer (sets control rate for ducking)
 * cdef enum:             # <<<<<<<<<<<<<<
 *     CONTROL_POINTS_PER_BUFFER = 8
 * 
 */
enum  {
  __pyx_e_5mpfmc_4core_5audio_5track_CONTROL_POINTS_PER_BUFFER = 8
};

/* "mpfmc/core/audio/track.pxd":13
 *     CONTROL_POINTS_PER_BUFFER = 8
 * 
 * cdef enum:             # <<<<<<<<<<<<<<
 *     MAX_SIMULTANEOUS_SOUNDS_DEFAULT = 8
 * 
 */
enum  {
  __pyx_e_5mpfmc_4core_5audio_5track_MAX_SIMULTANEOUS_SOUNDS_DEFAULT = 8
};

/* "mpfmc/core/audio/track.pxd":16
 *     MAX_SIMULTANEOUS_SOUNDS_DEFAULT = 8
 * 
 * cdef enum:             # <<<<<<<<<<<<<<
 *     MAX_SIMULTANEOUS_SOUNDS_LIMIT = 32
 * 
 */
enum  {
  __pyx_e_5mpfmc_4core_5audio_5track_MAX_SIMULTANEOUS_SOUNDS_LIMIT = 32
};

/* "mpfmc/core/audio/track.pxd":20
 * 
 * 
 * cdef enum TrackStatus:             # <<<<<<<<<<<<<<
 *     track_status_stopped = 0
 *     track_status_stopping = 1
 */
enum __pyx_t_5mpfmc_4core_5audio_5track_TrackStatus {
  __pyx_e_5mpfmc_4core_5audio_5track_track_status_stopped = 0,
  __pyx_e_5mpfmc_4core_5audio_5track_track_status_stopping = 1,
  __pyx_e_5mpfmc_4core_5audio_5track_track_status_playing = 2,
  __pyx_e_5mpfmc_4core_5audio_5track_track_status_pausing = 3,
  __pyx_e_5mpfmc_4core_5audio_5track_track_status_paused = 4
};

/* "mpfmc/core/audio/track.pxd":27
 *     track_status_paused = 4
 * 
 * ctypedef struct TrackState:             # <<<<<<<<<<<<<<
 *     # Common track state variables (for all track types)
 *     AudioCallbackData *callback_data
 */
struct __pyx_t_5mpfmc_4core_5audio_5track_TrackState {
  __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *callback_data;
  void (*mix_callback_function)(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *, Uint32, __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *);
  void *type_state;
  enum __pyx_t_5mpfmc_4core_5audio_5track_TrackStatus status;
  int active;
  int number;
  Uint8 volume;
  Uint8 fade_volume_start;
  Uint8 fade_volume_target;
  Uint8 fade_volume_current;
  Uint32 fade_steps;
  Uint32 fade_steps_remaining;
  int buffer_size;
  Uint8 *buffer;
  GSList *notification_messages;
  int ducking_is_active;
  GArray *ducking_control_points;
};
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleMemory;
typedef struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleMemory __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleMemory;
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleStream;
typedef struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleStream __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleStream;
union __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSampleData;
typedef union __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSampleData __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSampleData;
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample;
typedef struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample;

/* "mpfmc/core/audio/sound_file.pxd":19
 *     gint null_buffer_count
 * 
 * cdef enum SoundType:             # <<<<<<<<<<<<<<
 *     sound_type_memory = 0
 *     sound_type_streaming = 1
 */
enum __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundType {
  __pyx_e_5mpfmc_4core_5audio_10sound_file_sound_type_memory = 0,
  __pyx_e_5mpfmc_4core_5audio_10sound_file_sound_type_streaming = 1
};

/* "mpfmc/core/audio/sound_file.pxd":5
 * 
 * 
 * ctypedef struct SampleMemory:             # <<<<<<<<<<<<<<
 *     gpointer data
 *     gsize size
 */
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleMemory {
  gpointer data;
  gsize size;
};

/* "mpfmc/core/audio/sound_file.pxd":9
 *     gsize size
 * 
 * ctypedef struct SampleStream:             # <<<<<<<<<<<<<<
 *     GstElement *pipeline
 *     GstElement *sink
 */
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleStream {
  GstElement *pipeline;
  GstElement *sink;
  GstSample *sample;
  GstBuffer *buffer;
  GstMapInfo map_info;
  Uint32 map_buffer_pos;
  gboolean map_contains_valid_sample_data;
  gint null_buffer_count;
};

/* "mpfmc/core/audio/sound_file.pxd":23
 *     sound_type_streaming = 1
 * 
 * ctypedef union SoundSampleData:             # <<<<<<<<<<<<<<
 *     SampleMemory *memory
 *     SampleStream *stream
 */
union __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSampleData {
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleMemory *memory;
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SampleStream *stream;
};

/* "mpfmc/core/audio/sound_file.pxd":27
 *     SampleStream *stream
 * 
 * ctypedef struct SoundSample:             # <<<<<<<<<<<<<<
 *     SoundType type
 *     SoundSampleData data
 */
struct __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample {
  enum __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundType type;
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSampleData data;
  double duration;
  Uint32 size;
};
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataLooping;
typedef struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataLooping __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataLooping;
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataMarker;
typedef struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataMarker __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataMarker;
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageSoundLoopSet;
typedef struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageSoundLoopSet __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageSoundLoopSet;
union __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageData;
typedef union __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageData __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageData;
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer;
typedef struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer;

/* "mpfmc/core/audio/notification_message.pxd":10
 * # ---------------------------------------------------------------------------
 * 
 * cdef enum NotificationMessage:             # <<<<<<<<<<<<<<
 *     notification_sound_started = 1            # Notification that a sound has started playing
 *     notification_sound_stopped = 2            # Notification that a sound has stopped
 */
enum __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessage {
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_started = 1,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_stopped = 2,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_looping = 3,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_marker = 4,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_about_to_finish = 5,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_player_idle = 10,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_track_stopped = 0,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_track_paused = 21,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_started = 31,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_stopped = 32,
  __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_looping = 33
};

/* "mpfmc/core/audio/notification_message.pxd":23
 *     notification_sound_loop_set_looping = 33  # Notification that a sound_loop_set is looping back to the beginning
 * 
 * ctypedef struct NotificationMessageDataLooping:             # <<<<<<<<<<<<<<
 *     int loop_count
 *     int loops_remaining
 */
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataLooping {
  int loop_count;
  int loops_remaining;
};

/* "mpfmc/core/audio/notification_message.pxd":27
 *     int loops_remaining
 * 
 * ctypedef struct NotificationMessageDataMarker:             # <<<<<<<<<<<<<<
 *     int id
 * 
 */
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataMarker {
  int id;
};

/* "mpfmc/core/audio/notification_message.pxd":30
 *     int id
 * 
 * ctypedef struct NotificationMessageSoundLoopSet:             # <<<<<<<<<<<<<<
 *     long id
 *     gpointer player
 */
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageSoundLoopSet {
  long id;
  gpointer player;
};

/* "mpfmc/core/audio/notification_message.pxd":35
 * 
 * 
 * ctypedef union NotificationMessageData:             # <<<<<<<<<<<<<<
 *     NotificationMessageDataLooping looping
 *     NotificationMessageDataMarker marker
 */
union __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageData {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataLooping looping;
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageDataMarker marker;
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageSoundLoopSet sound_loop_set;
};

/* "mpfmc/core/audio/notification_message.pxd":40
 *     NotificationMessageSoundLoopSet sound_loop_set
 * 
 * ctypedef struct NotificationMessageContainer:             # <<<<<<<<<<<<<<
 *     NotificationMessage message
 *     Uint64 sound_id
 */
struct __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer {
  enum __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessage message;
  Uint64 sound_id;
  Uint64 sound_instance_id;
  int player;
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageData data;
};
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_TrackStandardState;
typedef struct __pyx_t_5mpfmc_4core_5audio_14track_standard_TrackStandardState __pyx_t_5mpfmc_4core_5audio_14track_standard_TrackStandardState;
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingSettings;
typedef struct __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingSettings __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingSettings;
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings;
typedef struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings;
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer;
typedef struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer;
struct __pyx_opt_args_5mpfmc_4core_5audio_14track_standard_13TrackStandard__play_sound_on_sound_player;

/* "mpfmc/core/audio/track_standard.pxd":12
 * # ---------------------------------------------------------------------------
 * 
 * cdef enum:             # <<<<<<<<<<<<<<
 *     no_marker = 0xFFFFFFFF
 * 
 */
enum  {
  __pyx_e_5mpfmc_4core_5audio_14track_standard_no_marker = 0xFFFFFFFF
};

/* "mpfmc/core/audio/track_standard.pxd":20
 *     SoundPlayer *sound_players
 * 
 * cdef enum SoundPlayerStatus:             # <<<<<<<<<<<<<<
 *     # Enumeration of the possible sound player status values.
 *     player_idle = 0
 */
enum __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayerStatus {
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_idle = 0,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_pending = 1,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_replacing = 2,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_fading_in = 3,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_fading_out = 4,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_playing = 5,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_finished = 6,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_player_stopping = 7
};

/* "mpfmc/core/audio/track_standard.pxd":39
 *     Sint32 release_duration
 * 
 * cdef enum DuckingStage:             # <<<<<<<<<<<<<<
 *     ducking_stage_idle = 0
 *     ducking_stage_delay = 1
 */
enum __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingStage {
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_idle = 0,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_delay = 1,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_attack = 2,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_hold = 3,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_release = 4,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_ducking_stage_finished = 5
};

/* "mpfmc/core/audio/track_standard.pxd":47
 *     ducking_stage_finished = 5
 * 
 * cdef enum FadingStatus:             # <<<<<<<<<<<<<<
 *     fading_status_not_fading = 0
 *     fading_status_fading_in = 1
 */
enum __pyx_t_5mpfmc_4core_5audio_14track_standard_FadingStatus {
  __pyx_e_5mpfmc_4core_5audio_14track_standard_fading_status_not_fading = 0,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_fading_status_fading_in = 1,
  __pyx_e_5mpfmc_4core_5audio_14track_standard_fading_status_fading_out = 2
};

/* "mpfmc/core/audio/track_standard.pxd":15
 *     no_marker = 0xFFFFFFFF
 * 
 * ctypedef struct TrackStandardState:             # <<<<<<<<<<<<<<
 *     # State variables for TrackStandard tracks
 *     int sound_player_count
 */
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_TrackStandardState {
  int sound_player_count;
  __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer *sound_players;
};

/* "mpfmc/core/audio/track_standard.pxd":31
 *     player_stopping = 7
 * 
 * ctypedef struct DuckingSettings:             # <<<<<<<<<<<<<<
 *     int track_bit_mask
 *     Sint32 attack_start_pos
 */
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingSettings {
  int track_bit_mask;
  Sint32 attack_start_pos;
  Sint32 attack_duration;
  Uint8 attenuation_volume;
  Sint32 release_start_pos;
  Sint32 release_duration;
};

/* "mpfmc/core/audio/track_standard.pxd":52
 *     fading_status_fading_out = 2
 * 
 * ctypedef struct SoundSettings:             # <<<<<<<<<<<<<<
 *     SoundSample *sample
 *     Uint8 volume
 */
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings {
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample *sample;
  Uint8 volume;
  Uint8 volume_left;
  Uint8 volume_right;
  int loops_remaining;
  int current_loop;
  Uint32 sample_pos;
  Uint32 loop_start_pos;
  Uint32 loop_end_pos;
  Uint64 sound_id;
  Uint64 sound_instance_id;
  int sound_priority;
  enum __pyx_t_5mpfmc_4core_5audio_14track_standard_FadingStatus fading_status;
  Uint32 fade_in_steps;
  Uint32 fade_out_steps;
  Uint32 fade_steps_remaining;
  Uint8 marker_count;
  GArray *markers;
  Uint32 about_to_finish_marker;
  int sound_has_ducking;
  __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingSettings ducking_settings;
  enum __pyx_t_5mpfmc_4core_5audio_14track_standard_DuckingStage ducking_stage;
  GArray *ducking_control_points;
};

/* "mpfmc/core/audio/track_standard.pxd":77
 *     GArray *ducking_control_points
 * 
 * ctypedef struct SoundPlayer:             # <<<<<<<<<<<<<<
 *     # The SoundPlayer keeps track of the current sample position in the source audio
 *     # samples and is also keeps track of variables for sound looping and determining when the
 */
struct __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer {
  enum __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayerStatus status;
  __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings current;
  __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings next;
  int track_num;
  int number;
};

/* "mpfmc/core/audio/track_standard.pxd":108
 *     cdef process_notification_message(self, NotificationMessageContainer *notification_message)
 *     cdef tuple _get_sound_player_with_lowest_priority(self)
 *     cdef bint _play_sound_on_sound_player(self, sound_instance, int player, bint force=?)             # <<<<<<<<<<<<<<
 *     cdef _set_player_sound_settings(self, SoundSettings *sound_settings, object sound_instance)
 *     cdef _set_player_playing(self, SoundPlayer *player, object sound_instance)
 */
struct __pyx_opt_args_5mpfmc_4core_5audio_14track_standard_13TrackStandard__play_sound_on_sound_player {
  int __pyx_n;
  int force;
};
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings;
typedef struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings;
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer;
typedef struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer;
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoopState;
typedef struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoopState __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoopState;

/* "mpfmc/core/audio/track_sound_loop.pxd":11
 * #    Sound Loop Track types
 * # ---------------------------------------------------------------------------
 * cdef enum:             # <<<<<<<<<<<<<<
 *     do_not_stop_loop = 0xFFFFFFFF
 * 
 */
enum  {
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_do_not_stop_loop = 0xFFFFFFFF
};

/* "mpfmc/core/audio/track_sound_loop.pxd":14
 *     do_not_stop_loop = 0xFFFFFFFF
 * 
 * cdef enum LayerStatus:             # <<<<<<<<<<<<<<
 *     layer_stopped = 0
 *     layer_queued = 1
 */
enum __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_LayerStatus {
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_layer_stopped = 0,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_layer_queued = 1,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_layer_playing = 2,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_layer_fading_in = 3,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_layer_fading_out = 4
};

/* "mpfmc/core/audio/track_sound_loop.pxd":34
 *     GArray *markers
 * 
 * cdef enum SoundLoopSetPlayerStatus:             # <<<<<<<<<<<<<<
 *     # Enumeration of the possible sound loop set player status values.
 *     player_idle = 0
 */
enum __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayerStatus {
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_player_idle = 0,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_player_delayed = 1,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_player_fading_in = 2,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_player_fading_out = 3,
  __pyx_e_5mpfmc_4core_5audio_16track_sound_loop_player_playing = 4
};

/* "mpfmc/core/audio/track_sound_loop.pxd":21
 *     layer_fading_out = 4
 * 
 * ctypedef struct SoundLoopLayerSettings:             # <<<<<<<<<<<<<<
 *     LayerStatus status
 *     SoundSample *sound
 */
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings {
  enum __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_LayerStatus status;
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample *sound;
  Uint8 volume;
  long sound_loop_set_id;
  Uint64 sound_id;
  Uint32 fade_in_steps;
  Uint32 fade_out_steps;
  Uint32 fade_steps_remaining;
  int looping;
  Uint8 marker_count;
  GArray *markers;
};

/* "mpfmc/core/audio/track_sound_loop.pxd":42
 *     player_playing = 4
 * 
 * ctypedef struct SoundLoopSetPlayer:             # <<<<<<<<<<<<<<
 *     SoundLoopSetPlayerStatus status
 *     Uint32 length
 */
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer {
  enum __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayerStatus status;
  Uint32 length;
  __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings master_sound_layer;
  GSList *layers;
  Uint32 sample_pos;
  Uint32 stop_loop_samples_remaining;
  Uint32 start_delay_samples_remaining;
  float tempo;
};

/* "mpfmc/core/audio/track_sound_loop.pxd":52
 *     float tempo
 * 
 * ctypedef struct TrackSoundLoopState:             # <<<<<<<<<<<<<<
 *     # State variables for TrackSoundLoop tracks
 *     GSList *players
 */
struct __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoopState {
  GSList *players;
  __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer *current;
};

/* "mpfmc/core/audio/track.pxd":51
 * #    Track base class
 * # ---------------------------------------------------------------------------
 * cdef class Track:             # <<<<<<<<<<<<<<
 * 
 *     cdef str _name
 */
struct __pyx_obj_5mpfmc_4core_5audio_5track_Track {
  PyObject_HEAD
  struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track *__pyx_vtab;
  PyObject *_name;
  int _number;
  PyObject *_events_when_stopped;
  PyObject *_events_when_played;
  PyObject *_events_when_paused;
  PyObject *mc;
  SDL_AudioDeviceID device_id;
  PyObject *log;
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *state;
};


/* "mpfmc/core/audio/sound_file.pxd":34
 * 
 * 
 * cdef class SoundFile:             # <<<<<<<<<<<<<<
 *     """SoundFile is the base class for wrapper classes used to manage sound sample data."""
 *     cdef str file_name
 */
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundFile {
  PyObject_HEAD
  PyObject *file_name;
  __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *callback_data;
  __pyx_t_5mpfmc_4core_5audio_10sound_file_SoundSample sample;
  PyObject *log;
};


/* "mpfmc/core/audio/sound_file.pxd":42
 * 
 * 
 * cdef class SoundMemoryFile(SoundFile):             # <<<<<<<<<<<<<<
 *     """SoundMemoryFile is a wrapper class to manage sound sample data stored
 *     in memory."""
 */
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile {
  struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundFile __pyx_base;
  int _loaded_using_sdl;
};


/* "mpfmc/core/audio/sound_file.pxd":48
 * 
 * 
 * cdef class SoundStreamingFile(SoundFile):             # <<<<<<<<<<<<<<
 *     """SoundStreamingFile is a wrapper class to manage streaming sound sample data."""
 *     cdef GstElement *pipeline
 */
struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile {
  struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundFile __pyx_base;
  GstElement *pipeline;
  GstElement *source;
  GstElement *convert;
  GstElement *resample;
  GstElement *sink;
  GstBus *bus;
  gulong bus_message_handler_id;
};


/* "mpfmc/core/audio/track_standard.pxd":91
 * #    TrackStandard class
 * # ---------------------------------------------------------------------------
 * cdef class TrackStandard(Track):             # <<<<<<<<<<<<<<
 * 
 *     cdef list _sound_queue
 */
struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard {
  struct __pyx_obj_5mpfmc_4core_5audio_5track_Track __pyx_base;
  PyObject *_sound_queue;
  PyObject *_playing_instances_by_id;
  int _max_simultaneous_sounds;
  __pyx_t_5mpfmc_4core_5audio_14track_standard_TrackStandardState *type_state;
};


/* "mpfmc/core/audio/track_sound_loop.pxd":61
 * #    TrackSoundLoop class
 * # ---------------------------------------------------------------------------
 * cdef class TrackSoundLoop(Track):             # <<<<<<<<<<<<<<
 * 
 *     # Track state needs to be stored in a C struct in order for them to be accessible in
 */
struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop {
  struct __pyx_obj_5mpfmc_4core_5audio_5track_Track __pyx_base;
  __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoopState *type_state;
  long _sound_loop_set_counter;
  PyObject *_active_sound_loop_sets;
};


/* "mpfmc/core/audio/audio_interface.pyx":66
 * #    AudioInterface class
 * # ---------------------------------------------------------------------------
 * cdef class AudioInterface:             # <<<<<<<<<<<<<<
 *     """
 *     The AudioInterface class provides a management wrapper around the SDL2 and SDL_Mixer
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface {
  PyObject_HEAD
  struct __pyx_vtabstruct_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_vtab;
  PyObject *tracks;
  PyObject *playlist_controllers;
  PyObject *mc;
  PyObject *log;
  __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData audio_callback_data;
};


/* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain {
  PyObject_HEAD
  PyObject *__pyx_v_gain_string;
};


/* "mpfmc/core/audio/audio_interface.pyx":249
 * 
 *         if gain_string.endswith('DB'):
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};


/* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs {
  PyObject_HEAD
  PyObject *__pyx_v_time_string;
};


/* "mpfmc/core/audio/audio_interface.pyx":288
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) / 1000.0
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};


/* "mpfmc/core/audio/audio_interface.pyx":292
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string)
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};


/* "mpfmc/core/audio/audio_interface.pyx":296
 * 
 *         elif 'D' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 86400
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};


/* "mpfmc/core/audio/audio_interface.pyx":300
 * 
 *         elif 'H' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 3600
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};


/* "mpfmc/core/audio/audio_interface.pyx":304
 * 
 *         elif 'M' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 60
 * 
 */
struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_outer_scope;
  Py_UCS4 __pyx_v_i;
};



/* "mpfmc/core/audio/track.pxd":51
 * #    Track base class
 * # ---------------------------------------------------------------------------
 * cdef class Track:             # <<<<<<<<<<<<<<
 * 
 *     cdef str _name
 */

struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track {
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *(*get_state)(struct __pyx_obj_5mpfmc_4core_5audio_5track_Track *);
  void (*mix_track_to_output)(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *, __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *, Uint8 *, Uint32);
  void (*mix_audio)(Uint8 *, Uint8 const *, Uint32, int);
  void (*mix_audio_stereo)(Uint8 *, Uint8 const *, Uint32, int, int);
  void (*apply_volume)(Uint8 *, Uint8 const *, Uint32, int);
  void (*apply_volume_stereo)(Uint8 *, Uint8 const *, Uint32, int, int);
};
static struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track *__pyx_vtabptr_5mpfmc_4core_5audio_5track_Track;


/* "mpfmc/core/audio/track_standard.pxd":91
 * #    TrackStandard class
 * # ---------------------------------------------------------------------------
 * cdef class TrackStandard(Track):             # <<<<<<<<<<<<<<
 * 
 *     cdef list _sound_queue
 */

struct __pyx_vtabstruct_5mpfmc_4core_5audio_14track_standard_TrackStandard {
  struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track __pyx_base;
  int (*_get_playing_sound_count)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, Uint64);
  PyObject *(*_get_playing_sound_instances)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, Uint64);
  int (*_get_idle_sound_player)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *);
  PyObject *(*process_notification_message)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *);
  PyObject *(*_get_sound_player_with_lowest_priority)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *);
  int (*_play_sound_on_sound_player)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, PyObject *, int, struct __pyx_opt_args_5mpfmc_4core_5audio_14track_standard_13TrackStandard__play_sound_on_sound_player *__pyx_optional_args);
  PyObject *(*_set_player_sound_settings)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundSettings *, PyObject *);
  PyObject *(*_set_player_playing)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer *, PyObject *);
  PyObject *(*_set_player_replacing)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, __pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer *, PyObject *);
  int (*_get_player_playing_sound_instance)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, PyObject *);
  Uint32 (*_fix_sample_frame_pos)(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *, Uint32, Uint8, int);
  void (*mix_playing_sounds)(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *, Uint32, __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *);
};
static struct __pyx_vtabstruct_5mpfmc_4core_5audio_14track_standard_TrackStandard *__pyx_vtabptr_5mpfmc_4core_5audio_14track_standard_TrackStandard;


/* "mpfmc/core/audio/track_sound_loop.pxd":61
 * #    TrackSoundLoop class
 * # ---------------------------------------------------------------------------
 * cdef class TrackSoundLoop(Track):             # <<<<<<<<<<<<<<
 * 
 *     # Track state needs to be stored in a C struct in order for them to be accessible in
 */

struct __pyx_vtabstruct_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop {
  struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track __pyx_base;
  PyObject *(*process_notification_message)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *);
  PyObject *(*_apply_layer_settings)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopLayerSettings *, PyObject *);
  PyObject *(*_initialize_player)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer *);
  PyObject *(*_delete_player)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer *);
  PyObject *(*_delete_player_layers)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, __pyx_t_5mpfmc_4core_5audio_16track_sound_loop_SoundLoopSetPlayer *);
  PyObject *(*_cancel_all_delayed_players)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *);
  PyObject *(*_fade_out_all_players)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, Uint32);
  Uint32 (*_round_sample_pos_up_to_interval)(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *, Uint32, Uint32, int);
  void (*mix_playing_sounds)(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *, Uint32, __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *);
};
static struct __pyx_vtabstruct_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *__pyx_vtabptr_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop;


/* "mpfmc/core/audio/audio_interface.pyx":66
 * #    AudioInterface class
 * # ---------------------------------------------------------------------------
 * cdef class AudioInterface:             # <<<<<<<<<<<<<<
 *     """
 *     The AudioInterface class provides a management wrapper around the SDL2 and SDL_Mixer
 */

struct __pyx_vtabstruct_5mpfmc_4core_5audio_15audio_interface_AudioInterface {
  PyObject *(*write_gst_log_message)(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *, PyObject *, PyObject *);
  void (*audio_callback)(void *, Uint8 *, int);
};
static struct __pyx_vtabstruct_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_vtabptr_5mpfmc_4core_5audio_15audio_interface_AudioInterface;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#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);
  #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
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#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)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

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

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

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* RaiseArgTupleInvalid.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);

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* None.proto */
static CYTHON_INLINE int __Pyx_div_int(int, int);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

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

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

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

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* unicode_iter.proto */
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
    PyObject* ustring, Py_ssize_t *length, void** data, int *kind);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_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);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(
    PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* PyIntFromDouble.proto */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
#else
#define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
#endif

/* PyUnicodeContains.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
    int result = PyUnicode_Contains(text, substring);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
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) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

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

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

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

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* ClassMethod.proto */
#include "descrobject.h"
static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __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);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint16(Uint16 value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint32(Uint32 value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint8(Uint8 value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE Uint16 __Pyx_PyInt_As_Uint16(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE Uint8 __Pyx_PyInt_As_Uint8(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

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

static PyObject *__pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_write_gst_log_message(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_message_type, PyObject *__pyx_v_message); /* proto*/
static void __pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_audio_callback(void *__pyx_v_data, Uint8 *__pyx_v_output_buffer, int __pyx_v_length); /* proto*/

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

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

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

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

/* Module declarations from 'mpfmc.core.audio.sdl2' */

/* Module declarations from 'mpfmc.core.audio.gstreamer' */

/* Module declarations from 'mpfmc.core.audio.track' */
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_5track_Track = 0;

/* Module declarations from 'mpfmc.core.audio.sound_file' */
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundFile = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile = 0;

/* Module declarations from 'mpfmc.core.audio.notification_message' */
static CYTHON_INLINE __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message(void); /*proto*/
static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_looping_notification(int, Uint64, Uint64, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *); /*proto*/

/* Module declarations from 'mpfmc.core.audio.track_standard' */
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard = 0;

/* Module declarations from 'mpfmc.core.audio.track_sound_loop' */
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop = 0;

/* Module declarations from 'mpfmc.core.audio.audio_interface' */
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr = 0;
static PyTypeObject *__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr = 0;
#define __Pyx_MODULE_NAME "mpfmc.core.audio.audio_interface"
extern int __pyx_module_is_main_mpfmc__core__audio__audio_interface;
int __pyx_module_is_main_mpfmc__core__audio__audio_interface = 0;

/* Implementation of 'mpfmc.core.audio.audio_interface' */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static const char __pyx_k_[] = "";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_M[] = "M";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_DB[] = "DB";
static const char __pyx_k_MS[] = "MS";
static const char __pyx_k_db[] = "db";
static const char __pyx_k_mc[] = "mc";
static const char __pyx_k_SDL[] = "SDL {}.{}.{}";
static const char __pyx_k_SEC[] = "SEC";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_ogg[] = "ogg";
static const char __pyx_k_pow[] = "pow";
static const char __pyx_k_wav[] = "wav";
static const char __pyx_k_GLib[] = "GLib {}.{}.{}";
static const char __pyx_k_MSEC[] = "MSEC";
static const char __pyx_k_NONE[] = "NONE";
static const char __pyx_k_argc[] = "argc";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_argv[] = "argv";
static const char __pyx_k_flac[] = "flac";
static const char __pyx_k_gain[] = "gain";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_nano[] = "nano";
static const char __pyx_k_rate[] = "rate";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_micro[] = "micro";
static const char __pyx_k_minor[] = "minor";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_sound[] = "sound";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_unload[] = "unload";
static const char __pyx_k_volume[] = "volume";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_enabled[] = "enabled";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_process[] = "process";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Loaded_s[] = "Loaded %s";
static const char __pyx_k_channels[] = "channels";
static const char __pyx_k_fade_out[] = "fade_out";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_gst_init[] = "_gst_init";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_shutdown[] = "shutdown";
static const char __pyx_k_GStreamer[] = "GStreamer {}.{}.{}.{}";
static const char __pyx_k_SDL_Mixer[] = "SDL_Mixer {}.{}.{}";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_db_to_gain[] = "db_to_gain";
static const char __pyx_k_initialize[] = "initialize";
static const char __pyx_k_max_layers[] = "max_layers";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_stop_sound[] = "stop_sound";
static const char __pyx_k_Initialized[] = "Initialized";
static const char __pyx_k_buffer_size[] = "buffer_size";
static const char __pyx_k_gain_string[] = "gain_string";
static const char __pyx_k_sample_rate[] = "sample_rate";
static const char __pyx_k_time_string[] = "time_string";
static const char __pyx_k_power_of_two[] = "power_of_two";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_clear_context[] = "clear_context";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_AudioException[] = "AudioException";
static const char __pyx_k_AudioInterface[] = "AudioInterface";
static const char __pyx_k_audio_channels[] = "audio_channels";
static const char __pyx_k_buffer_samples[] = "buffer_samples";
static const char __pyx_k_crossfade_time[] = "crossfade_time";
static const char __pyx_k_get_max_tracks[] = "get_max_tracks";
static const char __pyx_k_sound_instance[] = "sound_instance";
static const char __pyx_k_string_to_gain[] = "string_to_gain";
static const char __pyx_k_string_to_secs[] = "string_to_secs";
static const char __pyx_k_get_gst_version[] = "get_gst_version";
static const char __pyx_k_get_max_markers[] = "get_max_markers";
static const char __pyx_k_get_sdl_version[] = "get_sdl_version";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_stop_all_sounds[] = "stop_all_sounds";
static const char __pyx_k_bytes_per_sample[] = "bytes_per_sample";
static const char __pyx_k_fade_out_seconds[] = "fade_out_seconds";
static const char __pyx_k_get_glib_version[] = "get_glib_version";
static const char __pyx_k_get_track_by_name[] = "get_track_by_name";
static const char __pyx_k_PlaylistController[] = "PlaylistController";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_stop_sound_looping[] = "stop_sound_looping";
static const char __pyx_k_stop_sound_instance[] = "stop_sound_instance";
static const char __pyx_k_initialize_gstreamer[] = "_initialize_gstreamer";
static const char __pyx_k_Mix_OpenAudio_error_s[] = "Mix_OpenAudio error - %s";
static const char __pyx_k_get_gstreamer_version[] = "get_gstreamer_version";
static const char __pyx_k_get_sdl_mixer_version[] = "get_sdl_mixer_version";
static const char __pyx_k_Enabling_audio_playback[] = "Enabling audio playback";
static const char __pyx_k_max_simultaneous_sounds[] = "max_simultaneous_sounds";
static const char __pyx_k_seconds_to_bytes_factor[] = "seconds_to_bytes_factor";
static const char __pyx_k_Disabling_audio_playback[] = "Disabling audio playback";
static const char __pyx_k_audio_interface_instance[] = "audio_interface_instance";
static const char __pyx_k_SDL_InitSubSystem_error_s[] = "SDL_InitSubSystem error - %s";
static const char __pyx_k_stop_sound_instance_looping[] = "stop_sound_instance_looping";
static const char __pyx_k_string_to_gain_locals_genexpr[] = "string_to_gain.<locals>.genexpr";
static const char __pyx_k_string_to_secs_locals_genexpr[] = "string_to_secs.<locals>.genexpr";
static const char __pyx_k_Add_track_failed_the_track_name[] = "Add track failed - the track name '%s' already exists.";
static const char __pyx_k_Audio_Library_This_library_requ[] = "\nAudio Library\n\nThis library requires the SDL2, SDL_Mixer, and Gstreamer libraries.\n";
static const char __pyx_k_Settings_in_use_rate_d_channels[] = "Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)";
static const char __pyx_k_Unable_to_open_audio_for_output[] = "Unable to open audio for output (Mix_OpenAudio failed: %s)";
static const char __pyx_k_Add_track_failed_the_maximum_num[] = "Add track failed - the maximum number of tracks (%d) has been reached.";
static const char __pyx_k_Buffer_samples_is_required_to_be[] = "Buffer samples is required to be a power of two";
static const char __pyx_k_Channels_is_required_to_be_eithe[] = "Channels is required to be either 1 (mono) or 2 (stereo)";
static const char __pyx_k_NOTE_You_may_experience_noise_an[] = "NOTE: You may experience noise and other undesirable sound artifacts when you set your buffer at 1024 or smaller.";
static const char __pyx_k_Settings_requested_rate_d_channe[] = "Settings requested - rate: %d, channels: %d, buffer: %d samples";
static const char __pyx_k_Shutting_down_and_cleaning_up_al[] = "Shutting down and cleaning up allocated memory...";
static const char __pyx_k_The_audio_interface_only_support[] = "The audio interface only supports little endian systems in this release. Audio features will not be available.";
static const char __pyx_k_The_s_live_loop_track_has_succes[] = "The '%s' live loop track has successfully been created.";
static const char __pyx_k_The_s_playlist_track_and_control[] = "The '%s' playlist track and controller have successfully been created.";
static const char __pyx_k_The_s_standard_track_has_success[] = "The '%s' standard track has successfully been created.";
static const char __pyx_k_Unable_to_initialize_Audio_Inter[] = "Unable to initialize Audio Interface: Channels is required to be either 1 (mono) or 2 (stereo)";
static const char __pyx_k_Unable_to_initialize_GStreamer_c[] = "Unable to initialize GStreamer: code={} message={}";
static const char __pyx_k_Unable_to_initialize_SDL_SDL_Ini[] = "Unable to initialize SDL (SDL_InitSubSystem call failed: %s)";
static const char __pyx_k_Unable_to_initialize_gstreamer_c[] = "Unable to initialize gstreamer: code={} message={}";
static const char __pyx_k_mpfmc_core_audio_audio_exception[] = "mpfmc.core.audio.audio_exception";
static const char __pyx_k_mpfmc_core_audio_audio_interface[] = "mpfmc.core.audio.audio_interface";
static const char __pyx_k_mpfmc_core_audio_playlist_contro[] = "mpfmc.core.audio.playlist_controller";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_The_audio_interface_only_support_2[] = "The audio interface only supports little endian systems in this release.";
static const char __pyx_k_Unable_to_initialize_Audio_Inter_2[] = "Unable to initialize Audio Interface: Buffer samples is required to be a power of two";
static const char __pyx_k_mpfmc_core_audio_audio_interface_2[] = "mpfmc\\core\\audio\\audio_interface.pyx";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_kp_u_Add_track_failed_the_maximum_num;
static PyObject *__pyx_kp_u_Add_track_failed_the_track_name;
static PyObject *__pyx_n_s_AudioException;
static PyObject *__pyx_n_s_AudioInterface;
static PyObject *__pyx_n_u_AudioInterface;
static PyObject *__pyx_kp_u_Buffer_samples_is_required_to_be;
static PyObject *__pyx_kp_u_Channels_is_required_to_be_eithe;
static PyObject *__pyx_n_u_D;
static PyObject *__pyx_n_u_DB;
static PyObject *__pyx_kp_u_Disabling_audio_playback;
static PyObject *__pyx_kp_u_Enabling_audio_playback;
static PyObject *__pyx_kp_u_GLib;
static PyObject *__pyx_kp_u_GStreamer;
static PyObject *__pyx_n_u_H;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_u_Initialized;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_u_Loaded_s;
static PyObject *__pyx_n_u_M;
static PyObject *__pyx_n_u_MS;
static PyObject *__pyx_n_u_MSEC;
static PyObject *__pyx_kp_u_Mix_OpenAudio_error_s;
static PyObject *__pyx_n_u_NONE;
static PyObject *__pyx_kp_u_NOTE_You_may_experience_noise_an;
static PyObject *__pyx_n_s_PlaylistController;
static PyObject *__pyx_n_u_S;
static PyObject *__pyx_kp_u_SDL;
static PyObject *__pyx_kp_u_SDL_InitSubSystem_error_s;
static PyObject *__pyx_kp_u_SDL_Mixer;
static PyObject *__pyx_n_u_SEC;
static PyObject *__pyx_kp_u_Settings_in_use_rate_d_channels;
static PyObject *__pyx_kp_u_Settings_requested_rate_d_channe;
static PyObject *__pyx_kp_u_Shutting_down_and_cleaning_up_al;
static PyObject *__pyx_kp_u_The_audio_interface_only_support;
static PyObject *__pyx_kp_u_The_audio_interface_only_support_2;
static PyObject *__pyx_kp_u_The_s_live_loop_track_has_succes;
static PyObject *__pyx_kp_u_The_s_playlist_track_and_control;
static PyObject *__pyx_kp_u_The_s_standard_track_has_success;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_u_Unable_to_initialize_Audio_Inter;
static PyObject *__pyx_kp_u_Unable_to_initialize_Audio_Inter_2;
static PyObject *__pyx_kp_u_Unable_to_initialize_GStreamer_c;
static PyObject *__pyx_kp_u_Unable_to_initialize_SDL_SDL_Ini;
static PyObject *__pyx_kp_u_Unable_to_initialize_gstreamer_c;
static PyObject *__pyx_kp_u_Unable_to_open_audio_for_output;
static PyObject *__pyx_n_s_argc;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_argv;
static PyObject *__pyx_n_u_audio_channels;
static PyObject *__pyx_n_s_audio_interface_instance;
static PyObject *__pyx_n_s_buffer_samples;
static PyObject *__pyx_n_u_buffer_samples;
static PyObject *__pyx_n_u_buffer_size;
static PyObject *__pyx_n_u_bytes_per_sample;
static PyObject *__pyx_n_s_channels;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clear_context;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_crossfade_time;
static PyObject *__pyx_n_s_db;
static PyObject *__pyx_n_s_db_to_gain;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_disable;
static PyObject *__pyx_n_s_enabled;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_u_error;
static PyObject *__pyx_n_s_fade_out;
static PyObject *__pyx_n_s_fade_out_seconds;
static PyObject *__pyx_n_u_flac;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_gain;
static PyObject *__pyx_n_s_gain_string;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_getLogger;
static PyObject *__pyx_n_s_get_glib_version;
static PyObject *__pyx_n_s_get_gst_version;
static PyObject *__pyx_n_s_get_gstreamer_version;
static PyObject *__pyx_n_s_get_max_markers;
static PyObject *__pyx_n_s_get_max_tracks;
static PyObject *__pyx_n_s_get_sdl_mixer_version;
static PyObject *__pyx_n_s_get_sdl_version;
static PyObject *__pyx_n_s_get_track_by_name;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_gst_init;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_u_info;
static PyObject *__pyx_n_s_initialize;
static PyObject *__pyx_n_s_initialize_gstreamer;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_major;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_max_layers;
static PyObject *__pyx_n_s_max_simultaneous_sounds;
static PyObject *__pyx_n_s_mc;
static PyObject *__pyx_n_s_micro;
static PyObject *__pyx_n_s_minor;
static PyObject *__pyx_n_s_mpfmc_core_audio_audio_exception;
static PyObject *__pyx_n_s_mpfmc_core_audio_audio_interface;
static PyObject *__pyx_kp_s_mpfmc_core_audio_audio_interface_2;
static PyObject *__pyx_n_s_mpfmc_core_audio_playlist_contro;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_nano;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_num;
static PyObject *__pyx_n_u_ogg;
static PyObject *__pyx_n_s_pow;
static PyObject *__pyx_n_s_power_of_two;
static PyObject *__pyx_n_s_process;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rate;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_u_sample_rate;
static PyObject *__pyx_n_u_seconds_to_bytes_factor;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shutdown;
static PyObject *__pyx_n_s_sound;
static PyObject *__pyx_n_s_sound_instance;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stop_all_sounds;
static PyObject *__pyx_n_s_stop_sound;
static PyObject *__pyx_n_u_stop_sound;
static PyObject *__pyx_n_s_stop_sound_instance;
static PyObject *__pyx_n_u_stop_sound_instance;
static PyObject *__pyx_n_s_stop_sound_instance_looping;
static PyObject *__pyx_n_u_stop_sound_instance_looping;
static PyObject *__pyx_n_s_stop_sound_looping;
static PyObject *__pyx_n_u_stop_sound_looping;
static PyObject *__pyx_n_s_string_to_gain;
static PyObject *__pyx_n_s_string_to_gain_locals_genexpr;
static PyObject *__pyx_n_s_string_to_secs;
static PyObject *__pyx_n_s_string_to_secs_locals_genexpr;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time_string;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_unload;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_volume;
static PyObject *__pyx_n_s_warning;
static PyObject *__pyx_n_u_warning;
static PyObject *__pyx_n_u_wav;
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface__gst_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_2get_gst_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface___cinit__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kw); /* proto */
static int __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_rate, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer_samples); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_4__del__(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_6_initialize_gstreamer(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize(int __pyx_v_rate, int __pyx_v_channels, int __pyx_v_buffer_samples, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two(int __pyx_v_num); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain(float __pyx_v_db); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain(PyObject *__pyx_v_gain); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_16convert_seconds_to_samples(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_seconds); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_18convert_seconds_to_buffer_length(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_seconds); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_20convert_buffer_length_to_seconds(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, int __pyx_v_buffer_length); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_6genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_9genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_12genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs(PyObject *__pyx_v_time); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_24string_to_samples(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_samples); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_26get_sdl_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_28get_sdl_mixer_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_30get_gstreamer_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_32get_glib_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_34supported_extensions(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_36get_master_volume(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_38set_master_volume(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_volume); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_40get_settings(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled___get__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_42enable(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_44disable(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_46shutdown(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks(void); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers(void); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_52get_track_count(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_54get_track_names(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_56get_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, int __pyx_v_track_num); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_58get_track_type(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_60get_track_by_name(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_62create_standard_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, int __pyx_v_max_simultaneous_sounds, float __pyx_v_volume); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_64create_sound_loop_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, int __pyx_v_max_layers, float __pyx_v_volume); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_66create_playlist_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, float __pyx_v_crossfade_time, float __pyx_v_volume); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_68get_playlist_controller_count(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_70get_playlist_controller_names(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_72get_playlist_controller(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_controller_name); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_74load_sound_file_to_memory(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_file_name); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_76load_sound_file_for_streaming(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_file_name); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_78unload_sound_file(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_container); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_80stop_all_sounds(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_fade_out_seconds); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_82stop_sound_instance(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound_instance, PyObject *__pyx_v_fade_out); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_84stop_sound(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound, PyObject *__pyx_v_fade_out); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_86stop_sound(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_88stop_sound_instance_looping(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound_instance); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_90clear_context(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_92process(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_94__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_96__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface_AudioInterface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_int_4096;
static PyObject *__pyx_int_44100;
static int __pyx_k__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_codeobj__7;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_codeobj__11;
static PyObject *__pyx_codeobj__13;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__21;
/* Late includes */

/* "mpfmc/core/audio/audio_interface.pyx":44
 * #    Global GStreamer helper functions
 * # ---------------------------------------------------------------------------
 * def _gst_init():             # <<<<<<<<<<<<<<
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_1_gst_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface__gst_init[] = "_gst_init()\nInitializes the GStreamer library";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_1_gst_init = {"_gst_init", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_1_gst_init, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface__gst_init};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_1_gst_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_gst_init (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface__gst_init(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface__gst_init(CYTHON_UNUSED PyObject *__pyx_self) {
  int __pyx_v_argc;
  char **__pyx_v_argv;
  GError *__pyx_v_error;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_gst_init", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":46
 * def _gst_init():
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():             # <<<<<<<<<<<<<<
 *         return True
 *     cdef int argc = 0
 */
  __pyx_t_1 = (gst_is_initialized() != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":47
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():
 *         return True             # <<<<<<<<<<<<<<
 *     cdef int argc = 0
 *     cdef char **argv = NULL
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":46
 * def _gst_init():
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():             # <<<<<<<<<<<<<<
 *         return True
 *     cdef int argc = 0
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":48
 *     if gst_is_initialized():
 *         return True
 *     cdef int argc = 0             # <<<<<<<<<<<<<<
 *     cdef char **argv = NULL
 *     cdef GError *error
 */
  __pyx_v_argc = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":49
 *         return True
 *     cdef int argc = 0
 *     cdef char **argv = NULL             # <<<<<<<<<<<<<<
 *     cdef GError *error
 *     if not gst_init_check(&argc, &argv, &error):
 */
  __pyx_v_argv = NULL;

  /* "mpfmc/core/audio/audio_interface.pyx":51
 *     cdef char **argv = NULL
 *     cdef GError *error
 *     if not gst_init_check(&argc, &argv, &error):             # <<<<<<<<<<<<<<
 *         msg = 'Unable to initialize GStreamer: code={} message={}'.format(
 *                 error.code, <bytes>error.message)
 */
  __pyx_t_1 = ((!(gst_init_check((&__pyx_v_argc), (&__pyx_v_argv), (&__pyx_v_error)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "mpfmc/core/audio/audio_interface.pyx":52
 *     cdef GError *error
 *     if not gst_init_check(&argc, &argv, &error):
 *         msg = 'Unable to initialize GStreamer: code={} message={}'.format(             # <<<<<<<<<<<<<<
 *                 error.code, <bytes>error.message)
 *         raise AudioException(msg)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_initialize_GStreamer_c, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "mpfmc/core/audio/audio_interface.pyx":53
 *     if not gst_init_check(&argc, &argv, &error):
 *         msg = 'Unable to initialize GStreamer: code={} message={}'.format(
 *                 error.code, <bytes>error.message)             # <<<<<<<<<<<<<<
 *         raise AudioException(msg)
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_error->code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error->message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(((PyObject*)__pyx_t_5));
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_msg = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":54
 *         msg = 'Unable to initialize GStreamer: code={} message={}'.format(
 *                 error.code, <bytes>error.message)
 *         raise AudioException(msg)             # <<<<<<<<<<<<<<
 * 
 * def get_gst_version():
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 54, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":51
 *     cdef char **argv = NULL
 *     cdef GError *error
 *     if not gst_init_check(&argc, &argv, &error):             # <<<<<<<<<<<<<<
 *         msg = 'Unable to initialize GStreamer: code={} message={}'.format(
 *                 error.code, <bytes>error.message)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":44
 * #    Global GStreamer helper functions
 * # ---------------------------------------------------------------------------
 * def _gst_init():             # <<<<<<<<<<<<<<
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():
 */

  /* function exit code */
  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface._gst_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":56
 *         raise AudioException(msg)
 * 
 * def get_gst_version():             # <<<<<<<<<<<<<<
 *     """Returns the current version of GStreamer"""
 *     cdef unsigned int major, minor, micro, nano
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_3get_gst_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_2get_gst_version[] = "get_gst_version()\nReturns the current version of GStreamer";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_3get_gst_version = {"get_gst_version", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_3get_gst_version, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_2get_gst_version};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_3get_gst_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_gst_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_2get_gst_version(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_2get_gst_version(CYTHON_UNUSED PyObject *__pyx_self) {
  unsigned int __pyx_v_major;
  unsigned int __pyx_v_minor;
  unsigned int __pyx_v_micro;
  unsigned int __pyx_v_nano;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_gst_version", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":59
 *     """Returns the current version of GStreamer"""
 *     cdef unsigned int major, minor, micro, nano
 *     gst_version(&major, &minor, &micro, &nano)             # <<<<<<<<<<<<<<
 *     return major, minor, micro, nano
 * 
 */
  gst_version((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_micro), (&__pyx_v_nano));

  /* "mpfmc/core/audio/audio_interface.pyx":60
 *     cdef unsigned int major, minor, micro, nano
 *     gst_version(&major, &minor, &micro, &nano)
 *     return major, minor, micro, nano             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_major); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_minor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_micro); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_nano); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":56
 *         raise AudioException(msg)
 * 
 * def get_gst_version():             # <<<<<<<<<<<<<<
 *     """Returns the current version of GStreamer"""
 *     cdef unsigned int major, minor, micro, nano
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.get_gst_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":78
 *     cdef AudioCallbackData audio_callback_data
 * 
 *     def __cinit__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kw = 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_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface___cinit__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_args, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface___cinit__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kw) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":81
 *         pass
 * 
 *     def __init__(self, rate=44100, channels=2, buffer_samples=4096):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the AudioInterface.
 */

/* Python wrapper */
static int __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__[] = "\n        Initializes the AudioInterface.\n        Args:\n            rate: The audio sample rate used in the library\n            channels: The number of channels to use (1=mono, 2=stereo)\n            buffer_samples: The audio buffer size to use (in number of samples, must be power of two)\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__;
#endif
static int __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rate = 0;
  PyObject *__pyx_v_channels = 0;
  PyObject *__pyx_v_buffer_samples = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rate,&__pyx_n_s_channels,&__pyx_n_s_buffer_samples,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)__pyx_int_44100);
    values[1] = ((PyObject *)__pyx_int_2);
    values[2] = ((PyObject *)__pyx_int_4096);
    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);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        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 = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rate);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channels);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_samples);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 81, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_rate = values[0];
    __pyx_v_channels = values[1];
    __pyx_v_buffer_samples = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 81, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_rate, __pyx_v_channels, __pyx_v_buffer_samples);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_rate, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer_samples) {
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Uint16 __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":89
 *             buffer_samples: The audio buffer size to use (in number of samples, must be power of two)
 *         """
 *         self.log = logging.getLogger("AudioInterface")             # <<<<<<<<<<<<<<
 * 
 *         # Initialize threading in the extension library and acquire the Python global interpreter lock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_u_AudioInterface) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_AudioInterface);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->log);
  __Pyx_DECREF(__pyx_v_self->log);
  __pyx_v_self->log = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":92
 * 
 *         # Initialize threading in the extension library and acquire the Python global interpreter lock
 *         PyEval_InitThreads()             # <<<<<<<<<<<<<<
 * 
 *         if channels not in (1, 2):
 */
  PyEval_InitThreads();

  /* "mpfmc/core/audio/audio_interface.pyx":94
 *         PyEval_InitThreads()
 * 
 *         if channels not in (1, 2):             # <<<<<<<<<<<<<<
 *             self.log.error('Channels is required to be either 1 (mono) or 2 (stereo)')
 *             raise AudioException("Unable to initialize Audio Interface: "
 */
  __Pyx_INCREF(__pyx_v_channels);
  __pyx_t_1 = __pyx_v_channels;
  __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_5)) {

    /* "mpfmc/core/audio/audio_interface.pyx":95
 * 
 *         if channels not in (1, 2):
 *             self.log.error('Channels is required to be either 1 (mono) or 2 (stereo)')             # <<<<<<<<<<<<<<
 *             raise AudioException("Unable to initialize Audio Interface: "
 *                                  "Channels is required to be either 1 (mono) or 2 (stereo)")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Channels_is_required_to_be_eithe) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Channels_is_required_to_be_eithe);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":96
 *         if channels not in (1, 2):
 *             self.log.error('Channels is required to be either 1 (mono) or 2 (stereo)')
 *             raise AudioException("Unable to initialize Audio Interface: "             # <<<<<<<<<<<<<<
 *                                  "Channels is required to be either 1 (mono) or 2 (stereo)")
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Unable_to_initialize_Audio_Inter) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Unable_to_initialize_Audio_Inter);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 96, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":94
 *         PyEval_InitThreads()
 * 
 *         if channels not in (1, 2):             # <<<<<<<<<<<<<<
 *             self.log.error('Channels is required to be either 1 (mono) or 2 (stereo)')
 *             raise AudioException("Unable to initialize Audio Interface: "
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":100
 * 
 *         # Make sure buffer samples is a power of two (required by SDL2)
 *         if not AudioInterface.power_of_two(buffer_samples):             # <<<<<<<<<<<<<<
 *             self.log.error('Buffer samples is required to be a power of two')
 *             raise AudioException("Unable to initialize Audio Interface: "
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_power_of_two); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_buffer_samples) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_buffer_samples);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_5) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mpfmc/core/audio/audio_interface.pyx":101
 *         # Make sure buffer samples is a power of two (required by SDL2)
 *         if not AudioInterface.power_of_two(buffer_samples):
 *             self.log.error('Buffer samples is required to be a power of two')             # <<<<<<<<<<<<<<
 *             raise AudioException("Unable to initialize Audio Interface: "
 *                                  "Buffer samples is required to be a power of two")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Buffer_samples_is_required_to_be) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Buffer_samples_is_required_to_be);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":102
 *         if not AudioInterface.power_of_two(buffer_samples):
 *             self.log.error('Buffer samples is required to be a power of two')
 *             raise AudioException("Unable to initialize Audio Interface: "             # <<<<<<<<<<<<<<
 *                                  "Buffer samples is required to be a power of two")
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_Unable_to_initialize_Audio_Inter_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_Unable_to_initialize_Audio_Inter_2);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 102, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":100
 * 
 *         # Make sure buffer samples is a power of two (required by SDL2)
 *         if not AudioInterface.power_of_two(buffer_samples):             # <<<<<<<<<<<<<<
 *             self.log.error('Buffer samples is required to be a power of two')
 *             raise AudioException("Unable to initialize Audio Interface: "
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":106
 * 
 *         # Warn if a small buffer is used
 *         if buffer_samples <= 1024:             # <<<<<<<<<<<<<<
 *             self.log.warning('NOTE: You may experience noise and other undesirable sound artifacts '
 *                              'when you set your buffer at 1024 or smaller.')
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_buffer_samples, __pyx_int_1024, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "mpfmc/core/audio/audio_interface.pyx":107
 *         # Warn if a small buffer is used
 *         if buffer_samples <= 1024:
 *             self.log.warning('NOTE: You may experience noise and other undesirable sound artifacts '             # <<<<<<<<<<<<<<
 *                              'when you set your buffer at 1024 or smaller.')
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u_NOTE_You_may_experience_noise_an) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_NOTE_You_may_experience_noise_an);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":106
 * 
 *         # Warn if a small buffer is used
 *         if buffer_samples <= 1024:             # <<<<<<<<<<<<<<
 *             self.log.warning('NOTE: You may experience noise and other undesirable sound artifacts '
 *                              'when you set your buffer at 1024 or smaller.')
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":111
 * 
 *         # Initialize the SDL audio system
 *         if SDL_InitSubSystem(SDL_INIT_AUDIO) < 0:             # <<<<<<<<<<<<<<
 *             self.log.error('SDL_InitSubSystem error - %s' % SDL_GetError())
 *             raise AudioException('Unable to initialize SDL (SDL_InitSubSystem call failed: %s)' % SDL_GetError())
 */
  __pyx_t_4 = ((SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mpfmc/core/audio/audio_interface.pyx":112
 *         # Initialize the SDL audio system
 *         if SDL_InitSubSystem(SDL_INIT_AUDIO) < 0:
 *             self.log.error('SDL_InitSubSystem error - %s' % SDL_GetError())             # <<<<<<<<<<<<<<
 *             raise AudioException('Unable to initialize SDL (SDL_InitSubSystem call failed: %s)' % SDL_GetError())
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_SDL_InitSubSystem_error_s, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":113
 *         if SDL_InitSubSystem(SDL_INIT_AUDIO) < 0:
 *             self.log.error('SDL_InitSubSystem error - %s' % SDL_GetError())
 *             raise AudioException('Unable to initialize SDL (SDL_InitSubSystem call failed: %s)' % SDL_GetError())             # <<<<<<<<<<<<<<
 * 
 *         # Initialize the SDL_Mixer library to establish the output audio format and encoding
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Unable_to_initialize_SDL_SDL_Ini, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 113, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":111
 * 
 *         # Initialize the SDL audio system
 *         if SDL_InitSubSystem(SDL_INIT_AUDIO) < 0:             # <<<<<<<<<<<<<<
 *             self.log.error('SDL_InitSubSystem error - %s' % SDL_GetError())
 *             raise AudioException('Unable to initialize SDL (SDL_InitSubSystem call failed: %s)' % SDL_GetError())
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":117
 *         # Initialize the SDL_Mixer library to establish the output audio format and encoding
 *         # (sample rate, bit depth, buffer size)
 *         if Mix_OpenAudio(rate, AUDIO_S16SYS, channels, buffer_samples):             # <<<<<<<<<<<<<<
 *             self.log.error('Mix_OpenAudio error - %s' % SDL_GetError())
 *             raise AudioException('Unable to open audio for output (Mix_OpenAudio failed: %s)' % SDL_GetError())
 */
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_rate); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_buffer_samples); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_t_4 = (Mix_OpenAudio(__pyx_t_7, AUDIO_S16SYS, __pyx_t_8, __pyx_t_9) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mpfmc/core/audio/audio_interface.pyx":118
 *         # (sample rate, bit depth, buffer size)
 *         if Mix_OpenAudio(rate, AUDIO_S16SYS, channels, buffer_samples):
 *             self.log.error('Mix_OpenAudio error - %s' % SDL_GetError())             # <<<<<<<<<<<<<<
 *             raise AudioException('Unable to open audio for output (Mix_OpenAudio failed: %s)' % SDL_GetError())
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_Mix_OpenAudio_error_s, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":119
 *         if Mix_OpenAudio(rate, AUDIO_S16SYS, channels, buffer_samples):
 *             self.log.error('Mix_OpenAudio error - %s' % SDL_GetError())
 *             raise AudioException('Unable to open audio for output (Mix_OpenAudio failed: %s)' % SDL_GetError())             # <<<<<<<<<<<<<<
 * 
 *         # We want to use as little resources as possible for SDL_Mixer as we will just be using the custom
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Unable_to_open_audio_for_output, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 119, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":117
 *         # Initialize the SDL_Mixer library to establish the output audio format and encoding
 *         # (sample rate, bit depth, buffer size)
 *         if Mix_OpenAudio(rate, AUDIO_S16SYS, channels, buffer_samples):             # <<<<<<<<<<<<<<
 *             self.log.error('Mix_OpenAudio error - %s' % SDL_GetError())
 *             raise AudioException('Unable to open audio for output (Mix_OpenAudio failed: %s)' % SDL_GetError())
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":123
 *         # We want to use as little resources as possible for SDL_Mixer as we will just be using the custom
 *         # music player hook to play audio (no mixer channels needed).
 *         Mix_AllocateChannels(0)             # <<<<<<<<<<<<<<
 * 
 *         # Initialize GStreamer
 */
  (void)(Mix_AllocateChannels(0));

  /* "mpfmc/core/audio/audio_interface.pyx":126
 * 
 *         # Initialize GStreamer
 *         self._initialize_gstreamer()             # <<<<<<<<<<<<<<
 * 
 *         self.log.info("Initialized")
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initialize_gstreamer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":128
 *         self._initialize_gstreamer()
 * 
 *         self.log.info("Initialized")             # <<<<<<<<<<<<<<
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_mixer_version())
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_n_u_Initialized) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_Initialized);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":129
 * 
 *         self.log.info("Initialized")
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_version())             # <<<<<<<<<<<<<<
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_mixer_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_gstreamer_version())
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_get_sdl_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Loaded_s, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Loaded_s, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_kp_u_Loaded_s);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":130
 *         self.log.info("Initialized")
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_mixer_version())             # <<<<<<<<<<<<<<
 *         self.log.debug("Loaded %s", AudioInterface.get_gstreamer_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_glib_version())
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_get_sdl_mixer_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Loaded_s, __pyx_t_10};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_u_Loaded_s, __pyx_t_10};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_kp_u_Loaded_s);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":131
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_mixer_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_gstreamer_version())             # <<<<<<<<<<<<<<
 *         self.log.debug("Loaded %s", AudioInterface.get_glib_version())
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_get_gstreamer_version); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_kp_u_Loaded_s, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_kp_u_Loaded_s, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_10) {
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_kp_u_Loaded_s);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":132
 *         self.log.debug("Loaded %s", AudioInterface.get_sdl_mixer_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_gstreamer_version())
 *         self.log.debug("Loaded %s", AudioInterface.get_glib_version())             # <<<<<<<<<<<<<<
 * 
 *         # Lock SDL from calling the audio callback functions while we set things up
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_get_glib_version); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Loaded_s, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Loaded_s, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_kp_u_Loaded_s);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_kp_u_Loaded_s);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":135
 * 
 *         # Lock SDL from calling the audio callback functions while we set things up
 *         SDL_LockAudio()             # <<<<<<<<<<<<<<
 * 
 *         # Determine the actual audio format in use by the opened audio device.  This may or may not match
 */
  SDL_LockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":139
 *         # Determine the actual audio format in use by the opened audio device.  This may or may not match
 *         # the parameters used to initialize the audio interface.
 *         self.audio_callback_data.buffer_samples = buffer_samples             # <<<<<<<<<<<<<<
 *         Mix_QuerySpec(&self.audio_callback_data.sample_rate,
 *                       &self.audio_callback_data.format,
 */
  __pyx_t_11 = __Pyx_PyInt_As_Uint16(__pyx_v_buffer_samples); if (unlikely((__pyx_t_11 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
  __pyx_v_self->audio_callback_data.buffer_samples = __pyx_t_11;

  /* "mpfmc/core/audio/audio_interface.pyx":140
 *         # the parameters used to initialize the audio interface.
 *         self.audio_callback_data.buffer_samples = buffer_samples
 *         Mix_QuerySpec(&self.audio_callback_data.sample_rate,             # <<<<<<<<<<<<<<
 *                       &self.audio_callback_data.format,
 *                       &self.audio_callback_data.channels)
 */
  (void)(Mix_QuerySpec((&__pyx_v_self->audio_callback_data.sample_rate), (&__pyx_v_self->audio_callback_data.format), (&__pyx_v_self->audio_callback_data.channels)));

  /* "mpfmc/core/audio/audio_interface.pyx":145
 * 
 *         # Ensure system is little endian (big endian not supported)
 *         if not SDL_AUDIO_ISLITTLEENDIAN(self.audio_callback_data.format):             # <<<<<<<<<<<<<<
 *             self.log.error("The audio interface only supports little endian systems in this release. "
 *                            "Audio features will not be available.")
 */
  __pyx_t_4 = ((!(SDL_AUDIO_ISLITTLEENDIAN(__pyx_v_self->audio_callback_data.format) != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "mpfmc/core/audio/audio_interface.pyx":146
 *         # Ensure system is little endian (big endian not supported)
 *         if not SDL_AUDIO_ISLITTLEENDIAN(self.audio_callback_data.format):
 *             self.log.error("The audio interface only supports little endian systems in this release. "             # <<<<<<<<<<<<<<
 *                            "Audio features will not be available.")
 *             raise AudioException("The audio interface only supports little endian systems in this release.")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_kp_u_The_audio_interface_only_support) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_The_audio_interface_only_support);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":148
 *             self.log.error("The audio interface only supports little endian systems in this release. "
 *                            "Audio features will not be available.")
 *             raise AudioException("The audio interface only supports little endian systems in this release.")             # <<<<<<<<<<<<<<
 * 
 *         # The requested values used to initialize the audio interface.  A pointer to the audio_callback_data
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_kp_u_The_audio_interface_only_support_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_The_audio_interface_only_support_2);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 148, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":145
 * 
 *         # Ensure system is little endian (big endian not supported)
 *         if not SDL_AUDIO_ISLITTLEENDIAN(self.audio_callback_data.format):             # <<<<<<<<<<<<<<
 *             self.log.error("The audio interface only supports little endian systems in this release. "
 *                            "Audio features will not be available.")
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":153
 *         # structure is passed to the SDL audio callback function and is the source of all audio state
 *         # and mixing data needed to generate the output signal.
 *         self.audio_callback_data.bytes_per_sample = SDL_AUDIO_BITSIZE(self.audio_callback_data.format) // 8             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.buffer_size = self.audio_callback_data.buffer_samples * self.audio_callback_data.bytes_per_sample * self.audio_callback_data.channels
 *         self.audio_callback_data.bytes_per_control_point = self.audio_callback_data.buffer_size // CONTROL_POINTS_PER_BUFFER
 */
  __pyx_v_self->audio_callback_data.bytes_per_sample = __Pyx_div_long(SDL_AUDIO_BITSIZE(__pyx_v_self->audio_callback_data.format), 8);

  /* "mpfmc/core/audio/audio_interface.pyx":154
 *         # and mixing data needed to generate the output signal.
 *         self.audio_callback_data.bytes_per_sample = SDL_AUDIO_BITSIZE(self.audio_callback_data.format) // 8
 *         self.audio_callback_data.buffer_size = self.audio_callback_data.buffer_samples * self.audio_callback_data.bytes_per_sample * self.audio_callback_data.channels             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.bytes_per_control_point = self.audio_callback_data.buffer_size // CONTROL_POINTS_PER_BUFFER
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample
 */
  __pyx_v_self->audio_callback_data.buffer_size = ((__pyx_v_self->audio_callback_data.buffer_samples * __pyx_v_self->audio_callback_data.bytes_per_sample) * __pyx_v_self->audio_callback_data.channels);

  /* "mpfmc/core/audio/audio_interface.pyx":155
 *         self.audio_callback_data.bytes_per_sample = SDL_AUDIO_BITSIZE(self.audio_callback_data.format) // 8
 *         self.audio_callback_data.buffer_size = self.audio_callback_data.buffer_samples * self.audio_callback_data.bytes_per_sample * self.audio_callback_data.channels
 *         self.audio_callback_data.bytes_per_control_point = self.audio_callback_data.buffer_size // CONTROL_POINTS_PER_BUFFER             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample
 *         self.audio_callback_data.master_volume = SDL_MIX_MAXVOLUME // 2
 */
  if (unlikely(__pyx_e_5mpfmc_4core_5audio_5track_CONTROL_POINTS_PER_BUFFER == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 155, __pyx_L1_error)
  }
  __pyx_v_self->audio_callback_data.bytes_per_control_point = (__pyx_v_self->audio_callback_data.buffer_size / __pyx_e_5mpfmc_4core_5audio_5track_CONTROL_POINTS_PER_BUFFER);

  /* "mpfmc/core/audio/audio_interface.pyx":156
 *         self.audio_callback_data.buffer_size = self.audio_callback_data.buffer_samples * self.audio_callback_data.bytes_per_sample * self.audio_callback_data.channels
 *         self.audio_callback_data.bytes_per_control_point = self.audio_callback_data.buffer_size // CONTROL_POINTS_PER_BUFFER
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.master_volume = SDL_MIX_MAXVOLUME // 2
 *         self.audio_callback_data.quick_fade_steps = (<int>(QUICK_FADE_DURATION_SECS *
 */
  __pyx_v_self->audio_callback_data.seconds_to_bytes_factor = ((__pyx_v_self->audio_callback_data.sample_rate * __pyx_v_self->audio_callback_data.channels) * __pyx_v_self->audio_callback_data.bytes_per_sample);

  /* "mpfmc/core/audio/audio_interface.pyx":157
 *         self.audio_callback_data.bytes_per_control_point = self.audio_callback_data.buffer_size // CONTROL_POINTS_PER_BUFFER
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample
 *         self.audio_callback_data.master_volume = SDL_MIX_MAXVOLUME // 2             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.quick_fade_steps = (<int>(QUICK_FADE_DURATION_SECS *
 *                                                      self.audio_callback_data.sample_rate *
 */
  __pyx_v_self->audio_callback_data.master_volume = __Pyx_div_long(SDL_MIX_MAXVOLUME, 2);

  /* "mpfmc/core/audio/audio_interface.pyx":158
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample
 *         self.audio_callback_data.master_volume = SDL_MIX_MAXVOLUME // 2
 *         self.audio_callback_data.quick_fade_steps = (<int>(QUICK_FADE_DURATION_SECS *             # <<<<<<<<<<<<<<
 *                                                      self.audio_callback_data.sample_rate *
 *                                                      self.audio_callback_data.channels *
 */
  __pyx_t_9 = ((int)(((0.05 * __pyx_v_self->audio_callback_data.sample_rate) * __pyx_v_self->audio_callback_data.channels) * __pyx_v_self->audio_callback_data.bytes_per_sample));

  /* "mpfmc/core/audio/audio_interface.pyx":162
 *                                                      self.audio_callback_data.channels *
 *                                                      self.audio_callback_data.bytes_per_sample
 *                                                            )) // self.audio_callback_data.bytes_per_control_point             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.silence = 0
 *         self.audio_callback_data.track_count = 0
 */
  if (unlikely(__pyx_v_self->audio_callback_data.bytes_per_control_point == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 162, __pyx_L1_error)
  }
  else if (sizeof(int) == sizeof(long) && (!(((Uint16)-1) > 0)) && unlikely(__pyx_v_self->audio_callback_data.bytes_per_control_point == (Uint16)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_9))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(0, 162, __pyx_L1_error)
  }

  /* "mpfmc/core/audio/audio_interface.pyx":158
 *         self.audio_callback_data.seconds_to_bytes_factor = self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample
 *         self.audio_callback_data.master_volume = SDL_MIX_MAXVOLUME // 2
 *         self.audio_callback_data.quick_fade_steps = (<int>(QUICK_FADE_DURATION_SECS *             # <<<<<<<<<<<<<<
 *                                                      self.audio_callback_data.sample_rate *
 *                                                      self.audio_callback_data.channels *
 */
  __pyx_v_self->audio_callback_data.quick_fade_steps = __Pyx_div_int(__pyx_t_9, __pyx_v_self->audio_callback_data.bytes_per_control_point);

  /* "mpfmc/core/audio/audio_interface.pyx":163
 *                                                      self.audio_callback_data.bytes_per_sample
 *                                                            )) // self.audio_callback_data.bytes_per_control_point
 *         self.audio_callback_data.silence = 0             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.track_count = 0
 *         self.audio_callback_data.tracks = <void**>PyMem_Malloc(MAX_TRACKS * sizeof(TrackState*))
 */
  __pyx_v_self->audio_callback_data.silence = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":164
 *                                                            )) // self.audio_callback_data.bytes_per_control_point
 *         self.audio_callback_data.silence = 0
 *         self.audio_callback_data.track_count = 0             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.tracks = <void**>PyMem_Malloc(MAX_TRACKS * sizeof(TrackState*))
 *         self.audio_callback_data.c_log_file = NULL
 */
  __pyx_v_self->audio_callback_data.track_count = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":165
 *         self.audio_callback_data.silence = 0
 *         self.audio_callback_data.track_count = 0
 *         self.audio_callback_data.tracks = <void**>PyMem_Malloc(MAX_TRACKS * sizeof(TrackState*))             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.c_log_file = NULL
 *         # self.audio_callback_data.c_log_file = fopen("D:\\Temp\\Dev\\MPFMC_AudioLibrary.log", "wb")
 */
  __pyx_v_self->audio_callback_data.tracks = ((void **)PyMem_Malloc((8 * (sizeof(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *)))));

  /* "mpfmc/core/audio/audio_interface.pyx":166
 *         self.audio_callback_data.track_count = 0
 *         self.audio_callback_data.tracks = <void**>PyMem_Malloc(MAX_TRACKS * sizeof(TrackState*))
 *         self.audio_callback_data.c_log_file = NULL             # <<<<<<<<<<<<<<
 *         # self.audio_callback_data.c_log_file = fopen("D:\\Temp\\Dev\\MPFMC_AudioLibrary.log", "wb")
 *         # fprintf(self.audio_callback_data.c_log_file, "---------------------------------------------------------------------------\r\n")
 */
  __pyx_v_self->audio_callback_data.c_log_file = NULL;

  /* "mpfmc/core/audio/audio_interface.pyx":171
 *         # fflush(self.audio_callback_data.c_log_file)
 * 
 *         self.log.debug('Settings requested - rate: %d, channels: %d, buffer: %d samples',             # <<<<<<<<<<<<<<
 *                        rate, channels, buffer_samples)
 *         self.log.debug('Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)',
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mpfmc/core/audio/audio_interface.pyx":172
 * 
 *         self.log.debug('Settings requested - rate: %d, channels: %d, buffer: %d samples',
 *                        rate, channels, buffer_samples)             # <<<<<<<<<<<<<<
 *         self.log.debug('Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)',
 *                        self.audio_callback_data.sample_rate, self.audio_callback_data.channels,
 */
  __pyx_t_10 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_kp_u_Settings_requested_rate_d_channe, __pyx_v_rate, __pyx_v_channels, __pyx_v_buffer_samples};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_kp_u_Settings_requested_rate_d_channe, __pyx_v_rate, __pyx_v_channels, __pyx_v_buffer_samples};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_10) {
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Settings_requested_rate_d_channe);
    __Pyx_GIVEREF(__pyx_kp_u_Settings_requested_rate_d_channe);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_kp_u_Settings_requested_rate_d_channe);
    __Pyx_INCREF(__pyx_v_rate);
    __Pyx_GIVEREF(__pyx_v_rate);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_v_rate);
    __Pyx_INCREF(__pyx_v_channels);
    __Pyx_GIVEREF(__pyx_v_channels);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_9, __pyx_v_channels);
    __Pyx_INCREF(__pyx_v_buffer_samples);
    __Pyx_GIVEREF(__pyx_v_buffer_samples);
    PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_9, __pyx_v_buffer_samples);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":173
 *         self.log.debug('Settings requested - rate: %d, channels: %d, buffer: %d samples',
 *                        rate, channels, buffer_samples)
 *         self.log.debug('Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)',             # <<<<<<<<<<<<<<
 *                        self.audio_callback_data.sample_rate, self.audio_callback_data.channels,
 *                        self.audio_callback_data.buffer_samples, self.audio_callback_data.buffer_size,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "mpfmc/core/audio/audio_interface.pyx":174
 *                        rate, channels, buffer_samples)
 *         self.log.debug('Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)',
 *                        self.audio_callback_data.sample_rate, self.audio_callback_data.channels,             # <<<<<<<<<<<<<<
 *                        self.audio_callback_data.buffer_samples, self.audio_callback_data.buffer_size,
 *                        self.audio_callback_data.bytes_per_sample)
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->audio_callback_data.sample_rate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->audio_callback_data.channels); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "mpfmc/core/audio/audio_interface.pyx":175
 *         self.log.debug('Settings in use - rate: %d, channels: %d, buffer: %d samples (%d bytes @ %d bytes per sample)',
 *                        self.audio_callback_data.sample_rate, self.audio_callback_data.channels,
 *                        self.audio_callback_data.buffer_samples, self.audio_callback_data.buffer_size,             # <<<<<<<<<<<<<<
 *                        self.audio_callback_data.bytes_per_sample)
 * 
 */
  __pyx_t_6 = __Pyx_PyInt_From_Uint16(__pyx_v_self->audio_callback_data.buffer_samples); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_12 = __Pyx_PyInt_From_Uint32(__pyx_v_self->audio_callback_data.buffer_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "mpfmc/core/audio/audio_interface.pyx":176
 *                        self.audio_callback_data.sample_rate, self.audio_callback_data.channels,
 *                        self.audio_callback_data.buffer_samples, self.audio_callback_data.buffer_size,
 *                        self.audio_callback_data.bytes_per_sample)             # <<<<<<<<<<<<<<
 * 
 *         # Unlock the SDL audio callback functions
 */
  __pyx_t_13 = __Pyx_PyInt_From_Uint8(__pyx_v_self->audio_callback_data.bytes_per_sample); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[7] = {__pyx_t_14, __pyx_kp_u_Settings_in_use_rate_d_channels, __pyx_t_2, __pyx_t_10, __pyx_t_6, __pyx_t_12, __pyx_t_13};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[7] = {__pyx_t_14, __pyx_kp_u_Settings_in_use_rate_d_channels, __pyx_t_2, __pyx_t_10, __pyx_t_6, __pyx_t_12, __pyx_t_13};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 6+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  } else
  #endif
  {
    __pyx_t_15 = PyTuple_New(6+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    if (__pyx_t_14) {
      __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_Settings_in_use_rate_d_channels);
    __Pyx_GIVEREF(__pyx_kp_u_Settings_in_use_rate_d_channels);
    PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_kp_u_Settings_in_use_rate_d_channels);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_9, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_15, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_15, 4+__pyx_t_9, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_15, 5+__pyx_t_9, __pyx_t_13);
    __pyx_t_2 = 0;
    __pyx_t_10 = 0;
    __pyx_t_6 = 0;
    __pyx_t_12 = 0;
    __pyx_t_13 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":179
 * 
 *         # Unlock the SDL audio callback functions
 *         SDL_UnlockAudio()             # <<<<<<<<<<<<<<
 * 
 *         self.tracks = list()
 */
  SDL_UnlockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":181
 *         SDL_UnlockAudio()
 * 
 *         self.tracks = list()             # <<<<<<<<<<<<<<
 *         self.playlist_controllers = dict()
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->tracks);
  __Pyx_DECREF(__pyx_v_self->tracks);
  __pyx_v_self->tracks = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":182
 * 
 *         self.tracks = list()
 *         self.playlist_controllers = dict()             # <<<<<<<<<<<<<<
 * 
 *     def __del__(self):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->playlist_controllers);
  __Pyx_DECREF(__pyx_v_self->playlist_controllers);
  __pyx_v_self->playlist_controllers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":81
 *         pass
 * 
 *     def __init__(self, rate=44100, channels=2, buffer_samples=4096):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes the AudioInterface.
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":184
 *         self.playlist_controllers = dict()
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         """Shut down the audio interface and clean up allocated memory"""
 *         self.log.debug("Shutting down and cleaning up allocated memory...")
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_5__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_4__del__[] = "AudioInterface.__del__(self)\nShut down the audio interface and clean up allocated memory";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_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_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_4__del__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_4__del__(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  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("__del__", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":186
 *     def __del__(self):
 *         """Shut down the audio interface and clean up allocated memory"""
 *         self.log.debug("Shutting down and cleaning up allocated memory...")             # <<<<<<<<<<<<<<
 * 
 *         # Stop audio processing (will stop all SDL callbacks)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Shutting_down_and_cleaning_up_al) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Shutting_down_and_cleaning_up_al);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":189
 * 
 *         # Stop audio processing (will stop all SDL callbacks)
 *         self.shutdown()             # <<<<<<<<<<<<<<
 * 
 *         self.audio_callback_data.track_count = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shutdown); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":191
 *         self.shutdown()
 * 
 *         self.audio_callback_data.track_count = 0             # <<<<<<<<<<<<<<
 *         PyMem_Free(self.audio_callback_data.tracks)
 *         self.audio_callback_data.tracks = NULL
 */
  __pyx_v_self->audio_callback_data.track_count = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":192
 * 
 *         self.audio_callback_data.track_count = 0
 *         PyMem_Free(self.audio_callback_data.tracks)             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.tracks = NULL
 * 
 */
  PyMem_Free(__pyx_v_self->audio_callback_data.tracks);

  /* "mpfmc/core/audio/audio_interface.pyx":193
 *         self.audio_callback_data.track_count = 0
 *         PyMem_Free(self.audio_callback_data.tracks)
 *         self.audio_callback_data.tracks = NULL             # <<<<<<<<<<<<<<
 * 
 *         # Remove tracks
 */
  __pyx_v_self->audio_callback_data.tracks = NULL;

  /* "mpfmc/core/audio/audio_interface.pyx":196
 * 
 *         # Remove tracks
 *         self.tracks.clear()             # <<<<<<<<<<<<<<
 * 
 *         # SDL and SDL_Mixer no longer needed
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->tracks, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":199
 * 
 *         # SDL and SDL_Mixer no longer needed
 *         Mix_Quit()             # <<<<<<<<<<<<<<
 *         SDL_Quit()
 * 
 */
  Mix_Quit();

  /* "mpfmc/core/audio/audio_interface.pyx":200
 *         # SDL and SDL_Mixer no longer needed
 *         Mix_Quit()
 *         SDL_Quit()             # <<<<<<<<<<<<<<
 * 
 *     def _initialize_gstreamer(self):
 */
  SDL_Quit();

  /* "mpfmc/core/audio/audio_interface.pyx":184
 *         self.playlist_controllers = dict()
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         """Shut down the audio interface and clean up allocated memory"""
 *         self.log.debug("Shutting down and cleaning up allocated memory...")
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.AudioInterface.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":202
 *         SDL_Quit()
 * 
 *     def _initialize_gstreamer(self):             # <<<<<<<<<<<<<<
 *         """Initialize the GStreamer library"""
 *         if gst_is_initialized():
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7_initialize_gstreamer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_6_initialize_gstreamer[] = "AudioInterface._initialize_gstreamer(self)\nInitialize the GStreamer library";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7_initialize_gstreamer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_initialize_gstreamer (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_6_initialize_gstreamer(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_6_initialize_gstreamer(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  int __pyx_v_argc;
  char **__pyx_v_argv;
  GError *__pyx_v_error;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize_gstreamer", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":204
 *     def _initialize_gstreamer(self):
 *         """Initialize the GStreamer library"""
 *         if gst_is_initialized():             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  __pyx_t_1 = (gst_is_initialized() != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":205
 *         """Initialize the GStreamer library"""
 *         if gst_is_initialized():
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         cdef int argc = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":204
 *     def _initialize_gstreamer(self):
 *         """Initialize the GStreamer library"""
 *         if gst_is_initialized():             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":207
 *             return True
 * 
 *         cdef int argc = 0             # <<<<<<<<<<<<<<
 *         cdef char **argv = NULL
 *         cdef GError *error
 */
  __pyx_v_argc = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":208
 * 
 *         cdef int argc = 0
 *         cdef char **argv = NULL             # <<<<<<<<<<<<<<
 *         cdef GError *error
 *         if not gst_init_check(&argc, &argv, &error):
 */
  __pyx_v_argv = NULL;

  /* "mpfmc/core/audio/audio_interface.pyx":210
 *         cdef char **argv = NULL
 *         cdef GError *error
 *         if not gst_init_check(&argc, &argv, &error):             # <<<<<<<<<<<<<<
 *             msg = 'Unable to initialize gstreamer: code={} message={}'.format(error.code, <bytes>error.message)
 *             raise AudioException(msg)
 */
  __pyx_t_1 = ((!(gst_init_check((&__pyx_v_argc), (&__pyx_v_argv), (&__pyx_v_error)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "mpfmc/core/audio/audio_interface.pyx":211
 *         cdef GError *error
 *         if not gst_init_check(&argc, &argv, &error):
 *             msg = 'Unable to initialize gstreamer: code={} message={}'.format(error.code, <bytes>error.message)             # <<<<<<<<<<<<<<
 *             raise AudioException(msg)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unable_to_initialize_gstreamer_c, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_error->code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_error->message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_INCREF(((PyObject*)__pyx_t_5));
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_msg = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":212
 *         if not gst_init_check(&argc, &argv, &error):
 *             msg = 'Unable to initialize gstreamer: code={} message={}'.format(error.code, <bytes>error.message)
 *             raise AudioException(msg)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 212, __pyx_L1_error)

    /* "mpfmc/core/audio/audio_interface.pyx":210
 *         cdef char **argv = NULL
 *         cdef GError *error
 *         if not gst_init_check(&argc, &argv, &error):             # <<<<<<<<<<<<<<
 *             msg = 'Unable to initialize gstreamer: code={} message={}'.format(error.code, <bytes>error.message)
 *             raise AudioException(msg)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":202
 *         SDL_Quit()
 * 
 *     def _initialize_gstreamer(self):             # <<<<<<<<<<<<<<
 *         """Initialize the GStreamer library"""
 *         if gst_is_initialized():
 */

  /* function exit code */
  __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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface._initialize_gstreamer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":215
 * 
 *     @staticmethod
 *     def initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes and retrieves the audio interface instance.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize[] = "AudioInterface.initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs)\n\n        Initializes and retrieves the audio interface instance.\n        Args:\n            rate: The audio sample rate used in the library\n            channels: The number of channels to use (1=mono, 2=stereo)\n            buffer_samples: The audio buffer size in number of samples (must be power of two)\n\n        Returns:\n            An AudioInterface object instance.\n        ";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize = {"initialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_rate;
  int __pyx_v_channels;
  int __pyx_v_buffer_samples;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rate,&__pyx_n_s_channels,&__pyx_n_s_buffer_samples,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);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        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 = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rate);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channels);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer_samples);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "initialize") < 0)) __PYX_ERR(0, 215, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_rate = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_rate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error)
    } else {
      __pyx_v_rate = ((int)0xAC44);
    }
    if (values[1]) {
      __pyx_v_channels = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_channels == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error)
    } else {
      __pyx_v_channels = ((int)2);
    }
    if (values[2]) {
      __pyx_v_buffer_samples = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_buffer_samples == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 215, __pyx_L3_error)
    } else {
      __pyx_v_buffer_samples = ((int)0x1000);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("initialize", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize(__pyx_v_rate, __pyx_v_channels, __pyx_v_buffer_samples, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize(int __pyx_v_rate, int __pyx_v_channels, int __pyx_v_buffer_samples, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_audio_interface_instance = 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("initialize", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":227
 *         """
 *         # Initialize the audio instance and return it
 *         audio_interface_instance = AudioInterface(rate=rate,             # <<<<<<<<<<<<<<
 *                                                   channels=channels,
 *                                                   buffer_samples=buffer_samples,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rate, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":228
 *         # Initialize the audio instance and return it
 *         audio_interface_instance = AudioInterface(rate=rate,
 *                                                   channels=channels,             # <<<<<<<<<<<<<<
 *                                                   buffer_samples=buffer_samples,
 *                                                   **kwargs)
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_channels, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":229
 *         audio_interface_instance = AudioInterface(rate=rate,
 *                                                   channels=channels,
 *                                                   buffer_samples=buffer_samples,             # <<<<<<<<<<<<<<
 *                                                   **kwargs)
 *         return audio_interface_instance
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_buffer_samples); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer_samples, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":230
 *                                                   channels=channels,
 *                                                   buffer_samples=buffer_samples,
 *                                                   **kwargs)             # <<<<<<<<<<<<<<
 *         return audio_interface_instance
 * 
 */
  if (__Pyx_MergeKeywords(__pyx_t_1, __pyx_v_kwargs) < 0) __PYX_ERR(0, 230, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":227
 *         """
 *         # Initialize the audio instance and return it
 *         audio_interface_instance = AudioInterface(rate=rate,             # <<<<<<<<<<<<<<
 *                                                   channels=channels,
 *                                                   buffer_samples=buffer_samples,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_audio_interface_instance = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":231
 *                                                   buffer_samples=buffer_samples,
 *                                                   **kwargs)
 *         return audio_interface_instance             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_audio_interface_instance));
  __pyx_r = ((PyObject *)__pyx_v_audio_interface_instance);
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":215
 * 
 *     @staticmethod
 *     def initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes and retrieves the audio interface instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_audio_interface_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":234
 * 
 *     @staticmethod
 *     def power_of_two(int num):             # <<<<<<<<<<<<<<
 *         """ Returns whether or not the supplied number is a power of 2 """
 *         return ((num & (num - 1)) == 0) and num != 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two[] = "AudioInterface.power_of_two(int num)\n Returns whether or not the supplied number is a power of 2 ";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two = {"power_of_two", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_num;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("power_of_two (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num,0};
    PyObject* values[1] = {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  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power_of_two") < 0)) __PYX_ERR(0, 234, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_num = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("power_of_two", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.power_of_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two(__pyx_v_num);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two(int __pyx_v_num) {
  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("power_of_two", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":236
 *     def power_of_two(int num):
 *         """ Returns whether or not the supplied number is a power of 2 """
 *         return ((num & (num - 1)) == 0) and num != 0             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((__pyx_v_num & (__pyx_v_num - 1)) == 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_num != 0);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":234
 * 
 *     @staticmethod
 *     def power_of_two(int num):             # <<<<<<<<<<<<<<
 *         """ Returns whether or not the supplied number is a power of 2 """
 *         return ((num & (num - 1)) == 0) and num != 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.power_of_two", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":239
 * 
 *     @staticmethod
 *     def db_to_gain(float db):             # <<<<<<<<<<<<<<
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 *         return pow(10, db / 20.0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain[] = "AudioInterface.db_to_gain(float db)\nConverts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain = {"db_to_gain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_db;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db_to_gain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,0};
    PyObject* values[1] = {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  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_db)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "db_to_gain") < 0)) __PYX_ERR(0, 239, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_db = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_db == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("db_to_gain", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.db_to_gain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain(__pyx_v_db);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain(float __pyx_v_db) {
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("db_to_gain", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":241
 *     def db_to_gain(float db):
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 *         return pow(10, db / 20.0)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pow); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_db) / 20.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_10, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_10, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_int_10);
    __Pyx_GIVEREF(__pyx_int_10);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_int_10);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":239
 * 
 *     @staticmethod
 *     def db_to_gain(float db):             # <<<<<<<<<<<<<<
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 *         return pow(10, db / 20.0)
 */

  /* function exit code */
  __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_6);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.db_to_gain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain[] = "AudioInterface.string_to_gain(gain)\nConverts a string to a gain value (0.0 to 1.0)";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain = {"string_to_gain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_gain = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string_to_gain (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gain,0};
    PyObject* values[1] = {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  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gain)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_to_gain") < 0)) __PYX_ERR(0, 244, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_gain = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("string_to_gain", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 244, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_gain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain(__pyx_v_gain);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":249
 * 
 *         if gain_string.endswith('DB'):
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 249, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_gain_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_gain.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 249, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gain_string)) { __Pyx_RaiseClosureNameError("gain_string"); __PYX_ERR(0, 249, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gain_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 249, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_gain_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_gain_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 249, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain(PyObject *__pyx_v_gain) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *__pyx_cur_scope;
  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;
  double __pyx_t_5;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  double __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("string_to_gain", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 244, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mpfmc/core/audio/audio_interface.pyx":246
 *     def string_to_gain(gain):
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()             # <<<<<<<<<<<<<<
 * 
 *         if gain_string.endswith('DB'):
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_gain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_gain_string = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":248
 *         cdef str gain_string = str(gain).upper()
 * 
 *         if gain_string.endswith('DB'):             # <<<<<<<<<<<<<<
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_gain_string == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 248, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyUnicode_Tailmatch(__pyx_cur_scope->__pyx_v_gain_string, __pyx_n_u_DB, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 248, __pyx_L1_error)
  if ((__pyx_t_4 != 0)) {

    /* "mpfmc/core/audio/audio_interface.pyx":249
 * 
 *         if gain_string.endswith('DB'):
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_gain_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_gain_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":250
 *         if gain_string.endswith('DB'):
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)             # <<<<<<<<<<<<<<
 * 
 *         return min(max(float(gain_string), 0.0), 1.0)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = 1.0;
    __pyx_t_6 = 0.0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_db_to_gain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_v_gain_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
      __pyx_t_7 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {
      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_t_2;
      __pyx_t_2 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":248
 *         cdef str gain_string = str(gain).upper()
 * 
 *         if gain_string.endswith('DB'):             # <<<<<<<<<<<<<<
 *             gain_string = ''.join(i for i in gain_string if not i.isalpha())
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":252
 *             return min(max(AudioInterface.db_to_gain(float(gain_string)), 0.0), 1.0)
 * 
 *         return min(max(float(gain_string), 0.0), 1.0)             # <<<<<<<<<<<<<<
 * 
 *     def convert_seconds_to_samples(self, float seconds):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = 1.0;
  __pyx_t_6 = 0.0;
  __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_cur_scope->__pyx_v_gain_string); if (unlikely(__pyx_t_8 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error)
  if (((__pyx_t_6 > __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_6;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_t_6 = __pyx_t_9;
  if (((__pyx_t_5 < __pyx_t_6) != 0)) {
    __pyx_t_9 = __pyx_t_5;
  } else {
    __pyx_t_9 = __pyx_t_6;
  }
  __pyx_t_3 = PyFloat_FromDouble(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_gain", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":254
 *         return min(max(float(gain_string), 0.0), 1.0)
 * 
 *     def convert_seconds_to_samples(self, float seconds):             # <<<<<<<<<<<<<<
 *         """Converts the specified number of seconds into samples (based on current sample rate)"""
 *         return int(self.audio_callback_data.sample_rate * seconds)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_17convert_seconds_to_samples(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_16convert_seconds_to_samples[] = "AudioInterface.convert_seconds_to_samples(self, float seconds)\nConverts the specified number of seconds into samples (based on current sample rate)";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_17convert_seconds_to_samples(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds) {
  float __pyx_v_seconds;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert_seconds_to_samples (wrapper)", 0);
  assert(__pyx_arg_seconds); {
    __pyx_v_seconds = __pyx_PyFloat_AsFloat(__pyx_arg_seconds); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_seconds_to_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_16convert_seconds_to_samples(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((float)__pyx_v_seconds));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_16convert_seconds_to_samples(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_seconds) {
  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("convert_seconds_to_samples", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":256
 *     def convert_seconds_to_samples(self, float seconds):
 *         """Converts the specified number of seconds into samples (based on current sample rate)"""
 *         return int(self.audio_callback_data.sample_rate * seconds)             # <<<<<<<<<<<<<<
 * 
 *     def convert_seconds_to_buffer_length(self, float seconds):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromDouble((__pyx_v_self->audio_callback_data.sample_rate * __pyx_v_seconds)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":254
 *         return min(max(float(gain_string), 0.0), 1.0)
 * 
 *     def convert_seconds_to_samples(self, float seconds):             # <<<<<<<<<<<<<<
 *         """Converts the specified number of seconds into samples (based on current sample rate)"""
 *         return int(self.audio_callback_data.sample_rate * seconds)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_seconds_to_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":258
 *         return int(self.audio_callback_data.sample_rate * seconds)
 * 
 *     def convert_seconds_to_buffer_length(self, float seconds):             # <<<<<<<<<<<<<<
 *         """Convert the specified number of seconds into a buffer length (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_19convert_seconds_to_buffer_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_18convert_seconds_to_buffer_length[] = "AudioInterface.convert_seconds_to_buffer_length(self, float seconds)\nConvert the specified number of seconds into a buffer length (based on current\n        sample rate, the number of audio channels, and the number of bytes per sample).";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_19convert_seconds_to_buffer_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_seconds) {
  float __pyx_v_seconds;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert_seconds_to_buffer_length (wrapper)", 0);
  assert(__pyx_arg_seconds); {
    __pyx_v_seconds = __pyx_PyFloat_AsFloat(__pyx_arg_seconds); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_seconds_to_buffer_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_18convert_seconds_to_buffer_length(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((float)__pyx_v_seconds));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_18convert_seconds_to_buffer_length(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_seconds) {
  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("convert_seconds_to_buffer_length", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":261
 *         """Convert the specified number of seconds into a buffer length (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 *         return int(seconds * self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample)             # <<<<<<<<<<<<<<
 * 
 *     def convert_buffer_length_to_seconds(self, int buffer_length):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromDouble((((__pyx_v_seconds * __pyx_v_self->audio_callback_data.sample_rate) * __pyx_v_self->audio_callback_data.channels) * __pyx_v_self->audio_callback_data.bytes_per_sample)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":258
 *         return int(self.audio_callback_data.sample_rate * seconds)
 * 
 *     def convert_seconds_to_buffer_length(self, float seconds):             # <<<<<<<<<<<<<<
 *         """Convert the specified number of seconds into a buffer length (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_seconds_to_buffer_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":263
 *         return int(seconds * self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample)
 * 
 *     def convert_buffer_length_to_seconds(self, int buffer_length):             # <<<<<<<<<<<<<<
 *         """Convert the specified buffer length into a time in seconds (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_21convert_buffer_length_to_seconds(PyObject *__pyx_v_self, PyObject *__pyx_arg_buffer_length); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_20convert_buffer_length_to_seconds[] = "AudioInterface.convert_buffer_length_to_seconds(self, int buffer_length)\nConvert the specified buffer length into a time in seconds (based on current\n        sample rate, the number of audio channels, and the number of bytes per sample).";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_21convert_buffer_length_to_seconds(PyObject *__pyx_v_self, PyObject *__pyx_arg_buffer_length) {
  int __pyx_v_buffer_length;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert_buffer_length_to_seconds (wrapper)", 0);
  assert(__pyx_arg_buffer_length); {
    __pyx_v_buffer_length = __Pyx_PyInt_As_int(__pyx_arg_buffer_length); if (unlikely((__pyx_v_buffer_length == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_buffer_length_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_20convert_buffer_length_to_seconds(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((int)__pyx_v_buffer_length));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_20convert_buffer_length_to_seconds(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, int __pyx_v_buffer_length) {
  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("convert_buffer_length_to_seconds", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":266
 *         """Convert the specified buffer length into a time in seconds (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 *         return round(buffer_length / (self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample), 3)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((__pyx_v_self->audio_callback_data.sample_rate * __pyx_v_self->audio_callback_data.channels) * __pyx_v_self->audio_callback_data.bytes_per_sample);
  if (unlikely(__pyx_t_1 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 266, __pyx_L1_error)
  }
  __pyx_t_2 = PyFloat_FromDouble((((double)__pyx_v_buffer_length) / ((double)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":263
 *         return int(seconds * self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample)
 * 
 *     def convert_buffer_length_to_seconds(self, int buffer_length):             # <<<<<<<<<<<<<<
 *         """Convert the specified buffer length into a time in seconds (based on current
 *         sample rate, the number of audio channels, and the number of bytes per sample)."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.convert_buffer_length_to_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs[] = "AudioInterface.string_to_secs(time)\nDecodes a string of real-world time into a float of seconds.\n        Example inputs:\n\n        234ms\n        2s\n        None\n\n        If no \"s\" or \"ms\" is provided, this method assumes \"seconds.\"\n\n        If time is 'None' or a string of 'None', this method returns 0.0.\n\n        Returns:\n            Float. The examples listed above return 0.234, 2.0 and 0.0,\n            respectively\n        ";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs = {"string_to_secs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_time = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string_to_secs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,0};
    PyObject* values[1] = {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  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "string_to_secs") < 0)) __PYX_ERR(0, 269, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_time = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("string_to_secs", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 269, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs(__pyx_v_time);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":288
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) / 1000.0
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 288, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_secs_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 288, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string)) { __Pyx_RaiseClosureNameError("time_string"); __PYX_ERR(0, 288, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 288, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":292
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string)
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 292, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_secs_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 292, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string)) { __Pyx_RaiseClosureNameError("time_string"); __PYX_ERR(0, 292, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 292, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 292, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":296
 * 
 *         elif 'D' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 86400
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_6genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 296, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_8generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_secs_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 296, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string)) { __Pyx_RaiseClosureNameError("time_string"); __PYX_ERR(0, 296, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 296, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 296, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":300
 * 
 *         elif 'H' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 3600
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_9genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 300, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_11generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_secs_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 300, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string)) { __Pyx_RaiseClosureNameError("time_string"); __PYX_ERR(0, 300, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 300, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 300, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 300, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "mpfmc/core/audio/audio_interface.pyx":304
 * 
 *         elif 'M' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 60
 * 
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_12genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 304, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_14generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_string_to_secs_locals_genexpr, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!gen)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  void *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string)) { __Pyx_RaiseClosureNameError("time_string"); __PYX_ERR(0, 304, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(0, 304, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string);
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_time_string;
  __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 304, __pyx_L1_error)
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
    __pyx_t_2 = __pyx_t_7;
    __pyx_cur_scope->__pyx_v_i = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
    __pyx_t_8 = Py_UNICODE_ISALPHA(__pyx_cur_scope->__pyx_v_i); 
    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
    if (__pyx_t_9) {
      __pyx_t_10 = PyUnicode_FromOrdinal(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 304, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs(PyObject *__pyx_v_time) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_cur_scope;
  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_t_5;
  double __pyx_t_6;
  int __pyx_t_7;
  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("string_to_secs", 0);
  __pyx_cur_scope = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *)__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 269, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "mpfmc/core/audio/audio_interface.pyx":285
 *             respectively
 *         """
 *         cdef str time_string = str(time).upper()             # <<<<<<<<<<<<<<
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_time_string = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":287
 *         cdef str time_string = str(time).upper()
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) / 1000.0
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 287, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyUnicode_Tailmatch(__pyx_cur_scope->__pyx_v_time_string, __pyx_n_u_MS, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 287, __pyx_L1_error)
  if (!(__pyx_t_5 != 0)) {
  } else {
    __pyx_t_4 = (__pyx_t_5 != 0);
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 287, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyUnicode_Tailmatch(__pyx_cur_scope->__pyx_v_time_string, __pyx_n_u_MSEC, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 287, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "mpfmc/core/audio/audio_interface.pyx":288
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) / 1000.0
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_time_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_time_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":289
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) / 1000.0             # <<<<<<<<<<<<<<
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble((__pyx_t_6 / 1000.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":287
 *         cdef str time_string = str(time).upper()
 * 
 *         if time_string.endswith('MS') or time_string.endswith('MSEC'):             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) / 1000.0
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":291
 *             return float(time_string) / 1000.0
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string)
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 291, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyUnicode_Tailmatch(__pyx_cur_scope->__pyx_v_time_string, __pyx_n_u_S, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
  if (!(__pyx_t_5 != 0)) {
  } else {
    __pyx_t_4 = (__pyx_t_5 != 0);
    goto __pyx_L6_bool_binop_done;
  }
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "endswith");
    __PYX_ERR(0, 291, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyUnicode_Tailmatch(__pyx_cur_scope->__pyx_v_time_string, __pyx_n_u_SEC, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_4) {

    /* "mpfmc/core/audio/audio_interface.pyx":292
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string)
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_time_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_time_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":293
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string)             # <<<<<<<<<<<<<<
 * 
 *         elif 'D' in time_string:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":291
 *             return float(time_string) / 1000.0
 * 
 *         elif time_string.endswith('S') or time_string.endswith('SEC'):             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":295
 *             return float(time_string)
 * 
 *         elif 'D' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 86400
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 295, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PyUnicode_ContainsTF(__pyx_n_u_D, __pyx_cur_scope->__pyx_v_time_string, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mpfmc/core/audio/audio_interface.pyx":296
 * 
 *         elif 'D' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 86400
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_time_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_time_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":297
 *         elif 'D' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 86400             # <<<<<<<<<<<<<<
 * 
 *         elif 'H' in time_string:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble((__pyx_t_6 * 86400.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":295
 *             return float(time_string)
 * 
 *         elif 'D' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 86400
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":299
 *             return float(time_string) * 86400
 * 
 *         elif 'H' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 3600
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 299, __pyx_L1_error)
  }
  __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_n_u_H, __pyx_cur_scope->__pyx_v_time_string, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "mpfmc/core/audio/audio_interface.pyx":300
 * 
 *         elif 'H' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 3600
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_9genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_time_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_time_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":301
 *         elif 'H' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 3600             # <<<<<<<<<<<<<<
 * 
 *         elif 'M' in time_string:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble((__pyx_t_6 * 3600.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":299
 *             return float(time_string) * 86400
 * 
 *         elif 'H' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 3600
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":303
 *             return float(time_string) * 3600
 * 
 *         elif 'M' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 60
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_time_string == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 303, __pyx_L1_error)
  }
  __pyx_t_4 = (__Pyx_PyUnicode_ContainsTF(__pyx_n_u_M, __pyx_cur_scope->__pyx_v_time_string, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "mpfmc/core/audio/audio_interface.pyx":304
 * 
 *         elif 'M' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())             # <<<<<<<<<<<<<<
 *             return float(time_string) * 60
 * 
 */
    __pyx_t_1 = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_secs_12genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_time_string);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_time_string, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":305
 *         elif 'M' in time_string:
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 60             # <<<<<<<<<<<<<<
 * 
 *         elif not time_string or time_string == 'NONE':
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(__pyx_t_6 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 305, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble((__pyx_t_6 * 60.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":303
 *             return float(time_string) * 3600
 * 
 *         elif 'M' in time_string:             # <<<<<<<<<<<<<<
 *             time_string = ''.join(i for i in time_string if not i.isalpha())
 *             return float(time_string) * 60
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":307
 *             return float(time_string) * 60
 * 
 *         elif not time_string or time_string == 'NONE':             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_time_string != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_cur_scope->__pyx_v_time_string) != 0);
  __pyx_t_7 = ((!__pyx_t_4) != 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_time_string, __pyx_n_u_NONE, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_7 != 0);
  __pyx_t_5 = __pyx_t_4;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_5) {

    /* "mpfmc/core/audio/audio_interface.pyx":308
 * 
 *         elif not time_string or time_string == 'NONE':
 *             return 0.0             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_float_0_0);
    __pyx_r = __pyx_float_0_0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":307
 *             return float(time_string) * 60
 * 
 *         elif not time_string or time_string == 'NONE':             # <<<<<<<<<<<<<<
 *             return 0.0
 * 
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":311
 * 
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 return float(time_string)
 *             except:
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "mpfmc/core/audio/audio_interface.pyx":312
 *         else:
 *             try:
 *                 return float(time_string)             # <<<<<<<<<<<<<<
 *             except:
 *                 return 0.0
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_cur_scope->__pyx_v_time_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L14_try_return;

        /* "mpfmc/core/audio/audio_interface.pyx":311
 * 
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 return float(time_string)
 *             except:
 */
      }
      __pyx_L10_error:;
      __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;

      /* "mpfmc/core/audio/audio_interface.pyx":313
 *             try:
 *                 return float(time_string)
 *             except:             # <<<<<<<<<<<<<<
 *                 return 0.0
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 313, __pyx_L12_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_2);

        /* "mpfmc/core/audio/audio_interface.pyx":314
 *                 return float(time_string)
 *             except:
 *                 return 0.0             # <<<<<<<<<<<<<<
 * 
 *     def string_to_samples(self, samples):
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_float_0_0);
        __pyx_r = __pyx_float_0_0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L13_except_return;
      }
      __pyx_L12_except_error:;

      /* "mpfmc/core/audio/audio_interface.pyx":311
 * 
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 return float(time_string)
 *             except:
 */
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L14_try_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
      __pyx_L13_except_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
    }
  }

  /* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_secs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":316
 *                 return 0.0
 * 
 *     def string_to_samples(self, samples):             # <<<<<<<<<<<<<<
 *         """
 *         Converts a string to an integer value representing the number of samples.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_25string_to_samples(PyObject *__pyx_v_self, PyObject *__pyx_v_samples); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_24string_to_samples[] = "AudioInterface.string_to_samples(self, samples)\n\n        Converts a string to an integer value representing the number of samples.\n        Args:\n            samples: String containing either a time string or an integer number\n                of samples.\n\n        Returns:\n            Integer containing the number of samples.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_25string_to_samples(PyObject *__pyx_v_self, PyObject *__pyx_v_samples) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string_to_samples (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_24string_to_samples(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v_samples));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_24string_to_samples(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_samples) {
  PyObject *__pyx_v_samples_string = 0;
  float __pyx_v_seconds;
  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;
  float __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("string_to_samples", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":326
 *             Integer containing the number of samples.
 *         """
 *         cdef str samples_string = str(samples).upper()             # <<<<<<<<<<<<<<
 * 
 *         # If the string contains only digits we assume it is already in samples
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 326, __pyx_L1_error)
  __pyx_v_samples_string = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":329
 * 
 *         # If the string contains only digits we assume it is already in samples
 *         try:             # <<<<<<<<<<<<<<
 *             return int(float(samples_string))
 *         except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "mpfmc/core/audio/audio_interface.pyx":330
 *         # If the string contains only digits we assume it is already in samples
 *         try:
 *             return int(float(samples_string))             # <<<<<<<<<<<<<<
 *         except:
 *             pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_v_samples_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L7_try_return;

      /* "mpfmc/core/audio/audio_interface.pyx":329
 * 
 *         # If the string contains only digits we assume it is already in samples
 *         try:             # <<<<<<<<<<<<<<
 *             return int(float(samples_string))
 *         except:
 */
    }
    __pyx_L3_error:;
    __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;

    /* "mpfmc/core/audio/audio_interface.pyx":331
 *         try:
 *             return int(float(samples_string))
 *         except:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    __pyx_L7_try_return:;

    /* "mpfmc/core/audio/audio_interface.pyx":329
 * 
 *         # If the string contains only digits we assume it is already in samples
 *         try:             # <<<<<<<<<<<<<<
 *             return int(float(samples_string))
 *         except:
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
  }

  /* "mpfmc/core/audio/audio_interface.pyx":336
 *         # Time strings are also permitted and will be converted to seconds
 *         # and then to samples using the current sample rate.
 *         cdef float seconds = AudioInterface.string_to_secs(samples_string)             # <<<<<<<<<<<<<<
 *         return int(self.audio_callback_data.sample_rate * seconds)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface), __pyx_n_s_string_to_secs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_samples_string) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_samples_string);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_seconds = __pyx_t_7;

  /* "mpfmc/core/audio/audio_interface.pyx":337
 *         # and then to samples using the current sample rate.
 *         cdef float seconds = AudioInterface.string_to_secs(samples_string)
 *         return int(self.audio_callback_data.sample_rate * seconds)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_FromDouble((__pyx_v_self->audio_callback_data.sample_rate * __pyx_v_seconds)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":316
 *                 return 0.0
 * 
 *     def string_to_samples(self, samples):             # <<<<<<<<<<<<<<
 *         """
 *         Converts a string to an integer value representing the number of samples.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.string_to_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_samples_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":340
 * 
 *     @classmethod
 *     def get_sdl_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the SDL library
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_27get_sdl_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_26get_sdl_version[] = "AudioInterface.get_sdl_version(type cls)\n\n        Returns the version of the SDL library\n        :return: SDL library version string\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_27get_sdl_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sdl_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_26get_sdl_version(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_26get_sdl_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
  struct SDL_version __pyx_v_version;
  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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sdl_version", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":346
 *         """
 *         cdef SDL_version version
 *         SDL_GetVersion(&version)             # <<<<<<<<<<<<<<
 *         return 'SDL {}.{}.{}'.format(version.major, version.minor, version.patch)
 * 
 */
  SDL_GetVersion((&__pyx_v_version));

  /* "mpfmc/core/audio/audio_interface.pyx":347
 *         cdef SDL_version version
 *         SDL_GetVersion(&version)
 *         return 'SDL {}.{}.{}'.format(version.major, version.minor, version.patch)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_SDL, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_Uint8(__pyx_v_version.major); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_Uint8(__pyx_v_version.minor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_Uint8(__pyx_v_version.patch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":340
 * 
 *     @classmethod
 *     def get_sdl_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the SDL library
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_sdl_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":350
 * 
 *     @classmethod
 *     def get_sdl_mixer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the dynamically linked SDL_Mixer library
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_29get_sdl_mixer_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_28get_sdl_mixer_version[] = "AudioInterface.get_sdl_mixer_version(type cls)\n\n        Returns the version of the dynamically linked SDL_Mixer library\n        :return: SDL_Mixer library version string\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_29get_sdl_mixer_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_sdl_mixer_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_28get_sdl_mixer_version(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_28get_sdl_mixer_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
  struct SDL_version const *__pyx_v_version;
  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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_sdl_mixer_version", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":355
 *         :return: SDL_Mixer library version string
 *         """
 *         cdef const SDL_version *version = Mix_Linked_Version()             # <<<<<<<<<<<<<<
 *         return 'SDL_Mixer {}.{}.{}'.format(version.major, version.minor, version.patch)
 * 
 */
  __pyx_v_version = Mix_Linked_Version();

  /* "mpfmc/core/audio/audio_interface.pyx":356
 *         """
 *         cdef const SDL_version *version = Mix_Linked_Version()
 *         return 'SDL_Mixer {}.{}.{}'.format(version.major, version.minor, version.patch)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_SDL_Mixer, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_Uint8(__pyx_v_version->major); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_Uint8(__pyx_v_version->minor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_Uint8(__pyx_v_version->patch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":350
 * 
 *     @classmethod
 *     def get_sdl_mixer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the dynamically linked SDL_Mixer library
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_sdl_mixer_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":359
 * 
 *     @classmethod
 *     def get_gstreamer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GStreamer library
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_31get_gstreamer_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_30get_gstreamer_version[] = "AudioInterface.get_gstreamer_version(type cls)\n\n        Returns the version of the GStreamer library\n        :return: GStreamer library version string\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_31get_gstreamer_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_gstreamer_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_30get_gstreamer_version(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_30get_gstreamer_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
  PyObject *__pyx_v_gst_version = 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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_gstreamer_version", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":364
 *         :return: GStreamer library version string
 *         """
 *         gst_version = get_gst_version()             # <<<<<<<<<<<<<<
 *         return 'GStreamer {}.{}.{}.{}'.format(
 *             gst_version[0], gst_version[1], gst_version[2], gst_version[3])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_gst_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_gst_version = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":365
 *         """
 *         gst_version = get_gst_version()
 *         return 'GStreamer {}.{}.{}.{}'.format(             # <<<<<<<<<<<<<<
 *             gst_version[0], gst_version[1], gst_version[2], gst_version[3])
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_GStreamer, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mpfmc/core/audio/audio_interface.pyx":366
 *         gst_version = get_gst_version()
 *         return 'GStreamer {}.{}.{}.{}'.format(
 *             gst_version[0], gst_version[1], gst_version[2], gst_version[3])             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gst_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_gst_version, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_gst_version, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_gst_version, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":359
 * 
 *     @classmethod
 *     def get_gstreamer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GStreamer library
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_gstreamer_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gst_version);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":369
 * 
 *     @classmethod
 *     def get_glib_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GLib library
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_33get_glib_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_32get_glib_version[] = "AudioInterface.get_glib_version(type cls)\n\n        Returns the version of the GLib library\n        :return: GLib library version string\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_33get_glib_version(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_glib_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_32get_glib_version(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_32get_glib_version(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
  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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_glib_version", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":374
 *         :return: GLib library version string
 *         """
 *         return 'GLib {}.{}.{}'.format(             # <<<<<<<<<<<<<<
 *             glib_major_version, glib_minor_version, glib_micro_version)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_GLib, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mpfmc/core/audio/audio_interface.pyx":375
 *         """
 *         return 'GLib {}.{}.{}'.format(
 *             glib_major_version, glib_minor_version, glib_micro_version)             # <<<<<<<<<<<<<<
 * 
 *     def supported_extensions(self):
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(glib_major_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(glib_minor_version); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(glib_micro_version); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":369
 * 
 *     @classmethod
 *     def get_glib_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GLib library
 */

  /* function exit code */
  __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_glib_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":377
 *             glib_major_version, glib_minor_version, glib_micro_version)
 * 
 *     def supported_extensions(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the file extensions that are supported by the audio interface.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_35supported_extensions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_34supported_extensions[] = "AudioInterface.supported_extensions(self)\n\n        Get the file extensions that are supported by the audio interface.\n        Returns:\n            A list of file extensions supported.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_35supported_extensions(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("supported_extensions (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_34supported_extensions(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_34supported_extensions(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__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("supported_extensions", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":383
 *             A list of file extensions supported.
 *         """
 *         return ["wav", "ogg", "flac",]             # <<<<<<<<<<<<<<
 * 
 *     def get_master_volume(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_u_wav);
  __Pyx_GIVEREF(__pyx_n_u_wav);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wav);
  __Pyx_INCREF(__pyx_n_u_ogg);
  __Pyx_GIVEREF(__pyx_n_u_ogg);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_ogg);
  __Pyx_INCREF(__pyx_n_u_flac);
  __Pyx_GIVEREF(__pyx_n_u_flac);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_flac);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":377
 *             glib_major_version, glib_minor_version, glib_micro_version)
 * 
 *     def supported_extensions(self):             # <<<<<<<<<<<<<<
 *         """
 *         Get the file extensions that are supported by the audio interface.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.supported_extensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":385
 *         return ["wav", "ogg", "flac",]
 * 
 *     def get_master_volume(self):             # <<<<<<<<<<<<<<
 *         return round(self.audio_callback_data.master_volume / SDL_MIX_MAXVOLUME, 2)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_37get_master_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_36get_master_volume[] = "AudioInterface.get_master_volume(self)";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_37get_master_volume(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_master_volume (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_36get_master_volume(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_36get_master_volume(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__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("get_master_volume", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":386
 * 
 *     def get_master_volume(self):
 *         return round(self.audio_callback_data.master_volume / SDL_MIX_MAXVOLUME, 2)             # <<<<<<<<<<<<<<
 * 
 *     def set_master_volume(self, float volume):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(SDL_MIX_MAXVOLUME == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 386, __pyx_L1_error)
  }
  __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_self->audio_callback_data.master_volume) / ((double)SDL_MIX_MAXVOLUME))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __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;

  /* "mpfmc/core/audio/audio_interface.pyx":385
 *         return ["wav", "ogg", "flac",]
 * 
 *     def get_master_volume(self):             # <<<<<<<<<<<<<<
 *         return round(self.audio_callback_data.master_volume / SDL_MIX_MAXVOLUME, 2)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_master_volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":388
 *         return round(self.audio_callback_data.master_volume / SDL_MIX_MAXVOLUME, 2)
 * 
 *     def set_master_volume(self, float volume):             # <<<<<<<<<<<<<<
 *         SDL_LockAudio()
 *         self.audio_callback_data.master_volume = <Uint8>min(max(volume * SDL_MIX_MAXVOLUME, 0), SDL_MIX_MAXVOLUME)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_39set_master_volume(PyObject *__pyx_v_self, PyObject *__pyx_arg_volume); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_38set_master_volume[] = "AudioInterface.set_master_volume(self, float volume)";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_39set_master_volume(PyObject *__pyx_v_self, PyObject *__pyx_arg_volume) {
  float __pyx_v_volume;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_master_volume (wrapper)", 0);
  assert(__pyx_arg_volume); {
    __pyx_v_volume = __pyx_PyFloat_AsFloat(__pyx_arg_volume); if (unlikely((__pyx_v_volume == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.set_master_volume", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_38set_master_volume(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((float)__pyx_v_volume));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_38set_master_volume(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_volume) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  float __pyx_t_3;
  float __pyx_t_4;
  __Pyx_RefNannySetupContext("set_master_volume", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":389
 * 
 *     def set_master_volume(self, float volume):
 *         SDL_LockAudio()             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.master_volume = <Uint8>min(max(volume * SDL_MIX_MAXVOLUME, 0), SDL_MIX_MAXVOLUME)
 *         SDL_UnlockAudio()
 */
  SDL_LockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":390
 *     def set_master_volume(self, float volume):
 *         SDL_LockAudio()
 *         self.audio_callback_data.master_volume = <Uint8>min(max(volume * SDL_MIX_MAXVOLUME, 0), SDL_MIX_MAXVOLUME)             # <<<<<<<<<<<<<<
 *         SDL_UnlockAudio()
 * 
 */
  __pyx_t_1 = SDL_MIX_MAXVOLUME;
  __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_v_volume * SDL_MIX_MAXVOLUME);
  if (((__pyx_t_2 > __pyx_t_3) != 0)) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_3 = __pyx_t_4;
  if (((__pyx_t_1 < __pyx_t_3) != 0)) {
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_v_self->audio_callback_data.master_volume = ((Uint8)__pyx_t_4);

  /* "mpfmc/core/audio/audio_interface.pyx":391
 *         SDL_LockAudio()
 *         self.audio_callback_data.master_volume = <Uint8>min(max(volume * SDL_MIX_MAXVOLUME, 0), SDL_MIX_MAXVOLUME)
 *         SDL_UnlockAudio()             # <<<<<<<<<<<<<<
 * 
 *     def get_settings(self):
 */
  SDL_UnlockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":388
 *         return round(self.audio_callback_data.master_volume / SDL_MIX_MAXVOLUME, 2)
 * 
 *     def set_master_volume(self, float volume):             # <<<<<<<<<<<<<<
 *         SDL_LockAudio()
 *         self.audio_callback_data.master_volume = <Uint8>min(max(volume * SDL_MIX_MAXVOLUME, 0), SDL_MIX_MAXVOLUME)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":393
 *         SDL_UnlockAudio()
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         """
 *         Gets the current audio interface settings. This method is only intended for testing purposes.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_41get_settings(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_40get_settings[] = "AudioInterface.get_settings(self)\n\n        Gets the current audio interface settings. This method is only intended for testing purposes.\n        Returns:\n            A dictionary containing the current audio interface settings or None if the\n            audio interface is not enabled.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_41get_settings(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_settings (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_40get_settings(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_40get_settings(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  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("get_settings", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":400
 *             audio interface is not enabled.
 *         """
 *         if self.enabled:             # <<<<<<<<<<<<<<
 *             return {'sample_rate': self.audio_callback_data.sample_rate,
 *                     'audio_channels': self.audio_callback_data.channels,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enabled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "mpfmc/core/audio/audio_interface.pyx":401
 *         """
 *         if self.enabled:
 *             return {'sample_rate': self.audio_callback_data.sample_rate,             # <<<<<<<<<<<<<<
 *                     'audio_channels': self.audio_callback_data.channels,
 *                     'buffer_samples': self.audio_callback_data.buffer_samples,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->audio_callback_data.sample_rate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sample_rate, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":402
 *         if self.enabled:
 *             return {'sample_rate': self.audio_callback_data.sample_rate,
 *                     'audio_channels': self.audio_callback_data.channels,             # <<<<<<<<<<<<<<
 *                     'buffer_samples': self.audio_callback_data.buffer_samples,
 *                     'buffer_size': self.audio_callback_data.buffer_size,
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->audio_callback_data.channels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_audio_channels, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":403
 *             return {'sample_rate': self.audio_callback_data.sample_rate,
 *                     'audio_channels': self.audio_callback_data.channels,
 *                     'buffer_samples': self.audio_callback_data.buffer_samples,             # <<<<<<<<<<<<<<
 *                     'buffer_size': self.audio_callback_data.buffer_size,
 *                     'bytes_per_sample': self.audio_callback_data.bytes_per_sample,
 */
    __pyx_t_3 = __Pyx_PyInt_From_Uint16(__pyx_v_self->audio_callback_data.buffer_samples); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_buffer_samples, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":404
 *                     'audio_channels': self.audio_callback_data.channels,
 *                     'buffer_samples': self.audio_callback_data.buffer_samples,
 *                     'buffer_size': self.audio_callback_data.buffer_size,             # <<<<<<<<<<<<<<
 *                     'bytes_per_sample': self.audio_callback_data.bytes_per_sample,
 *                     'seconds_to_bytes_factor': self.audio_callback_data.seconds_to_bytes_factor
 */
    __pyx_t_3 = __Pyx_PyInt_From_Uint32(__pyx_v_self->audio_callback_data.buffer_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_buffer_size, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":405
 *                     'buffer_samples': self.audio_callback_data.buffer_samples,
 *                     'buffer_size': self.audio_callback_data.buffer_size,
 *                     'bytes_per_sample': self.audio_callback_data.bytes_per_sample,             # <<<<<<<<<<<<<<
 *                     'seconds_to_bytes_factor': self.audio_callback_data.seconds_to_bytes_factor
 *                     }
 */
    __pyx_t_3 = __Pyx_PyInt_From_Uint8(__pyx_v_self->audio_callback_data.bytes_per_sample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_bytes_per_sample, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":406
 *                     'buffer_size': self.audio_callback_data.buffer_size,
 *                     'bytes_per_sample': self.audio_callback_data.bytes_per_sample,
 *                     'seconds_to_bytes_factor': self.audio_callback_data.seconds_to_bytes_factor             # <<<<<<<<<<<<<<
 *                     }
 *         else:
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->audio_callback_data.seconds_to_bytes_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_seconds_to_bytes_factor, __pyx_t_3) < 0) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":400
 *             audio interface is not enabled.
 *         """
 *         if self.enabled:             # <<<<<<<<<<<<<<
 *             return {'sample_rate': self.audio_callback_data.sample_rate,
 *                     'audio_channels': self.audio_callback_data.channels,
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":409
 *                     }
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cdef write_gst_log_message(self, message_type, message):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":393
 *         SDL_UnlockAudio()
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         """
 *         Gets the current audio interface settings. This method is only intended for testing purposes.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_settings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":411
 *             return None
 * 
 *     cdef write_gst_log_message(self, message_type, message):             # <<<<<<<<<<<<<<
 *         """Write GStreamer log message to the mpfmc log"""
 *         # print(message_type, message)
 */

static PyObject *__pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_write_gst_log_message(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_message_type, PyObject *__pyx_v_message) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("write_gst_log_message", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":414
 *         """Write GStreamer log message to the mpfmc log"""
 *         # print(message_type, message)
 *         if message_type == 'error':             # <<<<<<<<<<<<<<
 *             self.log.error(message)
 *         elif message_type == 'warning':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_message_type, __pyx_n_u_error, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 414, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":415
 *         # print(message_type, message)
 *         if message_type == 'error':
 *             self.log.error(message)             # <<<<<<<<<<<<<<
 *         elif message_type == 'warning':
 *             self.log.warning(message)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __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;

    /* "mpfmc/core/audio/audio_interface.pyx":414
 *         """Write GStreamer log message to the mpfmc log"""
 *         # print(message_type, message)
 *         if message_type == 'error':             # <<<<<<<<<<<<<<
 *             self.log.error(message)
 *         elif message_type == 'warning':
 */
    goto __pyx_L3;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":416
 *         if message_type == 'error':
 *             self.log.error(message)
 *         elif message_type == 'warning':             # <<<<<<<<<<<<<<
 *             self.log.warning(message)
 *         elif message_type == 'info':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_message_type, __pyx_n_u_warning, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":417
 *             self.log.error(message)
 *         elif message_type == 'warning':
 *             self.log.warning(message)             # <<<<<<<<<<<<<<
 *         elif message_type == 'info':
 *             self.log.info(message)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __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;

    /* "mpfmc/core/audio/audio_interface.pyx":416
 *         if message_type == 'error':
 *             self.log.error(message)
 *         elif message_type == 'warning':             # <<<<<<<<<<<<<<
 *             self.log.warning(message)
 *         elif message_type == 'info':
 */
    goto __pyx_L3;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":418
 *         elif message_type == 'warning':
 *             self.log.warning(message)
 *         elif message_type == 'info':             # <<<<<<<<<<<<<<
 *             self.log.info(message)
 * 
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_message_type, __pyx_n_u_info, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":419
 *             self.log.warning(message)
 *         elif message_type == 'info':
 *             self.log.info(message)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_message) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_message);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __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;

    /* "mpfmc/core/audio/audio_interface.pyx":418
 *         elif message_type == 'warning':
 *             self.log.warning(message)
 *         elif message_type == 'info':             # <<<<<<<<<<<<<<
 *             self.log.info(message)
 * 
 */
  }
  __pyx_L3:;

  /* "mpfmc/core/audio/audio_interface.pyx":411
 *             return None
 * 
 *     cdef write_gst_log_message(self, message_type, message):             # <<<<<<<<<<<<<<
 *         """Write GStreamer log message to the mpfmc log"""
 *         # print(message_type, message)
 */

  /* function exit code */
  __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_4);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.write_gst_log_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":422
 * 
 *     @property
 *     def enabled(self):             # <<<<<<<<<<<<<<
 *         return Mix_GetMusicHookData() != NULL
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled___get__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled___get__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__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__", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":423
 *     @property
 *     def enabled(self):
 *         return Mix_GetMusicHookData() != NULL             # <<<<<<<<<<<<<<
 * 
 *     def enable(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GetMusicHookData() != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":422
 * 
 *     @property
 *     def enabled(self):             # <<<<<<<<<<<<<<
 *         return Mix_GetMusicHookData() != NULL
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.enabled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":425
 *         return Mix_GetMusicHookData() != NULL
 * 
 *     def enable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Enables audio playback (begins audio processing)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_43enable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_42enable[] = "AudioInterface.enable(self)\n\n        Enables audio playback (begins audio processing)\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_43enable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enable (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_42enable(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_42enable(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  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("enable", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":429
 *         Enables audio playback (begins audio processing)
 *         """
 *         self.log.debug("Enabling audio playback")             # <<<<<<<<<<<<<<
 *         Mix_HookMusic(self.audio_callback, &self.audio_callback_data)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Enabling_audio_playback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Enabling_audio_playback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":430
 *         """
 *         self.log.debug("Enabling audio playback")
 *         Mix_HookMusic(self.audio_callback, &self.audio_callback_data)             # <<<<<<<<<<<<<<
 * 
 *     def disable(self):
 */
  Mix_HookMusic(((struct __pyx_vtabstruct_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self->__pyx_vtab)->audio_callback, (&__pyx_v_self->audio_callback_data));

  /* "mpfmc/core/audio/audio_interface.pyx":425
 *         return Mix_GetMusicHookData() != NULL
 * 
 *     def enable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Enables audio playback (begins audio processing)
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.AudioInterface.enable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":432
 *         Mix_HookMusic(self.audio_callback, &self.audio_callback_data)
 * 
 *     def disable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disables audio playback (stops audio processing)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_45disable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_44disable[] = "AudioInterface.disable(self)\n\n        Disables audio playback (stops audio processing)\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_45disable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disable (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_44disable(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_44disable(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  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("disable", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":436
 *         Disables audio playback (stops audio processing)
 *         """
 *         self.log.debug("Disabling audio playback")             # <<<<<<<<<<<<<<
 *         self.stop_all_sounds()
 *         Mix_HookMusic(NULL, NULL)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_Disabling_audio_playback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_Disabling_audio_playback);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":437
 *         """
 *         self.log.debug("Disabling audio playback")
 *         self.stop_all_sounds()             # <<<<<<<<<<<<<<
 *         Mix_HookMusic(NULL, NULL)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop_all_sounds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":438
 *         self.log.debug("Disabling audio playback")
 *         self.stop_all_sounds()
 *         Mix_HookMusic(NULL, NULL)             # <<<<<<<<<<<<<<
 * 
 *     def shutdown(self):
 */
  Mix_HookMusic(NULL, NULL);

  /* "mpfmc/core/audio/audio_interface.pyx":432
 *         Mix_HookMusic(self.audio_callback, &self.audio_callback_data)
 * 
 *     def disable(self):             # <<<<<<<<<<<<<<
 *         """
 *         Disables audio playback (stops audio processing)
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.AudioInterface.disable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":440
 *         Mix_HookMusic(NULL, NULL)
 * 
 *     def shutdown(self):             # <<<<<<<<<<<<<<
 *         """
 *         Shuts down the audio device
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_47shutdown(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_46shutdown[] = "AudioInterface.shutdown(self)\n\n        Shuts down the audio device\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_47shutdown(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shutdown (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_46shutdown(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_46shutdown(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  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("shutdown", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":444
 *         Shuts down the audio device
 *         """
 *         self.disable()             # <<<<<<<<<<<<<<
 *         Mix_CloseAudio()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":445
 *         """
 *         self.disable()
 *         Mix_CloseAudio()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  Mix_CloseAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":440
 *         Mix_HookMusic(NULL, NULL)
 * 
 *     def shutdown(self):             # <<<<<<<<<<<<<<
 *         """
 *         Shuts down the audio device
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.AudioInterface.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":448
 * 
 *     @staticmethod
 *     def get_max_tracks():             # <<<<<<<<<<<<<<
 *         """ Returns the maximum number of tracks allowed. """
 *         return MAX_TRACKS
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks[] = "AudioInterface.get_max_tracks()\n Returns the maximum number of tracks allowed. ";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks = {"get_max_tracks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_max_tracks (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_max_tracks", 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, "get_max_tracks", 0))) return NULL;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks();

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_max_tracks", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":450
 *     def get_max_tracks():
 *         """ Returns the maximum number of tracks allowed. """
 *         return MAX_TRACKS             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_8);
  __pyx_r = __pyx_int_8;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":448
 * 
 *     @staticmethod
 *     def get_max_tracks():             # <<<<<<<<<<<<<<
 *         """ Returns the maximum number of tracks allowed. """
 *         return MAX_TRACKS
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":453
 * 
 *     @staticmethod
 *     def get_max_markers():             # <<<<<<<<<<<<<<
 *         """Return the maximum number of markers allowed per sound"""
 *         return MAX_MARKERS
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers[] = "AudioInterface.get_max_markers()\nReturn the maximum number of markers allowed per sound";
static PyMethodDef __pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers = {"get_max_markers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers};
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_max_markers (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_max_markers", 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, "get_max_markers", 0))) return NULL;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers();

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_max_markers", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":455
 *     def get_max_markers():
 *         """Return the maximum number of markers allowed per sound"""
 *         return MAX_MARKERS             # <<<<<<<<<<<<<<
 * 
 *     def get_track_count(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_16);
  __pyx_r = __pyx_int_16;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":453
 * 
 *     @staticmethod
 *     def get_max_markers():             # <<<<<<<<<<<<<<
 *         """Return the maximum number of markers allowed per sound"""
 *         return MAX_MARKERS
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":457
 *         return MAX_MARKERS
 * 
 *     def get_track_count(self):             # <<<<<<<<<<<<<<
 *         """Returns the number of tracks that have been created."""
 *         return len(self.tracks)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_53get_track_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_52get_track_count[] = "AudioInterface.get_track_count(self)\nReturns the number of tracks that have been created.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_53get_track_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_track_count (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_52get_track_count(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_52get_track_count(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_track_count", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":459
 *     def get_track_count(self):
 *         """Returns the number of tracks that have been created."""
 *         return len(self.tracks)             # <<<<<<<<<<<<<<
 * 
 *     def get_track_names(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 459, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":457
 *         return MAX_MARKERS
 * 
 *     def get_track_count(self):             # <<<<<<<<<<<<<<
 *         """Returns the number of tracks that have been created."""
 *         return len(self.tracks)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":461
 *         return len(self.tracks)
 * 
 *     def get_track_names(self):             # <<<<<<<<<<<<<<
 *         """Return the list of names of tracks that have been created."""
 *         return [track.name for track in self.tracks]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_55get_track_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_54get_track_names[] = "AudioInterface.get_track_names(self)\nReturn the list of names of tracks that have been created.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_55get_track_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_track_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_54get_track_names(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_54get_track_names(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  PyObject *__pyx_8genexpr6__pyx_v_track = NULL;
  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 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_track_names", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":463
 *     def get_track_names(self):
 *         """Return the list of names of tracks that have been created."""
 *         return [track.name for track in self.tracks]             # <<<<<<<<<<<<<<
 * 
 *     def get_track(self, int track_num):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__pyx_v_self->tracks == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 463, __pyx_L5_error)
    }
    __pyx_t_2 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L5_error)
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_track, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_track, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 463, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_track); __pyx_8genexpr6__pyx_v_track = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_track); __pyx_8genexpr6__pyx_v_track = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":461
 *         return len(self.tracks)
 * 
 *     def get_track_names(self):             # <<<<<<<<<<<<<<
 *         """Return the list of names of tracks that have been created."""
 *         return [track.name for track in self.tracks]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":465
 *         return [track.name for track in self.tracks]
 * 
 *     def get_track(self, int track_num):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the track with the specified track number.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_57get_track(PyObject *__pyx_v_self, PyObject *__pyx_arg_track_num); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_56get_track[] = "AudioInterface.get_track(self, int track_num)\n\n        Returns the track with the specified track number.\n        Args:\n            track_num: The track number to retrieve\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_57get_track(PyObject *__pyx_v_self, PyObject *__pyx_arg_track_num) {
  int __pyx_v_track_num;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_track (wrapper)", 0);
  assert(__pyx_arg_track_num); {
    __pyx_v_track_num = __Pyx_PyInt_As_int(__pyx_arg_track_num); if (unlikely((__pyx_v_track_num == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_56get_track(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((int)__pyx_v_track_num));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_56get_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, int __pyx_v_track_num) {
  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_t_5;
  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("get_track", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":471
 *             track_num: The track number to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.tracks[track_num]
 *         except IndexError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __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:*/ {

      /* "mpfmc/core/audio/audio_interface.pyx":472
 *         """
 *         try:
 *             return self.tracks[track_num]             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             return None
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_self->tracks == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 472, __pyx_L3_error)
      }
      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->tracks, __pyx_v_track_num, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "mpfmc/core/audio/audio_interface.pyx":471
 *             track_num: The track number to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.tracks[track_num]
 *         except IndexError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":473
 *         try:
 *             return self.tracks[track_num]
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 473, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "mpfmc/core/audio/audio_interface.pyx":474
 *             return self.tracks[track_num]
 *         except IndexError:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def get_track_type(self, str name not None):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __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;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "mpfmc/core/audio/audio_interface.pyx":471
 *             track_num: The track number to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.tracks[track_num]
 *         except IndexError:
 */
    __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_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_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;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":465
 *         return [track.name for track in self.tracks]
 * 
 *     def get_track(self, int track_num):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the track with the specified track number.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":476
 *             return None
 * 
 *     def get_track_type(self, str name not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the type of the track with the specified name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_59get_track_type(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_58get_track_type[] = "AudioInterface.get_track_type(self, unicode name)\n\n        Returns the type of the track with the specified name.\n        Args:\n            name: The name of the track\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_59get_track_type(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_track_type (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 0, "name", 1))) __PYX_ERR(0, 476, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_58get_track_type(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject*)__pyx_v_name));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_58get_track_type(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_track = NULL;
  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("get_track_type", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":482
 *             name: The name of the track
 *         """
 *         track = self.get_track_by_name(name)             # <<<<<<<<<<<<<<
 *         if track:
 *             return track.type
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_track_by_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_track = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":483
 *         """
 *         track = self.get_track_by_name(name)
 *         if track:             # <<<<<<<<<<<<<<
 *             return track.type
 *         else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_track); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "mpfmc/core/audio/audio_interface.pyx":484
 *         track = self.get_track_by_name(name)
 *         if track:
 *             return track.type             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":483
 *         """
 *         track = self.get_track_by_name(name)
 *         if track:             # <<<<<<<<<<<<<<
 *             return track.type
 *         else:
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":486
 *             return track.type
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def get_track_by_name(self, str name not None):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":476
 *             return None
 * 
 *     def get_track_type(self, str name not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the type of the track with the specified name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":488
 *             return None
 * 
 *     def get_track_by_name(self, str name not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the track with the specified name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_61get_track_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_60get_track_by_name[] = "AudioInterface.get_track_by_name(self, unicode name)\n\n        Returns the track with the specified name.\n        Args:\n            name: The track name to retrieve\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_61get_track_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_track_by_name (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 0, "name", 1))) __PYX_ERR(0, 488, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_60get_track_by_name(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject*)__pyx_v_name));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_60get_track_by_name(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_track_by_name", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "mpfmc/core/audio/audio_interface.pyx":494
 *             name: The track name to retrieve
 *         """
 *         name = name.lower()             # <<<<<<<<<<<<<<
 *         for track in self.tracks:
 *             if name == track.name:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":495
 *         """
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 return track
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 495, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":496
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 return track
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "mpfmc/core/audio/audio_interface.pyx":497
 *         for track in self.tracks:
 *             if name == track.name:
 *                 return track             # <<<<<<<<<<<<<<
 * 
 *         return None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_track);
      __pyx_r = __pyx_v_track;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "mpfmc/core/audio/audio_interface.pyx":496
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 return track
 * 
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":495
 *         """
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 return track
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":499
 *                 return track
 * 
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def create_standard_track(self, object mc, str name not None,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":488
 *             return None
 * 
 *     def get_track_by_name(self, str name not None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the track with the specified name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_track_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":501
 *         return None
 * 
 *     def create_standard_track(self, object mc, str name not None,             # <<<<<<<<<<<<<<
 *                               int max_simultaneous_sounds=MAX_SIMULTANEOUS_SOUNDS_DEFAULT,
 *                               float volume=1.0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_63create_standard_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_62create_standard_track[] = "AudioInterface.create_standard_track(self, mc, unicode name, int max_simultaneous_sounds=MAX_SIMULTANEOUS_SOUNDS_DEFAULT, float volume=1.0)\n\n        Creates a new standard track in the audio interface\n        Args:\n            mc: The media controller app\n            name: The name of the new track\n            max_simultaneous_sounds: The maximum number of sounds that may be played at one time on the track\n            volume: The track volume (0.0 to 1.0)\n\n        Returns:\n            A Track object for the newly created track\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_63create_standard_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mc = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_v_max_simultaneous_sounds;
  float __pyx_v_volume;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_standard_track (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mc,&__pyx_n_s_name,&__pyx_n_s_max_simultaneous_sounds,&__pyx_n_s_volume,0};
    PyObject* values[4] = {0,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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_standard_track", 0, 2, 4, 1); __PYX_ERR(0, 501, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_simultaneous_sounds);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_volume);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_standard_track") < 0)) __PYX_ERR(0, 501, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_mc = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_max_simultaneous_sounds = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_max_simultaneous_sounds == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 502, __pyx_L3_error)
    } else {
      __pyx_v_max_simultaneous_sounds = __pyx_k__2;
    }
    if (values[3]) {
      __pyx_v_volume = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_volume == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error)
    } else {
      __pyx_v_volume = ((float)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_standard_track", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 501, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_standard_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 0, "name", 1))) __PYX_ERR(0, 501, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_62create_standard_track(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_mc, __pyx_v_name, __pyx_v_max_simultaneous_sounds, __pyx_v_volume);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_62create_standard_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, int __pyx_v_max_simultaneous_sounds, float __pyx_v_volume) {
  int __pyx_v_track_num;
  PyObject *__pyx_v_track = NULL;
  struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *__pyx_v_new_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_standard_track", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "mpfmc/core/audio/audio_interface.pyx":515
 *             A Track object for the newly created track
 *         """
 *         cdef int track_num = len(self.tracks)             # <<<<<<<<<<<<<<
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "
 */
  __pyx_t_1 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 515, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_track_num = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":516
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  __pyx_t_3 = ((__pyx_v_track_num == 8) != 0);
  if (__pyx_t_3) {

    /* "mpfmc/core/audio/audio_interface.pyx":517
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "             # <<<<<<<<<<<<<<
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":519
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":516
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":522
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()             # <<<<<<<<<<<<<<
 *         for track in self.tracks:
 *             if name == track.name:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":523
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 523, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":524
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mpfmc/core/audio/audio_interface.pyx":525
 *         for track in self.tracks:
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_GIVEREF(__pyx_kp_u_Add_track_failed_the_track_name);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_name);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":526
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "mpfmc/core/audio/audio_interface.pyx":524
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":523
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":529
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 *         SDL_LockAudio()             # <<<<<<<<<<<<<<
 * 
 *         # Create the new standard track
 */
  SDL_LockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":533
 *         # Create the new standard track
 *         new_track = TrackStandard(mc,
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),             # <<<<<<<<<<<<<<
 *                                   name,
 *                                   track_num,
 */
  __pyx_t_4 = PyCapsule_New((&__pyx_v_self->audio_callback_data), NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mpfmc/core/audio/audio_interface.pyx":535
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                   name,
 *                                   track_num,             # <<<<<<<<<<<<<<
 *                                   self.audio_callback_data.buffer_size,
 *                                   max_simultaneous_sounds,
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_track_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mpfmc/core/audio/audio_interface.pyx":536
 *                                   name,
 *                                   track_num,
 *                                   self.audio_callback_data.buffer_size,             # <<<<<<<<<<<<<<
 *                                   max_simultaneous_sounds,
 *                                   volume)
 */
  __pyx_t_5 = __Pyx_PyInt_From_Uint32(__pyx_v_self->audio_callback_data.buffer_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mpfmc/core/audio/audio_interface.pyx":537
 *                                   track_num,
 *                                   self.audio_callback_data.buffer_size,
 *                                   max_simultaneous_sounds,             # <<<<<<<<<<<<<<
 *                                   volume)
 *         self.tracks.append(new_track)
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_max_simultaneous_sounds); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "mpfmc/core/audio/audio_interface.pyx":538
 *                                   self.audio_callback_data.buffer_size,
 *                                   max_simultaneous_sounds,
 *                                   volume)             # <<<<<<<<<<<<<<
 *         self.tracks.append(new_track)
 * 
 */
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_volume); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "mpfmc/core/audio/audio_interface.pyx":532
 * 
 *         # Create the new standard track
 *         new_track = TrackStandard(mc,             # <<<<<<<<<<<<<<
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                   name,
 */
  __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_mc);
  __Pyx_GIVEREF(__pyx_v_mc);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_mc);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_new_track = ((struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":539
 *                                   max_simultaneous_sounds,
 *                                   volume)
 *         self.tracks.append(new_track)             # <<<<<<<<<<<<<<
 * 
 *         # Update audio callback data with new track
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 539, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->tracks, ((PyObject *)__pyx_v_new_track)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 539, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":542
 * 
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.tracks[track_num] = new_track.state
 * 
 */
  __pyx_t_6 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_6);
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 542, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->audio_callback_data.track_count = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":543
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)
 *         self.audio_callback_data.tracks[track_num] = new_track.state             # <<<<<<<<<<<<<<
 * 
 *         # Allow audio callback function to be called again
 */
  __pyx_t_11 = __pyx_v_new_track->__pyx_base.state;
  (__pyx_v_self->audio_callback_data.tracks[__pyx_v_track_num]) = __pyx_t_11;

  /* "mpfmc/core/audio/audio_interface.pyx":546
 * 
 *         # Allow audio callback function to be called again
 *         SDL_UnlockAudio()             # <<<<<<<<<<<<<<
 * 
 *         self.log.debug("The '%s' standard track has successfully been created.", name)
 */
  SDL_UnlockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":548
 *         SDL_UnlockAudio()
 * 
 *         self.log.debug("The '%s' standard track has successfully been created.", name)             # <<<<<<<<<<<<<<
 * 
 *         return new_track
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_The_s_standard_track_has_success, __pyx_v_name};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_The_s_standard_track_has_success, __pyx_v_name};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_The_s_standard_track_has_success);
    __Pyx_GIVEREF(__pyx_kp_u_The_s_standard_track_has_success);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_kp_u_The_s_standard_track_has_success);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_name);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":550
 *         self.log.debug("The '%s' standard track has successfully been created.", name)
 * 
 *         return new_track             # <<<<<<<<<<<<<<
 * 
 *     def create_sound_loop_track(self, object mc, str name not None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_new_track));
  __pyx_r = ((PyObject *)__pyx_v_new_track);
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":501
 *         return None
 * 
 *     def create_standard_track(self, object mc, str name not None,             # <<<<<<<<<<<<<<
 *                               int max_simultaneous_sounds=MAX_SIMULTANEOUS_SOUNDS_DEFAULT,
 *                               float volume=1.0):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_standard_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_track);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":552
 *         return new_track
 * 
 *     def create_sound_loop_track(self, object mc, str name not None,             # <<<<<<<<<<<<<<
 *                                 int max_layers=8,
 *                                 float volume=1.0):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_65create_sound_loop_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_64create_sound_loop_track[] = "AudioInterface.create_sound_loop_track(self, mc, unicode name, int max_layers=8, float volume=1.0)\n\n        Creates a new sound loop track in the audio interface\n        Args:\n            mc: The media controller app\n            name: The name of the new track\n            max_layers: The maximum number of sounds that may be played at one time on the track\n            volume: The track volume (0.0 to 1.0)\n\n        Returns:\n            A Track object for the newly created track\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_65create_sound_loop_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mc = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_v_max_layers;
  float __pyx_v_volume;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_sound_loop_track (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mc,&__pyx_n_s_name,&__pyx_n_s_max_layers,&__pyx_n_s_volume,0};
    PyObject* values[4] = {0,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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_sound_loop_track", 0, 2, 4, 1); __PYX_ERR(0, 552, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_layers);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_volume);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_sound_loop_track") < 0)) __PYX_ERR(0, 552, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_mc = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_max_layers = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_max_layers == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L3_error)
    } else {
      __pyx_v_max_layers = ((int)8);
    }
    if (values[3]) {
      __pyx_v_volume = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_volume == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error)
    } else {
      __pyx_v_volume = ((float)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_sound_loop_track", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 552, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_sound_loop_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 0, "name", 1))) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_64create_sound_loop_track(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_mc, __pyx_v_name, __pyx_v_max_layers, __pyx_v_volume);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_64create_sound_loop_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, int __pyx_v_max_layers, float __pyx_v_volume) {
  int __pyx_v_track_num;
  PyObject *__pyx_v_track = NULL;
  struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *__pyx_v_new_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_sound_loop_track", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "mpfmc/core/audio/audio_interface.pyx":566
 *             A Track object for the newly created track
 *         """
 *         cdef int track_num = len(self.tracks)             # <<<<<<<<<<<<<<
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "
 */
  __pyx_t_1 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 566, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_track_num = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":567
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  __pyx_t_3 = ((__pyx_v_track_num == 8) != 0);
  if (__pyx_t_3) {

    /* "mpfmc/core/audio/audio_interface.pyx":568
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "             # <<<<<<<<<<<<<<
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":570
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":567
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":573
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()             # <<<<<<<<<<<<<<
 *         for track in self.tracks:
 *             if name == track.name:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":574
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 574, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 574, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":575
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 575, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mpfmc/core/audio/audio_interface.pyx":576
 *         for track in self.tracks:
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_GIVEREF(__pyx_kp_u_Add_track_failed_the_track_name);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_name);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":577
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "mpfmc/core/audio/audio_interface.pyx":575
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":574
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":580
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 *         SDL_LockAudio()             # <<<<<<<<<<<<<<
 * 
 *         # Create the new live loop track
 */
  SDL_LockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":584
 *         # Create the new live loop track
 *         new_track = TrackSoundLoop(mc,
 *                                    pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),             # <<<<<<<<<<<<<<
 *                                    name,
 *                                    track_num,
 */
  __pyx_t_4 = PyCapsule_New((&__pyx_v_self->audio_callback_data), NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mpfmc/core/audio/audio_interface.pyx":586
 *                                    pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                    name,
 *                                    track_num,             # <<<<<<<<<<<<<<
 *                                    self.audio_callback_data.buffer_size,
 *                                    max_layers,
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_track_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mpfmc/core/audio/audio_interface.pyx":587
 *                                    name,
 *                                    track_num,
 *                                    self.audio_callback_data.buffer_size,             # <<<<<<<<<<<<<<
 *                                    max_layers,
 *                                    volume)
 */
  __pyx_t_5 = __Pyx_PyInt_From_Uint32(__pyx_v_self->audio_callback_data.buffer_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mpfmc/core/audio/audio_interface.pyx":588
 *                                    track_num,
 *                                    self.audio_callback_data.buffer_size,
 *                                    max_layers,             # <<<<<<<<<<<<<<
 *                                    volume)
 *         self.tracks.append(new_track)
 */
  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_max_layers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "mpfmc/core/audio/audio_interface.pyx":589
 *                                    self.audio_callback_data.buffer_size,
 *                                    max_layers,
 *                                    volume)             # <<<<<<<<<<<<<<
 *         self.tracks.append(new_track)
 * 
 */
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_volume); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "mpfmc/core/audio/audio_interface.pyx":583
 * 
 *         # Create the new live loop track
 *         new_track = TrackSoundLoop(mc,             # <<<<<<<<<<<<<<
 *                                    pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                    name,
 */
  __pyx_t_9 = PyTuple_New(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_mc);
  __Pyx_GIVEREF(__pyx_v_mc);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_mc);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_8 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_new_track = ((struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":590
 *                                    max_layers,
 *                                    volume)
 *         self.tracks.append(new_track)             # <<<<<<<<<<<<<<
 * 
 *         # Update audio callback data with new track
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 590, __pyx_L1_error)
  }
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->tracks, ((PyObject *)__pyx_v_new_track)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 590, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":593
 * 
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.tracks[track_num] = new_track.state
 * 
 */
  __pyx_t_6 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_6);
  if (unlikely(__pyx_t_6 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 593, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_6); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->audio_callback_data.track_count = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":594
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)
 *         self.audio_callback_data.tracks[track_num] = new_track.state             # <<<<<<<<<<<<<<
 * 
 *         # Allow audio callback function to be called again
 */
  __pyx_t_11 = __pyx_v_new_track->__pyx_base.state;
  (__pyx_v_self->audio_callback_data.tracks[__pyx_v_track_num]) = __pyx_t_11;

  /* "mpfmc/core/audio/audio_interface.pyx":597
 * 
 *         # Allow audio callback function to be called again
 *         SDL_UnlockAudio()             # <<<<<<<<<<<<<<
 * 
 *         self.log.debug("The '%s' live loop track has successfully been created.", name)
 */
  SDL_UnlockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":599
 *         SDL_UnlockAudio()
 * 
 *         self.log.debug("The '%s' live loop track has successfully been created.", name)             # <<<<<<<<<<<<<<
 * 
 *         return new_track
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_The_s_live_loop_track_has_succes, __pyx_v_name};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_kp_u_The_s_live_loop_track_has_succes, __pyx_v_name};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_The_s_live_loop_track_has_succes);
    __Pyx_GIVEREF(__pyx_kp_u_The_s_live_loop_track_has_succes);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_kp_u_The_s_live_loop_track_has_succes);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_name);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":601
 *         self.log.debug("The '%s' live loop track has successfully been created.", name)
 * 
 *         return new_track             # <<<<<<<<<<<<<<
 * 
 *     def create_playlist_track(self, object mc, str name not None, float crossfade_time=0.0, float volume=1.0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_new_track));
  __pyx_r = ((PyObject *)__pyx_v_new_track);
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":552
 *         return new_track
 * 
 *     def create_sound_loop_track(self, object mc, str name not None,             # <<<<<<<<<<<<<<
 *                                 int max_layers=8,
 *                                 float volume=1.0):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_sound_loop_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_track);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":603
 *         return new_track
 * 
 *     def create_playlist_track(self, object mc, str name not None, float crossfade_time=0.0, float volume=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a new playlist track in the audio interface
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_67create_playlist_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_66create_playlist_track[] = "AudioInterface.create_playlist_track(self, mc, unicode name, float crossfade_time=0.0, float volume=1.0)\n\n        Creates a new playlist track in the audio interface\n        Args:\n            mc: The media controller app\n            name: The name of the new track\n            crossfade_time: The default crossfade time (secs) to use when fading between sounds\n            volume: The track volume (0.0 to 1.0)\n\n        Returns:\n            A Track object for the newly created track\n\n        Notes:\n            There is no specialized playlist track type.  This function creates a standard\n            audio track AND a corresponding playlist controller that will be used to manage\n            all sound actions on the track.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_67create_playlist_track(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mc = 0;
  PyObject *__pyx_v_name = 0;
  float __pyx_v_crossfade_time;
  float __pyx_v_volume;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_playlist_track (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mc,&__pyx_n_s_name,&__pyx_n_s_crossfade_time,&__pyx_n_s_volume,0};
    PyObject* values[4] = {0,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  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_playlist_track", 0, 2, 4, 1); __PYX_ERR(0, 603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_crossfade_time);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_volume);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_playlist_track") < 0)) __PYX_ERR(0, 603, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        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_mc = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_crossfade_time = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_crossfade_time == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L3_error)
    } else {
      __pyx_v_crossfade_time = ((float)0.0);
    }
    if (values[3]) {
      __pyx_v_volume = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_volume == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L3_error)
    } else {
      __pyx_v_volume = ((float)1.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_playlist_track", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 603, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_playlist_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 0, "name", 1))) __PYX_ERR(0, 603, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_66create_playlist_track(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_mc, __pyx_v_name, __pyx_v_crossfade_time, __pyx_v_volume);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_66create_playlist_track(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_mc, PyObject *__pyx_v_name, float __pyx_v_crossfade_time, float __pyx_v_volume) {
  int __pyx_v_track_num;
  PyObject *__pyx_v_track = NULL;
  struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *__pyx_v_new_track = NULL;
  PyObject *__pyx_v_playlist_controller = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_playlist_track", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "mpfmc/core/audio/audio_interface.pyx":620
 *             all sound actions on the track.
 *         """
 *         cdef int track_num = len(self.tracks)             # <<<<<<<<<<<<<<
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "
 */
  __pyx_t_1 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 620, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_track_num = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":621
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  __pyx_t_3 = ((__pyx_v_track_num == 8) != 0);
  if (__pyx_t_3) {

    /* "mpfmc/core/audio/audio_interface.pyx":622
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "             # <<<<<<<<<<<<<<
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":624
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":621
 *         """
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:             # <<<<<<<<<<<<<<
 *             self.log.error("Add track failed - the maximum number of tracks "
 *                            "(%d) has been reached.", MAX_TRACKS)
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":627
 * 
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()             # <<<<<<<<<<<<<<
 *         for track in self.tracks:
 *             if name == track.name:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":628
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 628, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":629
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "mpfmc/core/audio/audio_interface.pyx":630
 *         for track in self.tracks:
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_u_Add_track_failed_the_track_name, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_GIVEREF(__pyx_kp_u_Add_track_failed_the_track_name);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_kp_u_Add_track_failed_the_track_name);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_name);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":631
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "mpfmc/core/audio/audio_interface.pyx":629
 *         name = name.lower()
 *         for track in self.tracks:
 *             if name == track.name:             # <<<<<<<<<<<<<<
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 *                 return None
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":628
 *         # Make sure track name does not already exist (no duplicates allowed)
 *         name = name.lower()
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if name == track.name:
 *                 self.log.error("Add track failed - the track name '%s' already exists.", name)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":634
 * 
 *         # Make sure audio callback function cannot be called while we are changing the track data
 *         SDL_LockAudio()             # <<<<<<<<<<<<<<
 * 
 *         # Create the new standard track
 */
  SDL_LockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":638
 *         # Create the new standard track
 *         new_track = TrackStandard(mc,
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),             # <<<<<<<<<<<<<<
 *                                   name,
 *                                   track_num,
 */
  __pyx_t_4 = PyCapsule_New((&__pyx_v_self->audio_callback_data), NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "mpfmc/core/audio/audio_interface.pyx":640
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                   name,
 *                                   track_num,             # <<<<<<<<<<<<<<
 *                                   self.audio_callback_data.buffer_size,
 *                                   2,
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_track_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mpfmc/core/audio/audio_interface.pyx":641
 *                                   name,
 *                                   track_num,
 *                                   self.audio_callback_data.buffer_size,             # <<<<<<<<<<<<<<
 *                                   2,
 *                                   volume)
 */
  __pyx_t_5 = __Pyx_PyInt_From_Uint32(__pyx_v_self->audio_callback_data.buffer_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "mpfmc/core/audio/audio_interface.pyx":643
 *                                   self.audio_callback_data.buffer_size,
 *                                   2,
 *                                   volume)             # <<<<<<<<<<<<<<
 *         self.tracks.append(new_track)
 * 
 */
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_volume); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "mpfmc/core/audio/audio_interface.pyx":637
 * 
 *         # Create the new standard track
 *         new_track = TrackStandard(mc,             # <<<<<<<<<<<<<<
 *                                   pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL),
 *                                   name,
 */
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_mc);
  __Pyx_GIVEREF(__pyx_v_mc);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mc);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_8);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard), __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_new_track = ((struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":644
 *                                   2,
 *                                   volume)
 *         self.tracks.append(new_track)             # <<<<<<<<<<<<<<
 * 
 *         # Update audio callback data with new track
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 644, __pyx_L1_error)
  }
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->tracks, ((PyObject *)__pyx_v_new_track)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 644, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":647
 * 
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)             # <<<<<<<<<<<<<<
 *         self.audio_callback_data.tracks[track_num] = new_track.state
 * 
 */
  __pyx_t_8 = __pyx_v_self->tracks;
  __Pyx_INCREF(__pyx_t_8);
  if (unlikely(__pyx_t_8 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 647, __pyx_L1_error)
  }
  __pyx_t_2 = PyList_GET_SIZE(__pyx_t_8); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_self->audio_callback_data.track_count = __pyx_t_2;

  /* "mpfmc/core/audio/audio_interface.pyx":648
 *         # Update audio callback data with new track
 *         self.audio_callback_data.track_count = len(self.tracks)
 *         self.audio_callback_data.tracks[track_num] = new_track.state             # <<<<<<<<<<<<<<
 * 
 *         # Allow audio callback function to be called again
 */
  __pyx_t_10 = __pyx_v_new_track->__pyx_base.state;
  (__pyx_v_self->audio_callback_data.tracks[__pyx_v_track_num]) = __pyx_t_10;

  /* "mpfmc/core/audio/audio_interface.pyx":651
 * 
 *         # Allow audio callback function to be called again
 *         SDL_UnlockAudio()             # <<<<<<<<<<<<<<
 * 
 *         # Create playlist controller for the track
 */
  SDL_UnlockAudio();

  /* "mpfmc/core/audio/audio_interface.pyx":654
 * 
 *         # Create playlist controller for the track
 *         playlist_controller = PlaylistController(mc, new_track, crossfade_time)             # <<<<<<<<<<<<<<
 *         self.playlist_controllers[name] = playlist_controller
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PlaylistController); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_crossfade_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_mc, ((PyObject *)__pyx_v_new_track), __pyx_t_5};
    __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_mc, ((PyObject *)__pyx_v_new_track), __pyx_t_5};
    __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_mc);
    __Pyx_GIVEREF(__pyx_v_mc);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_mc);
    __Pyx_INCREF(((PyObject *)__pyx_v_new_track));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_new_track));
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, ((PyObject *)__pyx_v_new_track));
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_playlist_controller = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":655
 *         # Create playlist controller for the track
 *         playlist_controller = PlaylistController(mc, new_track, crossfade_time)
 *         self.playlist_controllers[name] = playlist_controller             # <<<<<<<<<<<<<<
 * 
 *         self.log.debug("The '%s' playlist track and controller have successfully been created.", name)
 */
  if (unlikely(__pyx_v_self->playlist_controllers == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 655, __pyx_L1_error)
  }
  if (unlikely(PyDict_SetItem(__pyx_v_self->playlist_controllers, __pyx_v_name, __pyx_v_playlist_controller) < 0)) __PYX_ERR(0, 655, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":657
 *         self.playlist_controllers[name] = playlist_controller
 * 
 *         self.log.debug("The '%s' playlist track and controller have successfully been created.", name)             # <<<<<<<<<<<<<<
 * 
 *         return new_track
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->log, __pyx_n_s_debug); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_The_s_playlist_track_and_control, __pyx_v_name};
    __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_u_The_s_playlist_track_and_control, __pyx_v_name};
    __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_8);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_u_The_s_playlist_track_and_control);
    __Pyx_GIVEREF(__pyx_kp_u_The_s_playlist_track_and_control);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_kp_u_The_s_playlist_track_and_control);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_name);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":659
 *         self.log.debug("The '%s' playlist track and controller have successfully been created.", name)
 * 
 *         return new_track             # <<<<<<<<<<<<<<
 * 
 *     def get_playlist_controller_count(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_new_track));
  __pyx_r = ((PyObject *)__pyx_v_new_track);
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":603
 *         return new_track
 * 
 *     def create_playlist_track(self, object mc, str name not None, float crossfade_time=0.0, float volume=1.0):             # <<<<<<<<<<<<<<
 *         """
 *         Creates a new playlist track in the audio interface
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.create_playlist_track", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XDECREF((PyObject *)__pyx_v_new_track);
  __Pyx_XDECREF(__pyx_v_playlist_controller);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":661
 *         return new_track
 * 
 *     def get_playlist_controller_count(self):             # <<<<<<<<<<<<<<
 *         """Returns the number of playlist controllers that have been created."""
 *         return len(self.playlist_controllers)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_69get_playlist_controller_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_68get_playlist_controller_count[] = "AudioInterface.get_playlist_controller_count(self)\nReturns the number of playlist controllers that have been created.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_69get_playlist_controller_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_playlist_controller_count (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_68get_playlist_controller_count(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_68get_playlist_controller_count(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_playlist_controller_count", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":663
 *     def get_playlist_controller_count(self):
 *         """Returns the number of playlist controllers that have been created."""
 *         return len(self.playlist_controllers)             # <<<<<<<<<<<<<<
 * 
 *     def get_playlist_controller_names(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->playlist_controllers;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 663, __pyx_L1_error)
  }
  __pyx_t_2 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":661
 *         return new_track
 * 
 *     def get_playlist_controller_count(self):             # <<<<<<<<<<<<<<
 *         """Returns the number of playlist controllers that have been created."""
 *         return len(self.playlist_controllers)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_playlist_controller_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":665
 *         return len(self.playlist_controllers)
 * 
 *     def get_playlist_controller_names(self):             # <<<<<<<<<<<<<<
 *         """Return the list of names of the playlist controllers that have been created."""
 *         return [controller for controller in self.playlist_controllers.keys()]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_71get_playlist_controller_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_70get_playlist_controller_names[] = "AudioInterface.get_playlist_controller_names(self)\nReturn the list of names of the playlist controllers that have been created.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_71get_playlist_controller_names(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_playlist_controller_names (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_70get_playlist_controller_names(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_70get_playlist_controller_names(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  PyObject *__pyx_8genexpr7__pyx_v_controller = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_playlist_controller_names", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":667
 *     def get_playlist_controller_names(self):
 *         """Return the list of names of the playlist controllers that have been created."""
 *         return [controller for controller in self.playlist_controllers.keys()]             # <<<<<<<<<<<<<<
 * 
 *     def get_playlist_controller(self, str controller_name):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    if (unlikely(__pyx_v_self->playlist_controllers == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
      __PYX_ERR(0, 667, __pyx_L5_error)
    }
    __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_self->playlist_controllers, 1, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;
    while (1) {
      __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, NULL, NULL, __pyx_t_5);
      if (unlikely(__pyx_t_7 == 0)) break;
      if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 667, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_controller, __pyx_t_6);
      __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_8genexpr7__pyx_v_controller))) __PYX_ERR(0, 667, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_controller); __pyx_8genexpr7__pyx_v_controller = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_controller); __pyx_8genexpr7__pyx_v_controller = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "mpfmc/core/audio/audio_interface.pyx":665
 *         return len(self.playlist_controllers)
 * 
 *     def get_playlist_controller_names(self):             # <<<<<<<<<<<<<<
 *         """Return the list of names of the playlist controllers that have been created."""
 *         return [controller for controller in self.playlist_controllers.keys()]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_playlist_controller_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_controller);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":669
 *         return [controller for controller in self.playlist_controllers.keys()]
 * 
 *     def get_playlist_controller(self, str controller_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the playlist controller with the specified name.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_73get_playlist_controller(PyObject *__pyx_v_self, PyObject *__pyx_v_controller_name); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_72get_playlist_controller[] = "AudioInterface.get_playlist_controller(self, unicode controller_name)\n\n        Returns the playlist controller with the specified name.\n        Args:\n            controller_name: The playlist controller name to retrieve\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_73get_playlist_controller(PyObject *__pyx_v_self, PyObject *__pyx_v_controller_name) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_playlist_controller (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_controller_name), (&PyUnicode_Type), 1, "controller_name", 1))) __PYX_ERR(0, 669, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_72get_playlist_controller(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject*)__pyx_v_controller_name));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_72get_playlist_controller(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_controller_name) {
  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_t_5;
  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("get_playlist_controller", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":675
 *             controller_name: The playlist controller name to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.playlist_controllers[controller_name]
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __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:*/ {

      /* "mpfmc/core/audio/audio_interface.pyx":676
 *         """
 *         try:
 *             return self.playlist_controllers[controller_name]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             return None
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_self->playlist_controllers == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 676, __pyx_L3_error)
      }
      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_self->playlist_controllers, __pyx_v_controller_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "mpfmc/core/audio/audio_interface.pyx":675
 *             controller_name: The playlist controller name to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.playlist_controllers[controller_name]
 *         except KeyError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":677
 *         try:
 *             return self.playlist_controllers[controller_name]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_playlist_controller", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 677, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "mpfmc/core/audio/audio_interface.pyx":678
 *             return self.playlist_controllers[controller_name]
 *         except KeyError:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def load_sound_file_to_memory(self, str file_name):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __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;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "mpfmc/core/audio/audio_interface.pyx":675
 *             controller_name: The playlist controller name to retrieve
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             return self.playlist_controllers[controller_name]
 *         except KeyError:
 */
    __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_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_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;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":669
 *         return [controller for controller in self.playlist_controllers.keys()]
 * 
 *     def get_playlist_controller(self, str controller_name):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the playlist controller with the specified name.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.get_playlist_controller", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":680
 *             return None
 * 
 *     def load_sound_file_to_memory(self, str file_name):             # <<<<<<<<<<<<<<
 *         """
 *         Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_75load_sound_file_to_memory(PyObject *__pyx_v_self, PyObject *__pyx_v_file_name); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_74load_sound_file_to_memory[] = "AudioInterface.load_sound_file_to_memory(self, unicode file_name)\n\n        Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.\n        Used in asset loading for Sound objects.\n        Args:\n            file_name: The audio file name to load.\n\n        Returns:\n            A SoundMemoryFile wrapper object containing a pointer to the sound sample\n            data in memory.  An exception is thrown if the sound is unable to be loaded.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_75load_sound_file_to_memory(PyObject *__pyx_v_self, PyObject *__pyx_v_file_name) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_sound_file_to_memory (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_name), (&PyUnicode_Type), 1, "file_name", 1))) __PYX_ERR(0, 680, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_74load_sound_file_to_memory(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject*)__pyx_v_file_name));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_74load_sound_file_to_memory(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_file_name) {
  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("load_sound_file_to_memory", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":691
 *             data in memory.  An exception is thrown if the sound is unable to be loaded.
 *         """
 *         return SoundMemoryFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def load_sound_file_for_streaming(self, str file_name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyCapsule_New((&__pyx_v_self->audio_callback_data), NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file_name);
  __Pyx_GIVEREF(__pyx_v_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __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;

  /* "mpfmc/core/audio/audio_interface.pyx":680
 *             return None
 * 
 *     def load_sound_file_to_memory(self, str file_name):             # <<<<<<<<<<<<<<
 *         """
 *         Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.load_sound_file_to_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":693
 *         return SoundMemoryFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))
 * 
 *     def load_sound_file_for_streaming(self, str file_name):             # <<<<<<<<<<<<<<
 *         """
 *         Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_77load_sound_file_for_streaming(PyObject *__pyx_v_self, PyObject *__pyx_v_file_name); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_76load_sound_file_for_streaming[] = "AudioInterface.load_sound_file_for_streaming(self, unicode file_name)\n\n        Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.\n        Used in asset loading for Sound objects.\n        Args:\n            file_name: The audio file name to load.\n\n        Returns:\n            A SoundMemoryFile wrapper object containing a pointer to the sound sample\n            data in memory.  An exception is thrown if the sound is unable to be loaded.\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_77load_sound_file_for_streaming(PyObject *__pyx_v_self, PyObject *__pyx_v_file_name) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_sound_file_for_streaming (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_name), (&PyUnicode_Type), 1, "file_name", 1))) __PYX_ERR(0, 693, __pyx_L1_error)
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_76load_sound_file_for_streaming(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject*)__pyx_v_file_name));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_76load_sound_file_for_streaming(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_file_name) {
  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("load_sound_file_for_streaming", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":704
 *             data in memory.  An exception is thrown if the sound is unable to be loaded.
 *         """
 *         return SoundStreamingFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def unload_sound_file(self, container not None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyCapsule_New((&__pyx_v_self->audio_callback_data), NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file_name);
  __Pyx_GIVEREF(__pyx_v_file_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file_name);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __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;

  /* "mpfmc/core/audio/audio_interface.pyx":693
 *         return SoundMemoryFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))
 * 
 *     def load_sound_file_for_streaming(self, str file_name):             # <<<<<<<<<<<<<<
 *         """
 *         Loads an audio file into a SoundMemoryFile wrapper object for use in a Sound object.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.load_sound_file_for_streaming", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":706
 *         return SoundStreamingFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))
 * 
 *     def unload_sound_file(self, container not None):             # <<<<<<<<<<<<<<
 *         """
 *         Unloads the source sample from the supplied container (used in Sound
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_79unload_sound_file(PyObject *__pyx_v_self, PyObject *__pyx_v_container); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_78unload_sound_file[] = "AudioInterface.unload_sound_file(self, container)\n\n        Unloads the source sample from the supplied container (used in Sound\n        asset unloading).  The sound will no longer be in memory.\n        Args:\n            container: A SoundFile object\n        ";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_79unload_sound_file(PyObject *__pyx_v_self, PyObject *__pyx_v_container) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unload_sound_file (wrapper)", 0);
  if (unlikely(((PyObject *)__pyx_v_container) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "container"); __PYX_ERR(0, 706, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_78unload_sound_file(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v_container));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_78unload_sound_file(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_container) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  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("unload_sound_file", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":713
 *             container: A SoundFile object
 *         """
 *         if not isinstance(container, SoundFile):             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_container, __pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundFile); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "mpfmc/core/audio/audio_interface.pyx":714
 *         """
 *         if not isinstance(container, SoundFile):
 *             return             # <<<<<<<<<<<<<<
 * 
 *         container.unload()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":713
 *             container: A SoundFile object
 *         """
 *         if not isinstance(container, SoundFile):             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":716
 *             return
 * 
 *         container.unload()             # <<<<<<<<<<<<<<
 * 
 *     def stop_all_sounds(self, float fade_out_seconds = 0.0):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_container, __pyx_n_s_unload); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":706
 *         return SoundStreamingFile(file_name, pycapsule.PyCapsule_New(&self.audio_callback_data, NULL, NULL))
 * 
 *     def unload_sound_file(self, container not None):             # <<<<<<<<<<<<<<
 *         """
 *         Unloads the source sample from the supplied container (used in Sound
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.unload_sound_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":718
 *         container.unload()
 * 
 *     def stop_all_sounds(self, float fade_out_seconds = 0.0):             # <<<<<<<<<<<<<<
 *         """Stops all playing and pending sounds in all tracks"""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_81stop_all_sounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_80stop_all_sounds[] = "AudioInterface.stop_all_sounds(self, float fade_out_seconds=0.0)\nStops all playing and pending sounds in all tracks";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_81stop_all_sounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_fade_out_seconds;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop_all_sounds (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fade_out_seconds,0};
    PyObject* values[1] = {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  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        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 = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fade_out_seconds);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stop_all_sounds") < 0)) __PYX_ERR(0, 718, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_fade_out_seconds = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_fade_out_seconds == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error)
    } else {
      __pyx_v_fade_out_seconds = ((float)0.0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stop_all_sounds", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 718, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_all_sounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_80stop_all_sounds(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_fade_out_seconds);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_80stop_all_sounds(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, float __pyx_v_fade_out_seconds) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stop_all_sounds", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":720
 *     def stop_all_sounds(self, float fade_out_seconds = 0.0):
 *         """Stops all playing and pending sounds in all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.stop_all_sounds(fade_out_seconds)
 * 
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 720, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 720, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":721
 *         """Stops all playing and pending sounds in all tracks"""
 *         for track in self.tracks:
 *             track.stop_all_sounds(fade_out_seconds)             # <<<<<<<<<<<<<<
 * 
 *     def stop_sound_instance(self, sound_instance not None, fade_out=None):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_stop_all_sounds); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_fade_out_seconds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":720
 *     def stop_all_sounds(self, float fade_out_seconds = 0.0):
 *         """Stops all playing and pending sounds in all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.stop_all_sounds(fade_out_seconds)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":718
 *         container.unload()
 * 
 *     def stop_all_sounds(self, float fade_out_seconds = 0.0):             # <<<<<<<<<<<<<<
 *         """Stops all playing and pending sounds in all tracks"""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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("mpfmc.core.audio.audio_interface.AudioInterface.stop_all_sounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":723
 *             track.stop_all_sounds(fade_out_seconds)
 * 
 *     def stop_sound_instance(self, sound_instance not None, fade_out=None):             # <<<<<<<<<<<<<<
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_83stop_sound_instance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_82stop_sound_instance[] = "AudioInterface.stop_sound_instance(self, sound_instance, fade_out=None)\nStops the specified sound instance";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_83stop_sound_instance(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sound_instance = 0;
  PyObject *__pyx_v_fade_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop_sound_instance (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound_instance,&__pyx_n_s_fade_out,0};
    PyObject* values[2] = {0,0};
    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);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sound_instance)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fade_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stop_sound_instance") < 0)) __PYX_ERR(0, 723, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sound_instance = values[0];
    __pyx_v_fade_out = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stop_sound_instance", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 723, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(((PyObject *)__pyx_v_sound_instance) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sound_instance"); __PYX_ERR(0, 723, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_82stop_sound_instance(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_sound_instance, __pyx_v_fade_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_82stop_sound_instance(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound_instance, PyObject *__pyx_v_fade_out) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stop_sound_instance", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":725
 *     def stop_sound_instance(self, sound_instance not None, fade_out=None):
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_instance"):
 *                 track.stop_sound_instance(sound_instance, fade_out)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 725, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":726
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_instance(sound_instance, fade_out)
 * 
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_track, __pyx_n_u_stop_sound_instance); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 726, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "mpfmc/core/audio/audio_interface.pyx":727
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance"):
 *                 track.stop_sound_instance(sound_instance, fade_out)             # <<<<<<<<<<<<<<
 * 
 *     def stop_sound(self, sound not None, fade_out=None):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_stop_sound_instance); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_sound_instance, __pyx_v_fade_out};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_sound_instance, __pyx_v_fade_out};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_sound_instance);
        __Pyx_GIVEREF(__pyx_v_sound_instance);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_sound_instance);
        __Pyx_INCREF(__pyx_v_fade_out);
        __Pyx_GIVEREF(__pyx_v_fade_out);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_fade_out);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":726
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_instance(sound_instance, fade_out)
 * 
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":725
 *     def stop_sound_instance(self, sound_instance not None, fade_out=None):
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_instance"):
 *                 track.stop_sound_instance(sound_instance, fade_out)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":723
 *             track.stop_all_sounds(fade_out_seconds)
 * 
 *     def stop_sound_instance(self, sound_instance not None, fade_out=None):             # <<<<<<<<<<<<<<
 *         """Stops the specified sound instance"""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":729
 *                 track.stop_sound_instance(sound_instance, fade_out)
 * 
 *     def stop_sound(self, sound not None, fade_out=None):             # <<<<<<<<<<<<<<
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_85stop_sound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_84stop_sound[] = "AudioInterface.stop_sound(self, sound, fade_out=None)\nStops all instances of the specified sound on all tracks";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_85stop_sound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sound = 0;
  PyObject *__pyx_v_fade_out = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop_sound (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sound,&__pyx_n_s_fade_out,0};
    PyObject* values[2] = {0,0};
    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);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sound)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fade_out);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stop_sound") < 0)) __PYX_ERR(0, 729, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sound = values[0];
    __pyx_v_fade_out = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stop_sound", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 729, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(((PyObject *)__pyx_v_sound) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sound"); __PYX_ERR(0, 729, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_84stop_sound(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), __pyx_v_sound, __pyx_v_fade_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_84stop_sound(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound, PyObject *__pyx_v_fade_out) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stop_sound", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":731
 *     def stop_sound(self, sound not None, fade_out=None):
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound"):
 *                 track.stop_sound(sound, fade_out)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 731, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":732
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound(sound, fade_out)
 * 
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_track, __pyx_n_u_stop_sound); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 732, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "mpfmc/core/audio/audio_interface.pyx":733
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound"):
 *                 track.stop_sound(sound, fade_out)             # <<<<<<<<<<<<<<
 * 
 *     def stop_sound(self, sound not None):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_stop_sound); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 733, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_sound, __pyx_v_fade_out};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_sound, __pyx_v_fade_out};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_sound);
        __Pyx_GIVEREF(__pyx_v_sound);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_sound);
        __Pyx_INCREF(__pyx_v_fade_out);
        __Pyx_GIVEREF(__pyx_v_fade_out);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_fade_out);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":732
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound(sound, fade_out)
 * 
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":731
 *     def stop_sound(self, sound not None, fade_out=None):
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound"):
 *                 track.stop_sound(sound, fade_out)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":729
 *                 track.stop_sound_instance(sound_instance, fade_out)
 * 
 *     def stop_sound(self, sound not None, fade_out=None):             # <<<<<<<<<<<<<<
 *         """Stops all instances of the specified sound on all tracks"""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":735
 *                 track.stop_sound(sound, fade_out)
 * 
 *     def stop_sound(self, sound not None):             # <<<<<<<<<<<<<<
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_87stop_sound(PyObject *__pyx_v_self, PyObject *__pyx_v_sound); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_86stop_sound[] = "AudioInterface.stop_sound(self, sound)\nStops all instances of the specified sound from continuing to loop on all tracks";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_87stop_sound(PyObject *__pyx_v_self, PyObject *__pyx_v_sound) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop_sound (wrapper)", 0);
  if (unlikely(((PyObject *)__pyx_v_sound) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sound"); __PYX_ERR(0, 735, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_86stop_sound(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v_sound));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_86stop_sound(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  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("stop_sound", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":737
 *     def stop_sound(self, sound not None):
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_looping"):
 *                 track.stop_sound_looping(sound)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 737, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":738
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_looping"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_looping(sound)
 * 
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_track, __pyx_n_u_stop_sound_looping); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "mpfmc/core/audio/audio_interface.pyx":739
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_looping"):
 *                 track.stop_sound_looping(sound)             # <<<<<<<<<<<<<<
 * 
 *     def stop_sound_instance_looping(self, sound_instance not None):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_stop_sound_looping); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_sound) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sound);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":738
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_looping"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_looping(sound)
 * 
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":737
 *     def stop_sound(self, sound not None):
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_looping"):
 *                 track.stop_sound_looping(sound)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":735
 *                 track.stop_sound(sound, fade_out)
 * 
 *     def stop_sound(self, sound not None):             # <<<<<<<<<<<<<<
 *         """Stops all instances of the specified sound from continuing to loop on all tracks"""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":741
 *                 track.stop_sound_looping(sound)
 * 
 *     def stop_sound_instance_looping(self, sound_instance not None):             # <<<<<<<<<<<<<<
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_89stop_sound_instance_looping(PyObject *__pyx_v_self, PyObject *__pyx_v_sound_instance); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_88stop_sound_instance_looping[] = "AudioInterface.stop_sound_instance_looping(self, sound_instance)\nStops the specified sound instance from continuing to loop.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_89stop_sound_instance_looping(PyObject *__pyx_v_self, PyObject *__pyx_v_sound_instance) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop_sound_instance_looping (wrapper)", 0);
  if (unlikely(((PyObject *)__pyx_v_sound_instance) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "sound_instance"); __PYX_ERR(0, 741, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_88stop_sound_instance_looping(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v_sound_instance));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_88stop_sound_instance_looping(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_sound_instance) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  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("stop_sound_instance_looping", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":743
 *     def stop_sound_instance_looping(self, sound_instance not None):
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_instance_looping"):
 *                 track.stop_sound_instance_looping(sound_instance)
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 743, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 743, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":744
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance_looping"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_instance_looping(sound_instance)
 * 
 */
    __pyx_t_4 = __Pyx_HasAttr(__pyx_v_track, __pyx_n_u_stop_sound_instance_looping); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 744, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "mpfmc/core/audio/audio_interface.pyx":745
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance_looping"):
 *                 track.stop_sound_instance_looping(sound_instance)             # <<<<<<<<<<<<<<
 * 
 *     def clear_context(self, context):
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_stop_sound_instance_looping); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_sound_instance) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_sound_instance);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "mpfmc/core/audio/audio_interface.pyx":744
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:
 *             if hasattr(track, "stop_sound_instance_looping"):             # <<<<<<<<<<<<<<
 *                 track.stop_sound_instance_looping(sound_instance)
 * 
 */
    }

    /* "mpfmc/core/audio/audio_interface.pyx":743
 *     def stop_sound_instance_looping(self, sound_instance not None):
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             if hasattr(track, "stop_sound_instance_looping"):
 *                 track.stop_sound_instance_looping(sound_instance)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":741
 *                 track.stop_sound_looping(sound)
 * 
 *     def stop_sound_instance_looping(self, sound_instance not None):             # <<<<<<<<<<<<<<
 *         """Stops the specified sound instance from continuing to loop."""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.stop_sound_instance_looping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":747
 *                 track.stop_sound_instance_looping(sound_instance)
 * 
 *     def clear_context(self, context):             # <<<<<<<<<<<<<<
 *         """Clears the context in all tracks"""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_91clear_context(PyObject *__pyx_v_self, PyObject *__pyx_v_context); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_90clear_context[] = "AudioInterface.clear_context(self, context)\nClears the context in all tracks";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_91clear_context(PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_context (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_90clear_context(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v_context));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_90clear_context(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, PyObject *__pyx_v_context) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  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("clear_context", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":749
 *     def clear_context(self, context):
 *         """Clears the context in all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.clear_context(context)
 * 
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 749, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 749, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":750
 *         """Clears the context in all tracks"""
 *         for track in self.tracks:
 *             track.clear_context(context)             # <<<<<<<<<<<<<<
 * 
 *     def process(self):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_clear_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_context) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_context);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":749
 *     def clear_context(self, context):
 *         """Clears the context in all tracks"""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.clear_context(context)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":747
 *                 track.stop_sound_instance_looping(sound_instance)
 * 
 *     def clear_context(self, context):             # <<<<<<<<<<<<<<
 *         """Clears the context in all tracks"""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.clear_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":752
 *             track.clear_context(context)
 * 
 *     def process(self):             # <<<<<<<<<<<<<<
 *         """Process tick function for the audio interface."""
 *         for track in self.tracks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_93process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_92process[] = "AudioInterface.process(self)\nProcess tick function for the audio interface.";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_93process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_92process(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_92process(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self) {
  PyObject *__pyx_v_track = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  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("process", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":754
 *     def process(self):
 *         """Process tick function for the audio interface."""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.process()
 * 
 */
  if (unlikely(__pyx_v_self->tracks == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 754, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->tracks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_track, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":755
 *         """Process tick function for the audio interface."""
 *         for track in self.tracks:
 *             track.process()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_track, __pyx_n_s_process); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":754
 *     def process(self):
 *         """Process tick function for the audio interface."""
 *         for track in self.tracks:             # <<<<<<<<<<<<<<
 *             track.process()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":752
 *             track.clear_context(context)
 * 
 *     def process(self):             # <<<<<<<<<<<<<<
 *         """Process tick function for the audio interface."""
 *         for track in self.tracks:
 */

  /* function exit code */
  __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_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.process", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_track);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/audio_interface.pyx":758
 * 
 *     @staticmethod
 *     cdef void audio_callback(void* data, Uint8 *output_buffer, int length) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Main audio callback function (called from SDL_mixer).
 */

static void __pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_audio_callback(void *__pyx_v_data, Uint8 *__pyx_v_output_buffer, int __pyx_v_length) {
  Uint32 __pyx_v_buffer_length;
  __pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *__pyx_v_callback_data;
  __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track;
  Uint8 __pyx_v_track_num;
  int __pyx_v_control_point;
  int __pyx_t_1;
  Uint8 __pyx_t_2;
  Uint8 __pyx_t_3;
  Uint8 __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  long __pyx_t_7;

  /* "mpfmc/core/audio/audio_interface.pyx":773
 *             track buffers are maintained in each Track object and are processed during this callback.
 *         """
 *         cdef Uint32 buffer_length = <Uint32> length             # <<<<<<<<<<<<<<
 *         cdef AudioCallbackData *callback_data = <AudioCallbackData*> data
 *         cdef TrackState *track
 */
  __pyx_v_buffer_length = ((Uint32)__pyx_v_length);

  /* "mpfmc/core/audio/audio_interface.pyx":774
 *         """
 *         cdef Uint32 buffer_length = <Uint32> length
 *         cdef AudioCallbackData *callback_data = <AudioCallbackData*> data             # <<<<<<<<<<<<<<
 *         cdef TrackState *track
 * 
 */
  __pyx_v_callback_data = ((__pyx_t_5mpfmc_4core_5audio_4sdl2_AudioCallbackData *)__pyx_v_data);

  /* "mpfmc/core/audio/audio_interface.pyx":777
 *         cdef TrackState *track
 * 
 *         if callback_data == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = ((__pyx_v_callback_data == NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/audio_interface.pyx":778
 * 
 *         if callback_data == NULL:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Initialize master output buffer with silence as it arrives uninitialized
 */
    goto __pyx_L0;

    /* "mpfmc/core/audio/audio_interface.pyx":777
 *         cdef TrackState *track
 * 
 *         if callback_data == NULL:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "mpfmc/core/audio/audio_interface.pyx":781
 * 
 *         # Initialize master output buffer with silence as it arrives uninitialized
 *         memset(output_buffer, 0, buffer_length)             # <<<<<<<<<<<<<<
 * 
 *         # Note: There are three separate loops over the tracks that must remain separate due
 */
  (void)(memset(__pyx_v_output_buffer, 0, __pyx_v_buffer_length));

  /* "mpfmc/core/audio/audio_interface.pyx":788
 * 
 *         # Loop over tracks, initializing the status, track buffer, and track ducking.
 *         for track_num in range(callback_data.track_count):             # <<<<<<<<<<<<<<
 *             track = <TrackState*>callback_data.tracks[track_num]
 * 
 */
  __pyx_t_2 = __pyx_v_callback_data->track_count;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_track_num = __pyx_t_4;

    /* "mpfmc/core/audio/audio_interface.pyx":789
 *         # Loop over tracks, initializing the status, track buffer, and track ducking.
 *         for track_num in range(callback_data.track_count):
 *             track = <TrackState*>callback_data.tracks[track_num]             # <<<<<<<<<<<<<<
 * 
 *             track.active = False
 */
    __pyx_v_track = ((__pyx_t_5mpfmc_4core_5audio_5track_TrackState *)(__pyx_v_callback_data->tracks[__pyx_v_track_num]));

    /* "mpfmc/core/audio/audio_interface.pyx":791
 *             track = <TrackState*>callback_data.tracks[track_num]
 * 
 *             track.active = False             # <<<<<<<<<<<<<<
 *             memset(track.buffer, 0, buffer_length)
 * 
 */
    __pyx_v_track->active = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":792
 * 
 *             track.active = False
 *             memset(track.buffer, 0, buffer_length)             # <<<<<<<<<<<<<<
 * 
 *             track.ducking_is_active = False
 */
    (void)(memset(__pyx_v_track->buffer, 0, __pyx_v_buffer_length));

    /* "mpfmc/core/audio/audio_interface.pyx":794
 *             memset(track.buffer, 0, buffer_length)
 * 
 *             track.ducking_is_active = False             # <<<<<<<<<<<<<<
 *             for control_point in range(CONTROL_POINTS_PER_BUFFER):
 *                 g_array_set_val_uint8(track.ducking_control_points, control_point, SDL_MIX_MAXVOLUME)
 */
    __pyx_v_track->ducking_is_active = 0;

    /* "mpfmc/core/audio/audio_interface.pyx":795
 * 
 *             track.ducking_is_active = False
 *             for control_point in range(CONTROL_POINTS_PER_BUFFER):             # <<<<<<<<<<<<<<
 *                 g_array_set_val_uint8(track.ducking_control_points, control_point, SDL_MIX_MAXVOLUME)
 * 
 */
    __pyx_t_5 = __pyx_e_5mpfmc_4core_5audio_5track_CONTROL_POINTS_PER_BUFFER;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_control_point = __pyx_t_7;

      /* "mpfmc/core/audio/audio_interface.pyx":796
 *             track.ducking_is_active = False
 *             for control_point in range(CONTROL_POINTS_PER_BUFFER):
 *                 g_array_set_val_uint8(track.ducking_control_points, control_point, SDL_MIX_MAXVOLUME)             # <<<<<<<<<<<<<<
 * 
 *         # Loop over tracks, mixing the playing sounds into the track's audio buffer
 */
      g_array_set_val_uint8(__pyx_v_track->ducking_control_points, __pyx_v_control_point, SDL_MIX_MAXVOLUME);
    }
  }

  /* "mpfmc/core/audio/audio_interface.pyx":799
 * 
 *         # Loop over tracks, mixing the playing sounds into the track's audio buffer
 *         for track_num in range(callback_data.track_count):             # <<<<<<<<<<<<<<
 *             track = <TrackState*>callback_data.tracks[track_num]
 * 
 */
  __pyx_t_2 = __pyx_v_callback_data->track_count;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_track_num = __pyx_t_4;

    /* "mpfmc/core/audio/audio_interface.pyx":800
 *         # Loop over tracks, mixing the playing sounds into the track's audio buffer
 *         for track_num in range(callback_data.track_count):
 *             track = <TrackState*>callback_data.tracks[track_num]             # <<<<<<<<<<<<<<
 * 
 *             # No need to process/mix the track if the track is stopped or paused
 */
    __pyx_v_track = ((__pyx_t_5mpfmc_4core_5audio_5track_TrackState *)(__pyx_v_callback_data->tracks[__pyx_v_track_num]));

    /* "mpfmc/core/audio/audio_interface.pyx":803
 * 
 *             # No need to process/mix the track if the track is stopped or paused
 *             if track.status == track_status_stopped or track.status == track_status_paused:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    switch (__pyx_v_track->status) {
      case __pyx_e_5mpfmc_4core_5audio_5track_track_status_stopped:
      case __pyx_e_5mpfmc_4core_5audio_5track_track_status_paused:

      /* "mpfmc/core/audio/audio_interface.pyx":804
 *             # No need to process/mix the track if the track is stopped or paused
 *             if track.status == track_status_stopped or track.status == track_status_paused:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             # Call the track's mix callback function (generates audio into track buffer)
 */
      goto __pyx_L8_continue;

      /* "mpfmc/core/audio/audio_interface.pyx":803
 * 
 *             # No need to process/mix the track if the track is stopped or paused
 *             if track.status == track_status_stopped or track.status == track_status_paused:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      break;
      default: break;
    }

    /* "mpfmc/core/audio/audio_interface.pyx":807
 * 
 *             # Call the track's mix callback function (generates audio into track buffer)
 *             if track.mix_callback_function != NULL:             # <<<<<<<<<<<<<<
 *                 track.mix_callback_function(track, buffer_length, callback_data)
 * 
 */
    __pyx_t_1 = ((__pyx_v_track->mix_callback_function != NULL) != 0);
    if (__pyx_t_1) {

      /* "mpfmc/core/audio/audio_interface.pyx":808
 *             # Call the track's mix callback function (generates audio into track buffer)
 *             if track.mix_callback_function != NULL:
 *                 track.mix_callback_function(track, buffer_length, callback_data)             # <<<<<<<<<<<<<<
 * 
 *         # Loop over tracks again, applying ducking and mixing down tracks to the master output buffer
 */
      __pyx_v_track->mix_callback_function(__pyx_v_track, __pyx_v_buffer_length, __pyx_v_callback_data);

      /* "mpfmc/core/audio/audio_interface.pyx":807
 * 
 *             # Call the track's mix callback function (generates audio into track buffer)
 *             if track.mix_callback_function != NULL:             # <<<<<<<<<<<<<<
 *                 track.mix_callback_function(track, buffer_length, callback_data)
 * 
 */
    }
    __pyx_L8_continue:;
  }

  /* "mpfmc/core/audio/audio_interface.pyx":811
 * 
 *         # Loop over tracks again, applying ducking and mixing down tracks to the master output buffer
 *         for track_num in range(callback_data.track_count):             # <<<<<<<<<<<<<<
 *             track = <TrackState*>callback_data.tracks[track_num]
 * 
 */
  __pyx_t_2 = __pyx_v_callback_data->track_count;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_track_num = __pyx_t_4;

    /* "mpfmc/core/audio/audio_interface.pyx":812
 *         # Loop over tracks again, applying ducking and mixing down tracks to the master output buffer
 *         for track_num in range(callback_data.track_count):
 *             track = <TrackState*>callback_data.tracks[track_num]             # <<<<<<<<<<<<<<
 * 
 *             # Only mix the track to the master output and apply ducking if it is active
 */
    __pyx_v_track = ((__pyx_t_5mpfmc_4core_5audio_5track_TrackState *)(__pyx_v_callback_data->tracks[__pyx_v_track_num]));

    /* "mpfmc/core/audio/audio_interface.pyx":815
 * 
 *             # Only mix the track to the master output and apply ducking if it is active
 *             if track.active:             # <<<<<<<<<<<<<<
 *                 Track.mix_track_to_output(track,
 *                                           callback_data,
 */
    __pyx_t_1 = (__pyx_v_track->active != 0);
    if (__pyx_t_1) {

      /* "mpfmc/core/audio/audio_interface.pyx":816
 *             # Only mix the track to the master output and apply ducking if it is active
 *             if track.active:
 *                 Track.mix_track_to_output(track,             # <<<<<<<<<<<<<<
 *                                           callback_data,
 *                                           output_buffer,
 */
      __pyx_vtabptr_5mpfmc_4core_5audio_5track_Track->mix_track_to_output(__pyx_v_track, __pyx_v_callback_data, __pyx_v_output_buffer, __pyx_v_buffer_length);

      /* "mpfmc/core/audio/audio_interface.pyx":815
 * 
 *             # Only mix the track to the master output and apply ducking if it is active
 *             if track.active:             # <<<<<<<<<<<<<<
 *                 Track.mix_track_to_output(track,
 *                                           callback_data,
 */
    }
  }

  /* "mpfmc/core/audio/audio_interface.pyx":822
 * 
 *         # Apply master volume to output buffer
 *         Track.apply_volume(output_buffer, output_buffer, buffer_length, callback_data.master_volume)             # <<<<<<<<<<<<<<
 */
  __pyx_vtabptr_5mpfmc_4core_5audio_5track_Track->apply_volume(__pyx_v_output_buffer, __pyx_v_output_buffer, __pyx_v_buffer_length, __pyx_v_callback_data->master_volume);

  /* "mpfmc/core/audio/audio_interface.pyx":758
 * 
 *     @staticmethod
 *     cdef void audio_callback(void* data, Uint8 *output_buffer, int length) nogil:             # <<<<<<<<<<<<<<
 *         """
 *         Main audio callback function (called from SDL_mixer).
 */

  /* function exit code */
  __pyx_L0:;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_95__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_94__reduce_cython__[] = "AudioInterface.__reduce_cython__(self)";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_95__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_94__reduce_cython__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_94__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__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("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_97__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_96__setstate_cython__[] = "AudioInterface.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_97__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_96__setstate_cython__(((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_96__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("mpfmc.core.audio.audio_interface.AudioInterface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "mpfmc/core/audio/notification_message.pxd":52
 * # ---------------------------------------------------------------------------
 * 
 * cdef inline NotificationMessageContainer *_create_notification_message() nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Creates a new notification message.
 */

static CYTHON_INLINE __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message(void) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_r;

  /* "mpfmc/core/audio/notification_message.pxd":57
 *     :return: A pointer to the new notification message.
 *     """
 *     return <NotificationMessageContainer*>g_slice_alloc0(sizeof(NotificationMessageContainer))             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_started_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,
 */
  __pyx_r = ((__pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *)g_slice_alloc0((sizeof(__pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer))));
  goto __pyx_L0;

  /* "mpfmc/core/audio/notification_message.pxd":52
 * # ---------------------------------------------------------------------------
 * 
 * cdef inline NotificationMessageContainer *_create_notification_message() nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Creates a new notification message.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "mpfmc/core/audio/notification_message.pxd":59
 *     return <NotificationMessageContainer*>g_slice_alloc0(sizeof(NotificationMessageContainer))
 * 
 * cdef inline void send_sound_started_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_started_notification(int __pyx_v_player, Uint64 __pyx_v_sound_id, Uint64 __pyx_v_sound_instance_id, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":69
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_started
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":70
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_started
 *         notification_message.player = player
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":71
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_started             # <<<<<<<<<<<<<<
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_started;

    /* "mpfmc/core/audio/notification_message.pxd":72
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_started
 *         notification_message.player = player             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 */
    __pyx_v_notification_message->player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":73
 *         notification_message.message = notification_sound_started
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":74
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->sound_instance_id = __pyx_v_sound_instance_id;

    /* "mpfmc/core/audio/notification_message.pxd":76
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_stopped_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":70
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_started
 *         notification_message.player = player
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":59
 *     return <NotificationMessageContainer*>g_slice_alloc0(sizeof(NotificationMessageContainer))
 * 
 * cdef inline void send_sound_started_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":78
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_stopped_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_stopped_notification(int __pyx_v_player, Uint64 __pyx_v_sound_id, Uint64 __pyx_v_sound_instance_id, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":88
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_stopped
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":89
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_stopped
 *         notification_message.player = player
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":90
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_stopped             # <<<<<<<<<<<<<<
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_stopped;

    /* "mpfmc/core/audio/notification_message.pxd":91
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_stopped
 *         notification_message.player = player             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 */
    __pyx_v_notification_message->player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":92
 *         notification_message.message = notification_sound_stopped
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":93
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->sound_instance_id = __pyx_v_sound_instance_id;

    /* "mpfmc/core/audio/notification_message.pxd":95
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_looping_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":89
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_stopped
 *         notification_message.player = player
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":78
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_stopped_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":97
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_looping_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_looping_notification(int __pyx_v_player, Uint64 __pyx_v_sound_id, Uint64 __pyx_v_sound_instance_id, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":107
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_looping
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":108
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_looping
 *         notification_message.player = player
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":109
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_looping             # <<<<<<<<<<<<<<
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_looping;

    /* "mpfmc/core/audio/notification_message.pxd":110
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_looping
 *         notification_message.player = player             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 */
    __pyx_v_notification_message->player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":111
 *         notification_message.message = notification_sound_looping
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":112
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->sound_instance_id = __pyx_v_sound_instance_id;

    /* "mpfmc/core/audio/notification_message.pxd":114
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_about_to_finish_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":108
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_looping
 *         notification_message.player = player
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":97
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_looping_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                  TrackState *track) nogil:
 *     """
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":116
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_about_to_finish_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                          TrackState *track) nogil:
 *     """
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_about_to_finish_notification(int __pyx_v_player, Uint64 __pyx_v_sound_id, Uint64 __pyx_v_sound_instance_id, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":126
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_about_to_finish
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":127
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_about_to_finish
 *         notification_message.player = player
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":128
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_about_to_finish             # <<<<<<<<<<<<<<
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_about_to_finish;

    /* "mpfmc/core/audio/notification_message.pxd":129
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_about_to_finish
 *         notification_message.player = player             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 */
    __pyx_v_notification_message->player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":130
 *         notification_message.message = notification_sound_about_to_finish
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":131
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->sound_instance_id = __pyx_v_sound_instance_id;

    /* "mpfmc/core/audio/notification_message.pxd":133
 *         notification_message.sound_instance_id = sound_instance_id
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_marker_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":127
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_about_to_finish
 *         notification_message.player = player
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":116
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_about_to_finish_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                          TrackState *track) nogil:
 *     """
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":135
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_marker_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                 TrackState *track,
 *                                                 int marker_id) nogil:
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_marker_notification(int __pyx_v_player, Uint64 __pyx_v_sound_id, Uint64 __pyx_v_sound_instance_id, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track, int __pyx_v_marker_id) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":147
 *         marker_id: The id of the marker being sent for the specified sound
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_marker
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":148
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_marker
 *         notification_message.player = player
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":149
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_marker             # <<<<<<<<<<<<<<
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_marker;

    /* "mpfmc/core/audio/notification_message.pxd":150
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_marker
 *         notification_message.player = player             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 */
    __pyx_v_notification_message->player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":151
 *         notification_message.message = notification_sound_marker
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = sound_instance_id
 *         notification_message.data.marker.id = marker_id
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":152
 *         notification_message.player = player
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id             # <<<<<<<<<<<<<<
 *         notification_message.data.marker.id = marker_id
 * 
 */
    __pyx_v_notification_message->sound_instance_id = __pyx_v_sound_instance_id;

    /* "mpfmc/core/audio/notification_message.pxd":153
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = sound_instance_id
 *         notification_message.data.marker.id = marker_id             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->data.marker.id = __pyx_v_marker_id;

    /* "mpfmc/core/audio/notification_message.pxd":155
 *         notification_message.data.marker.id = marker_id
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_track_stopped_notification(TrackState *track) nogil:
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":148
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_marker
 *         notification_message.player = player
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":135
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_marker_notification(int player, Uint64 sound_id, Uint64 sound_instance_id,             # <<<<<<<<<<<<<<
 *                                                 TrackState *track,
 *                                                 int marker_id) nogil:
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":157
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_track_stopped_notification(TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a track stopped notification
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_track_stopped_notification(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":163
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_stopped
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":164
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_track_stopped
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":165
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_stopped             # <<<<<<<<<<<<<<
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_track_stopped;

    /* "mpfmc/core/audio/notification_message.pxd":166
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_stopped
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_track_paused_notification(TrackState *track) nogil:
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":164
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_track_stopped
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":157
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_track_stopped_notification(TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a track stopped notification
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":168
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_track_paused_notification(TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a track paused notification
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_track_paused_notification(__pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":174
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_paused
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":175
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_track_paused
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":176
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_paused             # <<<<<<<<<<<<<<
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_track_paused;

    /* "mpfmc/core/audio/notification_message.pxd":177
 *     if notification_message != NULL:
 *         notification_message.message = notification_track_paused
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_loop_set_started_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":175
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_track_paused
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":168
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_track_paused_notification(TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a track paused notification
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":179
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_started_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set started notification
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_loop_set_started_notification(int __pyx_v_sound_loop_set_id, Uint64 __pyx_v_sound_id, gpointer __pyx_v_player, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":188
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_started
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":189
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_started
 *         notification_message.player = 0
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":190
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_started             # <<<<<<<<<<<<<<
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_started;

    /* "mpfmc/core/audio/notification_message.pxd":191
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_started
 *         notification_message.player = 0             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 */
    __pyx_v_notification_message->player = 0;

    /* "mpfmc/core/audio/notification_message.pxd":192
 *         notification_message.message = notification_sound_loop_set_started
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":193
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player
 */
    __pyx_v_notification_message->sound_instance_id = 0;

    /* "mpfmc/core/audio/notification_message.pxd":194
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.player = player
 * 
 */
    __pyx_v_notification_message->data.sound_loop_set.id = __pyx_v_sound_loop_set_id;

    /* "mpfmc/core/audio/notification_message.pxd":195
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->data.sound_loop_set.player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":197
 *         notification_message.data.sound_loop_set.player = player
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_loop_set_stopped_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":189
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_started
 *         notification_message.player = 0
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":179
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_started_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set started notification
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":199
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_stopped_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set stopped notification
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_loop_set_stopped_notification(int __pyx_v_sound_loop_set_id, Uint64 __pyx_v_sound_id, gpointer __pyx_v_player, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":208
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_stopped
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":209
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_stopped
 *         notification_message.player = 0
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":210
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_stopped             # <<<<<<<<<<<<<<
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_stopped;

    /* "mpfmc/core/audio/notification_message.pxd":211
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_stopped
 *         notification_message.player = 0             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 */
    __pyx_v_notification_message->player = 0;

    /* "mpfmc/core/audio/notification_message.pxd":212
 *         notification_message.message = notification_sound_loop_set_stopped
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":213
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player
 */
    __pyx_v_notification_message->sound_instance_id = 0;

    /* "mpfmc/core/audio/notification_message.pxd":214
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.player = player
 * 
 */
    __pyx_v_notification_message->data.sound_loop_set.id = __pyx_v_sound_loop_set_id;

    /* "mpfmc/core/audio/notification_message.pxd":215
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->data.sound_loop_set.player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":217
 *         notification_message.data.sound_loop_set.player = player
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 * cdef inline void send_sound_loop_set_looping_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":209
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_stopped
 *         notification_message.player = 0
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":199
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_stopped_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set stopped notification
 */

  /* function exit code */
}

/* "mpfmc/core/audio/notification_message.pxd":219
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_looping_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set looping notification
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_loop_set_looping_notification(int __pyx_v_sound_loop_set_id, Uint64 __pyx_v_sound_id, gpointer __pyx_v_player, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  __pyx_t_5mpfmc_4core_5audio_20notification_message_NotificationMessageContainer *__pyx_v_notification_message;
  int __pyx_t_1;

  /* "mpfmc/core/audio/notification_message.pxd":228
 *         track: The TrackState pointer
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()             # <<<<<<<<<<<<<<
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_looping
 */
  __pyx_v_notification_message = __pyx_f_5mpfmc_4core_5audio_20notification_message__create_notification_message();

  /* "mpfmc/core/audio/notification_message.pxd":229
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_looping
 *         notification_message.player = 0
 */
  __pyx_t_1 = ((__pyx_v_notification_message != NULL) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/notification_message.pxd":230
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_looping             # <<<<<<<<<<<<<<
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 */
    __pyx_v_notification_message->message = __pyx_e_5mpfmc_4core_5audio_20notification_message_notification_sound_loop_set_looping;

    /* "mpfmc/core/audio/notification_message.pxd":231
 *     if notification_message != NULL:
 *         notification_message.message = notification_sound_loop_set_looping
 *         notification_message.player = 0             # <<<<<<<<<<<<<<
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 */
    __pyx_v_notification_message->player = 0;

    /* "mpfmc/core/audio/notification_message.pxd":232
 *         notification_message.message = notification_sound_loop_set_looping
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id             # <<<<<<<<<<<<<<
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 */
    __pyx_v_notification_message->sound_id = __pyx_v_sound_id;

    /* "mpfmc/core/audio/notification_message.pxd":233
 *         notification_message.player = 0
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player
 */
    __pyx_v_notification_message->sound_instance_id = 0;

    /* "mpfmc/core/audio/notification_message.pxd":234
 *         notification_message.sound_id = sound_id
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id             # <<<<<<<<<<<<<<
 *         notification_message.data.sound_loop_set.player = player
 * 
 */
    __pyx_v_notification_message->data.sound_loop_set.id = __pyx_v_sound_loop_set_id;

    /* "mpfmc/core/audio/notification_message.pxd":235
 *         notification_message.sound_instance_id = 0
 *         notification_message.data.sound_loop_set.id = sound_loop_set_id
 *         notification_message.data.sound_loop_set.player = player             # <<<<<<<<<<<<<<
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 */
    __pyx_v_notification_message->data.sound_loop_set.player = __pyx_v_player;

    /* "mpfmc/core/audio/notification_message.pxd":237
 *         notification_message.data.sound_loop_set.player = player
 * 
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)             # <<<<<<<<<<<<<<
 * 
 */
    __pyx_v_track->notification_messages = g_slist_prepend(__pyx_v_track->notification_messages, __pyx_v_notification_message);

    /* "mpfmc/core/audio/notification_message.pxd":229
 *     """
 *     cdef NotificationMessageContainer *notification_message = _create_notification_message()
 *     if notification_message != NULL:             # <<<<<<<<<<<<<<
 *         notification_message.message = notification_sound_loop_set_looping
 *         notification_message.player = 0
 */
  }

  /* "mpfmc/core/audio/notification_message.pxd":219
 *         track.notification_messages = g_slist_prepend(track.notification_messages, notification_message)
 * 
 * cdef inline void send_sound_loop_set_looping_notification(int sound_loop_set_id, Uint64 sound_id, gpointer player, TrackState *track) nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Sends a sound_loop_set looping notification
 */

  /* function exit code */
}

/* "mpfmc/core/audio/track_standard.pxd":128
 *                                       Uint8 volume, TrackState *track, int player_num) nogil
 * 
 * cdef inline void end_of_sound_processing(SoundPlayer* player,             # <<<<<<<<<<<<<<
 *                                          TrackState *track) nogil:
 *     """
 */

static CYTHON_INLINE void __pyx_f_5mpfmc_4core_5audio_14track_standard_end_of_sound_processing(__pyx_t_5mpfmc_4core_5audio_14track_standard_SoundPlayer *__pyx_v_player, __pyx_t_5mpfmc_4core_5audio_5track_TrackState *__pyx_v_track) {
  int __pyx_t_1;

  /* "mpfmc/core/audio/track_standard.pxd":139
 *     """
 *     # Check if we are at the end of the source sample buffer (loop if applicable)
 *     if player.current.loops_remaining > 0:             # <<<<<<<<<<<<<<
 *         # At the end and still loops remaining, loop back to the beginning
 *         player.current.loops_remaining -= 1
 */
  __pyx_t_1 = ((__pyx_v_player->current.loops_remaining > 0) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/track_standard.pxd":141
 *     if player.current.loops_remaining > 0:
 *         # At the end and still loops remaining, loop back to the beginning
 *         player.current.loops_remaining -= 1             # <<<<<<<<<<<<<<
 *         player.current.sample_pos = 0
 *         player.current.current_loop += 1
 */
    __pyx_v_player->current.loops_remaining = (__pyx_v_player->current.loops_remaining - 1);

    /* "mpfmc/core/audio/track_standard.pxd":142
 *         # At the end and still loops remaining, loop back to the beginning
 *         player.current.loops_remaining -= 1
 *         player.current.sample_pos = 0             # <<<<<<<<<<<<<<
 *         player.current.current_loop += 1
 *         send_sound_looping_notification(player.number,
 */
    __pyx_v_player->current.sample_pos = 0;

    /* "mpfmc/core/audio/track_standard.pxd":143
 *         player.current.loops_remaining -= 1
 *         player.current.sample_pos = 0
 *         player.current.current_loop += 1             # <<<<<<<<<<<<<<
 *         send_sound_looping_notification(player.number,
 *                                  player.current.sound_id, player.current.sound_instance_id,
 */
    __pyx_v_player->current.current_loop = (__pyx_v_player->current.current_loop + 1);

    /* "mpfmc/core/audio/track_standard.pxd":144
 *         player.current.sample_pos = 0
 *         player.current.current_loop += 1
 *         send_sound_looping_notification(player.number,             # <<<<<<<<<<<<<<
 *                                  player.current.sound_id, player.current.sound_instance_id,
 *                                  track)
 */
    __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_looping_notification(__pyx_v_player->number, __pyx_v_player->current.sound_id, __pyx_v_player->current.sound_instance_id, __pyx_v_track);

    /* "mpfmc/core/audio/track_standard.pxd":139
 *     """
 *     # Check if we are at the end of the source sample buffer (loop if applicable)
 *     if player.current.loops_remaining > 0:             # <<<<<<<<<<<<<<
 *         # At the end and still loops remaining, loop back to the beginning
 *         player.current.loops_remaining -= 1
 */
    goto __pyx_L3;
  }

  /* "mpfmc/core/audio/track_standard.pxd":148
 *                                  track)
 * 
 *     elif player.current.loops_remaining == 0:             # <<<<<<<<<<<<<<
 *         # At the end and not looping, the sample has finished playing
 *         player.status = player_finished
 */
  __pyx_t_1 = ((__pyx_v_player->current.loops_remaining == 0) != 0);
  if (__pyx_t_1) {

    /* "mpfmc/core/audio/track_standard.pxd":150
 *     elif player.current.loops_remaining == 0:
 *         # At the end and not looping, the sample has finished playing
 *         player.status = player_finished             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    __pyx_v_player->status = __pyx_e_5mpfmc_4core_5audio_14track_standard_player_finished;

    /* "mpfmc/core/audio/track_standard.pxd":148
 *                                  track)
 * 
 *     elif player.current.loops_remaining == 0:             # <<<<<<<<<<<<<<
 *         # At the end and not looping, the sample has finished playing
 *         player.status = player_finished
 */
    goto __pyx_L3;
  }

  /* "mpfmc/core/audio/track_standard.pxd":154
 *     else:
 *         # Looping infinitely, loop back to the beginning
 *         player.current.sample_pos = 0             # <<<<<<<<<<<<<<
 *         player.current.current_loop += 1
 *         send_sound_looping_notification(player.number,
 */
  /*else*/ {
    __pyx_v_player->current.sample_pos = 0;

    /* "mpfmc/core/audio/track_standard.pxd":155
 *         # Looping infinitely, loop back to the beginning
 *         player.current.sample_pos = 0
 *         player.current.current_loop += 1             # <<<<<<<<<<<<<<
 *         send_sound_looping_notification(player.number,
 *                                  player.current.sound_id, player.current.sound_instance_id,
 */
    __pyx_v_player->current.current_loop = (__pyx_v_player->current.current_loop + 1);

    /* "mpfmc/core/audio/track_standard.pxd":156
 *         player.current.sample_pos = 0
 *         player.current.current_loop += 1
 *         send_sound_looping_notification(player.number,             # <<<<<<<<<<<<<<
 *                                  player.current.sound_id, player.current.sound_instance_id,
 *                                  track)
 */
    __pyx_f_5mpfmc_4core_5audio_20notification_message_send_sound_looping_notification(__pyx_v_player->number, __pyx_v_player->current.sound_id, __pyx_v_player->current.sound_instance_id, __pyx_v_track);
  }
  __pyx_L3:;

  /* "mpfmc/core/audio/track_standard.pxd":128
 *                                       Uint8 volume, TrackState *track, int player_num) nogil
 * 
 * cdef inline void end_of_sound_processing(SoundPlayer* player,             # <<<<<<<<<<<<<<
 *                                          TrackState *track) nogil:
 *     """
 */

  /* function exit code */
}
static struct __pyx_vtabstruct_5mpfmc_4core_5audio_15audio_interface_AudioInterface __pyx_vtable_5mpfmc_4core_5audio_15audio_interface_AudioInterface;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface_AudioInterface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)o);
  p->__pyx_vtab = __pyx_vtabptr_5mpfmc_4core_5audio_15audio_interface_AudioInterface;
  p->tracks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->playlist_controllers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->mc = Py_None; Py_INCREF(Py_None);
  p->log = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface_AudioInterface(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->tracks);
  Py_CLEAR(p->playlist_controllers);
  Py_CLEAR(p->mc);
  Py_CLEAR(p->log);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface_AudioInterface(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)o;
  if (p->tracks) {
    e = (*v)(p->tracks, a); if (e) return e;
  }
  if (p->playlist_controllers) {
    e = (*v)(p->playlist_controllers, a); if (e) return e;
  }
  if (p->mc) {
    e = (*v)(p->mc, a); if (e) return e;
  }
  if (p->log) {
    e = (*v)(p->log, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5mpfmc_4core_5audio_15audio_interface_AudioInterface(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *)o;
  tmp = ((PyObject*)p->tracks);
  p->tracks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->playlist_controllers);
  p->playlist_controllers = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mc);
  p->mc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->log);
  p->log = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_enabled(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7enabled_1__get__(o);
}

static PyMethodDef __pyx_methods_5mpfmc_4core_5audio_15audio_interface_AudioInterface[] = {
  {"__del__", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_5__del__, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_4__del__},
  {"_initialize_gstreamer", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_7_initialize_gstreamer, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_6_initialize_gstreamer},
  {"initialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_8initialize},
  {"power_of_two", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_10power_of_two},
  {"db_to_gain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_12db_to_gain},
  {"string_to_gain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_14string_to_gain},
  {"convert_seconds_to_samples", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_17convert_seconds_to_samples, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_16convert_seconds_to_samples},
  {"convert_seconds_to_buffer_length", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_19convert_seconds_to_buffer_length, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_18convert_seconds_to_buffer_length},
  {"convert_buffer_length_to_seconds", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_21convert_buffer_length_to_seconds, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_20convert_buffer_length_to_seconds},
  {"string_to_secs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_22string_to_secs},
  {"string_to_samples", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_25string_to_samples, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_24string_to_samples},
  {"get_sdl_version", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_27get_sdl_version, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_26get_sdl_version},
  {"get_sdl_mixer_version", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_29get_sdl_mixer_version, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_28get_sdl_mixer_version},
  {"get_gstreamer_version", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_31get_gstreamer_version, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_30get_gstreamer_version},
  {"get_glib_version", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_33get_glib_version, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_32get_glib_version},
  {"supported_extensions", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_35supported_extensions, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_34supported_extensions},
  {"get_master_volume", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_37get_master_volume, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_36get_master_volume},
  {"set_master_volume", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_39set_master_volume, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_38set_master_volume},
  {"get_settings", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_41get_settings, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_40get_settings},
  {"enable", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_43enable, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_42enable},
  {"disable", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_45disable, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_44disable},
  {"shutdown", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_47shutdown, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_46shutdown},
  {"get_max_tracks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_48get_max_tracks},
  {"get_max_markers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_50get_max_markers},
  {"get_track_count", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_53get_track_count, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_52get_track_count},
  {"get_track_names", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_55get_track_names, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_54get_track_names},
  {"get_track", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_57get_track, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_56get_track},
  {"get_track_type", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_59get_track_type, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_58get_track_type},
  {"get_track_by_name", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_61get_track_by_name, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_60get_track_by_name},
  {"create_standard_track", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_63create_standard_track, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_62create_standard_track},
  {"create_sound_loop_track", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_65create_sound_loop_track, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_64create_sound_loop_track},
  {"create_playlist_track", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_67create_playlist_track, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_66create_playlist_track},
  {"get_playlist_controller_count", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_69get_playlist_controller_count, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_68get_playlist_controller_count},
  {"get_playlist_controller_names", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_71get_playlist_controller_names, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_70get_playlist_controller_names},
  {"get_playlist_controller", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_73get_playlist_controller, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_72get_playlist_controller},
  {"load_sound_file_to_memory", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_75load_sound_file_to_memory, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_74load_sound_file_to_memory},
  {"load_sound_file_for_streaming", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_77load_sound_file_for_streaming, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_76load_sound_file_for_streaming},
  {"unload_sound_file", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_79unload_sound_file, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_78unload_sound_file},
  {"stop_all_sounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_81stop_all_sounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_80stop_all_sounds},
  {"stop_sound_instance", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_83stop_sound_instance, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_82stop_sound_instance},
  {"stop_sound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_85stop_sound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_84stop_sound},
  {"stop_sound", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_87stop_sound, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_86stop_sound},
  {"stop_sound_instance_looping", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_89stop_sound_instance_looping, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_88stop_sound_instance_looping},
  {"clear_context", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_91clear_context, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_90clear_context},
  {"process", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_93process, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_92process},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_95__reduce_cython__, METH_NOARGS, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_94__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_97__setstate_cython__, METH_O, __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_96__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5mpfmc_4core_5audio_15audio_interface_AudioInterface[] = {
  {(char *)"enabled", __pyx_getprop_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_enabled, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.AudioInterface", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "AudioInterface(rate=44100, channels=2, buffer_samples=4096)\n\n    The AudioInterface class provides a management wrapper around the SDL2 and SDL_Mixer\n    libraries.\n    ", /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*tp_traverse*/
  __pyx_tp_clear_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5mpfmc_4core_5audio_15audio_interface_AudioInterface, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *)o;
  Py_CLEAR(p->__pyx_v_gain_string);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct__string_to_gain", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *)o;
  Py_CLEAR(p->__pyx_v_time_string);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_2_string_to_secs", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr = 0;

static PyObject *__pyx_tp_new_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr[--__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr[__pyx_freecount_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "mpfmc.core.audio.audio_interface.__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*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_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_audio_interface(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_audio_interface},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "audio_interface",
    __pyx_k_Audio_Library_This_library_requ, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_kp_u_Add_track_failed_the_maximum_num, __pyx_k_Add_track_failed_the_maximum_num, sizeof(__pyx_k_Add_track_failed_the_maximum_num), 0, 1, 0, 0},
  {&__pyx_kp_u_Add_track_failed_the_track_name, __pyx_k_Add_track_failed_the_track_name, sizeof(__pyx_k_Add_track_failed_the_track_name), 0, 1, 0, 0},
  {&__pyx_n_s_AudioException, __pyx_k_AudioException, sizeof(__pyx_k_AudioException), 0, 0, 1, 1},
  {&__pyx_n_s_AudioInterface, __pyx_k_AudioInterface, sizeof(__pyx_k_AudioInterface), 0, 0, 1, 1},
  {&__pyx_n_u_AudioInterface, __pyx_k_AudioInterface, sizeof(__pyx_k_AudioInterface), 0, 1, 0, 1},
  {&__pyx_kp_u_Buffer_samples_is_required_to_be, __pyx_k_Buffer_samples_is_required_to_be, sizeof(__pyx_k_Buffer_samples_is_required_to_be), 0, 1, 0, 0},
  {&__pyx_kp_u_Channels_is_required_to_be_eithe, __pyx_k_Channels_is_required_to_be_eithe, sizeof(__pyx_k_Channels_is_required_to_be_eithe), 0, 1, 0, 0},
  {&__pyx_n_u_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 1, 0, 1},
  {&__pyx_n_u_DB, __pyx_k_DB, sizeof(__pyx_k_DB), 0, 1, 0, 1},
  {&__pyx_kp_u_Disabling_audio_playback, __pyx_k_Disabling_audio_playback, sizeof(__pyx_k_Disabling_audio_playback), 0, 1, 0, 0},
  {&__pyx_kp_u_Enabling_audio_playback, __pyx_k_Enabling_audio_playback, sizeof(__pyx_k_Enabling_audio_playback), 0, 1, 0, 0},
  {&__pyx_kp_u_GLib, __pyx_k_GLib, sizeof(__pyx_k_GLib), 0, 1, 0, 0},
  {&__pyx_kp_u_GStreamer, __pyx_k_GStreamer, sizeof(__pyx_k_GStreamer), 0, 1, 0, 0},
  {&__pyx_n_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_u_Initialized, __pyx_k_Initialized, sizeof(__pyx_k_Initialized), 0, 1, 0, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_u_Loaded_s, __pyx_k_Loaded_s, sizeof(__pyx_k_Loaded_s), 0, 1, 0, 0},
  {&__pyx_n_u_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 1, 0, 1},
  {&__pyx_n_u_MS, __pyx_k_MS, sizeof(__pyx_k_MS), 0, 1, 0, 1},
  {&__pyx_n_u_MSEC, __pyx_k_MSEC, sizeof(__pyx_k_MSEC), 0, 1, 0, 1},
  {&__pyx_kp_u_Mix_OpenAudio_error_s, __pyx_k_Mix_OpenAudio_error_s, sizeof(__pyx_k_Mix_OpenAudio_error_s), 0, 1, 0, 0},
  {&__pyx_n_u_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 1, 0, 1},
  {&__pyx_kp_u_NOTE_You_may_experience_noise_an, __pyx_k_NOTE_You_may_experience_noise_an, sizeof(__pyx_k_NOTE_You_may_experience_noise_an), 0, 1, 0, 0},
  {&__pyx_n_s_PlaylistController, __pyx_k_PlaylistController, sizeof(__pyx_k_PlaylistController), 0, 0, 1, 1},
  {&__pyx_n_u_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 1, 0, 1},
  {&__pyx_kp_u_SDL, __pyx_k_SDL, sizeof(__pyx_k_SDL), 0, 1, 0, 0},
  {&__pyx_kp_u_SDL_InitSubSystem_error_s, __pyx_k_SDL_InitSubSystem_error_s, sizeof(__pyx_k_SDL_InitSubSystem_error_s), 0, 1, 0, 0},
  {&__pyx_kp_u_SDL_Mixer, __pyx_k_SDL_Mixer, sizeof(__pyx_k_SDL_Mixer), 0, 1, 0, 0},
  {&__pyx_n_u_SEC, __pyx_k_SEC, sizeof(__pyx_k_SEC), 0, 1, 0, 1},
  {&__pyx_kp_u_Settings_in_use_rate_d_channels, __pyx_k_Settings_in_use_rate_d_channels, sizeof(__pyx_k_Settings_in_use_rate_d_channels), 0, 1, 0, 0},
  {&__pyx_kp_u_Settings_requested_rate_d_channe, __pyx_k_Settings_requested_rate_d_channe, sizeof(__pyx_k_Settings_requested_rate_d_channe), 0, 1, 0, 0},
  {&__pyx_kp_u_Shutting_down_and_cleaning_up_al, __pyx_k_Shutting_down_and_cleaning_up_al, sizeof(__pyx_k_Shutting_down_and_cleaning_up_al), 0, 1, 0, 0},
  {&__pyx_kp_u_The_audio_interface_only_support, __pyx_k_The_audio_interface_only_support, sizeof(__pyx_k_The_audio_interface_only_support), 0, 1, 0, 0},
  {&__pyx_kp_u_The_audio_interface_only_support_2, __pyx_k_The_audio_interface_only_support_2, sizeof(__pyx_k_The_audio_interface_only_support_2), 0, 1, 0, 0},
  {&__pyx_kp_u_The_s_live_loop_track_has_succes, __pyx_k_The_s_live_loop_track_has_succes, sizeof(__pyx_k_The_s_live_loop_track_has_succes), 0, 1, 0, 0},
  {&__pyx_kp_u_The_s_playlist_track_and_control, __pyx_k_The_s_playlist_track_and_control, sizeof(__pyx_k_The_s_playlist_track_and_control), 0, 1, 0, 0},
  {&__pyx_kp_u_The_s_standard_track_has_success, __pyx_k_The_s_standard_track_has_success, sizeof(__pyx_k_The_s_standard_track_has_success), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_u_Unable_to_initialize_Audio_Inter, __pyx_k_Unable_to_initialize_Audio_Inter, sizeof(__pyx_k_Unable_to_initialize_Audio_Inter), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_initialize_Audio_Inter_2, __pyx_k_Unable_to_initialize_Audio_Inter_2, sizeof(__pyx_k_Unable_to_initialize_Audio_Inter_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_initialize_GStreamer_c, __pyx_k_Unable_to_initialize_GStreamer_c, sizeof(__pyx_k_Unable_to_initialize_GStreamer_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_initialize_SDL_SDL_Ini, __pyx_k_Unable_to_initialize_SDL_SDL_Ini, sizeof(__pyx_k_Unable_to_initialize_SDL_SDL_Ini), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_initialize_gstreamer_c, __pyx_k_Unable_to_initialize_gstreamer_c, sizeof(__pyx_k_Unable_to_initialize_gstreamer_c), 0, 1, 0, 0},
  {&__pyx_kp_u_Unable_to_open_audio_for_output, __pyx_k_Unable_to_open_audio_for_output, sizeof(__pyx_k_Unable_to_open_audio_for_output), 0, 1, 0, 0},
  {&__pyx_n_s_argc, __pyx_k_argc, sizeof(__pyx_k_argc), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_argv, __pyx_k_argv, sizeof(__pyx_k_argv), 0, 0, 1, 1},
  {&__pyx_n_u_audio_channels, __pyx_k_audio_channels, sizeof(__pyx_k_audio_channels), 0, 1, 0, 1},
  {&__pyx_n_s_audio_interface_instance, __pyx_k_audio_interface_instance, sizeof(__pyx_k_audio_interface_instance), 0, 0, 1, 1},
  {&__pyx_n_s_buffer_samples, __pyx_k_buffer_samples, sizeof(__pyx_k_buffer_samples), 0, 0, 1, 1},
  {&__pyx_n_u_buffer_samples, __pyx_k_buffer_samples, sizeof(__pyx_k_buffer_samples), 0, 1, 0, 1},
  {&__pyx_n_u_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 1, 0, 1},
  {&__pyx_n_u_bytes_per_sample, __pyx_k_bytes_per_sample, sizeof(__pyx_k_bytes_per_sample), 0, 1, 0, 1},
  {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clear_context, __pyx_k_clear_context, sizeof(__pyx_k_clear_context), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_crossfade_time, __pyx_k_crossfade_time, sizeof(__pyx_k_crossfade_time), 0, 0, 1, 1},
  {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1},
  {&__pyx_n_s_db_to_gain, __pyx_k_db_to_gain, sizeof(__pyx_k_db_to_gain), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 0, 1, 1},
  {&__pyx_n_s_enabled, __pyx_k_enabled, sizeof(__pyx_k_enabled), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_u_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 1, 0, 1},
  {&__pyx_n_s_fade_out, __pyx_k_fade_out, sizeof(__pyx_k_fade_out), 0, 0, 1, 1},
  {&__pyx_n_s_fade_out_seconds, __pyx_k_fade_out_seconds, sizeof(__pyx_k_fade_out_seconds), 0, 0, 1, 1},
  {&__pyx_n_u_flac, __pyx_k_flac, sizeof(__pyx_k_flac), 0, 1, 0, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_gain, __pyx_k_gain, sizeof(__pyx_k_gain), 0, 0, 1, 1},
  {&__pyx_n_s_gain_string, __pyx_k_gain_string, sizeof(__pyx_k_gain_string), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
  {&__pyx_n_s_get_glib_version, __pyx_k_get_glib_version, sizeof(__pyx_k_get_glib_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_gst_version, __pyx_k_get_gst_version, sizeof(__pyx_k_get_gst_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_gstreamer_version, __pyx_k_get_gstreamer_version, sizeof(__pyx_k_get_gstreamer_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_max_markers, __pyx_k_get_max_markers, sizeof(__pyx_k_get_max_markers), 0, 0, 1, 1},
  {&__pyx_n_s_get_max_tracks, __pyx_k_get_max_tracks, sizeof(__pyx_k_get_max_tracks), 0, 0, 1, 1},
  {&__pyx_n_s_get_sdl_mixer_version, __pyx_k_get_sdl_mixer_version, sizeof(__pyx_k_get_sdl_mixer_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_sdl_version, __pyx_k_get_sdl_version, sizeof(__pyx_k_get_sdl_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_track_by_name, __pyx_k_get_track_by_name, sizeof(__pyx_k_get_track_by_name), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_gst_init, __pyx_k_gst_init, sizeof(__pyx_k_gst_init), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
  {&__pyx_n_u_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 1, 0, 1},
  {&__pyx_n_s_initialize, __pyx_k_initialize, sizeof(__pyx_k_initialize), 0, 0, 1, 1},
  {&__pyx_n_s_initialize_gstreamer, __pyx_k_initialize_gstreamer, sizeof(__pyx_k_initialize_gstreamer), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_max_layers, __pyx_k_max_layers, sizeof(__pyx_k_max_layers), 0, 0, 1, 1},
  {&__pyx_n_s_max_simultaneous_sounds, __pyx_k_max_simultaneous_sounds, sizeof(__pyx_k_max_simultaneous_sounds), 0, 0, 1, 1},
  {&__pyx_n_s_mc, __pyx_k_mc, sizeof(__pyx_k_mc), 0, 0, 1, 1},
  {&__pyx_n_s_micro, __pyx_k_micro, sizeof(__pyx_k_micro), 0, 0, 1, 1},
  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
  {&__pyx_n_s_mpfmc_core_audio_audio_exception, __pyx_k_mpfmc_core_audio_audio_exception, sizeof(__pyx_k_mpfmc_core_audio_audio_exception), 0, 0, 1, 1},
  {&__pyx_n_s_mpfmc_core_audio_audio_interface, __pyx_k_mpfmc_core_audio_audio_interface, sizeof(__pyx_k_mpfmc_core_audio_audio_interface), 0, 0, 1, 1},
  {&__pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_k_mpfmc_core_audio_audio_interface_2, sizeof(__pyx_k_mpfmc_core_audio_audio_interface_2), 0, 0, 1, 0},
  {&__pyx_n_s_mpfmc_core_audio_playlist_contro, __pyx_k_mpfmc_core_audio_playlist_contro, sizeof(__pyx_k_mpfmc_core_audio_playlist_contro), 0, 0, 1, 1},
  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_nano, __pyx_k_nano, sizeof(__pyx_k_nano), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {&__pyx_n_u_ogg, __pyx_k_ogg, sizeof(__pyx_k_ogg), 0, 1, 0, 1},
  {&__pyx_n_s_pow, __pyx_k_pow, sizeof(__pyx_k_pow), 0, 0, 1, 1},
  {&__pyx_n_s_power_of_two, __pyx_k_power_of_two, sizeof(__pyx_k_power_of_two), 0, 0, 1, 1},
  {&__pyx_n_s_process, __pyx_k_process, sizeof(__pyx_k_process), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rate, __pyx_k_rate, sizeof(__pyx_k_rate), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_u_sample_rate, __pyx_k_sample_rate, sizeof(__pyx_k_sample_rate), 0, 1, 0, 1},
  {&__pyx_n_u_seconds_to_bytes_factor, __pyx_k_seconds_to_bytes_factor, sizeof(__pyx_k_seconds_to_bytes_factor), 0, 1, 0, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shutdown, __pyx_k_shutdown, sizeof(__pyx_k_shutdown), 0, 0, 1, 1},
  {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1},
  {&__pyx_n_s_sound_instance, __pyx_k_sound_instance, sizeof(__pyx_k_sound_instance), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_stop_all_sounds, __pyx_k_stop_all_sounds, sizeof(__pyx_k_stop_all_sounds), 0, 0, 1, 1},
  {&__pyx_n_s_stop_sound, __pyx_k_stop_sound, sizeof(__pyx_k_stop_sound), 0, 0, 1, 1},
  {&__pyx_n_u_stop_sound, __pyx_k_stop_sound, sizeof(__pyx_k_stop_sound), 0, 1, 0, 1},
  {&__pyx_n_s_stop_sound_instance, __pyx_k_stop_sound_instance, sizeof(__pyx_k_stop_sound_instance), 0, 0, 1, 1},
  {&__pyx_n_u_stop_sound_instance, __pyx_k_stop_sound_instance, sizeof(__pyx_k_stop_sound_instance), 0, 1, 0, 1},
  {&__pyx_n_s_stop_sound_instance_looping, __pyx_k_stop_sound_instance_looping, sizeof(__pyx_k_stop_sound_instance_looping), 0, 0, 1, 1},
  {&__pyx_n_u_stop_sound_instance_looping, __pyx_k_stop_sound_instance_looping, sizeof(__pyx_k_stop_sound_instance_looping), 0, 1, 0, 1},
  {&__pyx_n_s_stop_sound_looping, __pyx_k_stop_sound_looping, sizeof(__pyx_k_stop_sound_looping), 0, 0, 1, 1},
  {&__pyx_n_u_stop_sound_looping, __pyx_k_stop_sound_looping, sizeof(__pyx_k_stop_sound_looping), 0, 1, 0, 1},
  {&__pyx_n_s_string_to_gain, __pyx_k_string_to_gain, sizeof(__pyx_k_string_to_gain), 0, 0, 1, 1},
  {&__pyx_n_s_string_to_gain_locals_genexpr, __pyx_k_string_to_gain_locals_genexpr, sizeof(__pyx_k_string_to_gain_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_string_to_secs, __pyx_k_string_to_secs, sizeof(__pyx_k_string_to_secs), 0, 0, 1, 1},
  {&__pyx_n_s_string_to_secs_locals_genexpr, __pyx_k_string_to_secs_locals_genexpr, sizeof(__pyx_k_string_to_secs_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time_string, __pyx_k_time_string, sizeof(__pyx_k_time_string), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_unload, __pyx_k_unload, sizeof(__pyx_k_unload), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1},
  {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
  {&__pyx_n_u_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 1, 0, 1},
  {&__pyx_n_u_wav, __pyx_k_wav, sizeof(__pyx_k_wav), 0, 1, 0, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 214, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 266, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 473, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 677, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 788, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "mpfmc/core/audio/audio_interface.pyx":517
 *         cdef int track_num = len(self.tracks)
 *         if track_num == MAX_TRACKS:
 *             self.log.error("Add track failed - the maximum number of tracks "             # <<<<<<<<<<<<<<
 *                            "(%d) has been reached.", MAX_TRACKS)
 *             return None
 */
  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_kp_u_Add_track_failed_the_maximum_num, __pyx_int_8); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "mpfmc/core/audio/audio_interface.pyx":44
 * #    Global GStreamer helper functions
 * # ---------------------------------------------------------------------------
 * def _gst_init():             # <<<<<<<<<<<<<<
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():
 */
  __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_argc, __pyx_n_s_argv, __pyx_n_s_error, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_gst_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 44, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":56
 *         raise AudioException(msg)
 * 
 * def get_gst_version():             # <<<<<<<<<<<<<<
 *     """Returns the current version of GStreamer"""
 *     cdef unsigned int major, minor, micro, nano
 */
  __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_micro, __pyx_n_s_nano); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_get_gst_version, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 56, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":215
 * 
 *     @staticmethod
 *     def initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes and retrieves the audio interface instance.
 */
  __pyx_tuple__10 = PyTuple_Pack(5, __pyx_n_s_rate, __pyx_n_s_channels, __pyx_n_s_buffer_samples, __pyx_n_s_kwargs, __pyx_n_s_audio_interface_instance); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_initialize, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 215, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":234
 * 
 *     @staticmethod
 *     def power_of_two(int num):             # <<<<<<<<<<<<<<
 *         """ Returns whether or not the supplied number is a power of 2 """
 *         return ((num & (num - 1)) == 0) and num != 0
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_num); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_power_of_two, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 234, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":239
 * 
 *     @staticmethod
 *     def db_to_gain(float db):             # <<<<<<<<<<<<<<
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 *         return pow(10, db / 20.0)
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_db); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_db_to_gain, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 239, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */
  __pyx_tuple__16 = PyTuple_Pack(4, __pyx_n_s_gain, __pyx_n_s_gain_string, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_string_to_gain, 244, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 244, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */
  __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_time, __pyx_n_s_time_string, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_string_to_secs, 269, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 269, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":448
 * 
 *     @staticmethod
 *     def get_max_tracks():             # <<<<<<<<<<<<<<
 *         """ Returns the maximum number of tracks allowed. """
 *         return MAX_TRACKS
 */
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_get_max_tracks, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 448, __pyx_L1_error)

  /* "mpfmc/core/audio/audio_interface.pyx":453
 * 
 *     @staticmethod
 *     def get_max_markers():             # <<<<<<<<<<<<<<
 *         """Return the maximum number of markers allowed per sound"""
 *         return MAX_MARKERS
 */
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfmc_core_audio_audio_interface_2, __pyx_n_s_get_max_markers, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_44100 = PyInt_FromLong(44100L); if (unlikely(!__pyx_int_44100)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_5mpfmc_4core_5audio_15audio_interface_AudioInterface = &__pyx_vtable_5mpfmc_4core_5audio_15audio_interface_AudioInterface;
  __pyx_vtable_5mpfmc_4core_5audio_15audio_interface_AudioInterface.write_gst_log_message = (PyObject *(*)(struct __pyx_obj_5mpfmc_4core_5audio_15audio_interface_AudioInterface *, PyObject *, PyObject *))__pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_write_gst_log_message;
  __pyx_vtable_5mpfmc_4core_5audio_15audio_interface_AudioInterface.audio_callback = (void (*)(void *, Uint8 *, int))__pyx_f_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_audio_callback;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 66, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__.doc = __pyx_doc_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_2__init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface.tp_dict, __pyx_vtabptr_5mpfmc_4core_5audio_15audio_interface_AudioInterface) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AudioInterface, (PyObject *)&__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface = &__pyx_type_5mpfmc_4core_5audio_15audio_interface_AudioInterface;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct__string_to_gain;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_2_string_to_secs;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_3_genexpr;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_4_genexpr;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 296, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_5_genexpr;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_6_genexpr;
  if (PyType_Ready(&__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr.tp_dictoffset && __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr = &__pyx_type_5mpfmc_4core_5audio_15audio_interface___pyx_scope_struct_7_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule("mpfmc.core.audio.track"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5mpfmc_4core_5audio_5track_Track = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.track", "Track", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_5track_Track), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_5track_Track) __PYX_ERR(2, 51, __pyx_L1_error)
  __pyx_vtabptr_5mpfmc_4core_5audio_5track_Track = (struct __pyx_vtabstruct_5mpfmc_4core_5audio_5track_Track*)__Pyx_GetVtable(__pyx_ptype_5mpfmc_4core_5audio_5track_Track->tp_dict); if (unlikely(!__pyx_vtabptr_5mpfmc_4core_5audio_5track_Track)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("mpfmc.core.audio.sound_file"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundFile = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.sound_file", "SoundFile", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundFile), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundFile) __PYX_ERR(3, 34, __pyx_L1_error)
  __pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.sound_file", "SoundMemoryFile", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundMemoryFile) __PYX_ERR(3, 42, __pyx_L1_error)
  __pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.sound_file", "SoundStreamingFile", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_10sound_file_SoundStreamingFile) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("mpfmc.core.audio.track_standard"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.track_standard", "TrackStandard", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_14track_standard_TrackStandard), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard) __PYX_ERR(4, 91, __pyx_L1_error)
  __pyx_vtabptr_5mpfmc_4core_5audio_14track_standard_TrackStandard = (struct __pyx_vtabstruct_5mpfmc_4core_5audio_14track_standard_TrackStandard*)__Pyx_GetVtable(__pyx_ptype_5mpfmc_4core_5audio_14track_standard_TrackStandard->tp_dict); if (unlikely(!__pyx_vtabptr_5mpfmc_4core_5audio_14track_standard_TrackStandard)) __PYX_ERR(4, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("mpfmc.core.audio.track_sound_loop"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop = __Pyx_ImportType(__pyx_t_1, "mpfmc.core.audio.track_sound_loop", "TrackSoundLoop", sizeof(struct __pyx_obj_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop) __PYX_ERR(5, 61, __pyx_L1_error)
  __pyx_vtabptr_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop = (struct __pyx_vtabstruct_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop*)__Pyx_GetVtable(__pyx_ptype_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop->tp_dict); if (unlikely(!__pyx_vtabptr_5mpfmc_4core_5audio_16track_sound_loop_TrackSoundLoop)) __PYX_ERR(5, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initaudio_interface(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initaudio_interface(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_audio_interface(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_audio_interface(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_audio_interface(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'audio_interface' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #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("__Pyx_PyMODINIT_FUNC PyInit_audio_interface(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("audio_interface", __pyx_methods, __pyx_k_Audio_Library_This_library_requ, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_mpfmc__core__audio__audio_interface) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "mpfmc.core.audio.audio_interface")) {
      if (unlikely(PyDict_SetItemString(modules, "mpfmc.core.audio.audio_interface", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "mpfmc/core/audio/audio_interface.pyx":15
 * cimport cpython.pycapsule as pycapsule
 * 
 * from math import pow             # <<<<<<<<<<<<<<
 * import logging
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_pow);
  __Pyx_GIVEREF(__pyx_n_s_pow);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_pow);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_pow); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pow, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":16
 * 
 * from math import pow
 * import logging             # <<<<<<<<<<<<<<
 * 
 * from mpfmc.core.audio.sdl2 cimport *
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":24
 * from mpfmc.core.audio.track_sound_loop cimport *
 * from mpfmc.core.audio.sound_file cimport *
 * from mpfmc.core.audio.audio_exception import AudioException             # <<<<<<<<<<<<<<
 * from mpfmc.core.audio.playlist_controller import PlaylistController
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_AudioException);
  __Pyx_GIVEREF(__pyx_n_s_AudioException);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AudioException);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mpfmc_core_audio_audio_exception, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_AudioException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AudioException, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":25
 * from mpfmc.core.audio.sound_file cimport *
 * from mpfmc.core.audio.audio_exception import AudioException
 * from mpfmc.core.audio.playlist_controller import PlaylistController             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_PlaylistController);
  __Pyx_GIVEREF(__pyx_n_s_PlaylistController);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PlaylistController);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpfmc_core_audio_playlist_contro, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PlaylistController); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PlaylistController, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":44
 * #    Global GStreamer helper functions
 * # ---------------------------------------------------------------------------
 * def _gst_init():             # <<<<<<<<<<<<<<
 *     """Initializes the GStreamer library"""
 *     if gst_is_initialized():
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_1_gst_init, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gst_init, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":56
 *         raise AudioException(msg)
 * 
 * def get_gst_version():             # <<<<<<<<<<<<<<
 *     """Returns the current version of GStreamer"""
 *     cdef unsigned int major, minor, micro, nano
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_3get_gst_version, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_gst_version, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "mpfmc/core/audio/audio_interface.pyx":215
 * 
 *     @staticmethod
 *     def initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Initializes and retrieves the audio interface instance.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_9initialize, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_initialize, __pyx_t_2) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":214
 *             raise AudioException(msg)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def initialize(int rate=44100, int channels=2, int buffer_samples=4096, **kwargs):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_initialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_initialize, __pyx_t_1) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":234
 * 
 *     @staticmethod
 *     def power_of_two(int num):             # <<<<<<<<<<<<<<
 *         """ Returns whether or not the supplied number is a power of 2 """
 *         return ((num & (num - 1)) == 0) and num != 0
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_11power_of_two, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_power_of_two, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":233
 *         return audio_interface_instance
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def power_of_two(int num):
 *         """ Returns whether or not the supplied number is a power of 2 """
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_power_of_two); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_power_of_two, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":239
 * 
 *     @staticmethod
 *     def db_to_gain(float db):             # <<<<<<<<<<<<<<
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 *         return pow(10, db / 20.0)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_13db_to_gain, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_db_to_gain, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":238
 *         return ((num & (num - 1)) == 0) and num != 0
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def db_to_gain(float db):
 *         """Converts a value in decibels (-inf to 0.0) to a gain (0.0 to 1.0)"""
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_db_to_gain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_db_to_gain, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":244
 * 
 *     @staticmethod
 *     def string_to_gain(gain):             # <<<<<<<<<<<<<<
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 *         cdef str gain_string = str(gain).upper()
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_15string_to_gain, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_string_to_gain, __pyx_t_1) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":243
 *         return pow(10, db / 20.0)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def string_to_gain(gain):
 *         """Converts a string to a gain value (0.0 to 1.0)"""
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_string_to_gain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_string_to_gain, __pyx_t_2) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":269
 * 
 *     @staticmethod
 *     def string_to_secs(time):             # <<<<<<<<<<<<<<
 *         """Decodes a string of real-world time into a float of seconds.
 *         Example inputs:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_23string_to_secs, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_string_to_secs, __pyx_t_2) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":268
 *         return round(buffer_length / (self.audio_callback_data.sample_rate * self.audio_callback_data.channels * self.audio_callback_data.bytes_per_sample), 3)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def string_to_secs(time):
 *         """Decodes a string of real-world time into a float of seconds.
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_string_to_secs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_string_to_secs, __pyx_t_1) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":340
 * 
 *     @classmethod
 *     def get_sdl_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the SDL library
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_sdl_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mpfmc/core/audio/audio_interface.pyx":339
 *         return int(self.audio_callback_data.sample_rate * seconds)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_sdl_version(cls):
 *         """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_sdl_version, __pyx_t_2) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":350
 * 
 *     @classmethod
 *     def get_sdl_mixer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the dynamically linked SDL_Mixer library
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_sdl_mixer_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mpfmc/core/audio/audio_interface.pyx":349
 *         return 'SDL {}.{}.{}'.format(version.major, version.minor, version.patch)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_sdl_mixer_version(cls):
 *         """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_sdl_mixer_version, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":359
 * 
 *     @classmethod
 *     def get_gstreamer_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GStreamer library
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_gstreamer_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "mpfmc/core/audio/audio_interface.pyx":358
 *         return 'SDL_Mixer {}.{}.{}'.format(version.major, version.minor, version.patch)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_gstreamer_version(cls):
 *         """
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_gstreamer_version, __pyx_t_2) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":369
 * 
 *     @classmethod
 *     def get_glib_version(cls):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the version of the GLib library
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_glib_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "mpfmc/core/audio/audio_interface.pyx":368
 *             gst_version[0], gst_version[1], gst_version[2], gst_version[3])
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_glib_version(cls):
 *         """
 */
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_glib_version, __pyx_t_1) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":448
 * 
 *     @staticmethod
 *     def get_max_tracks():             # <<<<<<<<<<<<<<
 *         """ Returns the maximum number of tracks allowed. """
 *         return MAX_TRACKS
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_49get_max_tracks, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_max_tracks, __pyx_t_1) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":447
 *         Mix_CloseAudio()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get_max_tracks():
 *         """ Returns the maximum number of tracks allowed. """
 */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_max_tracks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_max_tracks, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":453
 * 
 *     @staticmethod
 *     def get_max_markers():             # <<<<<<<<<<<<<<
 *         """Return the maximum number of markers allowed per sound"""
 *         return MAX_MARKERS
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5mpfmc_4core_5audio_15audio_interface_14AudioInterface_51get_max_markers, NULL, __pyx_n_s_mpfmc_core_audio_audio_interface); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_max_markers, __pyx_t_2) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":452
 *         return MAX_TRACKS
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def get_max_markers():
 *         """Return the maximum number of markers allowed per sound"""
 */
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface, __pyx_n_s_get_max_markers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface->tp_dict, __pyx_n_s_get_max_markers, __pyx_t_1) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5mpfmc_4core_5audio_15audio_interface_AudioInterface);

  /* "mpfmc/core/audio/audio_interface.pyx":502
 * 
 *     def create_standard_track(self, object mc, str name not None,
 *                               int max_simultaneous_sounds=MAX_SIMULTANEOUS_SOUNDS_DEFAULT,             # <<<<<<<<<<<<<<
 *                               float volume=1.0):
 *         """
 */
  __pyx_k__2 = __pyx_e_5mpfmc_4core_5audio_5track_MAX_SIMULTANEOUS_SOUNDS_DEFAULT;

  /* "mpfmc/core/audio/audio_interface.pyx":1
 * #!python             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True, language_level=3
 * """
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "mpfmc/core/audio/track_standard.pxd":128
 *                                       Uint8 volume, TrackState *track, int player_num) nogil
 * 
 * cdef inline void end_of_sound_processing(SoundPlayer* player,             # <<<<<<<<<<<<<<
 *                                          TrackState *track) nogil:
 *     """
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init mpfmc.core.audio.audio_interface", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init mpfmc.core.audio.audio_interface");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    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 (PyType_Check(type)) {
#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;
        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;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
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 *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            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 = PyObject_Call(type, args, NULL);
            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) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else 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) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_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_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,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* RaiseDoubleKeywords */
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
}

/* ParseKeywords */
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_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
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(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
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(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,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* RaiseArgTupleInvalid */
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,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* None */
static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
    int q = a / b;
    int r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_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
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
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);
}

/* UnpackItemEndCheck */
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;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* MergeKeywords */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* unicode_iter */
static CYTHON_INLINE int __Pyx_init_unicode_iteration(
    PyObject* ustring, Py_ssize_t *length, void** data, int *kind) {
#if CYTHON_PEP393_ENABLED
    if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1;
    *kind   = PyUnicode_KIND(ustring);
    *length = PyUnicode_GET_LENGTH(ustring);
    *data   = PyUnicode_DATA(ustring);
#else
    *kind   = 0;
    *length = PyUnicode_GET_SIZE(ustring);
    *data   = (void*)PyUnicode_AS_UNICODE(ustring);
#endif
    return 0;
}

/* unicode_tailmatch */
static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
                                          Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
    for (i = 0; i < count; i++) {
        Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
                                     start, end, direction);
#else
        PyObject* sub = PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = PyUnicode_Tailmatch(s, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return (int) result;
        }
    }
    return 0;
}
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
                                     Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
    }
    return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}

/* pyobject_as_double */
static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if ((0)) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* PyIntFromDouble */
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
    if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
        return PyInt_FromLong((long)value);
    }
    return PyLong_FromDouble(value);
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    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;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    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;
    #endif
    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;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* GetVTable */
static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    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;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    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_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* GetNameInClass */
static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    PyObject *result;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
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 - start) / 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, ((size_t)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);
}

/* AddTraceback */
#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,
        0,
        0,
        0,
        0,
        __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,
        __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;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    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_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint16(Uint16 value) {
    const Uint16 neg_one = (Uint16) ((Uint16) 0 - (Uint16) 1), const_zero = (Uint16) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Uint16) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Uint16) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint16) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Uint16) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint16) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Uint16),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint32(Uint32 value) {
    const Uint32 neg_one = (Uint32) ((Uint32) 0 - (Uint32) 1), const_zero = (Uint32) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Uint32) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Uint32) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint32) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Uint32) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint32) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Uint32),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Uint8(Uint8 value) {
    const Uint8 neg_one = (Uint8) ((Uint8) 0 - (Uint8) 1), const_zero = (Uint8) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Uint8) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Uint8) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint8) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Uint8) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Uint8) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Uint8),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE Uint16 __Pyx_PyInt_As_Uint16(PyObject *x) {
    const Uint16 neg_one = (Uint16) ((Uint16) 0 - (Uint16) 1), const_zero = (Uint16) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Uint16) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Uint16, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Uint16) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Uint16) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Uint16, digit, digits[0])
                case 2:
                    if (8 * sizeof(Uint16) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) >= 2 * PyLong_SHIFT) {
                            return (Uint16) (((((Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Uint16) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) >= 3 * PyLong_SHIFT) {
                            return (Uint16) (((((((Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Uint16) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) >= 4 * PyLong_SHIFT) {
                            return (Uint16) (((((((((Uint16)digits[3]) << PyLong_SHIFT) | (Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (Uint16) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(Uint16) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint16, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Uint16) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint16, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Uint16) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Uint16, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Uint16,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(Uint16) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 2 * PyLong_SHIFT) {
                            return (Uint16) (((Uint16)-1)*(((((Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(Uint16) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 2 * PyLong_SHIFT) {
                            return (Uint16) ((((((Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(Uint16) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 3 * PyLong_SHIFT) {
                            return (Uint16) (((Uint16)-1)*(((((((Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Uint16) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 3 * PyLong_SHIFT) {
                            return (Uint16) ((((((((Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(Uint16) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 4 * PyLong_SHIFT) {
                            return (Uint16) (((Uint16)-1)*(((((((((Uint16)digits[3]) << PyLong_SHIFT) | (Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Uint16) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint16, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint16) - 1 > 4 * PyLong_SHIFT) {
                            return (Uint16) ((((((((((Uint16)digits[3]) << PyLong_SHIFT) | (Uint16)digits[2]) << PyLong_SHIFT) | (Uint16)digits[1]) << PyLong_SHIFT) | (Uint16)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(Uint16) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint16, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Uint16) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint16, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Uint16 val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Uint16) -1;
        }
    } else {
        Uint16 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Uint16) -1;
        val = __Pyx_PyInt_As_Uint16(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Uint16");
    return (Uint16) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Uint16");
    return (Uint16) -1;
}

/* CIntFromPy */
static CYTHON_INLINE Uint8 __Pyx_PyInt_As_Uint8(PyObject *x) {
    const Uint8 neg_one = (Uint8) ((Uint8) 0 - (Uint8) 1), const_zero = (Uint8) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Uint8) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Uint8, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Uint8) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Uint8) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Uint8, digit, digits[0])
                case 2:
                    if (8 * sizeof(Uint8) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) >= 2 * PyLong_SHIFT) {
                            return (Uint8) (((((Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Uint8) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) >= 3 * PyLong_SHIFT) {
                            return (Uint8) (((((((Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Uint8) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) >= 4 * PyLong_SHIFT) {
                            return (Uint8) (((((((((Uint8)digits[3]) << PyLong_SHIFT) | (Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (Uint8) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(Uint8) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint8, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Uint8) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Uint8) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Uint8, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Uint8,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(Uint8) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 2 * PyLong_SHIFT) {
                            return (Uint8) (((Uint8)-1)*(((((Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(Uint8) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 2 * PyLong_SHIFT) {
                            return (Uint8) ((((((Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(Uint8) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 3 * PyLong_SHIFT) {
                            return (Uint8) (((Uint8)-1)*(((((((Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Uint8) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 3 * PyLong_SHIFT) {
                            return (Uint8) ((((((((Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(Uint8) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 4 * PyLong_SHIFT) {
                            return (Uint8) (((Uint8)-1)*(((((((((Uint8)digits[3]) << PyLong_SHIFT) | (Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Uint8) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Uint8) - 1 > 4 * PyLong_SHIFT) {
                            return (Uint8) ((((((((((Uint8)digits[3]) << PyLong_SHIFT) | (Uint8)digits[2]) << PyLong_SHIFT) | (Uint8)digits[1]) << PyLong_SHIFT) | (Uint8)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(Uint8) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint8, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(Uint8) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Uint8 val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Uint8) -1;
        }
    } else {
        Uint8 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Uint8) -1;
        val = __Pyx_PyInt_As_Uint8(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Uint8");
    return (Uint8) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Uint8");
    return (Uint8) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    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;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
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);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
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
        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;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  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;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
