1 /*
2  * Copyright (C) 2020 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_vst3_plugin_ui_h__
20 #define __ardour_vst3_plugin_ui_h__
21 
22 #ifdef VST3_SUPPORT
23 
24 #include "plugin_ui.h"
25 
26 namespace ARDOUR {
27 	class PluginInsert;
28 	class VST3Plugin;
29 }
30 
31 class VST3PluginUI : public PlugUIBase, public Gtk::VBox
32 {
33 public:
34 	VST3PluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VST3Plugin>);
35 	virtual ~VST3PluginUI ();
36 
37 	gint get_preferred_height ();
38 	gint get_preferred_width ();
39 	bool resizable ();
40 	void forward_key_event (GdkEventKey*);
41 	bool non_gtk_gui() const;
42 
43 	int  package (Gtk::Window&);
44 	bool start_updating (GdkEventAny*);
45 	bool stop_updating (GdkEventAny*);
46 
47 protected:
48 	virtual void resize_callback (int, int) = 0;
49 
50   bool forward_scroll_event (GdkEventScroll*);
51 
52 	boost::shared_ptr<ARDOUR::PluginInsert> _pi;
53 	boost::shared_ptr<ARDOUR::VST3Plugin>   _vst3;
54 
55 	Gtk::HBox _ardour_buttons_box;
56 
57 	int _req_width;
58 	int _req_height;
59 
60 	bool _resize_in_progress;
61 	bool _view_realized;
62 
63 private:
64 	void parameter_update ();
65 
66 	PBD::ScopedConnection _resize_connection;
67 	sigc::connection      _update_connection;
68 };
69 
70 #endif // VST3_SUPPORT
71 #endif
72