summaryrefslogtreecommitdiff
path: root/lv2/lv2_gui.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-28 20:30:05 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-28 20:30:05 +0200
commitcdbb903edbbe71d3e7a8db61728164b88e8e9c45 (patch)
tree468caa16babdb10134f442181feb876ed2b3ae1b /lv2/lv2_gui.cc
parent3eeba619215dadb15a5fd992cba03bf760c23d3a (diff)
Fix gui crash on window close. Make drumkit and midimap file and status reshow in the gui.
Diffstat (limited to 'lv2/lv2_gui.cc')
-rw-r--r--lv2/lv2_gui.cc31
1 files changed, 5 insertions, 26 deletions
diff --git a/lv2/lv2_gui.cc b/lv2/lv2_gui.cc
index afd47a2..0242dcf 100644
--- a/lv2/lv2_gui.cc
+++ b/lv2/lv2_gui.cc
@@ -120,47 +120,32 @@ struct DG_GUI {
static void ui_run(struct lv2_external_ui * _this_)
{
- printf("run() called\n");
struct DG_GUI *dggui = (struct DG_GUI *)_this_;
dggui->gui->processEvents();
}
static void ui_show(struct lv2_external_ui * _this_)
{
- printf("show() called\n");
struct DG_GUI *dggui = (struct DG_GUI *)_this_;
dggui->gui->show();
}
static void ui_hide(struct lv2_external_ui * _this_)
{
- printf("hide() called\n");
struct DG_GUI *dggui = (struct DG_GUI *)_this_;
dggui->gui->hide();
}
static void closeHandler(void *ptr)
{
- printf("> closeHandler\n");
struct DG_GUI *gui = (struct DG_GUI *)ptr;
- if(gui->ui_host_ptr && gui->ui_host_ptr->ui_closed)
- gui->ui_host_ptr->ui_closed(gui->controller);
- gui->gui->hide();
- printf("< closeHandler\n");
-}
-static void midimapHandler(void *ptr, const char* file)
-{
- /*
- printf("> midimapHandler %s\n", file);
- struct DG_GUI *gui = (struct DG_GUI *)ptr;
- gui->instance->midimapfile = file;
-
- DGLV2 *dglv2 = (DGLV2 *)gui->instance_handle;
- dglv2->in->loadMidiMap(file);
+ if(gui->ui_host_ptr && gui->ui_host_ptr->ui_closed) {
+ gui->ui_host_ptr->ui_closed(gui->controller);
+ }
- printf("< midimapHandler\n");
- */
+ delete gui->gui;
+ gui->gui = NULL;
}
static LV2UI_Handle ui_instantiate(const struct _LV2UI_Descriptor * descriptor,
@@ -207,8 +192,6 @@ static LV2UI_Handle ui_instantiate(const struct _LV2UI_Descriptor * descriptor,
pt->virt.hide = ui_hide;
pt->gui = new PluginGUI(pt->instance);
pt->gui->setWindowClosedCallback(closeHandler, pt);
- pt->gui->setChangeMidimapCallback(midimapHandler, pt);
- // pt->gui->show();
*widget = (LV2UI_Widget)pt;
@@ -217,7 +200,6 @@ static LV2UI_Handle ui_instantiate(const struct _LV2UI_Descriptor * descriptor,
static void ui_cleanup(LV2UI_Handle ui)
{
- printf("ui_cleanup\n");
struct DG_GUI* pt = (struct DG_GUI*)ui;
delete pt->gui;
delete pt;
@@ -229,7 +211,6 @@ static void ui_port_event(LV2UI_Handle ui,
uint32_t format,
const void * buffer)
{
- printf("ui_cport_event\n");
}
#ifdef __cplusplus
@@ -246,8 +227,6 @@ static LV2UI_Descriptor descriptor = {
const LV2UI_Descriptor *lv2ui_descriptor(uint32_t index)
{
- printf("lv2ui_descriptor\n");
-
if(index == 0) return &descriptor;
return NULL;
}