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 #include "ardour_dialog.h"
38 class EngineControl : public ArdourDialog {
43 static bool need_setup ();
44 int setup_engine (bool start);
46 XMLNode& get_state ();
47 void set_state (const XMLNode&);
50 Gtk::Notebook notebook;
52 /* core fields used by all backends */
54 Gtk::ComboBoxText backend_combo;
55 Gtk::ComboBoxText input_device_combo;
56 Gtk::ComboBoxText output_device_combo;
57 Gtk::ComboBoxText sample_rate_combo;
58 Gtk::ComboBoxText buffer_size_combo;
59 Gtk::Label buffer_size_duration_label;
60 Gtk::Adjustment input_latency_adjustment;
61 Gtk::SpinButton input_latency;
62 Gtk::Adjustment output_latency_adjustment;
63 Gtk::SpinButton output_latency;
64 Gtk::Adjustment input_channels_adjustment;
65 Gtk::SpinButton input_channels;
66 Gtk::Adjustment output_channels_adjustment;
67 Gtk::SpinButton output_channels;
68 Gtk::Adjustment ports_adjustment;
69 Gtk::SpinButton ports_spinner;
71 Gtk::Button control_app_button;
75 Gtk::CheckButton realtime_button;
76 Gtk::CheckButton no_memory_lock_button;
77 Gtk::CheckButton unlock_memory_button;
78 Gtk::CheckButton soft_mode_button;
79 Gtk::CheckButton monitor_button;
80 Gtk::CheckButton force16bit_button;
81 Gtk::CheckButton hw_monitor_button;
82 Gtk::CheckButton hw_meter_button;
83 Gtk::CheckButton verbose_output_button;
85 Gtk::ComboBoxText preset_combo;
86 Gtk::ComboBoxText serverpath_combo;
87 Gtk::ComboBoxText driver_combo;
88 Gtk::ComboBoxText device_combo;
89 Gtk::ComboBoxText timeout_combo;
90 Gtk::ComboBoxText dither_mode_combo;
91 Gtk::ComboBoxText audio_mode_combo;
92 Gtk::ComboBoxText midi_driver_combo;
94 Gtk::Table basic_packer;
95 Gtk::Table midi_packer;
100 sigc::connection sr_connection;
101 sigc::connection bs_connection;
103 static bool engine_running ();
105 void driver_changed ();
106 void backend_changed ();
107 void sample_rate_changed ();
108 void buffer_size_changed ();
110 uint32_t get_rate() const;
111 uint32_t get_buffer_size() const;
112 uint32_t get_input_channels() const;
113 uint32_t get_output_channels() const;
114 uint32_t get_input_latency() const;
115 uint32_t get_output_latency() const;
116 std::string get_device_name() const;
117 std::string get_driver() const;
119 void audio_mode_changed ();
120 void device_changed ();
121 void list_devices ();
122 void show_buffer_duration ();
128 std::string sample_rate;
129 std::string buffer_size;
130 uint32_t input_latency;
131 uint32_t output_latency;
132 uint32_t input_channels;
133 uint32_t output_channels;
136 State() : active (false) {};
139 typedef std::list<State> StateList;
143 State* get_matching_state (const std::string& backend,
144 const std::string& driver,
145 const std::string& device);
146 State* get_current_state ();
147 void maybe_set_state ();
150 static bool print_channel_count (Gtk::SpinButton*);
152 void build_notebook ();
154 void on_response (int);
155 void control_app_button_clicked ();
156 void manage_control_app_sensitivity ();
159 #endif /* __gtk2_ardour_engine_dialog_h__ */