/* DO NOT EDIT THIS FILE. */
/* This file was generated by xctocc from "wxs_mio.xc". */


#if defined(_MSC_VER)
# include "wx.h"
#endif

#include "wx_obj.h"
#include "wx_medio.h"




#ifdef wx_x
# define BM_SELECTED(map) ((map)->selectedTo)
#endif
#if defined(wx_mac) || defined(wx_msw)
# define BM_SELECTED(map) ((map)->selectedInto)
#endif
# define BM_IN_USE(map) ((map)->selectedIntoDC)





#include "wxscheme.h"
#include "wxs_mio.h"

#ifdef MZ_PRECISE_GC
START_XFORM_SKIP;
#endif


#undef l_ADDRESS
#undef l_DEREF
#undef l_TEST
#undef l_POINT
#undef l_TYPE
#undef l_LIST_ITEM_BUNDLE
#undef l_LIST_ITEM_UNBUNDLE
#undef l_MAKE_LIST
#undef l_MAKE_ARRAY
#undef l_EXTRA
#undef l_TERMINATE
#undef l_COPY
#undef l_OKTEST
#undef l_INTTYPE

#define l_ADDRESS 
#define l_DEREF 
#define l_NEWATOMIC 
#define l_NULLOK 0
#define l_TEST 
#define l_POINT 
#define l_EXTRA 0
#define l_TERMINATE 
#define l_COPY l_COPYDEST=l_COPYSRC;
#define l_OKTEST 
#define l_INTTYPE long
#define l_DIRECTMALLOC 0

#define l_TYPE char
#define l_LIST_ITEM_BUNDLE objscheme_bundle_char
#define l_LIST_ITEM_UNBUNDLE objscheme_unbundle_char
#define l_MAKE_LIST __MakecharList
#define l_MAKE_ARRAY __MakecharArray





static Scheme_Object *l_MAKE_LIST(l_TYPE l_POINT *f, l_INTTYPE c)
{
  Scheme_Object *cdr = scheme_null, *obj;
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, cdr);

  while (c--) {
    obj = WITH_VAR_STACK(l_LIST_ITEM_BUNDLE(l_ADDRESS f[c]));
    cdr = WITH_VAR_STACK(scheme_make_pair(obj, cdr));
  }
  
  return cdr;
}

static l_TYPE l_POINT *l_MAKE_ARRAY(Scheme_Object *l, l_INTTYPE *c, char *who)
{
  Scheme_Object *orig_l = l;
  int i = 0;
  long len;
  l_TYPE l_POINT *f = NULL;

  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH(0, l);
  VAR_STACK_PUSH(1, orig_l);
  VAR_STACK_PUSH(2, f);

  len = WITH_VAR_STACK(scheme_proper_list_length(l));
  if (len < 0) WITH_VAR_STACK(scheme_wrong_type(who, "proper-list", -1, 0, &l));
  if (c) *c = len;

  if (!(len + l_EXTRA))
    return NULL;

#if l_DIRECTMALLOC
  f = (l_TYPE l_POINT *)WITH_VAR_STACK(GC_malloc_atomic(sizeof(l_TYPE l_POINT) * (len + l_EXTRA)));
#else
  f = WITH_VAR_STACK(new l_NEWATOMIC l_TYPE l_POINT[len + l_EXTRA]);
#endif

  while (!SCHEME_NULLP(l)) {
    if (!SCHEME_LISTP(l)) {
      WITH_VAR_STACK(scheme_arg_mismatch(who, "expected a proper list: ", orig_l));
      return NULL;
    }

#define l_COPYDEST f[i]
#define l_COPYSRC (l_DEREF WITH_VAR_STACK(l_LIST_ITEM_UNBUNDLE(SCHEME_CAR(l), who l_TEST)))

    l_COPY

    l_OKTEST

    i++;

    l = SCHEME_CDR(l);
  }
  l_TERMINATE

  return f;
}



static char *VectorToArray(char *r, Scheme_Object *vec, long *len)
{
  long c, i;
  Scheme_Object **a;
  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH(0, r);
  VAR_STACK_PUSH(1, vec);
  VAR_STACK_PUSH(2, a);


  if (!SCHEME_VECTORP(vec))
    WITH_VAR_STACK(scheme_wrong_type(METHODNAME("editor-stream-in-base%","read"), 
		                     "character vector", -1, 0, &vec));

  c = *len = SCHEME_VEC_SIZE(vec);

  if (!r)
    r = WITH_VAR_STACK((char *)scheme_malloc_atomic(c));

  for (a = SCHEME_VEC_ELS(vec), i = 0; i < c; i++) {
    if (!SCHEME_CHARP(a[i]))
      WITH_VAR_STACK(scheme_wrong_type(METHODNAME("editor-stream-in-base%","read"), 
				       "character vector", -1, 0, &vec));
    r[i] = SCHEME_CHAR_VAL(a[i]);
  }

  return r;
}

