Fix crash when X11 is not available for VST UIs
[ardour.git] / gtk2_ardour / return_ui.h
1 /*
2  * Copyright (C) 2009-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2009 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef __ardour_gtk_return_ui_h__
22 #define __ardour_gtk_return_ui_h__
23
24 #include "gain_meter.h"
25 #include "panner_ui.h"
26 #include "ardour_window.h"
27
28 namespace ARDOUR {
29         class Return;
30         class IOProcessor;
31 }
32
33 class IOSelector;
34
35 class ReturnUI : public Gtk::HBox
36 {
37 public:
38         ReturnUI (Gtk::Window *,boost::shared_ptr<ARDOUR::Return>, ARDOUR::Session*);
39         ~ReturnUI();
40
41         void update ();
42         void fast_update ();
43
44         IOSelector* io;
45
46         boost::shared_ptr<ARDOUR::Return>& retrn() { return _return; }
47
48 private:
49         boost::shared_ptr<ARDOUR::Return> _return;
50         GainMeter                         _gpm;
51         Gtk::VBox                         _vbox;
52         Gtk::VBox                         _hbox;
53
54         sigc::connection screen_update_connection;
55         sigc::connection fast_screen_update_connection;
56         PBD::ScopedConnection input_change_connection;
57
58         void ins_changed (ARDOUR::IOChange, void*);
59 };
60
61 class ReturnUIWindow : public ArdourWindow
62 {
63   public:
64         ReturnUIWindow(boost::shared_ptr<ARDOUR::Return>, ARDOUR::Session*);
65         ~ReturnUIWindow();
66
67         ReturnUI* ui;
68
69   private:
70         Gtk::HBox hpacker;
71
72         PBD::ScopedConnection going_away_connection;
73 };
74
75 #endif /* __ardour_gtk_return_ui_h__ */
76