ardour/gtk2_ardour/vst3_plugin_ui.h
Robin Gareus 7e2bb01ff1
VST3: ignore GUI size allocations before realizing the view
This fixes crashes with some VST3s when calling `onSize()` before
attaching thew view (e.g. Reason Rack Plug on macOS).
2020-11-19 23:12:52 +01:00

72 lines
1.8 KiB
C++

/*
* Copyright (C) 2020 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __ardour_vst3_plugin_ui_h__
#define __ardour_vst3_plugin_ui_h__
#ifdef VST3_SUPPORT
#include "plugin_ui.h"
namespace ARDOUR {
class PluginInsert;
class VST3Plugin;
}
class VST3PluginUI : public PlugUIBase, public Gtk::VBox
{
public:
VST3PluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VST3Plugin>);
virtual ~VST3PluginUI ();
gint get_preferred_height ();
gint get_preferred_width ();
bool resizable ();
void forward_key_event (GdkEventKey*);
bool non_gtk_gui() const;
int package (Gtk::Window&);
bool start_updating (GdkEventAny*);
bool stop_updating (GdkEventAny*);
protected:
virtual void resize_callback (int, int) = 0;
bool forward_scroll_event (GdkEventScroll*);
boost::shared_ptr<ARDOUR::PluginInsert> _pi;
boost::shared_ptr<ARDOUR::VST3Plugin> _vst3;
Gtk::HBox _ardour_buttons_box;
int _req_width;
int _req_height;
bool _resize_in_progress;
bool _view_realized;
private:
void parameter_update ();
PBD::ScopedConnection _resize_connection;
sigc::connection _update_connection;
};
#endif // VST3_SUPPORT
#endif