static Scheme_Object *ArrayToVector(char *r, Scheme_Object *vec, long len)
{
  long i;
  Scheme_Object **a;
  SETUP_VAR_STACK(3);
  VAR_STACK_PUSH(0, r);
  VAR_STACK_PUSH(1, vec);
  VAR_STACK_PUSH(2, a);

  if (!vec)
    vec = WITH_VAR_STACK(scheme_make_vector(len, WITH_VAR_STACK(scheme_make_char(0))));
  else if (!SCHEME_VECTORP(vec))
    WITH_VAR_STACK(scheme_wrong_type(METHODNAME("editor-stream-in-base%","read"), 
		                     "character vector", -1, 0, &vec));
  
  for (a = SCHEME_VEC_ELS(vec), i = 0; i < len; i++)
    a[i] = WITH_VAR_STACK(scheme_make_char(r[i]));

  return vec;
}




class os_wxMediaStreamInBase : public wxMediaStreamInBase {
 public:

  os_wxMediaStreamInBase CONSTRUCTOR_ARGS(());
  ~os_wxMediaStreamInBase();
  long Read(char* x0, long x1);
  Bool Bad();
  void Skip(nnlong x0);
  void Seek(nnlong x0);
  long Tell();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamInBase::gcMark() {
  wxMediaStreamInBase::gcMark();
}
void os_wxMediaStreamInBase::gcFixup() {
  wxMediaStreamInBase::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamInBase_class;

os_wxMediaStreamInBase::os_wxMediaStreamInBase CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxMediaStreamInBase())
{
}

os_wxMediaStreamInBase::~os_wxMediaStreamInBase()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

long os_wxMediaStreamInBase::Read(char* x0, long x1)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamInBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamInBase_class, "read", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  p[0] = NULL;
  p[0] = ArrayToVector(x0, NULL, x1);

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  VectorToArray(x0, p[0], &x1);
  
  return WITH_VAR_STACK(objscheme_unbundle_integer(v, "read in editor-stream-in-base%"", extracting return value"));
  }
}

Bool os_wxMediaStreamInBase::Bad()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamInBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamInBase_class, "bad?", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "bad? in editor-stream-in-base%"", extracting return value"));
  }
}

void os_wxMediaStreamInBase::Skip(nnlong x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamInBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamInBase_class, "skip", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = scheme_make_integer(x0);
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

void os_wxMediaStreamInBase::Seek(nnlong x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamInBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamInBase_class, "seek", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = scheme_make_integer(x0);
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

long os_wxMediaStreamInBase::Tell()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamInBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamInBase_class, "tell", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_integer(v, "tell in editor-stream-in-base%"", extracting return value"));
  }
}

