Fly my pretties!
[ardour.git] / gtk2_ardour / option_editor.h
1 /*
2     Copyright (C) 2001 Paul Davis 
3
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.
8
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.
13
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.
17
18     $Id$
19 */
20
21 #ifndef __gtk_ardour_option_editor_h__
22 #define __gtk_ardour_option_editor_h__
23
24 #include <gtkmm.h>
25
26 #include <ardour/session.h>
27
28 #include "ardour_dialog.h"
29 #include "editing.h"
30 #include "audio_clock.h"
31
32 class ARDOUR_UI;
33 class PublicEditor;
34 class Mixer_UI;
35 class IOSelector;
36 class GainMeter;
37 class PannerUI;
38
39 class OptionEditor : public ArdourDialog
40 {
41   public:
42         OptionEditor (ARDOUR_UI&, PublicEditor&, Mixer_UI&);
43         ~OptionEditor ();
44
45         void set_session (ARDOUR::Session *);
46         void save ();
47
48   private:
49         ARDOUR::Session *session;
50         ARDOUR_UI& ui;
51         PublicEditor& editor;
52         Mixer_UI& mixer;
53
54         Gtk::Notebook notebook;
55
56         /* Generic */
57
58         void session_control_changed (ARDOUR::Session::ControlType);
59         void queue_session_control_changed (ARDOUR::Session::ControlType);
60         void map_some_session_state (Gtk::CheckButton& button, bool (ARDOUR::Session::*get)() const);
61         gint wm_close (GdkEventAny *);
62         void just_close_win();
63         gint focus_out_event_handler (GdkEventFocus*, void (OptionEditor::*pmf)());
64
65         /* paths */
66
67         Gtk::Table              path_table;
68
69         Gtk::Entry              session_raid_entry;
70
71         Gtk::Combo              native_format_combo;
72
73         void setup_path_options();
74         void add_session_paths ();
75         void remove_session_paths ();
76         gint native_format_chosen (GdkEventAny *);
77         void raid_path_changed ();
78
79         /* fades */
80
81         // Gtk::Table           fade_table;
82
83         Gtk::VBox        fade_packer;
84         Gtk::CheckButton auto_xfade_button;
85         Gtk::CheckButton xfade_active_button;
86         Gtk::Label       layer_mode_label;
87         Gtk::Combo       layer_mode_combo;
88         Gtk::Label       xfade_model_label;
89         Gtk::Combo       xfade_model_combo;
90         Gtk::Adjustment  short_xfade_adjustment;
91         Gtk::HScale      short_xfade_slider;
92
93         void auto_xfade_clicked ();
94         void xfade_active_clicked ();
95         gint layer_mode_chosen (GdkEventAny*);
96         gint xfade_model_chosen (GdkEventAny*);
97         void setup_fade_options();
98         void short_xfade_adjustment_changed ();
99
100         /* solo */
101
102         Gtk::VBox        solo_packer;
103         Gtk::CheckButton solo_latched_button;
104         Gtk::CheckButton solo_via_bus_button;
105
106         void solo_latched_clicked();
107         void solo_via_bus_clicked ();
108         
109         void setup_solo_options();
110
111         /* display */
112
113         Gtk::VBox        display_packer;
114         Gtk::CheckButton show_waveforms_button;
115         Gtk::CheckButton show_waveforms_recording_button;
116         Gtk::CheckButton mixer_strip_width_button;
117         Gtk::CheckButton show_measures_button;
118         Gtk::CheckButton follow_playhead_button;
119         Gtk::Combo meter_hold_combo;
120         Gtk::Combo meter_falloff_combo;
121
122         void setup_display_options();
123         void show_waveforms_clicked ();
124         void show_waveforms_recording_clicked ();
125         void show_measures_clicked ();
126         void strip_width_clicked ();
127         void follow_playhead_clicked ();
128         gint meter_hold_chosen (GdkEventAny *);
129         gint meter_falloff_chosen (GdkEventAny *);
130         
131         void display_control_changed (Editing::DisplayControl);
132
133         /* Sync */
134
135         Gtk::VBox sync_packer;
136
137         Gtk::CheckButton send_mtc_button;
138         Gtk::CheckButton send_mmc_button;
139         Gtk::CheckButton jack_time_master_button;
140         Gtk::Combo slave_type_combo;
141         Gtk::Combo smpte_fps_combo;
142         AudioClock smpte_offset_clock;
143         Gtk::CheckButton smpte_offset_negative_button;
144
145         void setup_sync_options ();
146         gint send_mtc_toggled (GdkEventButton*, Gtk::CheckButton*);
147
148         gint slave_type_chosen (GdkEventAny*);
149         void jack_time_master_clicked ();
150         void jack_transport_master_clicked ();
151         gint smpte_fps_chosen (GdkEventAny*);
152         void smpte_offset_chosen ();
153         void smpte_offset_negative_clicked ();
154
155         /* MIDI */
156
157         Gtk::VBox  midi_packer;
158         Gtk::CheckButton midi_feedback_button;
159         Gtk::CheckButton midi_control_button;
160         Gtk::CheckButton mmc_control_button;
161
162         void send_mmc_toggled (Gtk::CheckButton*);
163         void mmc_control_toggled (Gtk::CheckButton*);
164         void midi_control_toggled (Gtk::CheckButton*);
165         void midi_feedback_toggled (Gtk::CheckButton*);
166
167         gint port_online_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
168         gint port_trace_in_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
169         gint port_trace_out_toggled (GdkEventButton*,MIDI::Port*,Gtk::ToggleButton*);
170         
171         gint mmc_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
172         gint mtc_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
173         gint midi_port_chosen (GdkEventButton*,MIDI::Port*,Gtk::RadioButton*);
174
175         void map_port_online (MIDI::Port*, Gtk::ToggleButton*);
176
177         void setup_midi_options();
178
179         enum PortIndex {
180                 MtcIndex = 0,
181                 MmcIndex = 1,
182                 MidiIndex = 2
183         };
184
185         std::map<MIDI::Port*,vector<Gtk::RadioButton*> > port_toggle_buttons;
186
187         /* Click */
188
189         IOSelector*   click_io_selector;
190         GainMeter* click_gpm;
191         PannerUI*     click_panner;
192         Gtk::VBox     click_packer;
193         Gtk::Table    click_table;
194         Gtk::Entry    click_path_entry;
195         Gtk::Entry    click_emphasis_path_entry;
196         Gtk::Button   click_browse_button;
197         Gtk::Button   click_emphasis_browse_button;
198
199         void setup_click_editor ();
200         void clear_click_editor ();
201
202         void click_chosen (vector<string> paths, bool ignore);
203         void click_emphasis_chosen (vector<string> paths, bool ignore);
204
205         void click_browse_clicked ();
206         void click_emphasis_browse_clicked ();
207         
208         void click_sound_changed ();
209         void click_emphasis_sound_changed ();
210
211         /* Auditioner */
212
213         Gtk::VBox     audition_packer;
214         Gtk::HBox     audition_hpacker;
215         Gtk::Label    audition_label;
216         IOSelector*   auditioner_io_selector;
217         GainMeter* auditioner_gpm;
218         PannerUI* auditioner_panner;
219
220         void setup_auditioner_editor ();
221         void clear_auditioner_editor ();
222         void connect_audition_editor ();
223
224         /* keyboard/mouse */
225
226         Gtk::Table keyboard_mouse_table;
227         Gtk::Combo edit_modifier_combo;
228         Gtk::Combo delete_modifier_combo;
229         Gtk::Combo snap_modifier_combo;
230         Gtk::Adjustment delete_button_adjustment;
231         Gtk::SpinButton delete_button_spin;
232         Gtk::Adjustment edit_button_adjustment;
233         Gtk::SpinButton edit_button_spin;
234
235         void setup_keyboard_options ();
236         gint delete_modifier_chosen (GdkEventAny*);
237         gint edit_modifier_chosen (GdkEventAny*);
238         gint snap_modifier_chosen (GdkEventAny*);
239         void edit_button_changed ();
240         void delete_button_changed ();
241
242         /* Miscellany */
243
244         Gtk::VBox misc_packer;
245
246         Gtk::CheckButton auto_connect_inputs_button;
247
248         Gtk::RadioButton auto_connect_output_physical_button;
249         Gtk::RadioButton auto_connect_output_master_button;
250         Gtk::RadioButton auto_connect_output_manual_button;
251
252         Gtk::CheckButton hw_monitor_button;
253         Gtk::CheckButton sw_monitor_button;
254         Gtk::CheckButton plugins_stop_button;
255         Gtk::CheckButton plugins_on_rec_button;
256         Gtk::CheckButton verify_remove_last_capture_button;
257         Gtk::CheckButton stop_rec_on_xrun_button;
258         Gtk::CheckButton stop_at_end_button;
259         Gtk::CheckButton debug_keyboard_button;
260         Gtk::CheckButton speed_quieten_button;
261
262         void setup_misc_options ();
263         void plugins_stop_with_transport_clicked ();
264         void verify_remove_last_capture_clicked ();
265         void plugins_on_while_recording_clicked ();
266         void auto_connect_inputs_clicked ();
267         void auto_connect_output_physical_clicked ();
268         void auto_connect_output_master_clicked ();
269         void auto_connect_output_manual_clicked ();
270         void hw_monitor_clicked ();
271         void sw_monitor_clicked ();
272         void stop_rec_on_xrun_clicked ();
273         void stop_at_end_clicked ();
274         void debug_keyboard_clicked ();
275         void speed_quieten_clicked ();
276
277         void fixup_combo_size (Gtk::Combo&, vector<string>& strings);
278 };
279
280 #endif /* __gtk_ardour_option_editor_h__ */
281
282