Fix crash when X11 is not available for VST UIs
[ardour.git] / gtk2_ardour / rc_option_editor.h
1 /*
2  * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2012-2017 Robin Gareus <robin@gareus.org>
4  * Copyright (C) 2012-2018 Paul Davis <paul@linuxaudiosystems.com>
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 __gtk_ardour_rc_option_editor_h__
22 #define __gtk_ardour_rc_option_editor_h__
23
24 #include "widgets/tabbable.h"
25
26 #include "option_editor.h"
27 #include "visibility_group.h"
28 #include "transport_masters_dialog.h"
29
30 /** @file rc_option_editor.h
31  *  @brief Editing of options which are obtained from and written back to one of the .rc files.
32  *
33  *  This is subclassed from OptionEditor.  Simple options (e.g. boolean and simple choices)
34  *  are expressed using subclasses of Option.  More complex UI elements are represented
35  *  using individual classes subclassed from OptionEditorBox.
36  */
37
38 /** Editor for options which are obtained from and written back to one of the .rc files. */
39 class RCOptionEditor : public OptionEditorContainer, public ARDOUR::SessionHandlePtr, public ArdourWidgets::Tabbable
40 {
41 public:
42         RCOptionEditor ();
43
44         void set_session (ARDOUR::Session*);
45
46         Gtk::Window* use_own_window (bool and_fill_it);
47         XMLNode& get_state ();
48
49 private:
50         void parameter_changed (std::string const &);
51         void ltc_generator_volume_changed ();
52         ARDOUR::RCConfiguration* _rc_config;
53         BoolOption* _solo_control_is_listen_control;
54         ComboOption<ARDOUR::ListenPosition>* _listen_position;
55         VisibilityGroup _mixer_strip_visibility;
56         BoolOption* _sync_framerate;
57         ComboStringOption* _ltc_port;
58         HSliderOption* _ltc_volume_slider;
59         Gtk::Adjustment* _ltc_volume_adjustment;
60         BoolOption* _ltc_send_continuously;
61         BoolOption* _plugin_prefer_inline;
62         TransportMastersWidget _transport_masters_widget;
63
64         PBD::ScopedConnection parameter_change_connection;
65         PBD::ScopedConnection engine_started_connection;
66
67         /* plugin actions */
68         void plugin_scan_refresh ();
69         void clear_vst_cache ();
70         void clear_vst_blacklist ();
71         void clear_au_cache ();
72         void clear_au_blacklist ();
73         void edit_lxvst_path ();
74         void edit_vst_path ();
75 };
76
77 #endif /* __gtk_ardour_rc_option_editor_h__ */