/* Generated by Pyrex 0.9.3 on Wed Jan 11 02:30:57 2006 */

#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#include "pss.h"


typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_ReRaise(void); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetExcValue(void); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static void __Pyx_WriteUnraisable(char *name); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
staticforward char **__pyx_f;

/* Declarations from pysdlsound */

static PyObject *__pyx_k1;
static PyObject *__pyx_k2;
static PyObject *__pyx_k3;
static PyObject *__pyx_k4;
static PyObject *__pyx_k5;
static PyObject *__pyx_k6;

/* Implementation of pysdlsound */

static PyObject *__pyx_n__extension;
static PyObject *__pyx_n_check_error;
static PyObject *__pyx_n_play;
static PyObject *__pyx_n_queue;
static PyObject *__pyx_n_stop;
static PyObject *__pyx_n_dequeue;
static PyObject *__pyx_n_queue_depth;
static PyObject *__pyx_n_playing_name;
static PyObject *__pyx_n_pause;
static PyObject *__pyx_n_unpause;
static PyObject *__pyx_n_unpause_all;
static PyObject *__pyx_n_fadeout;
static PyObject *__pyx_n_busy;
static PyObject *__pyx_n_get_pos;
static PyObject *__pyx_n_set_volume;
static PyObject *__pyx_n_set_end_event;
static PyObject *__pyx_n_get_volume;
static PyObject *__pyx_n_init;
static PyObject *__pyx_n_quit;
static PyObject *__pyx_n_check_version;
static PyObject *__pyx_n_False;

static PyObject *__pyx_n_rfind;

static PyObject *__pyx_k7p;

static char (__pyx_k7[]) = ".";

static PyObject *__pyx_f_10pysdlsound__extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound__extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_v_i;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  int __pyx_4;
  static char *__pyx_argnames[] = {"s",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_s)) return 0;
  Py_INCREF(__pyx_v_s);
  __pyx_v_i = Py_None; Py_INCREF(__pyx_v_i);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":47 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_s, __pyx_n_rfind); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;}
  Py_INCREF(__pyx_k7p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_i);
  __pyx_v_i = __pyx_3;
  __pyx_3 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":48 */
  __pyx_1 = PyInt_FromLong((-1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_i, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; goto __pyx_L1;}
  __pyx_4 = __pyx_4 == 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_4) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":49 */
    Py_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":50 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
  __pyx_3 = PyNumber_Add(__pyx_v_i, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PySequence_GetSlice(__pyx_v_s, __pyx_4, 0x7fffffff); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("pysdlsound._extension");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_i);
  Py_DECREF(__pyx_v_s);
  return __pyx_r;
}

static PyObject *__pyx_n_Exception;

static PyObject *__pyx_f_10pysdlsound_check_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_check_error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_e;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_2;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
  __pyx_v_e = Py_None; Py_INCREF(__pyx_v_e);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":53 */
  __pyx_1 = PyString_FromString(PSS_get_error()); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
  Py_DECREF(__pyx_v_e);
  __pyx_v_e = __pyx_1;
  __pyx_1 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":54 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_e); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":55 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
    __Pyx_Raise(__pyx_1, __pyx_v_e, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("pysdlsound.check_error");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_e);
  return __pyx_r;
}

static PyObject *__pyx_k8p;

static char (__pyx_k8[]) = "Could not create RWops.";

