fix import/embed with "sequence files" option
[ardour2.git] / gtk2_ardour / option_editor.h
blobed6d752e6e6bfe1e082950159dadaeaedbdb9e3e
1 #ifndef __gtk_ardour_option_editor_h__
2 #define __gtk_ardour_option_editor_h__
4 /*
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.
23 #include <vector>
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"
40 #include "editing.h"
41 #include "audio_clock.h"
43 class ARDOUR_UI;
44 class PublicEditor;
45 class Mixer_UI;
46 class IOSelector;
47 class GainMeter;
48 class PannerUI;
50 class OptionEditor : public ArdourDialog
52 public:
53 OptionEditor (ARDOUR_UI&, PublicEditor&, Mixer_UI&);
54 ~OptionEditor ();
56 void set_session (ARDOUR::Session *);
57 void save ();
59 private:
60 ARDOUR::Session *session;
61 ARDOUR_UI& ui;
62 PublicEditor& editor;
63 Mixer_UI& mixer;
65 Gtk::Notebook notebook;
67 /* Generic */
69 gint wm_close (GdkEventAny *);
70 bool focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
71 void parameter_changed (const char* name);
73 /* paths */
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 ();
83 /* misc */
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 ();
109 /* Sync */
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 ();
124 /* MIDI */
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;
139 Gtk::Adjustment initial_program_change_adjustment;
140 Gtk::SpinButton initial_program_change_spinner;
142 void add_midi_port ();
143 void remove_midi_port (MIDI::Port*);
144 void redisplay_midi_ports ();
146 void port_online_toggled (MIDI::Port*,Gtk::ToggleButton*);
147 void port_trace_in_toggled (MIDI::Port*,Gtk::ToggleButton*);
148 void port_trace_out_toggled (MIDI::Port*,Gtk::ToggleButton*);
150 void mmc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
151 void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
152 void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
153 bool port_removable (MIDI::Port*);
155 void mmc_receive_device_id_adjusted ();
156 void mmc_send_device_id_adjusted ();
158 void initial_program_change_adjusted ();
160 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
162 void setup_midi_options();
164 enum PortIndex {
165 MtcIndex = 0,
166 MmcIndex = 1,
167 MidiIndex = 2
170 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
172 /* Click */
174 IOSelector* click_io_selector;
175 GainMeter* click_gpm;
176 PannerUI* click_panner;
177 bool first_click_setup;
178 Gtk::HBox click_hpacker;
179 Gtk::VBox click_packer;
180 Gtk::Table click_table;
181 Gtk::Entry click_path_entry;
182 Gtk::Entry click_emphasis_path_entry;
183 Gtk::Button click_browse_button;
184 Gtk::Button click_emphasis_browse_button;
186 void setup_click_editor ();
187 void clear_click_editor ();
189 void click_chosen (const string & paths);
190 void click_emphasis_chosen (const string & paths);
192 void click_browse_clicked ();
193 void click_emphasis_browse_clicked ();
195 void click_sound_changed ();
196 void click_emphasis_sound_changed ();
198 /* Auditioner */
200 Gtk::VBox audition_packer;
201 Gtk::HBox audition_hpacker;
202 Gtk::Label audition_label;
203 IOSelector* auditioner_io_selector;
204 GainMeter* auditioner_gpm;
205 PannerUI* auditioner_panner;
207 void setup_auditioner_editor ();
208 void clear_auditioner_editor ();
209 void connect_audition_editor ();
211 /* keyboard/mouse */
213 Gtk::Table keyboard_mouse_table;
214 Gtk::ComboBoxText keyboard_layout_selector;
215 Gtk::ComboBoxText edit_modifier_combo;
216 Gtk::ComboBoxText delete_modifier_combo;
217 Gtk::ComboBoxText snap_modifier_combo;
218 Gtk::Adjustment delete_button_adjustment;
219 Gtk::SpinButton delete_button_spin;
220 Gtk::Adjustment edit_button_adjustment;
221 Gtk::SpinButton edit_button_spin;
223 std::map<std::string,std::string> bindings_files;
225 void setup_keyboard_options ();
226 void delete_modifier_chosen ();
227 void edit_modifier_chosen ();
228 void snap_modifier_chosen ();
229 void edit_button_changed ();
230 void delete_button_changed ();
231 void bindings_changed ();
234 #endif /* __gtk_ardour_option_editor_h__ */