static Scheme_Object *os_wxMediaStreamInBaseRead(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);
  char* x0 INIT_NULLED_OUT;
  long x1;

  SETUP_VAR_STACK_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);

  
  x0 = NULL;

  x0 = VectorToArray(NULL, p[0], &x1);
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Read(x0, x1));
  else
    r = WITH_VAR_STACK(((wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Read(x0, x1));

  ArrayToVector(x0, p[0], x1);
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamInBaseBad(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Bad());
  else
    r = WITH_VAR_STACK(((wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Bad());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaStreamInBaseSkip(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "skip in editor-stream-in-base%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Skip(x0));
  else
    WITH_VAR_STACK(((wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Skip(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInBaseSeek(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "seek in editor-stream-in-base%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Seek(x0));
  else
    WITH_VAR_STACK(((wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Seek(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInBaseTell(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Tell());
  else
    r = WITH_VAR_STACK(((wxMediaStreamInBase *)((Scheme_Class_Object *)obj)->primdata)->Tell());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamInBase_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamInBase *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-in-base%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxMediaStreamInBase CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamInBase());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamInBase(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamInBase_class);

  os_wxMediaStreamInBase_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-in-base%", "object%", os_wxMediaStreamInBase_ConstructScheme, 5));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamInBase_class, "read", os_wxMediaStreamInBaseRead, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamInBase_class, "bad?", os_wxMediaStreamInBaseBad, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamInBase_class, "skip", os_wxMediaStreamInBaseSkip, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamInBase_class, "seek", os_wxMediaStreamInBaseSeek, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamInBase_class, "tell", os_wxMediaStreamInBaseTell, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamInBase_class));


}

int objscheme_istype_wxMediaStreamInBase(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamInBase_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-in-base% object or " XC_NULL_STR: "editor-stream-in-base% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamInBase(class wxMediaStreamInBase *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamInBase_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamInBase *objscheme_unbundle_wxMediaStreamInBase(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamInBase(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamInBase *)o->primdata;
  else
    return (wxMediaStreamInBase *)o->primdata;
}





class os_wxMediaStreamOutBase : public wxMediaStreamOutBase {
 public:

  os_wxMediaStreamOutBase CONSTRUCTOR_ARGS(());
  ~os_wxMediaStreamOutBase();
  void Write(char* x0, long x1);
  Bool Bad();
  void Seek(nnlong x0);
  long Tell();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamOutBase::gcMark() {
  wxMediaStreamOutBase::gcMark();
}
void os_wxMediaStreamOutBase::gcFixup() {
  wxMediaStreamOutBase::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamOutBase_class;

os_wxMediaStreamOutBase::os_wxMediaStreamOutBase CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxMediaStreamOutBase())
{
}

os_wxMediaStreamOutBase::~os_wxMediaStreamOutBase()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

void os_wxMediaStreamOutBase::Write(char* x0, long x1)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamOutBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(6);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  VAR_STACK_PUSH(5, x0);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamOutBase_class, "write", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = NULL;
  p[0] = WITH_VAR_STACK(__MakecharList(x0, x1));

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

Bool os_wxMediaStreamOutBase::Bad()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamOutBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamOutBase_class, "bad?", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_bool(v, "bad? in editor-stream-out-base%"", extracting return value"));
  }
}

void os_wxMediaStreamOutBase::Seek(nnlong x0)
{
  Scheme_Object *p[1] INIT_NULLED_ARRAY({ NULLED_OUT });
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamOutBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(5);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  VAR_STACK_PUSH_ARRAY(2, p, 1);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamOutBase_class, "seek", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return;
  } else {
  
  p[0] = scheme_make_integer(x0);
  

  v = WITH_VAR_STACK(scheme_apply(method, 1, p));
  
  
  }
}

long os_wxMediaStreamOutBase::Tell()
{
  Scheme_Object **p = NULL;
  Scheme_Object *v;
  Scheme_Object *method INIT_NULLED_OUT;
#ifdef MZ_PRECISE_GC
  os_wxMediaStreamOutBase *sElF = this;
#endif
  static void *mcache = 0;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, method);
  VAR_STACK_PUSH(1, sElF);
  SET_VAR_STACK();

  method = objscheme_find_method((Scheme_Object *)__gc_external, os_wxMediaStreamOutBase_class, "tell", &mcache);
  if (!method || OBJSCHEME_PRIM_METHOD(method)) {
    SET_VAR_STACK();
    return 0;
  } else {
  
  

  v = WITH_VAR_STACK(scheme_apply(method, 0, p));
  
  
  return WITH_VAR_STACK(objscheme_unbundle_integer(v, "tell in editor-stream-out-base%"", extracting return value"));
  }
}

static Scheme_Object *os_wxMediaStreamOutBaseWrite(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  char* x0 INIT_NULLED_OUT;
  long x1;

  SETUP_VAR_STACK_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, x0);

  
  x0 = NULL;

  x0 = WITH_VAR_STACK(__MakecharArray((0 < n) ? p[0] : scheme_null, &x1, METHODNAME("editor-stream-out-base%","write")));
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Write(x0, x1));
  else
    WITH_VAR_STACK(((wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Write(x0, x1));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamOutBaseBad(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Bad());
  else
    r = WITH_VAR_STACK(((wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Bad());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaStreamOutBaseSeek(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "seek in editor-stream-out-base%"));

  
  if (((Scheme_Class_Object *)obj)->primflag)
    WITH_VAR_STACK(((os_wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Seek(x0));
  else
    WITH_VAR_STACK(((wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Seek(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamOutBaseTell(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  if (((Scheme_Class_Object *)obj)->primflag)
    r = WITH_VAR_STACK(((os_wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Tell());
  else
    r = WITH_VAR_STACK(((wxMediaStreamOutBase *)((Scheme_Class_Object *)obj)->primdata)->Tell());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamOutBase_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamOutBase *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-out-base%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxMediaStreamOutBase CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamOutBase());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamOutBase(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamOutBase_class);

  os_wxMediaStreamOutBase_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-out-base%", "object%", os_wxMediaStreamOutBase_ConstructScheme, 4));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOutBase_class, "write", os_wxMediaStreamOutBaseWrite, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOutBase_class, "bad?", os_wxMediaStreamOutBaseBad, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOutBase_class, "seek", os_wxMediaStreamOutBaseSeek, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOutBase_class, "tell", os_wxMediaStreamOutBaseTell, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamOutBase_class));


}

int objscheme_istype_wxMediaStreamOutBase(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamOutBase_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-out-base% object or " XC_NULL_STR: "editor-stream-out-base% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamOutBase(class wxMediaStreamOutBase *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamOutBase_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamOutBase *objscheme_unbundle_wxMediaStreamOutBase(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamOutBase(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamOutBase *)o->primdata;
  else
    return (wxMediaStreamOutBase *)o->primdata;
}






class os_wxMediaStreamInStringBase : public wxMediaStreamInStringBase {
 public:

  os_wxMediaStreamInStringBase CONSTRUCTOR_ARGS((string x0, long x1));
  ~os_wxMediaStreamInStringBase();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamInStringBase::gcMark() {
  wxMediaStreamInStringBase::gcMark();
}
void os_wxMediaStreamInStringBase::gcFixup() {
  wxMediaStreamInStringBase::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamInStringBase_class;

os_wxMediaStreamInStringBase::os_wxMediaStreamInStringBase CONSTRUCTOR_ARGS((string x0, long x1))
CONSTRUCTOR_INIT(: wxMediaStreamInStringBase(x0, x1))
{
}

os_wxMediaStreamInStringBase::~os_wxMediaStreamInStringBase()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *os_wxMediaStreamInStringBase_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamInStringBase *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  string x0 INIT_NULLED_OUT;
  long x1;

  SETUP_VAR_STACK_PRE_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);
  VAR_STACK_PUSH(3, x0);

  
  if (n != 1) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-in-string-base%", 1, 1, n, p));
  x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "initialization in editor-stream-in-string-base%"));

  x1 = SCHEME_STRTAG_VAL(p[0]);
  realobj = WITH_VAR_STACK(new os_wxMediaStreamInStringBase CONSTRUCTOR_ARGS((x0, x1)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamInStringBase(x0, x1));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamInStringBase(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamInStringBase_class);

  os_wxMediaStreamInStringBase_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-in-string-base%", "editor-stream-in-base%", os_wxMediaStreamInStringBase_ConstructScheme, 0));



  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamInStringBase_class));


}

int objscheme_istype_wxMediaStreamInStringBase(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamInStringBase_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-in-string-base% object or " XC_NULL_STR: "editor-stream-in-string-base% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamInStringBase(class wxMediaStreamInStringBase *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamInStringBase_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamInStringBase *objscheme_unbundle_wxMediaStreamInStringBase(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamInStringBase(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamInStringBase *)o->primdata;
  else
    return (wxMediaStreamInStringBase *)o->primdata;
}






class os_wxMediaStreamOutStringBase : public wxMediaStreamOutStringBase {
 public:

  os_wxMediaStreamOutStringBase CONSTRUCTOR_ARGS(());
  ~os_wxMediaStreamOutStringBase();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamOutStringBase::gcMark() {
  wxMediaStreamOutStringBase::gcMark();
}
void os_wxMediaStreamOutStringBase::gcFixup() {
  wxMediaStreamOutStringBase::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamOutStringBase_class;

os_wxMediaStreamOutStringBase::os_wxMediaStreamOutStringBase CONSTRUCTOR_ARGS(())
CONSTRUCTOR_INIT(: wxMediaStreamOutStringBase())
{
}

os_wxMediaStreamOutStringBase::~os_wxMediaStreamOutStringBase()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *os_wxMediaStreamOutStringBaseGetString(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nstring r;
  objscheme_check_valid(obj);
  long _x0;
  long* x0 = &_x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMediaStreamOutStringBase *)((Scheme_Class_Object *)obj)->primdata)->GetString(x0));

  
  
  return (r ? scheme_make_sized_string(r, _x0 - 1, 0) : XC_SCHEME_NULL);
}

static Scheme_Object *os_wxMediaStreamOutStringBase_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamOutStringBase *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();

  SETUP_VAR_STACK_PRE_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);

  
  if (n != 0) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-out-string-base%", 0, 0, n, p));

  
  realobj = WITH_VAR_STACK(new os_wxMediaStreamOutStringBase CONSTRUCTOR_ARGS(()));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamOutStringBase());
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamOutStringBase(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamOutStringBase_class);

  os_wxMediaStreamOutStringBase_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-out-string-base%", "editor-stream-out-base%", os_wxMediaStreamOutStringBase_ConstructScheme, 1));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOutStringBase_class, "get-string", os_wxMediaStreamOutStringBaseGetString, 0, 0));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamOutStringBase_class));


}

int objscheme_istype_wxMediaStreamOutStringBase(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamOutStringBase_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-out-string-base% object or " XC_NULL_STR: "editor-stream-out-string-base% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamOutStringBase(class wxMediaStreamOutStringBase *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamOutStringBase_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamOutStringBase *objscheme_unbundle_wxMediaStreamOutStringBase(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamOutStringBase(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamOutStringBase *)o->primdata;
  else
    return (wxMediaStreamOutStringBase *)o->primdata;
}


static long GetExact(wxMediaStreamIn *s)
{
  long l;
  s->Get(&l);
  return l;
}
static double GetInexact(wxMediaStreamIn *s)
{
  double d;
  s->Get(&d);
  return d;
}

#define GET Get


  








class os_wxMediaStreamIn : public wxMediaStreamIn {
 public:

  os_wxMediaStreamIn CONSTRUCTOR_ARGS((class wxMediaStreamInBase* x0));
  ~os_wxMediaStreamIn();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamIn::gcMark() {
  wxMediaStreamIn::gcMark();
}
void os_wxMediaStreamIn::gcFixup() {
  wxMediaStreamIn::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamIn_class;

os_wxMediaStreamIn::os_wxMediaStreamIn CONSTRUCTOR_ARGS((class wxMediaStreamInBase* x0))
CONSTRUCTOR_INIT(: wxMediaStreamIn(x0))
{
}

os_wxMediaStreamIn::~os_wxMediaStreamIn()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *os_wxMediaStreamInOk(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->Ok());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaStreamInJumpTo(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "jump-to in editor-stream-in%"));

  
  WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->JumpTo(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInTell(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->Tell());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamInSkip(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "skip in editor-stream-in%"));

  
  WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->Skip(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInRemoveBoundary(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->RemoveBoundary());

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInSetBoundary(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "set-boundary in editor-stream-in%"));

  
  WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->SetBoundary(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamInGET(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  SETUP_PRE_VAR_STACK(2);
  PRE_VAR_STACK_PUSH(0, p);
  PRE_VAR_STACK_PUSH(1, obj);
  REMEMBER_VAR_STACK();
  class wxMediaStreamIn* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  if ((n >= 1) && (WITH_REMEMBERED_STACK(objscheme_istype_box(p[0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_integer(objscheme_unbox(p[0], NULL), NULL)))) {
    long _x0;
    long* x0 = &_x0;
  Scheme_Object *sbox_tmp;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count(">> in editor-stream-in% (exact case)", 1, 1, n, p));
          *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0], ">> in editor-stream-in% (exact case)")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, ">> in editor-stream-in% (exact case)"", extracting boxed argument")));

    
    r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->GET(x0));

    
    if (n > 0)
      WITH_VAR_STACK(objscheme_set_box(p[0], scheme_make_integer(_x0)));
    
  } else  {
    double _x0;
    double* x0 = &_x0;
  Scheme_Object *sbox_tmp;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count(">> in editor-stream-in% (inexact case)", 1, 1, n, p));
          *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0], ">> in editor-stream-in% (inexact case)")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, ">> in editor-stream-in% (inexact case)"", extracting boxed argument")));

    
    r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->GET(x0));

    
    if (n > 0)
      WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
    
  }

  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamIn(r));
}

static Scheme_Object *os_wxMediaStreamInGetInexact(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  double r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(GetInexact(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)));

  
  
  return WITH_REMEMBERED_STACK(scheme_make_double(r));
}

static Scheme_Object *os_wxMediaStreamInGetExact(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(GetExact(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)));

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamInGetFixed(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaStreamIn* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  long _x0;
  long* x0 = &_x0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, r);

  
      *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0], "get-fixed in editor-stream-in%")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get-fixed in editor-stream-in%"", extracting boxed argument")));

  
  r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->GetFixed(x0));

  
  if (n > 0)
    WITH_VAR_STACK(objscheme_set_box(p[0], scheme_make_integer(_x0)));
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamIn(r));
}

static Scheme_Object *os_wxMediaStreamInGetString(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  nstring r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  nnlong _x0;
  nnlong* x0 = &_x0;
  Scheme_Object *sbox_tmp;

  SETUP_VAR_STACK_REMEMBERED(3);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, r);

  
  if (n > 0) {
    if (XC_SCHEME_NULLP(p[0]))
    x0 = NULL;
  else
    *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_nullable_unbox(p[0], "get-string in editor-stream-in%")), WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(sbox_tmp, "get-string in editor-stream-in%"", extracting boxed argument")));
  } else
    x0 = NULL;

  x0 = &_x0;
  r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->GetString(x0));

  
  if (n > 0 && !XC_SCHEME_NULLP(p[0]))
    WITH_VAR_STACK(objscheme_set_box(p[0], scheme_make_integer(_x0)));
  
  return (r ? scheme_make_sized_string(r, _x0 - 1, 0) : XC_SCHEME_NULL);
}