static PyObject *__pyx_f_10pysdlsound_play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_play(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_paused = 0;
  PyObject *__pyx_v_fadein = 0;
  PyObject *__pyx_v_tight = 0;
  struct SDL_RWops (*__pyx_v_rw);
  PyObject *__pyx_v_pause;
  PyObject *__pyx_v_ext;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  char (*__pyx_5);
  int __pyx_6;
  int __pyx_7;
  int __pyx_8;
  static char *__pyx_argnames[] = {"channel","file","name","paused","fadein","tight",0};
  __pyx_v_paused = __pyx_k1;
  __pyx_v_fadein = __pyx_k2;
  __pyx_v_tight = __pyx_k3;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|OOO", __pyx_argnames, &__pyx_v_channel, &__pyx_v_file, &__pyx_v_name, &__pyx_v_paused, &__pyx_v_fadein, &__pyx_v_tight)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_file);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_paused);
  Py_INCREF(__pyx_v_fadein);
  Py_INCREF(__pyx_v_tight);
  __pyx_v_pause = Py_None; Py_INCREF(__pyx_v_pause);
  __pyx_v_ext = Py_None; Py_INCREF(__pyx_v_ext);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":60 */
  __pyx_v_rw = RWopsFromPythonThreaded(__pyx_v_file);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":62 */
  __pyx_1 = (__pyx_v_rw == 0);
  if (__pyx_1) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":63 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k8p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":65 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_paused); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":66 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
    Py_DECREF(__pyx_v_pause);
    __pyx_v_pause = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":68 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;}
    Py_DECREF(__pyx_v_pause);
    __pyx_v_pause = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L3:;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":70 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_tight); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":71 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;}
    Py_DECREF(__pyx_v_tight);
    __pyx_v_tight = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":73 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
    Py_DECREF(__pyx_v_tight);
    __pyx_v_tight = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L4:;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":75 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__extension); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_name);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_ext);
  __pyx_v_ext = __pyx_4;
  __pyx_4 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":77 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
  __pyx_5 = PyString_AsString(__pyx_v_ext); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
  __pyx_6 = PyInt_AsLong(__pyx_v_fadein); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
  __pyx_7 = PyInt_AsLong(__pyx_v_tight); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
  __pyx_8 = PyInt_AsLong(__pyx_v_pause); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
  PSS_play(__pyx_1,__pyx_v_rw,__pyx_5,__pyx_v_name,__pyx_6,__pyx_7,__pyx_8);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":78 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.play");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_pause);
  Py_DECREF(__pyx_v_ext);
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_file);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_paused);
  Py_DECREF(__pyx_v_fadein);
  Py_DECREF(__pyx_v_tight);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_queue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_queue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_fadein = 0;
  PyObject *__pyx_v_tight = 0;
  struct SDL_RWops (*__pyx_v_rw);
  PyObject *__pyx_v_ext;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  char (*__pyx_5);
  int __pyx_6;
  int __pyx_7;
  static char *__pyx_argnames[] = {"channel","file","name","fadein","tight",0};
  __pyx_v_fadein = __pyx_k4;
  __pyx_v_tight = __pyx_k5;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|OO", __pyx_argnames, &__pyx_v_channel, &__pyx_v_file, &__pyx_v_name, &__pyx_v_fadein, &__pyx_v_tight)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_file);
  Py_INCREF(__pyx_v_name);
  Py_INCREF(__pyx_v_fadein);
  Py_INCREF(__pyx_v_tight);
  __pyx_v_ext = Py_None; Py_INCREF(__pyx_v_ext);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":83 */
  __pyx_v_rw = RWopsFromPythonThreaded(__pyx_v_file);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":85 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_tight); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":86 */
    __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
    Py_DECREF(__pyx_v_tight);
    __pyx_v_tight = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":88 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
    Py_DECREF(__pyx_v_tight);
    __pyx_v_tight = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L2:;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":90 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__extension); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_INCREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_name);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_ext);
  __pyx_v_ext = __pyx_4;
  __pyx_4 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":92 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_5 = PyString_AsString(__pyx_v_ext); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_6 = PyInt_AsLong(__pyx_v_fadein); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
  __pyx_7 = PyInt_AsLong(__pyx_v_tight); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
  PSS_queue(__pyx_1,__pyx_v_rw,__pyx_5,__pyx_v_name,__pyx_6,__pyx_7);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":93 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.queue");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_ext);
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_file);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_fadein);
  Py_DECREF(__pyx_v_tight);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_stop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_stop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":96 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
  PSS_stop(__pyx_1);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":97 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.stop");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_dequeue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_dequeue(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_even_tight = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  int __pyx_2;
  static char *__pyx_argnames[] = {"channel","even_tight",0};
  __pyx_v_even_tight = __pyx_k6;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_channel, &__pyx_v_even_tight)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_even_tight);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":100 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_even_tight); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
  PSS_dequeue(__pyx_1,__pyx_2);

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pysdlsound.dequeue");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_even_tight);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_queue_depth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_queue_depth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":103 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(PSS_queue_depth(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("pysdlsound.queue_depth");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_playing_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_playing_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":106 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
  __pyx_2 = PSS_playing_name(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("pysdlsound.playing_name");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_pause(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_pause(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":109 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
  PSS_pause(__pyx_1,1);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":110 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.pause");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_unpause(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_unpause(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":113 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;}
  PSS_pause(__pyx_1,0);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":114 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.unpause");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_unpause_all(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_unpause_all(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":117 */
  PSS_unpause_all();

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pysdlsound.unpause_all");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_fadeout(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_fadeout(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_ms = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"channel","ms",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_channel, &__pyx_v_ms)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_ms);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":120 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_ms); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
  PSS_fadeout(__pyx_1,__pyx_2);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":121 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("pysdlsound.fadeout");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_ms);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_busy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_busy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":124 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong((PSS_get_pos(__pyx_1) != (-1))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("pysdlsound.busy");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_get_pos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_get_pos(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":127 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(PSS_get_pos(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("pysdlsound.get_pos");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_set_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_set_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_volume = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  float __pyx_5;
  static char *__pyx_argnames[] = {"channel","volume",0};
  extern double pow(double, double);
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_channel, &__pyx_v_volume)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_volume);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":130 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(10); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_3 = PyNumber_Power(__pyx_2, __pyx_v_volume, Py_None); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyInt_FromLong(10); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  __pyx_4 = PyNumber_Divide(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyFloat_AsDouble(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  PSS_set_volume(__pyx_1,__pyx_5);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":131 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.set_volume");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_volume);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_set_end_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_set_end_event(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  int __pyx_2;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  static char *__pyx_argnames[] = {"channel","event",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_channel, &__pyx_v_event)) return 0;
  Py_INCREF(__pyx_v_channel);
  Py_INCREF(__pyx_v_event);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":134 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_event); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  PSS_set_endevent(__pyx_1,__pyx_2);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":135 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("pysdlsound.set_end_event");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  Py_DECREF(__pyx_v_event);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_get_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_get_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_channel = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  static char *__pyx_argnames[] = {"channel",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_channel)) return 0;
  Py_INCREF(__pyx_v_channel);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":138 */
  __pyx_1 = PyInt_AsLong(__pyx_v_channel); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
  __pyx_2 = PyFloat_FromDouble(PSS_get_volume(__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("pysdlsound.get_volume");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_channel);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_init(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_freq = 0;
  PyObject *__pyx_v_stereo = 0;
  PyObject *__pyx_v_samples = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  int __pyx_2;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  static char *__pyx_argnames[] = {"freq","stereo","samples",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_freq, &__pyx_v_stereo, &__pyx_v_samples)) return 0;
  Py_INCREF(__pyx_v_freq);
  Py_INCREF(__pyx_v_stereo);
  Py_INCREF(__pyx_v_samples);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":141 */
  __pyx_1 = PyInt_AsLong(__pyx_v_freq); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
  __pyx_2 = PyInt_AsLong(__pyx_v_stereo); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
  __pyx_3 = PyInt_AsLong(__pyx_v_samples); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
  PSS_init(__pyx_1,__pyx_2,__pyx_3);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":142 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_check_error); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
  __pyx_5 = PyTuple_New(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
  __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("pysdlsound.init");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_freq);
  Py_DECREF(__pyx_v_stereo);
  Py_DECREF(__pyx_v_samples);
  return __pyx_r;
}

static PyObject *__pyx_f_10pysdlsound_quit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_quit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_r;
  static char *__pyx_argnames[] = {0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":145 */
  PSS_quit();

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  __Pyx_AddTraceback("pysdlsound.quit");
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

static PyObject *__pyx_k9p;

static char (__pyx_k9[]) = "pysdlsound version mismatch.";

static PyObject *__pyx_f_10pysdlsound_check_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10pysdlsound_check_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_version = 0;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"version",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_version)) return 0;
  Py_INCREF(__pyx_v_version);

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":148 */
  __pyx_2 = PyInt_FromLong(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_version, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_1 = __pyx_1 < 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!__pyx_1) {
    __pyx_2 = PyInt_FromLong(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_v_version, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
    __pyx_1 = __pyx_1 > 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  if (__pyx_1) {

    /* "/home/tom/ab/renpy/module/pysdlsound.pyx":149 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    Py_INCREF(__pyx_k9p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k9p);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __Pyx_Raise(__pyx_4, 0, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  __pyx_r = Py_None; Py_INCREF(__pyx_r);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("pysdlsound.check_version");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_version);
  return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
  {&__pyx_n_Exception, "Exception"},
  {&__pyx_n_False, "False"},
  {&__pyx_n__extension, "_extension"},
  {&__pyx_n_busy, "busy"},
  {&__pyx_n_check_error, "check_error"},
  {&__pyx_n_check_version, "check_version"},
  {&__pyx_n_dequeue, "dequeue"},
  {&__pyx_n_fadeout, "fadeout"},
  {&__pyx_n_get_pos, "get_pos"},
  {&__pyx_n_get_volume, "get_volume"},
  {&__pyx_n_init, "init"},
  {&__pyx_n_pause, "pause"},
  {&__pyx_n_play, "play"},
  {&__pyx_n_playing_name, "playing_name"},
  {&__pyx_n_queue, "queue"},
  {&__pyx_n_queue_depth, "queue_depth"},
  {&__pyx_n_quit, "quit"},
  {&__pyx_n_rfind, "rfind"},
  {&__pyx_n_set_end_event, "set_end_event"},
  {&__pyx_n_set_volume, "set_volume"},
  {&__pyx_n_stop, "stop"},
  {&__pyx_n_unpause, "unpause"},
  {&__pyx_n_unpause_all, "unpause_all"},
  {0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
  {&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
  {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)},
  {0, 0, 0}
};

static struct PyMethodDef __pyx_methods[] = {
  {"_extension", (PyCFunction)__pyx_f_10pysdlsound__extension, METH_VARARGS|METH_KEYWORDS, 0},
  {"check_error", (PyCFunction)__pyx_f_10pysdlsound_check_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"play", (PyCFunction)__pyx_f_10pysdlsound_play, METH_VARARGS|METH_KEYWORDS, 0},
  {"queue", (PyCFunction)__pyx_f_10pysdlsound_queue, METH_VARARGS|METH_KEYWORDS, 0},
  {"stop", (PyCFunction)__pyx_f_10pysdlsound_stop, METH_VARARGS|METH_KEYWORDS, 0},
  {"dequeue", (PyCFunction)__pyx_f_10pysdlsound_dequeue, METH_VARARGS|METH_KEYWORDS, 0},
  {"queue_depth", (PyCFunction)__pyx_f_10pysdlsound_queue_depth, METH_VARARGS|METH_KEYWORDS, 0},
  {"playing_name", (PyCFunction)__pyx_f_10pysdlsound_playing_name, METH_VARARGS|METH_KEYWORDS, 0},
  {"pause", (PyCFunction)__pyx_f_10pysdlsound_pause, METH_VARARGS|METH_KEYWORDS, 0},
  {"unpause", (PyCFunction)__pyx_f_10pysdlsound_unpause, METH_VARARGS|METH_KEYWORDS, 0},
  {"unpause_all", (PyCFunction)__pyx_f_10pysdlsound_unpause_all, METH_VARARGS|METH_KEYWORDS, 0},
  {"fadeout", (PyCFunction)__pyx_f_10pysdlsound_fadeout, METH_VARARGS|METH_KEYWORDS, 0},
  {"busy", (PyCFunction)__pyx_f_10pysdlsound_busy, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_pos", (PyCFunction)__pyx_f_10pysdlsound_get_pos, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_volume", (PyCFunction)__pyx_f_10pysdlsound_set_volume, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_end_event", (PyCFunction)__pyx_f_10pysdlsound_set_end_event, METH_VARARGS|METH_KEYWORDS, 0},
  {"get_volume", (PyCFunction)__pyx_f_10pysdlsound_get_volume, METH_VARARGS|METH_KEYWORDS, 0},
  {"init", (PyCFunction)__pyx_f_10pysdlsound_init, METH_VARARGS|METH_KEYWORDS, 0},
  {"quit", (PyCFunction)__pyx_f_10pysdlsound_quit, METH_VARARGS|METH_KEYWORDS, 0},
  {"check_version", (PyCFunction)__pyx_f_10pysdlsound_check_version, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

DL_EXPORT(void) initpysdlsound(void); /*proto*/
DL_EXPORT(void) initpysdlsound(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  __pyx_m = Py_InitModule4("pysdlsound", __pyx_methods, 0, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;};

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":57 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
  __pyx_k1 = __pyx_1;
  __pyx_1 = 0;
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
  __pyx_k2 = __pyx_2;
  __pyx_2 = 0;
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
  __pyx_k3 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":80 */
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_k4 = __pyx_4;
  __pyx_4 = 0;
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_k5 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":99 */
  __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;}
  __pyx_k6 = __pyx_6;
  __pyx_6 = 0;

  /* "/home/tom/ab/renpy/module/pysdlsound.pyx":147 */
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("pysdlsound");
}

static char *__pyx_filenames[] = {
  "pysdlsound.pyx",
};
statichere char **__pyx_f = __pyx_filenames;

/* Runtime support code */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    /* Next, repeatedly, replace a tuple exception with its first item */
    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
        PyObject *tmp = type;
        type = PyTuple_GET_ITEM(type, 0);
        Py_INCREF(type);
        Py_DECREF(tmp);
    }
    if (PyString_Check(type))
        ;
    else if (PyClass_Check(type))
        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
    else if (PyInstance_Check(type)) {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
              "instance exception may not have a separate value");
            goto raise_error;
        }
        else {
            /* Normalize to raise <class>, <instance> */
            Py_DECREF(value);
            value = type;
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
            Py_INCREF(type);
        }
    }
    else {
        /* Not something you can raise.  You get an exception
           anyway, just not what you specified :-) */
        PyErr_Format(PyExc_TypeError,
                 "exceptions must be strings, classes, or "
                 "instances, not %s", type->ob_type->tp_name);
        goto raise_error;
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyObject *empty_tuple = 0;
    PyObject *empty_string = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    
    py_srcfile = PyString_FromString(__pyx_filename);
    if (!py_srcfile) goto bad;
    py_funcname = PyString_FromString(funcname);
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    empty_tuple = PyTuple_New(0);
    if (!empty_tuple) goto bad;
    empty_string = PyString_FromString("");
    if (!empty_string) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        empty_tuple,  /*PyObject *consts,*/
        empty_tuple,  /*PyObject *names,*/
        empty_tuple,  /*PyObject *varnames,*/
        empty_tuple,  /*PyObject *freevars,*/
        empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(empty_tuple);
    Py_XDECREF(empty_string);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
