Fix crash when X11 is not available for VST UIs
[ardour.git] / gtk2_ardour / video_server_dialog.h
1 /*
2  * Copyright (C) 2013-2017 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 #ifndef __gtk_ardour_video_server_dialog_h__
19 #define __gtk_ardour_video_server_dialog_h__
20
21 #include <string>
22
23 #include <gtkmm/adjustment.h>
24 #include <gtkmm/button.h>
25 #include <gtkmm/checkbutton.h>
26 #include <gtkmm/comboboxtext.h>
27 #include <gtkmm/entry.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/spinbutton.h>
30
31 #include "ardour/types.h"
32 #include "ardour/template_utils.h"
33 #include "ardour_dialog.h"
34
35 /** @class VideoServerDialog
36  *  @brief dialog box to collect video-server settings
37  */
38 class VideoServerDialog : public ArdourDialog
39 {
40 public:
41         VideoServerDialog (ARDOUR::Session*);
42         ~VideoServerDialog ();
43
44         std::string get_exec_path () { return path_entry.get_text(); }
45         std::string get_docroot ();
46         std::string get_listenaddr () { return listenaddr_combo.get_active_text();}
47         int get_listenport () { return listenport_spinner.get_value_as_int();}
48         int get_cachesize () { return cachesize_spinner.get_value_as_int();}
49         bool show_again () { return showagain_checkbox.get_active();}
50
51 private:
52         void on_show ();
53         void open_path_dialog ();
54         void open_docroot_dialog ();
55
56         Gtk::Label        path_label;
57         Gtk::Entry        path_entry;
58         Gtk::Button       path_browse_button;
59
60         Gtk::Label        docroot_label;
61         Gtk::Entry        docroot_entry;
62         Gtk::Button       docroot_browse_button;
63
64         Gtk::ComboBoxText listenaddr_combo;
65         Gtk::Adjustment   listenport_adjustment;
66         Gtk::SpinButton   listenport_spinner;
67         Gtk::Adjustment   cachesize_adjustment;
68         Gtk::SpinButton   cachesize_spinner;
69         Gtk::CheckButton  showagain_checkbox;
70 };
71
72 #endif /* __gtk_ardour_video_server_dialog_h__ */