start work on the changes to EngineControl (dialog) to integrate with new backend...
[ardour.git] / gtk2_ardour / engine_dialog.h
1 /*
2     Copyright (C) 2010 Paul Davis
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __gtk2_ardour_engine_dialog_h__
21 #define __gtk2_ardour_engine_dialog_h__
22
23 #include <map>
24 #include <vector>
25 #include <string>
26
27 #include <gtkmm/checkbutton.h>
28 #include <gtkmm/spinbutton.h>
29 #include <gtkmm/notebook.h>
30 #include <gtkmm/comboboxtext.h>
31 #include <gtkmm/table.h>
32 #include <gtkmm/expander.h>
33 #include <gtkmm/box.h>
34 #include <gtkmm/buttonbox.h>
35 #include <gtkmm/button.h>
36
37 class EngineControl : public Gtk::VBox {
38   public:
39         EngineControl ();
40         ~EngineControl ();
41
42         static bool need_setup ();
43         int setup_engine ();
44
45         bool was_used() const { return _used; }
46         XMLNode& get_state ();
47         void set_state (const XMLNode&);
48
49   private:
50     /* core fields used by all backends */
51
52     Gtk::ComboBoxText backend_combo;
53     Gtk::ComboBoxText input_device_combo;
54     Gtk::ComboBoxText output_device_combo;
55     Gtk::ComboBoxText sample_rate_combo;
56     Gtk::ComboBoxText buffer_size_combo;
57     Gtk::Adjustment input_latency_adjustment;
58     Gtk::SpinButton input_latency;
59     Gtk::Adjustment output_latency_adjustment;
60     Gtk::SpinButton output_latency;
61     Gtk::Adjustment input_channels_adjustment;
62     Gtk::SpinButton input_channels;
63     Gtk::Adjustment output_channels_adjustment;
64     Gtk::SpinButton output_channels;
65     Gtk::Adjustment ports_adjustment;
66     Gtk::SpinButton ports_spinner;
67     Gtk::Label latency_label;
68
69     /* JACK specific */
70     
71     Gtk::CheckButton realtime_button;
72     Gtk::CheckButton no_memory_lock_button;
73     Gtk::CheckButton unlock_memory_button;
74     Gtk::CheckButton soft_mode_button;
75     Gtk::CheckButton monitor_button;
76     Gtk::CheckButton force16bit_button;
77     Gtk::CheckButton hw_monitor_button;
78     Gtk::CheckButton hw_meter_button;
79     Gtk::CheckButton verbose_output_button;
80     
81     
82     Gtk::ComboBoxText preset_combo;
83     Gtk::ComboBoxText serverpath_combo;
84     Gtk::ComboBoxText driver_combo;
85     Gtk::ComboBoxText interface_combo;
86     Gtk::ComboBoxText timeout_combo;
87     Gtk::ComboBoxText dither_mode_combo;
88     Gtk::ComboBoxText audio_mode_combo;
89     Gtk::ComboBoxText midi_driver_combo;
90     
91     Gtk::Table basic_packer;
92     Gtk::Table options_packer;
93     Gtk::Table device_packer;
94     Gtk::HBox basic_hbox;
95     Gtk::HBox options_hbox;
96     Gtk::HBox device_hbox;
97     Gtk::Notebook notebook;
98     
99     bool _used;
100     
101     static bool engine_running ();
102     
103     void driver_changed ();
104     void backend_changed ();
105
106     void redisplay_latency ();
107     uint32_t get_rate();
108     void audio_mode_changed ();
109     void interface_changed ();
110     void list_devices ();
111 };
112
113 #endif /* __gtk2_ardour_engine_dialog_h__ */