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
This commit is contained in:
parent
80d8dfcefa
commit
ba41591ef1
|
@ -69,8 +69,7 @@ ControlPoint::ControlPoint (AutomationLine& al)
|
||||||
item = new Canvas::SimpleRect (line.canvas_group());
|
item = new Canvas::SimpleRect (line.canvas_group());
|
||||||
item->property_draw() = true;
|
item->property_draw() = true;
|
||||||
item->property_fill() = false;
|
item->property_fill() = false;
|
||||||
item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointFill.get();
|
item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
|
||||||
item->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get();
|
|
||||||
item->property_outline_pixels() = 1;
|
item->property_outline_pixels() = 1;
|
||||||
item->set_data ("control_point", this);
|
item->set_data ("control_point", this);
|
||||||
item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler));
|
item->signal_event().connect (mem_fun (this, &ControlPoint::event_handler));
|
||||||
|
|
|
@ -35,7 +35,7 @@ using namespace PBD;
|
||||||
|
|
||||||
#define NS_UI "http://lv2plug.in/ns/extensions/ui#"
|
#define NS_UI "http://lv2plug.in/ns/extensions/ui#"
|
||||||
|
|
||||||
static SuilHost* ui_host = NULL;
|
static SuilHost* ui_host = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
LV2PluginUI::lv2_ui_write(LV2UI_Controller controller,
|
LV2PluginUI::lv2_ui_write(LV2UI_Controller controller,
|
||||||
|
@ -60,7 +60,7 @@ void LV2PluginUI::on_external_ui_closed(LV2UI_Controller controller)
|
||||||
{
|
{
|
||||||
LV2PluginUI* me = (LV2PluginUI*)controller;
|
LV2PluginUI* me = (LV2PluginUI*)controller;
|
||||||
me->_screen_update_connection.disconnect();
|
me->_screen_update_connection.disconnect();
|
||||||
me->_external_ui_ptr = NULL;
|
me->_external_ui_ptr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -131,9 +131,10 @@ LV2PluginUI::LV2PluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<
|
||||||
: PlugUIBase (pi)
|
: PlugUIBase (pi)
|
||||||
, _lv2(lv2p)
|
, _lv2(lv2p)
|
||||||
, _current_ui_thread (0)
|
, _current_ui_thread (0)
|
||||||
, _inst(NULL)
|
, _inst (0)
|
||||||
, _values(NULL)
|
, _values (0)
|
||||||
, _external_ui_ptr(NULL)
|
, _gui_widget (0)
|
||||||
|
, _external_ui_ptr (0)
|
||||||
{
|
{
|
||||||
if (!_lv2->is_external_ui()) {
|
if (!_lv2->is_external_ui()) {
|
||||||
lv2ui_instantiate("gtk2gui");
|
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 = (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;
|
features_dst[--features_count] = &_external_ui_feature;
|
||||||
while (features_count--) {
|
while (features_count--) {
|
||||||
*features++ = *features_src++;
|
*features++ = *features_src++;
|
||||||
|
@ -175,7 +176,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ui_host) {
|
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)
|
const char* container_type = (is_external_ui)
|
||||||
? NS_UI "external"
|
? 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 (_inst) {
|
||||||
if (!is_external_ui) {
|
if (!is_external_ui) {
|
||||||
GtkWidget* c_widget = (GtkWidget*)suil_instance_get_widget(_inst);
|
GtkWidget* c_widget = (GtkWidget*)suil_instance_get_widget(_inst);
|
||||||
|
@ -242,12 +243,10 @@ LV2PluginUI::lv2ui_free()
|
||||||
|
|
||||||
suil_instance_free((SuilInstance*)_inst);
|
suil_instance_free((SuilInstance*)_inst);
|
||||||
|
|
||||||
_inst = NULL;
|
_inst = 0;
|
||||||
_gui_widget = NULL;
|
_gui_widget = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LV2PluginUI::~LV2PluginUI ()
|
LV2PluginUI::~LV2PluginUI ()
|
||||||
{
|
{
|
||||||
//cout << "LV2PluginUI destructor called" << endl;
|
//cout << "LV2PluginUI destructor called" << endl;
|
||||||
|
@ -262,8 +261,8 @@ LV2PluginUI::~LV2PluginUI ()
|
||||||
_screen_update_connection.disconnect();
|
_screen_update_connection.disconnect();
|
||||||
|
|
||||||
if (_lv2->is_external_ui()) {
|
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 is no longer valid - on_window_hide() will not try to use it if is 0*/
|
||||||
_external_ui_ptr = NULL;
|
_external_ui_ptr = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +342,7 @@ LV2PluginUI::on_window_hide()
|
||||||
if (_external_ui_ptr) {
|
if (_external_ui_ptr) {
|
||||||
LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
|
LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
|
||||||
//suil_instance_get_descriptor(_inst)->cleanup(_inst);
|
//suil_instance_get_descriptor(_inst)->cleanup(_inst);
|
||||||
//_external_ui_ptr = NULL;
|
//_external_ui_ptr = 0;
|
||||||
//_screen_update_connection.disconnect();
|
//_screen_update_connection.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue