2 * Copyright (C) 2017 Johannes Mueller <github@johannes-mueller.org>
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 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.
19 #ifndef __ardour_plugin_display__
20 #define __ardour_plugin_display__
22 #include <gtkmm/drawingarea.h>
24 #include "ardour/plugin.h"
26 class PluginDisplay : public Gtk::DrawingArea
29 PluginDisplay(boost::shared_ptr<ARDOUR::Plugin>, uint32_t max_height = 80);
30 virtual ~PluginDisplay();
33 bool on_expose_event (GdkEventExpose *);
34 void on_size_request (Gtk::Requisition* req);
35 bool on_button_press_event (GdkEventButton *ev);
36 bool on_button_release_event (GdkEventButton *ev);
38 void plugin_going_away () {
39 _qdraw_connection.disconnect ();
42 virtual void update_height_alloc (uint32_t inline_height);
43 virtual uint32_t render_inline (cairo_t *, uint32_t width);
45 virtual void display_frame (cairo_t* cr, double w, double h);
47 boost::shared_ptr<ARDOUR::Plugin> _plug;
48 PBD::ScopedConnection _qdraw_connection;
49 PBD::ScopedConnection _death_connection;
50 cairo_surface_t* _surf;