From ba41591ef15e817507e12d7ea713e963259e99a7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 11 May 2012 12:21:43 +0000 Subject: backport LV2 plugin GUI bug fix involving uninitialized _gui_widget member; convert NULL in that file to zeroes as per style guide git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@12249 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/automation_line.cc | 3 +-- gtk2_ardour/lv2_plugin_ui.cc | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index ded54a5a24..7dd6cd1d44 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -69,8 +69,7 @@ ControlPoint::ControlPoint (AutomationLine& al) item = new Canvas::SimpleRect (line.canvas_group()); item->property_draw() = true; item->property_fill() = false; - item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointFill.get(); - item->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get(); + item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get(); item->property_outline_pixels() = 1; item->set_data ("control_point", this); item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler)); diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index ba06a5a824..2558e8ac2e 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -35,7 +35,7 @@ using namespace PBD; #define NS_UI "http://lv2plug.in/ns/extensions/ui#" -static SuilHost* ui_host = NULL; +static SuilHost* ui_host = 0; void LV2PluginUI::lv2_ui_write(LV2UI_Controller controller, @@ -60,7 +60,7 @@ void LV2PluginUI::on_external_ui_closed(LV2UI_Controller controller) { LV2PluginUI* me = (LV2PluginUI*)controller; me->_screen_update_connection.disconnect(); - me->_external_ui_ptr = NULL; + me->_external_ui_ptr = 0; } void @@ -131,9 +131,10 @@ LV2PluginUI::LV2PluginUI (boost::shared_ptr pi, boost::shared_ptr< : PlugUIBase (pi) , _lv2(lv2p) , _current_ui_thread (0) - , _inst(NULL) - , _values(NULL) - , _external_ui_ptr(NULL) + , _inst (0) + , _values (0) + , _gui_widget (0) + , _external_ui_ptr (0) { if (!_lv2->is_external_ui()) { lv2ui_instantiate("gtk2gui"); @@ -165,7 +166,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } features_dst = features = (LV2_Feature**)malloc(sizeof(LV2_Feature*) * features_count); - features_dst[--features_count] = NULL; + features_dst[--features_count] = 0; features_dst[--features_count] = &_external_ui_feature; while (features_count--) { *features++ = *features_src++; @@ -175,7 +176,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } if (!ui_host) { - ui_host = suil_host_new(LV2PluginUI::lv2_ui_write, NULL, NULL, NULL); + ui_host = suil_host_new(LV2PluginUI::lv2_ui_write, 0, 0, 0); } const char* container_type = (is_external_ui) ? NS_UI "external" @@ -204,7 +205,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) } } - _external_ui_ptr = NULL; + _external_ui_ptr = 0; if (_inst) { if (!is_external_ui) { GtkWidget* c_widget = (GtkWidget*)suil_instance_get_widget(_inst); @@ -242,12 +243,10 @@ LV2PluginUI::lv2ui_free() suil_instance_free((SuilInstance*)_inst); - _inst = NULL; - _gui_widget = NULL; + _inst = 0; + _gui_widget = 0; } - - LV2PluginUI::~LV2PluginUI () { //cout << "LV2PluginUI destructor called" << endl; @@ -262,8 +261,8 @@ LV2PluginUI::~LV2PluginUI () _screen_update_connection.disconnect(); if (_lv2->is_external_ui()) { - /*external UI is no longer valid - on_window_hide() will not try to use it if is NULL*/ - _external_ui_ptr = NULL; + /*external UI is no longer valid - on_window_hide() will not try to use it if is 0*/ + _external_ui_ptr = 0; } } @@ -343,7 +342,7 @@ LV2PluginUI::on_window_hide() if (_external_ui_ptr) { LV2_EXTERNAL_UI_HIDE(_external_ui_ptr); //suil_instance_get_descriptor(_inst)->cleanup(_inst); - //_external_ui_ptr = NULL; + //_external_ui_ptr = 0; //_screen_update_connection.disconnect(); } } -- cgit v1.2.3