summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-03-04 21:45:51 +0000
committerCarl Hetherington <carl@carlh.net>2012-03-04 21:45:51 +0000
commit0e5abb0e4b4ab94542d8800f6354eff38088d997 (patch)
tree50b3834c98bc4682e73c1710f1f7b1d61a5d74e3 /gtk2_ardour
parent22b583a8e7bb226b388ea6b9ea49d3c7b9c75197 (diff)
Make lv2ui_instantiate and lv2ui_free a little more symmetrical, so that there aren't GTK errors on reopening a LV2 plugin UI because of trying to repack already packed widgets (#4733).
git-svn-id: svn://localhost/ardour2/branches/3.0@11589 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/lv2_plugin_ui.cc29
-rw-r--r--gtk2_ardour/lv2_plugin_ui.h2
2 files changed, 20 insertions, 11 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc
index b5a4f0b83e..d014cddd10 100644
--- a/gtk2_ardour/lv2_plugin_ui.cc
+++ b/gtk2_ardour/lv2_plugin_ui.cc
@@ -151,6 +151,7 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
: PlugUIBase(pi)
, _lv2(lv2p)
, _gui_widget(NULL)
+ , _ardour_buttons_box(NULL)
, _values(NULL)
, _external_ui_ptr(NULL)
, _inst(NULL)
@@ -228,17 +229,17 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
_external_ui_ptr = NULL;
if (_inst) {
if (!is_external_ui) {
- Gtk::HBox* box = manage (new Gtk::HBox);
- box->set_spacing (6);
- box->set_border_width (6);
- box->pack_end (focus_button, false, false);
- box->pack_end (bypass_button, false, false, 10);
- box->pack_end (delete_button, false, false);
- box->pack_end (save_button, false, false);
- box->pack_end (add_button, false, false);
- box->pack_end (_preset_combo, false, false);
- box->show_all();
- pack_start(*box, false, false);
+ _ardour_buttons_box = manage (new Gtk::HBox);
+ _ardour_buttons_box->set_spacing (6);
+ _ardour_buttons_box->set_border_width (6);
+ _ardour_buttons_box->pack_end (focus_button, false, false);
+ _ardour_buttons_box->pack_end (bypass_button, false, false, 10);
+ _ardour_buttons_box->pack_end (delete_button, false, false);
+ _ardour_buttons_box->pack_end (save_button, false, false);
+ _ardour_buttons_box->pack_end (add_button, false, false);
+ _ardour_buttons_box->pack_end (_preset_combo, false, false);
+ _ardour_buttons_box->show_all();
+ pack_start(*_ardour_buttons_box, false, false);
GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst);
_gui_widget = Glib::wrap(c_widget);
@@ -281,6 +282,12 @@ LV2PluginUI::lv2ui_free()
remove (*_gui_widget);
}
+ if (_ardour_buttons_box) {
+ remove (*_ardour_buttons_box);
+ delete _ardour_buttons_box;
+ _ardour_buttons_box = 0;
+ }
+
suil_instance_free((SuilInstance*)_inst);
_inst = NULL;
diff --git a/gtk2_ardour/lv2_plugin_ui.h b/gtk2_ardour/lv2_plugin_ui.h
index 7284f82128..d245ed31a1 100644
--- a/gtk2_ardour/lv2_plugin_ui.h
+++ b/gtk2_ardour/lv2_plugin_ui.h
@@ -68,6 +68,8 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
std::vector<int> _output_ports;
sigc::connection _screen_update_connection;
Gtk::Widget* _gui_widget;
+ /** a box containing the focus, bypass, delete, save / add preset buttons etc. */
+ Gtk::HBox* _ardour_buttons_box;
float* _values;
std::vector<ControllableRef> _controllables;
struct lv2_external_ui_host _external_ui_host;