2 Copyright (C) 2001 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.
21 #ifndef __gtk_ardour_option_editor_h__
22 #define __gtk_ardour_option_editor_h__
24 #include <gtkmm/notebook.h>
25 #include <gtkmm/checkbutton.h>
26 #include <gtkmm/table.h>
27 #include <gtkmm/entry.h>
28 #include <gtkmm/box.h>
29 #include <gtkmm/label.h>
30 #include <gtkmm/adjustment.h>
31 #include <gtkmm/scale.h>
32 #include <gtkmm/spinbutton.h>
33 #include <gtkmm/radiobutton.h>
34 #include <gtkmm/comboboxtext.h>
36 #include <ardour/session.h>
38 #include "ardour_dialog.h"
40 #include "audio_clock.h"
49 class OptionEditor : public Gtk::Dialog
52 OptionEditor (ARDOUR_UI&, PublicEditor&, Mixer_UI&);
55 void set_session (ARDOUR::Session *);
59 ARDOUR::Session *session;
64 Gtk::Notebook notebook;
68 void session_control_changed (ARDOUR::Session::ControlType);
69 void queue_session_control_changed (ARDOUR::Session::ControlType);
70 void map_some_session_state (Gtk::CheckButton& button, bool (ARDOUR::Session::*get)() const);
71 gint wm_close (GdkEventAny *);
72 void just_close_win();
73 bool focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
77 Gtk::Table path_table;
79 Gtk::Entry session_raid_entry;
81 Gtk::ComboBoxText native_format_combo;
83 Glib::RefPtr<Gtk::ListStore> sfdb_paths;
84 Gtk::TreeView sfdb_path_view;
86 struct SoundFilePathColumns : public Gtk::TreeModel::ColumnRecord
89 Gtk::TreeModelColumn<std::string> paths;
91 SoundFilePathColumns() { add (paths); }
93 SoundFilePathColumns sfdb_path_columns;
95 void setup_path_options();
96 void add_session_paths ();
97 void remove_session_paths ();
98 void native_format_chosen ();
99 void raid_path_changed ();
103 // Gtk::Table fade_table;
105 Gtk::VBox fade_packer;
106 Gtk::CheckButton auto_xfade_button;
107 Gtk::CheckButton xfade_active_button;
108 Gtk::Label layer_mode_label;
109 Gtk::ComboBoxText layer_mode_combo;
110 Gtk::Label xfade_model_label;
111 Gtk::ComboBoxText xfade_model_combo;
112 Gtk::Adjustment short_xfade_adjustment;
113 Gtk::HScale short_xfade_slider;
115 void auto_xfade_clicked ();
116 void xfade_active_clicked ();
117 void layer_mode_chosen ();
118 void xfade_model_chosen ();
119 void setup_fade_options();
120 void short_xfade_adjustment_changed ();
124 Gtk::VBox solo_packer;
125 Gtk::CheckButton solo_latched_button;
126 Gtk::CheckButton solo_via_bus_button;
128 void solo_latched_clicked();
129 void solo_via_bus_clicked ();
131 void setup_solo_options();
135 Gtk::VBox display_packer;
136 Gtk::CheckButton show_waveforms_button;
137 Gtk::CheckButton show_waveforms_recording_button;
138 Gtk::CheckButton mixer_strip_width_button;
139 Gtk::CheckButton show_measures_button;
140 Gtk::CheckButton follow_playhead_button;
141 Gtk::ComboBoxText meter_hold_combo;
142 Gtk::ComboBoxText meter_falloff_combo;
144 void setup_display_options();
145 void show_waveforms_clicked ();
146 void show_waveforms_recording_clicked ();
147 void show_measures_clicked ();
148 void strip_width_clicked ();
149 void follow_playhead_clicked ();
150 void meter_hold_chosen ();
151 void meter_falloff_chosen ();
153 void display_control_changed (Editing::DisplayControl);
157 Gtk::VBox sync_packer;
159 Gtk::CheckButton send_mtc_button;
160 Gtk::CheckButton send_mmc_button;
161 Gtk::CheckButton jack_time_master_button;
162 Gtk::ComboBoxText slave_type_combo;
163 Gtk::ComboBoxText smpte_fps_combo;
164 AudioClock smpte_offset_clock;
165 Gtk::CheckButton smpte_offset_negative_button;
167 void setup_sync_options ();
168 gint send_mtc_toggled (GdkEventButton*, Gtk::CheckButton*);
170 void slave_type_chosen ();
171 void jack_time_master_clicked ();
172 void jack_transport_master_clicked ();
173 void smpte_fps_chosen ();
174 void smpte_offset_chosen ();
175 void smpte_offset_negative_clicked ();
179 Gtk::VBox midi_packer;
180 Gtk::CheckButton midi_feedback_button;
181 Gtk::CheckButton midi_control_button;
182 Gtk::CheckButton mmc_control_button;
184 Gtk::RadioButton::Group mtc_button_group;
185 Gtk::RadioButton::Group mmc_button_group;
186 Gtk::RadioButton::Group midi_button_group;
188 void send_mmc_toggled (Gtk::CheckButton*);
189 void mmc_control_toggled (Gtk::CheckButton*);
190 void midi_control_toggled (Gtk::CheckButton*);
191 void midi_feedback_toggled (Gtk::CheckButton*);
193 gint port_online_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
194 gint port_trace_in_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
195 gint port_trace_out_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
197 gint mmc_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
198 gint mtc_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
199 gint midi_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
201 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
203 void setup_midi_options();
211 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
215 IOSelector* click_io_selector;
216 GainMeter* click_gpm;
217 PannerUI* click_panner;
218 Gtk::VBox click_packer;
219 Gtk::Table click_table;
220 Gtk::Entry click_path_entry;
221 Gtk::Entry click_emphasis_path_entry;
222 Gtk::Button click_browse_button;
223 Gtk::Button click_emphasis_browse_button;
225 void setup_click_editor ();
226 void clear_click_editor ();
228 void click_chosen (const string & paths);
229 void click_emphasis_chosen (const string & paths);
231 void click_browse_clicked ();
232 void click_emphasis_browse_clicked ();
234 void click_sound_changed ();
235 void click_emphasis_sound_changed ();
239 Gtk::VBox audition_packer;
240 Gtk::HBox audition_hpacker;
241 Gtk::Label audition_label;
242 IOSelector* auditioner_io_selector;
243 GainMeter* auditioner_gpm;
244 PannerUI* auditioner_panner;
246 void setup_auditioner_editor ();
247 void clear_auditioner_editor ();
248 void connect_audition_editor ();
252 Gtk::Table keyboard_mouse_table;
253 Gtk::ComboBoxText edit_modifier_combo;
254 Gtk::ComboBoxText delete_modifier_combo;
255 Gtk::ComboBoxText snap_modifier_combo;
256 Gtk::Adjustment delete_button_adjustment;
257 Gtk::SpinButton delete_button_spin;
258 Gtk::Adjustment edit_button_adjustment;
259 Gtk::SpinButton edit_button_spin;
261 void setup_keyboard_options ();
262 void delete_modifier_chosen ();
263 void edit_modifier_chosen ();
264 void snap_modifier_chosen ();
265 void edit_button_changed ();
266 void delete_button_changed ();
270 Gtk::VBox misc_packer;
272 Gtk::CheckButton auto_connect_inputs_button;
274 Gtk::RadioButton auto_connect_output_physical_button;
275 Gtk::RadioButton auto_connect_output_master_button;
276 Gtk::RadioButton auto_connect_output_manual_button;
277 Gtk::RadioButton::Group auto_connect_output_button_group;
279 Gtk::CheckButton hw_monitor_button;
280 Gtk::CheckButton sw_monitor_button;
281 Gtk::CheckButton plugins_stop_button;
282 Gtk::CheckButton plugins_on_rec_button;
283 Gtk::CheckButton verify_remove_last_capture_button;
284 Gtk::CheckButton stop_rec_on_xrun_button;
285 Gtk::CheckButton stop_at_end_button;
286 Gtk::CheckButton debug_keyboard_button;
287 Gtk::CheckButton speed_quieten_button;
289 void setup_misc_options ();
290 void plugins_stop_with_transport_clicked ();
291 void verify_remove_last_capture_clicked ();
292 void plugins_on_while_recording_clicked ();
293 void auto_connect_inputs_clicked ();
294 void auto_connect_output_physical_clicked ();
295 void auto_connect_output_master_clicked ();
296 void auto_connect_output_manual_clicked ();
297 void hw_monitor_clicked ();
298 void sw_monitor_clicked ();
299 void stop_rec_on_xrun_clicked ();
300 void stop_at_end_clicked ();
301 void debug_keyboard_clicked ();
302 void speed_quieten_clicked ();
304 void fixup_combo_size (Gtk::ComboBoxText&, std::vector<std::string>& strings);
307 #endif /* __gtk_ardour_option_editor_h__ */