2 Copyright (C) 2017 Paul Davis
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.
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.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_plugin_display__
21 #define __ardour_plugin_display__
23 #include <gtkmm/drawingarea.h>
25 #include "ardour/plugin.h"
27 class PluginDisplay : public Gtk::DrawingArea
30 PluginDisplay(boost::shared_ptr<ARDOUR::Plugin>, uint32_t max_height = 80);
31 virtual ~PluginDisplay();
34 bool on_expose_event (GdkEventExpose *);
35 void on_size_request (Gtk::Requisition* req);
36 bool on_button_press_event (GdkEventButton *ev);
37 bool on_button_release_event (GdkEventButton *ev);
39 void plugin_going_away () {
40 _qdraw_connection.disconnect ();
43 virtual void update_height_alloc (uint32_t inline_height);
44 virtual uint32_t render_inline (cairo_t *, uint32_t width);
46 virtual void display_frame (cairo_t* cr, double w, double h);
48 boost::shared_ptr<ARDOUR::Plugin> _plug;
49 PBD::ScopedConnection _qdraw_connection;
50 PBD::ScopedConnection _death_connection;
51 cairo_surface_t* _surf;