static Scheme_Object *os_wxMediaStreamInGet(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  SETUP_PRE_VAR_STACK(2);
  PRE_VAR_STACK_PUSH(0, p);
  PRE_VAR_STACK_PUSH(1, obj);
  REMEMBER_VAR_STACK();
  class wxMediaStreamIn* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  if ((n >= 1) && (WITH_REMEMBERED_STACK(objscheme_istype_box(p[0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_integer(objscheme_unbox(p[0], NULL), NULL)))) {
    long _x0;
    long* x0 = &_x0;
  Scheme_Object *sbox_tmp;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("get in editor-stream-in% (exact number case)", 1, 1, n, p));
          *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0], "get in editor-stream-in% (exact number case)")), WITH_VAR_STACK(objscheme_unbundle_integer(sbox_tmp, "get in editor-stream-in% (exact number case)"", extracting boxed argument")));

    
    r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->Get(x0));

    
    if (n > 0)
      WITH_VAR_STACK(objscheme_set_box(p[0], scheme_make_integer(_x0)));
    
  } else  {
    double _x0;
    double* x0 = &_x0;
  Scheme_Object *sbox_tmp;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("get in editor-stream-in% (inexact number case)", 1, 1, n, p));
          *x0 = (sbox_tmp = WITH_VAR_STACK(objscheme_unbox(p[0], "get in editor-stream-in% (inexact number case)")), WITH_VAR_STACK(objscheme_unbundle_float(sbox_tmp, "get in editor-stream-in% (inexact number case)"", extracting boxed argument")));

    
    r = WITH_VAR_STACK(((wxMediaStreamIn *)((Scheme_Class_Object *)obj)->primdata)->Get(x0));

    
    if (n > 0)
      WITH_VAR_STACK(objscheme_set_box(p[0], WITH_VAR_STACK(scheme_make_double(_x0))));
    
  }

  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamIn(r));
}

