| @@ -37,7 +37,7 @@ typedef struct { /** fake */ int unused; } * lv2_rtsafe_memory_pool_handle; | |||
| #define LV2_RTSAFE_MEMORY_POOL_NAME_MAX 128 | |||
| /** structure, pointer to which is to be supplied as @c data member of ::LV2_Feature */ | |||
| struct lv2_rtsafe_memory_pool_provider | |||
| typedef struct | |||
| { | |||
| /** | |||
| * This function is called when plugin wants to create memory pool | |||
| @@ -112,7 +112,7 @@ struct lv2_rtsafe_memory_pool_provider | |||
| (*deallocate)( | |||
| lv2_rtsafe_memory_pool_handle pool, | |||
| void * memory_ptr); | |||
| }; | |||
| } lv2_rtsafe_memory_pool_provider; | |||
| #if 0 | |||
| { /* Adjust editor indent */ | |||
| @@ -1303,19 +1303,16 @@ class PluginParameter(QWidget, ui_carla_parameter.Ui_PluginParameter): | |||
| # Plugin GUI | |||
| class PluginGUI(QDialog): | |||
| def __init__(self, parent, plugin_name): | |||
| def __init__(self, parent, plugin_name, resizable): | |||
| QDialog.__init__(self, parent) | |||
| self.myLayout = QVBoxLayout(self) | |||
| self.myLayout.setContentsMargins(0, 0, 0, 0) | |||
| self.setLayout(self.myLayout) | |||
| self.resizable = False #gui_data['resizable'] | |||
| self.resizable = resizable | |||
| self.setNewSize(300, 300) | |||
| #if (not plugin_name): | |||
| #plugin_name = "Plugin" | |||
| self.setWindowTitle("%s (GUI)" % (plugin_name)) | |||
| def setNewSize(self, width, height): | |||
| @@ -2023,13 +2020,11 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): | |||
| if (self.pinfo['hints'] & PLUGIN_HAS_GUI): | |||
| gui_info = CarlaHost.get_gui_info(self.plugin_id) | |||
| print("--------------------------------------------------------------------") | |||
| print(gui_info) | |||
| self.gui_dialog_type = gui_info['type'] | |||
| if (self.gui_dialog_type in (GUI_INTERNAL_QT4, GUI_INTERNAL_X11)): | |||
| self.gui_dialog = None | |||
| self.gui_dialog = PluginGUI(self, self.pinfo['name']) | |||
| self.gui_dialog = PluginGUI(self, self.pinfo['name'], gui_info['resizable']) | |||
| self.gui_dialog.hide() | |||
| self.gui_dialog_geometry = None | |||
| self.connect(self.gui_dialog, SIGNAL("finished(int)"), SLOT("slot_guiClosed()")) | |||
| @@ -403,7 +403,7 @@ GuiInfo* get_gui_info(unsigned short plugin_id) | |||
| { | |||
| qDebug("get_gui_info(%i)", plugin_id); | |||
| static GuiInfo info = { GUI_NONE }; | |||
| static GuiInfo info = { GUI_NONE, false }; | |||
| info.type = GUI_NONE; | |||
| for (unsigned short i=0; i<MAX_PLUGINS; i++) | |||
| @@ -201,6 +201,7 @@ struct MidiProgramInfo { | |||
| struct GuiInfo { | |||
| GuiType type; | |||
| bool resizable; | |||
| }; | |||
| struct PluginBridgeInfo { | |||
| @@ -432,6 +432,7 @@ public: | |||
| virtual void get_gui_info(GuiInfo* info) | |||
| { | |||
| info->type = GUI_NONE; | |||
| info->resizable = false; | |||
| } | |||
| void set_id(short id) | |||
| @@ -140,6 +140,7 @@ public: | |||
| info->type = GUI_EXTERNAL_OSC; | |||
| else | |||
| info->type = GUI_NONE; | |||
| info->resizable = false; | |||
| } | |||
| virtual void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
| @@ -25,6 +25,6 @@ | |||
| void | |||
| rtmempool_allocator_init( | |||
| struct lv2_rtsafe_memory_pool_provider * allocator_ptr); | |||
| lv2_rtsafe_memory_pool_provider * allocator_ptr); | |||
| #endif /* #ifndef RTMEMPOOL_H__1FA54215_11CF_4659_9CF3_C17A10A67A1F__INCLUDED */ | |||
| @@ -43,6 +43,9 @@ extern "C" { | |||
| #include "lv2-rtmempool/rtmempool.h" | |||
| } | |||
| #include <QtGui/QDialog> | |||
| #include <QtGui/QLayout> | |||
| // static max values | |||
| const unsigned int MAX_EVENT_BUFFER = 8192; // 0x7FFF; // 32767 | |||
| @@ -209,7 +212,10 @@ public: | |||
| delete (LV2UI_Resize*)features[lv2_feature_id_ui_resize]->data; | |||
| if (features[lv2_feature_id_external_ui] && features[lv2_feature_id_external_ui]->data) | |||
| { | |||
| free((void*)((lv2_external_ui_host*)features[lv2_feature_id_external_ui]->data)->plugin_human_id); | |||
| delete (lv2_external_ui_host*)features[lv2_feature_id_external_ui]->data; | |||
| } | |||
| ui_lib_close(); | |||
| } | |||
| @@ -472,7 +478,8 @@ public: | |||
| virtual void get_gui_info(GuiInfo* info) | |||
| { | |||
| info->type = gui.type; | |||
| info->type = gui.type; | |||
| info->resizable = gui.resizable; | |||
| } | |||
| virtual void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
| @@ -525,44 +532,43 @@ public: | |||
| CarlaPlugin::set_custom_data(dtype, key, value, gui_send); | |||
| } | |||
| virtual void set_gui_data(int, void* /*ptr*/) | |||
| virtual void set_gui_data(int, void* ptr) | |||
| { | |||
| // switch(gui.type) | |||
| // { | |||
| // case GUI_INTERNAL_QT4: | |||
| // if (ui.widget) | |||
| // { | |||
| // QDialog* qtPtr = (QDialog*)ptr; | |||
| // QWidget* widget = (QWidget*)ui.widget; | |||
| switch(gui.type) | |||
| { | |||
| case GUI_INTERNAL_QT4: | |||
| if (ui.widget) | |||
| { | |||
| QDialog* qtPtr = (QDialog*)ptr; | |||
| QWidget* widget = (QWidget*)ui.widget; | |||
| // qtPtr->layout()->addWidget(widget); | |||
| // widget->setParent(qtPtr); | |||
| // widget->show(); | |||
| // } | |||
| // break; | |||
| qtPtr->layout()->addWidget(widget); | |||
| widget->adjustSize(); | |||
| widget->setParent(qtPtr); | |||
| widget->show(); | |||
| } | |||
| break; | |||
| // case GUI_INTERNAL_X11: | |||
| // if (ui.descriptor) | |||
| // { | |||
| // QDialog* qtPtr = (QDialog*)ptr; | |||
| // features[lv2_feature_id_ui_parent]->data = (void*)qtPtr->winId(); | |||
| // ui.handle = ui.descriptor->instantiate(ui.descriptor, | |||
| // descriptor->URI, | |||
| // ui.rdf_descriptor->Bundle, | |||
| // carla_lv2_ui_write_function, | |||
| // this, | |||
| // &ui.widget, | |||
| // features); | |||
| // if (ui.handle && ui.descriptor->port_event) | |||
| // update_ui_ports(); | |||
| // } | |||
| // break; | |||
| case GUI_INTERNAL_X11: | |||
| if (ui.descriptor) | |||
| { | |||
| QDialog* qtPtr = (QDialog*)ptr; | |||
| features[lv2_feature_id_ui_parent]->data = (void*)qtPtr->winId(); | |||
| ui.handle = ui.descriptor->instantiate(ui.descriptor, | |||
| descriptor->URI, | |||
| ui.rdf_descriptor->Bundle, | |||
| carla_lv2_ui_write_function, | |||
| this, | |||
| &ui.widget, | |||
| features); | |||
| update_ui_ports(); | |||
| } | |||
| break; | |||
| // default: | |||
| // break; | |||
| // } | |||
| default: | |||
| break; | |||
| } | |||
| } | |||
| virtual void show_gui(bool yesno) | |||
| @@ -2028,7 +2034,7 @@ public: | |||
| else if (iExt >= 0) | |||
| iFinal = iExt; | |||
| bool is_bridged = (iFinal == eQt4 || iFinal == eX11 || iFinal == eGtk2); | |||
| bool is_bridged = false; //(iFinal == eQt4 || iFinal == eX11 || iFinal == eGtk2); | |||
| // Use proper UI now | |||
| if (iFinal >= 0) | |||
| @@ -170,6 +170,7 @@ public: | |||
| info->type = GUI_INTERNAL_QT4; | |||
| else | |||
| info->type = GUI_NONE; | |||
| info->resizable = false; | |||
| } | |||
| virtual void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
| @@ -781,7 +781,8 @@ class MidiProgramInfo(Structure): | |||
| class GuiInfo(Structure): | |||
| _fields_ = [ | |||
| ("type", c_enum) | |||
| ("type", c_enum), | |||
| ("resizable", c_bool), | |||
| ] | |||
| class PluginBridgeInfo(Structure): | |||