2 Copyright (C) 2010 Paul Davis
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
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk2_ardour_engine_dialog_h__
21 #define __gtk2_ardour_engine_dialog_h__
27 #include <gtkmm/checkbutton.h>
28 #include <gtkmm/spinbutton.h>
29 #include <gtkmm/comboboxtext.h>
30 #include <gtkmm/table.h>
31 #include <gtkmm/expander.h>
32 #include <gtkmm/box.h>
33 #include <gtkmm/buttonbox.h>
34 #include <gtkmm/button.h>
36 class EngineControl : public Gtk::VBox {
41 static bool need_setup ();
42 int setup_engine (bool start);
44 bool was_used() const { return _used; }
45 XMLNode& get_state ();
46 void set_state (const XMLNode&);
49 Gtk::Notebook notebook;
51 /* core fields used by all backends */
53 Gtk::ComboBoxText backend_combo;
54 Gtk::ComboBoxText input_device_combo;
55 Gtk::ComboBoxText output_device_combo;
56 Gtk::ComboBoxText sample_rate_combo;
57 Gtk::ComboBoxText buffer_size_combo;
58 Gtk::Adjustment input_latency_adjustment;
59 Gtk::SpinButton input_latency;
60 Gtk::Adjustment output_latency_adjustment;
61 Gtk::SpinButton output_latency;
62 Gtk::Adjustment input_channels_adjustment;
63 Gtk::SpinButton input_channels;
64 Gtk::Adjustment output_channels_adjustment;
65 Gtk::SpinButton output_channels;
66 Gtk::Adjustment ports_adjustment;
67 Gtk::SpinButton ports_spinner;
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;
82 Gtk::ComboBoxText preset_combo;
83 Gtk::ComboBoxText serverpath_combo;
84 Gtk::ComboBoxText driver_combo;
85 Gtk::ComboBoxText device_combo;
86 Gtk::ComboBoxText timeout_combo;
87 Gtk::ComboBoxText dither_mode_combo;
88 Gtk::ComboBoxText audio_mode_combo;
89 Gtk::ComboBoxText midi_driver_combo;
91 Gtk::Table basic_packer;
92 Gtk::Table midi_packer;
96 sigc::connection sr_connection;
97 sigc::connection bs_connection;
101 static bool engine_running ();
103 void driver_changed ();
104 void backend_changed ();
105 void sample_rate_changed ();
106 void buffer_size_changed ();
108 uint32_t get_rate() const;
109 uint32_t get_buffer_size() const;
110 uint32_t get_input_channels() const;
111 uint32_t get_output_channels() const;
112 uint32_t get_input_latency() const;
113 uint32_t get_output_latency() const;
114 std::string get_device_name() const;
115 std::string get_driver() const;
117 void audio_mode_changed ();
118 void device_changed ();
119 void list_devices ();
120 void reshow_buffer_sizes (bool choice_changed);
126 std::string sample_rate;
127 std::string buffer_size;
128 std::string input_latency;
129 std::string output_latency;
130 std::string input_channels;
131 std::string output_channels;
134 State() : active (false) {};
137 typedef std::list<State> StateList;
141 State* get_matching_state (const std::string& backend,
142 const std::string& driver,
143 const std::string& device);
144 State* get_current_state ();
145 void maybe_set_state ();
149 #endif /* __gtk2_ardour_engine_dialog_h__ */