static Scheme_Object *os_wxMediaStreamIn_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamIn *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  class wxMediaStreamInBase* x0 INIT_NULLED_OUT;

  SETUP_VAR_STACK_PRE_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);
  VAR_STACK_PUSH(3, x0);

  
  if (n != 1) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-in%", 1, 1, n, p));
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamInBase(p[0], "initialization in editor-stream-in%", 0));

  
  realobj = WITH_VAR_STACK(new os_wxMediaStreamIn CONSTRUCTOR_ARGS((x0)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamIn(x0));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamIn(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamIn_class);

  os_wxMediaStreamIn_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-in%", "object%", os_wxMediaStreamIn_ConstructScheme, 12));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "ok?", os_wxMediaStreamInOk, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "jump-to", os_wxMediaStreamInJumpTo, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "tell", os_wxMediaStreamInTell, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "skip", os_wxMediaStreamInSkip, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "remove-boundary", os_wxMediaStreamInRemoveBoundary, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "set-boundary", os_wxMediaStreamInSetBoundary, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, ">>", os_wxMediaStreamInGET, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "get-inexact", os_wxMediaStreamInGetInexact, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "get-exact", os_wxMediaStreamInGetExact, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "get-fixed", os_wxMediaStreamInGetFixed, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "get-string", os_wxMediaStreamInGetString, 0, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamIn_class, "get", os_wxMediaStreamInGet, 1, 1));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamIn_class));


}

