1 #ifndef __gtk_ardour_option_editor_h__
2 #define __gtk_ardour_option_editor_h__
5 Copyright (C) 2001 Paul Davis
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <gtkmm/notebook.h>
26 #include <gtkmm/checkbutton.h>
27 #include <gtkmm/table.h>
28 #include <gtkmm/entry.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/adjustment.h>
32 #include <gtkmm/scale.h>
33 #include <gtkmm/spinbutton.h>
34 #include <gtkmm/radiobutton.h>
35 #include <gtkmm/comboboxtext.h>
37 #include <ardour/session.h>
39 #include "ardour_dialog.h"
41 #include "audio_clock.h"
50 class OptionEditor : public ArdourDialog
53 OptionEditor (ARDOUR_UI&, PublicEditor&, Mixer_UI&);
56 void set_session (ARDOUR::Session *);
60 ARDOUR::Session *session;
65 Gtk::Notebook notebook;
69 gint wm_close (GdkEventAny *);
70 bool focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
71 void parameter_changed (const char* name);
75 Gtk::Table path_table;
76 Gtk::Entry session_raid_entry;
78 void setup_path_options();
79 void add_session_paths ();
80 void remove_session_paths ();
81 void raid_path_changed ();
85 Gtk::VBox misc_packer;
87 Gtk::Adjustment short_xfade_adjustment;
88 Gtk::HScale short_xfade_slider;
89 Gtk::Adjustment destructo_xfade_adjustment;
90 Gtk::HScale destructo_xfade_slider;
92 void setup_misc_options();
94 void short_xfade_adjustment_changed ();
95 void destructo_xfade_adjustment_changed ();
97 Gtk::Adjustment history_depth;
98 Gtk::Adjustment saved_history_depth;
99 Gtk::SpinButton history_depth_spinner;
100 Gtk::SpinButton saved_history_depth_spinner;
101 Gtk::CheckButton limit_history_button;
102 Gtk::CheckButton save_history_button;
104 void history_depth_changed();
105 void saved_history_depth_changed();
106 void save_history_toggled ();
107 void limit_history_toggled ();
111 Gtk::VBox sync_packer;
113 Gtk::ComboBoxText slave_type_combo;
114 AudioClock smpte_offset_clock;
115 Gtk::CheckButton smpte_offset_negative_button;
116 Gtk::CheckButton synced_timecode_button;
118 void setup_sync_options ();
120 void smpte_offset_chosen ();
121 void smpte_offset_negative_clicked ();
122 void synced_timecode_toggled ();
126 Gtk::VBox midi_packer;
128 Gtk::RadioButton::Group mtc_button_group;
129 Gtk::RadioButton::Group mmc_button_group;
130 Gtk::RadioButton::Group midi_button_group;
132 Gtk::Table midi_port_table;
133 std::vector<Gtk::Widget*> midi_port_table_widgets;
134 Gtk::Adjustment mmc_receive_device_id_adjustment;
135 Gtk::SpinButton mmc_receive_device_id_spinner;
136 Gtk::Adjustment mmc_send_device_id_adjustment;
137 Gtk::SpinButton mmc_send_device_id_spinner;
138 Gtk::Button add_midi_port_button;
140 void add_midi_port ();
141 void remove_midi_port (MIDI::Port*);
142 void redisplay_midi_ports ();
144 void port_online_toggled (MIDI::Port*,Gtk::ToggleButton*);
145 void port_trace_in_toggled (MIDI::Port*,Gtk::ToggleButton*);
146 void port_trace_out_toggled (MIDI::Port*,Gtk::ToggleButton*);
148 void mmc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
149 void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
150 void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
151 bool port_removable (MIDI::Port*);
153 void mmc_receive_device_id_adjusted ();
154 void mmc_send_device_id_adjusted ();
156 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
158 void setup_midi_options();
166 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
170 IOSelector* click_io_selector;
171 GainMeter* click_gpm;
172 PannerUI* click_panner;
173 Gtk::VBox click_packer;
174 Gtk::Table click_table;
175 Gtk::Entry click_path_entry;
176 Gtk::Entry click_emphasis_path_entry;
177 Gtk::Button click_browse_button;
178 Gtk::Button click_emphasis_browse_button;
180 void setup_click_editor ();
181 void clear_click_editor ();
183 void click_chosen (const string & paths);
184 void click_emphasis_chosen (const string & paths);
186 void click_browse_clicked ();
187 void click_emphasis_browse_clicked ();
189 void click_sound_changed ();
190 void click_emphasis_sound_changed ();
194 Gtk::VBox audition_packer;
195 Gtk::HBox audition_hpacker;
196 Gtk::Label audition_label;
197 IOSelector* auditioner_io_selector;
198 GainMeter* auditioner_gpm;
199 PannerUI* auditioner_panner;
201 void setup_auditioner_editor ();
202 void clear_auditioner_editor ();
203 void connect_audition_editor ();
207 Gtk::Table keyboard_mouse_table;
208 Gtk::ComboBoxText keyboard_layout_selector;
209 Gtk::ComboBoxText edit_modifier_combo;
210 Gtk::ComboBoxText delete_modifier_combo;
211 Gtk::ComboBoxText snap_modifier_combo;
212 Gtk::Adjustment delete_button_adjustment;
213 Gtk::SpinButton delete_button_spin;
214 Gtk::Adjustment edit_button_adjustment;
215 Gtk::SpinButton edit_button_spin;
217 std::map<std::string,std::string> bindings_files;
219 void setup_keyboard_options ();
220 void delete_modifier_chosen ();
221 void edit_modifier_chosen ();
222 void snap_modifier_chosen ();
223 void edit_button_changed ();
224 void delete_button_changed ();
225 void bindings_changed ();
227 void fixup_combo_size (Gtk::ComboBoxText&, std::vector<std::string>& strings);
230 #endif /* __gtk_ardour_option_editor_h__ */