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 Gtk::Dialog
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)());
72 Gtk::Table path_table;
73 Gtk::Entry session_raid_entry;
75 void setup_path_options();
76 void add_session_paths ();
77 void remove_session_paths ();
78 void raid_path_changed ();
82 Gtk::VBox fade_packer;
83 Gtk::Adjustment short_xfade_adjustment;
84 Gtk::HScale short_xfade_slider;
85 Gtk::Adjustment destructo_xfade_adjustment;
86 Gtk::HScale destructo_xfade_slider;
88 void setup_fade_options();
89 void short_xfade_adjustment_changed ();
90 void destructo_xfade_adjustment_changed ();
94 Gtk::VBox sync_packer;
96 Gtk::ComboBoxText slave_type_combo;
97 AudioClock smpte_offset_clock;
98 Gtk::CheckButton smpte_offset_negative_button;
100 void setup_sync_options ();
102 void smpte_offset_chosen ();
103 void smpte_offset_negative_clicked ();
107 Gtk::VBox midi_packer;
109 Gtk::RadioButton::Group mtc_button_group;
110 Gtk::RadioButton::Group mmc_button_group;
111 Gtk::RadioButton::Group midi_button_group;
113 Gtk::Table midi_port_table;
114 std::vector<Gtk::Widget*> midi_port_table_widgets;
115 Gtk::Adjustment mmc_receive_device_id_adjustment;
116 Gtk::SpinButton mmc_receive_device_id_spinner;
117 Gtk::Adjustment mmc_send_device_id_adjustment;
118 Gtk::SpinButton mmc_send_device_id_spinner;
119 Gtk::Button add_midi_port_button;
121 void add_midi_port ();
122 void remove_midi_port (MIDI::Port*);
123 void redisplay_midi_ports ();
125 void port_online_toggled (MIDI::Port*,Gtk::ToggleButton*);
126 void port_trace_in_toggled (MIDI::Port*,Gtk::ToggleButton*);
127 void port_trace_out_toggled (MIDI::Port*,Gtk::ToggleButton*);
129 void mmc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
130 void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
131 void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*, Gtk::Button*);
132 bool port_removable (MIDI::Port*);
134 void mmc_receive_device_id_adjusted ();
135 void mmc_send_device_id_adjusted ();
137 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
139 void setup_midi_options();
147 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
151 IOSelector* click_io_selector;
152 GainMeter* click_gpm;
153 PannerUI* click_panner;
154 Gtk::VBox click_packer;
155 Gtk::Table click_table;
156 Gtk::Entry click_path_entry;
157 Gtk::Entry click_emphasis_path_entry;
158 Gtk::Button click_browse_button;
159 Gtk::Button click_emphasis_browse_button;
161 void setup_click_editor ();
162 void clear_click_editor ();
164 void click_chosen (const string & paths);
165 void click_emphasis_chosen (const string & paths);
167 void click_browse_clicked ();
168 void click_emphasis_browse_clicked ();
170 void click_sound_changed ();
171 void click_emphasis_sound_changed ();
175 Gtk::VBox audition_packer;
176 Gtk::HBox audition_hpacker;
177 Gtk::Label audition_label;
178 IOSelector* auditioner_io_selector;
179 GainMeter* auditioner_gpm;
180 PannerUI* auditioner_panner;
182 void setup_auditioner_editor ();
183 void clear_auditioner_editor ();
184 void connect_audition_editor ();
188 Gtk::Table keyboard_mouse_table;
189 Gtk::ComboBoxText edit_modifier_combo;
190 Gtk::ComboBoxText delete_modifier_combo;
191 Gtk::ComboBoxText snap_modifier_combo;
192 Gtk::Adjustment delete_button_adjustment;
193 Gtk::SpinButton delete_button_spin;
194 Gtk::Adjustment edit_button_adjustment;
195 Gtk::SpinButton edit_button_spin;
197 void setup_keyboard_options ();
198 void delete_modifier_chosen ();
199 void edit_modifier_chosen ();
200 void snap_modifier_chosen ();
201 void edit_button_changed ();
202 void delete_button_changed ();
204 void fixup_combo_size (Gtk::ComboBoxText&, std::vector<std::string>& strings);
207 #endif /* __gtk_ardour_option_editor_h__ */