int objscheme_istype_wxMediaStreamIn(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamIn_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-in% object or " XC_NULL_STR: "editor-stream-in% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamIn(class wxMediaStreamIn *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamIn_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamIn *objscheme_unbundle_wxMediaStreamIn(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamIn(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamIn *)o->primdata;
  else
    return (wxMediaStreamIn *)o->primdata;
}


#define PUT Put








class os_wxMediaStreamOut : public wxMediaStreamOut {
 public:

  os_wxMediaStreamOut CONSTRUCTOR_ARGS((class wxMediaStreamOutBase* x0));
  ~os_wxMediaStreamOut();
#ifdef MZ_PRECISE_GC
  void gcMark();
  void gcFixup();
#endif
};

#ifdef MZ_PRECISE_GC
void os_wxMediaStreamOut::gcMark() {
  wxMediaStreamOut::gcMark();
}
void os_wxMediaStreamOut::gcFixup() {
  wxMediaStreamOut::gcFixup();
}
#endif

static Scheme_Object *os_wxMediaStreamOut_class;

os_wxMediaStreamOut::os_wxMediaStreamOut CONSTRUCTOR_ARGS((class wxMediaStreamOutBase* x0))
CONSTRUCTOR_INIT(: wxMediaStreamOut(x0))
{
}

os_wxMediaStreamOut::~os_wxMediaStreamOut()
{
    objscheme_destroy(this, (Scheme_Object *)__gc_external);
}

static Scheme_Object *os_wxMediaStreamOutOk(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  Bool r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Ok());

  
  
  return (r ? scheme_true : scheme_false);
}

static Scheme_Object *os_wxMediaStreamOutJumpTo(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  objscheme_check_valid(obj);
  nnlong x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "jump-to in editor-stream-out%"));

  
  WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->JumpTo(x0));

  
  
  return scheme_void;
}

static Scheme_Object *os_wxMediaStreamOutTell(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  long r;
  objscheme_check_valid(obj);

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  

  
  r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Tell());

  
  
  return scheme_make_integer(r);
}

