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.
20 #ifndef __gtk_ardour_option_editor_h__
21 #define __gtk_ardour_option_editor_h__
23 #include <gtkmm/notebook.h>
24 #include <gtkmm/checkbutton.h>
25 #include <gtkmm/table.h>
26 #include <gtkmm/entry.h>
27 #include <gtkmm/box.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/adjustment.h>
30 #include <gtkmm/scale.h>
31 #include <gtkmm/spinbutton.h>
32 #include <gtkmm/radiobutton.h>
33 #include <gtkmm/comboboxtext.h>
35 #include <ardour/session.h>
37 #include "ardour_dialog.h"
39 #include "audio_clock.h"
48 class OptionEditor : public ArdourDialog
51 OptionEditor (ARDOUR_UI&, PublicEditor&, Mixer_UI&);
54 void set_session (ARDOUR::Session *);
58 ARDOUR::Session *session;
63 Gtk::Notebook notebook;
67 gint wm_close (GdkEventAny *);
68 bool focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
69 void parameter_changed (const char* name);
73 Gtk::Table path_table;
74 Gtk::Entry session_raid_entry;
76 void setup_path_options();
77 void add_session_paths ();
78 void remove_session_paths ();
79 void raid_path_changed ();
83 Gtk::VBox misc_packer;
85 Gtk::Adjustment short_xfade_adjustment;
86 Gtk::HScale short_xfade_slider;
87 Gtk::Adjustment destructo_xfade_adjustment;
88 Gtk::HScale destructo_xfade_slider;
90 void setup_misc_options();
92 void short_xfade_adjustment_changed ();
93 void destructo_xfade_adjustment_changed ();
95 Gtk::Adjustment history_depth;
96 Gtk::Adjustment saved_history_depth;
97 Gtk::SpinButton history_depth_spinner;
98 Gtk::SpinButton saved_history_depth_spinner;
99 Gtk::CheckButton limit_history_button;
100 Gtk::CheckButton save_history_button;
102 void history_depth_changed();
103 void saved_history_depth_changed();
104 void save_history_toggled ();
105 void limit_history_toggled ();
109 Gtk::VBox sync_packer;
111 Gtk::ComboBoxText slave_type_combo;
112 AudioClock smpte_offset_clock;
113 Gtk::CheckButton smpte_offset_negative_button;
114 Gtk::CheckButton synced_timecode_button;
116 void setup_sync_options ();
118 void smpte_offset_chosen ();
119 void smpte_offset_negative_clicked ();
120 void synced_timecode_toggled ();
124 Gtk::VBox midi_packer;
126 Gtk::RadioButton::Group mtc_button_group;
127 Gtk::RadioButton::Group mmc_button_group;
128 Gtk::RadioButton::Group midi_button_group;
130 Gtk::Table midi_port_table;
131 std::vector<Gtk::Widget*> midi_port_table_widgets;
132 Gtk::Adjustment mmc_receive_device_id_adjustment;
133 Gtk::SpinButton mmc_receive_device_id_spinner;
134 Gtk::Adjustment mmc_send_device_id_adjustment;
135 Gtk::SpinButton mmc_send_device_id_spinner;
136 Gtk::Button add_midi_port_button;
138 void add_midi_port ();
139 void remove_midi_port (MIDI::Port*);
140 void redisplay_midi_ports ();
142 void port_online_toggled (MIDI::Port*,Gtk::ToggleButton*);
143 void port_trace_in_toggled (MIDI::Port*,Gtk::ToggleButton*);
144 void port_trace_out_toggled (MIDI::Port*,Gtk::ToggleButton*);
146 void mmc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
147 void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
148 void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
149 bool port_removable (MIDI::Port*);
151 void mmc_receive_device_id_adjusted ();
152 void mmc_send_device_id_adjusted ();
154 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
156 void setup_midi_options();
164 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
168 IOSelector* click_io_selector;
169 GainMeter* click_gpm;
170 PannerUI* click_panner;
171 Gtk::VBox click_packer;
172 Gtk::Table click_table;
173 Gtk::Entry click_path_entry;
174 Gtk::Entry click_emphasis_path_entry;
175 Gtk::Button click_browse_button;
176 Gtk::Button click_emphasis_browse_button;
178 void setup_click_editor ();
179 void clear_click_editor ();
181 void click_chosen (const string & paths);
182 void click_emphasis_chosen (const string & paths);
184 void click_browse_clicked ();
185 void click_emphasis_browse_clicked ();
187 void click_sound_changed ();
188 void click_emphasis_sound_changed ();
192 Gtk::VBox audition_packer;
193 Gtk::HBox audition_hpacker;
194 Gtk::Label audition_label;
195 IOSelector* auditioner_io_selector;
196 GainMeter* auditioner_gpm;
197 PannerUI* auditioner_panner;
199 void setup_auditioner_editor ();
200 void clear_auditioner_editor ();
201 void connect_audition_editor ();
205 Gtk::Table keyboard_mouse_table;
206 Gtk::ComboBoxText edit_modifier_combo;
207 Gtk::ComboBoxText delete_modifier_combo;
208 Gtk::ComboBoxText snap_modifier_combo;
209 Gtk::Adjustment delete_button_adjustment;
210 Gtk::SpinButton delete_button_spin;
211 Gtk::Adjustment edit_button_adjustment;
212 Gtk::SpinButton edit_button_spin;
214 void setup_keyboard_options ();
215 void delete_modifier_chosen ();
216 void edit_modifier_chosen ();
217 void snap_modifier_chosen ();
218 void edit_button_changed ();
219 void delete_button_changed ();
221 void fixup_combo_size (Gtk::ComboBoxText&, std::vector<std::string>& strings);
224 #endif /* __gtk_ardour_option_editor_h__ */