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 gint wm_close (GdkEventAny *);
69 bool focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
73 Gtk::Table path_table;
74 Gtk::Entry session_raid_entry;
76 struct SoundFilePathColumns : public Gtk::TreeModel::ColumnRecord {
78 SoundFilePathColumns() { add (paths); }
79 Gtk::TreeModelColumn<std::string> paths;
83 SoundFilePathColumns sfdb_path_columns;
84 Glib::RefPtr<Gtk::ListStore> sfdb_paths;
85 Gtk::TreeView sfdb_path_view;
87 void setup_path_options();
88 void add_session_paths ();
89 void remove_session_paths ();
90 void raid_path_changed ();
94 Gtk::VBox fade_packer;
95 Gtk::Adjustment short_xfade_adjustment;
96 Gtk::HScale short_xfade_slider;
97 Gtk::Adjustment destructo_xfade_adjustment;
98 Gtk::HScale destructo_xfade_slider;
100 void setup_fade_options();
101 void short_xfade_adjustment_changed ();
102 void destructo_xfade_adjustment_changed ();
106 Gtk::VBox sync_packer;
108 Gtk::ComboBoxText slave_type_combo;
109 Gtk::ComboBoxText smpte_fps_combo;
110 AudioClock smpte_offset_clock;
111 Gtk::CheckButton smpte_offset_negative_button;
113 void setup_sync_options ();
115 void smpte_fps_chosen ();
116 void smpte_offset_chosen ();
117 void smpte_offset_negative_clicked ();
121 Gtk::VBox midi_packer;
123 Gtk::RadioButton::Group mtc_button_group;
124 Gtk::RadioButton::Group mmc_button_group;
125 Gtk::RadioButton::Group midi_button_group;
127 gint port_online_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
128 gint port_trace_in_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
129 gint port_trace_out_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
131 void mmc_port_chosen (MIDI::Port*,Gtk::RadioButton*);
132 void mtc_port_chosen (MIDI::Port*,Gtk::RadioButton*);
133 void midi_port_chosen (MIDI::Port*,Gtk::RadioButton*);
135 void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
137 void setup_midi_options();
145 std::map<MIDI::Port*,std::vector<Gtk::RadioButton*> > port_toggle_buttons;
149 IOSelector* click_io_selector;
150 GainMeter* click_gpm;
151 PannerUI* click_panner;
152 Gtk::VBox click_packer;
153 Gtk::Table click_table;
154 Gtk::Entry click_path_entry;
155 Gtk::Entry click_emphasis_path_entry;
156 Gtk::Button click_browse_button;
157 Gtk::Button click_emphasis_browse_button;
159 void setup_click_editor ();
160 void clear_click_editor ();
162 void click_chosen (const string & paths);
163 void click_emphasis_chosen (const string & paths);
165 void click_browse_clicked ();
166 void click_emphasis_browse_clicked ();
168 void click_sound_changed ();
169 void click_emphasis_sound_changed ();
173 Gtk::VBox audition_packer;
174 Gtk::HBox audition_hpacker;
175 Gtk::Label audition_label;
176 IOSelector* auditioner_io_selector;
177 GainMeter* auditioner_gpm;
178 PannerUI* auditioner_panner;
180 void setup_auditioner_editor ();
181 void clear_auditioner_editor ();
182 void connect_audition_editor ();
186 Gtk::Table keyboard_mouse_table;
187 Gtk::ComboBoxText edit_modifier_combo;
188 Gtk::ComboBoxText delete_modifier_combo;
189 Gtk::ComboBoxText snap_modifier_combo;
190 Gtk::Adjustment delete_button_adjustment;
191 Gtk::SpinButton delete_button_spin;
192 Gtk::Adjustment edit_button_adjustment;
193 Gtk::SpinButton edit_button_spin;
195 void setup_keyboard_options ();
196 void delete_modifier_chosen ();
197 void edit_modifier_chosen ();
198 void snap_modifier_chosen ();
199 void edit_button_changed ();
200 void delete_button_changed ();
202 void fixup_combo_size (Gtk::ComboBoxText&, std::vector<std::string>& strings);
205 #endif /* __gtk_ardour_option_editor_h__ */