%%
headers
#include <Python.h>
#define PY_ARRAY_UNIQUE_SYMBOL gxw_ARRAY_API
#define NO_IMPORT_ARRAY
#include <numpy/ndarrayobject.h>
#include <pygobject.h>
#include <pygtk/pygtk.h>
#include <gxw.h>
%%
modulename gxw
%%
import gtk.Box as PyGtkBox_Type
import gtk.DrawingArea as PyGtkDrawingArea_Type
import gtk.Range as PyGtkRange_Type
import gtk.ToggleButton as PyGtkToggleButton_Type
import gtk.RadioButton as PyGtkRadioButton_Type
import gtk.Misc as PyGtkMisc_Type
import gtk.Alignment as PyGtkAlignment_Type
import gtk.Widget as PyGtkWidget_Type
import gtk.Label as PyGtkLabel_Type
import gtk.TreeModel as PyGtkTreeModel_Type
%%
ignore set_regler_connect_func
ignore set_selector_connect_func
ignore set_switch_connect_func
%%
ignore-glob
 *_get_type
%%
override gx_wave_view_set_frame kwargs
static PyObject *
_wrap_gx_wave_view_set_frame(PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "frame", NULL };
    PyObject *frame = NULL, *arr = NULL;
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:gx.WaveView.set", kwlist, &frame))
        return NULL;
    if ((arr = PyArray_FromObject(frame, NPY_FLOAT, 1, 1)) == NULL)
        return NULL;
    PyObject *key = PyString_FromString("_arr");
    PyObject_SetAttr((PyObject*)self, key, arr); // quick hack to keep reference
    Py_DECREF(key);
    gx_wave_view_set_frame(GX_WAVE_VIEW(self->obj), (float*)PyArray_DATA(arr), PyArray_SIZE(arr));
    Py_INCREF(Py_None);
    return Py_None;
}
%%
override gx_ir_edit_set_ir_data kwargs
static PyObject *
_wrap_gx_ir_edit_set_ir_data(PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "data", "samplerate", NULL };
    int chan, len, samplerate;
    PyObject *data = NULL, *arr = NULL;
    if (!PyArg_ParseTupleAndKeywords(args, kwargs,"Oi:Gx.IREdit.set_ir_data", kwlist, &data, &samplerate))
        return NULL;
    if ((arr = PyArray_FromObject(data, NPY_FLOAT, 1, 2)) == NULL)
        return NULL;
    PyObject *key = PyString_FromString("_arr");
    PyObject_SetAttr((PyObject*)self, key, arr); // quick hack to keep reference
    Py_DECREF(key);
    if (PyArray_NDIM(arr) == 1) {
        chan = 0;
    } else {
        chan = PyArray_DIM(arr, 1);
    }
    gx_ir_edit_set_ir_data(GX_IR_EDIT(self->obj), (float*)PyArray_DATA(arr), chan, PyArray_DIM(arr,0), samplerate);
    Py_INCREF(Py_None);
    return Py_None;
}
%%