static Scheme_Object *os_wxMediaStreamOutPUT(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  SETUP_PRE_VAR_STACK(2);
  PRE_VAR_STACK_PUSH(0, p);
  PRE_VAR_STACK_PUSH(1, obj);
  REMEMBER_VAR_STACK();
  class wxMediaStreamOut* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  if ((n >= 1) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0], NULL))) {
    string x0 INIT_NULLED_OUT;

    SETUP_VAR_STACK_PRE_REMEMBERED(4);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);
    VAR_STACK_PUSH(3, x0);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("<< in editor-stream-out% (string case)", 1, 1, n, p));
    x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "<< in editor-stream-out% (string case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->PUT(x0));

    
    
  } else if ((n >= 1) && WITH_REMEMBERED_STACK(objscheme_istype_float(p[0], NULL))) {
    double x0;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("<< in editor-stream-out% (inexact number case)", 1, 1, n, p));
    x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "<< in editor-stream-out% (inexact number case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->PUT(x0));

    
    
  } else  {
    long x0;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("<< in editor-stream-out% (exact number case)", 1, 1, n, p));
    x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "<< in editor-stream-out% (exact number case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->PUT(x0));

    
    
  }

  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamOut(r));
}

static Scheme_Object *os_wxMediaStreamOutPutFixed(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  REMEMBER_VAR_STACK();
  class wxMediaStreamOut* r;
  objscheme_check_valid(obj);
  long x0;

  SETUP_VAR_STACK_REMEMBERED(2);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);

  
  x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "put-fixed in editor-stream-out%"));

  
  r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->PutFixed(x0));

  
  
  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamOut(r));
}

static Scheme_Object *os_wxMediaStreamOutPut(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p)
  SETUP_PRE_VAR_STACK(2);
  PRE_VAR_STACK_PUSH(0, p);
  PRE_VAR_STACK_PUSH(1, obj);
  REMEMBER_VAR_STACK();
  class wxMediaStreamOut* r INIT_NULLED_OUT;
  objscheme_check_valid(obj);
  if ((n >= 1) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[0], NULL))) {
    string x0 INIT_NULLED_OUT;

    SETUP_VAR_STACK_PRE_REMEMBERED(4);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);
    VAR_STACK_PUSH(3, x0);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("put in editor-stream-out% (string without length case)", 1, 1, n, p));
    x0 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[0], "put in editor-stream-out% (string without length case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Put(x0));

    
    
  } else if ((n >= 2) && WITH_REMEMBERED_STACK(objscheme_istype_number(p[0], NULL)) && WITH_REMEMBERED_STACK(objscheme_istype_string(p[1], NULL))) {
    nnint x0;
    string x1 INIT_NULLED_OUT;

    SETUP_VAR_STACK_PRE_REMEMBERED(4);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);
    VAR_STACK_PUSH(3, x1);

    
    if (n != 2) 
      WITH_VAR_STACK(scheme_wrong_count("put in editor-stream-out% (length and string case)", 2, 2, n, p));
    x0 = WITH_VAR_STACK(objscheme_unbundle_nonnegative_integer(p[0], "put in editor-stream-out% (length and string case)"));
    x1 = (string)WITH_VAR_STACK(objscheme_unbundle_string(p[1], "put in editor-stream-out% (length and string case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Put(x0, x1));

    
    
  } else if ((n >= 1) && WITH_REMEMBERED_STACK(objscheme_istype_integer(p[0], NULL))) {
    long x0;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("put in editor-stream-out% (exact number case)", 1, 1, n, p));
    x0 = WITH_VAR_STACK(objscheme_unbundle_integer(p[0], "put in editor-stream-out% (exact number case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Put(x0));

    
    
  } else  {
    double x0;

    SETUP_VAR_STACK_PRE_REMEMBERED(3);
    VAR_STACK_PUSH(0, p);
    VAR_STACK_PUSH(1, obj);
    VAR_STACK_PUSH(2, r);

    
    if (n != 1) 
      WITH_VAR_STACK(scheme_wrong_count("put in editor-stream-out% (inexact number case)", 1, 1, n, p));
    x0 = WITH_VAR_STACK(objscheme_unbundle_float(p[0], "put in editor-stream-out% (inexact number case)"));

    
    r = WITH_VAR_STACK(((wxMediaStreamOut *)((Scheme_Class_Object *)obj)->primdata)->Put(x0));

    
    
  }

  return WITH_REMEMBERED_STACK(objscheme_bundle_wxMediaStreamOut(r));
}

static Scheme_Object *os_wxMediaStreamOut_ConstructScheme(Scheme_Object *obj, int n,  Scheme_Object *p[])
{
  SETUP_PRE_VAR_STACK(1);
  PRE_VAR_STACK_PUSH(0, obj);
  os_wxMediaStreamOut *realobj INIT_NULLED_OUT;
  REMEMBER_VAR_STACK();
  class wxMediaStreamOutBase* x0 INIT_NULLED_OUT;

  SETUP_VAR_STACK_PRE_REMEMBERED(4);
  VAR_STACK_PUSH(0, p);
  VAR_STACK_PUSH(1, obj);
  VAR_STACK_PUSH(2, realobj);
  VAR_STACK_PUSH(3, x0);

  
  if (n != 1) 
    WITH_VAR_STACK(scheme_wrong_count("initialization in editor-stream-out%", 1, 1, n, p));
  x0 = WITH_VAR_STACK(objscheme_unbundle_wxMediaStreamOutBase(p[0], "initialization in editor-stream-out%", 0));

  
  realobj = WITH_VAR_STACK(new os_wxMediaStreamOut CONSTRUCTOR_ARGS((x0)));
#ifdef MZ_PRECISE_GC
  WITH_VAR_STACK(realobj->gcInit_wxMediaStreamOut(x0));
#endif
  realobj->__gc_external = (void *)obj;
  objscheme_note_creation(obj);
  
  
  ((Scheme_Class_Object *)obj)->primdata = realobj;
  WITH_REMEMBERED_STACK(objscheme_register_primpointer(obj, &((Scheme_Class_Object *)obj)->primdata));
  ((Scheme_Class_Object *)obj)->primflag = 1;
  return obj;
}

void objscheme_setup_wxMediaStreamOut(void *env)
{
  SETUP_VAR_STACK(1);
  VAR_STACK_PUSH(0, env);

  wxREGGLOB(os_wxMediaStreamOut_class);

  os_wxMediaStreamOut_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "editor-stream-out%", "object%", os_wxMediaStreamOut_ConstructScheme, 6));

  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "ok?", os_wxMediaStreamOutOk, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "jump-to", os_wxMediaStreamOutJumpTo, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "tell", os_wxMediaStreamOutTell, 0, 0));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "<<", os_wxMediaStreamOutPUT, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "put-fixed", os_wxMediaStreamOutPutFixed, 1, 1));
  WITH_VAR_STACK(scheme_add_method_w_arity(os_wxMediaStreamOut_class, "put", os_wxMediaStreamOutPut, 1, 2));


  WITH_VAR_STACK(scheme_made_class(os_wxMediaStreamOut_class));


}

int objscheme_istype_wxMediaStreamOut(Scheme_Object *obj, const char *stop, int nullOK)
{
  REMEMBER_VAR_STACK();
  if (nullOK && XC_SCHEME_NULLP(obj)) return 1;
  if (SAME_TYPE(SCHEME_TYPE(obj), scheme_object_type)
      && scheme_is_subclass(((Scheme_Class_Object *)obj)->sclass,          os_wxMediaStreamOut_class))
    return 1;
  else {
    if (!stop)
       return 0;
    WITH_REMEMBERED_STACK(scheme_wrong_type(stop, nullOK ? "editor-stream-out% object or " XC_NULL_STR: "editor-stream-out% object", -1, 0, &obj));
    return 0;
  }
}

Scheme_Object *objscheme_bundle_wxMediaStreamOut(class wxMediaStreamOut *realobj)
{
  Scheme_Class_Object *obj INIT_NULLED_OUT;
  Scheme_Object *sobj INIT_NULLED_OUT;

  if (!realobj) return XC_SCHEME_NULL;

  if (realobj->__gc_external)
    return (Scheme_Object *)realobj->__gc_external;

  SETUP_VAR_STACK(2);
  VAR_STACK_PUSH(0, obj);
  VAR_STACK_PUSH(1, realobj);

  if ((sobj = WITH_VAR_STACK(objscheme_bundle_by_type(realobj, realobj->__type))))
    return sobj;
  obj = (Scheme_Class_Object *)WITH_VAR_STACK(scheme_make_uninited_object(os_wxMediaStreamOut_class));

  obj->primdata = realobj;
  WITH_VAR_STACK(objscheme_register_primpointer(obj, &obj->primdata));
  obj->primflag = 0;

  realobj->__gc_external = (void *)obj;
  return (Scheme_Object *)obj;
}

class wxMediaStreamOut *objscheme_unbundle_wxMediaStreamOut(Scheme_Object *obj, const char *where, int nullOK)
{
  if (nullOK && XC_SCHEME_NULLP(obj)) return NULL;

  REMEMBER_VAR_STACK();

  (void)objscheme_istype_wxMediaStreamOut(obj, where, nullOK);
  Scheme_Class_Object *o = (Scheme_Class_Object *)obj;
  WITH_REMEMBERED_STACK(objscheme_check_valid(obj));
  if (o->primflag)
    return (os_wxMediaStreamOut *)o->primdata;
  else
    return (wxMediaStreamOut *)o->primdata;
}


#ifdef MZ_PRECISE_GC
END_XFORM_SKIP;
#endif
