spell check
[ardour2.git] / gtk2_ardour / rc_option_editor.cc
blob722612d21c9ffaec7d3c6d863c384c0640119aa3
1 #ifdef WAF_BUILD
2 #include "gtk2ardour-config.h"
3 #endif
5 #include <gtkmm/liststore.h>
6 #include <gtkmm/stock.h>
7 #include <gtkmm/scale.h>
8 #include <gtkmm2ext/utils.h>
9 #include <gtkmm2ext/slider_controller.h>
11 #include "pbd/fpu.h"
12 #include "pbd/cpus.h"
14 #include "midi++/manager.h"
16 #include "ardour/audioengine.h"
17 #include "ardour/dB.h"
18 #include "ardour/rc_configuration.h"
19 #include "ardour/control_protocol_manager.h"
20 #include "control_protocol/control_protocol.h"
22 #include "gui_thread.h"
23 #include "midi_tracer.h"
24 #include "rc_option_editor.h"
25 #include "utils.h"
26 #include "midi_port_dialog.h"
27 #include "sfdb_ui.h"
28 #include "keyboard.h"
29 #include "i18n.h"
31 using namespace std;
32 using namespace Gtk;
33 using namespace Gtkmm2ext;
34 using namespace PBD;
35 using namespace ARDOUR;
37 class ClickOptions : public OptionEditorBox
39 public:
40 ClickOptions (RCConfiguration* c, ArdourDialog* p)
41 : _rc_config (c),
42 _parent (p)
44 Table* t = manage (new Table (2, 3));
45 t->set_spacings (4);
47 Label* l = manage (new Label (_("Click audio file:")));
48 l->set_alignment (0, 0.5);
49 t->attach (*l, 0, 1, 0, 1, FILL);
50 t->attach (_click_path_entry, 1, 2, 0, 1, FILL);
51 Button* b = manage (new Button (_("Browse...")));
52 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_browse_clicked));
53 t->attach (*b, 2, 3, 0, 1, FILL);
55 l = manage (new Label (_("Click emphasis audio file:")));
56 l->set_alignment (0, 0.5);
57 t->attach (*l, 0, 1, 1, 2, FILL);
58 t->attach (_click_emphasis_path_entry, 1, 2, 1, 2, FILL);
59 b = manage (new Button (_("Browse...")));
60 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked));
61 t->attach (*b, 2, 3, 1, 2, FILL);
63 _box->pack_start (*t, false, false);
66 void parameter_changed (string const & p)
68 if (p == "click-sound") {
69 _click_path_entry.set_text (_rc_config->get_click_sound());
70 } else if (p == "click-emphasis-sound") {
71 _click_emphasis_path_entry.set_text (_rc_config->get_click_emphasis_sound());
75 void set_state_from_config ()
77 parameter_changed ("click-sound");
78 parameter_changed ("click-emphasis-sound");
81 private:
83 void click_browse_clicked ()
85 SoundFileChooser sfdb (*_parent, _("Choose Click"));
87 sfdb.show_all ();
88 sfdb.present ();
90 if (sfdb.run () == RESPONSE_OK) {
91 click_chosen (sfdb.get_filename());
95 void click_chosen (string const & path)
97 _click_path_entry.set_text (path);
98 _rc_config->set_click_sound (path);
101 void click_emphasis_browse_clicked ()
103 SoundFileChooser sfdb (*_parent, _("Choose Click Emphasis"));
105 sfdb.show_all ();
106 sfdb.present ();
108 if (sfdb.run () == RESPONSE_OK) {
109 click_emphasis_chosen (sfdb.get_filename());
113 void click_emphasis_chosen (string const & path)
115 _click_emphasis_path_entry.set_text (path);
116 _rc_config->set_click_emphasis_sound (path);
119 RCConfiguration* _rc_config;
120 ArdourDialog* _parent;
121 Entry _click_path_entry;
122 Entry _click_emphasis_path_entry;
125 class UndoOptions : public OptionEditorBox
127 public:
128 UndoOptions (RCConfiguration* c) :
129 _rc_config (c),
130 _limit_undo_button (_("Limit undo history to")),
131 _save_undo_button (_("Save undo history of"))
133 Table* t = new Table (2, 3);
134 t->set_spacings (4);
136 t->attach (_limit_undo_button, 0, 1, 0, 1, FILL);
137 _limit_undo_spin.set_range (0, 512);
138 _limit_undo_spin.set_increments (1, 10);
139 t->attach (_limit_undo_spin, 1, 2, 0, 1, FILL | EXPAND);
140 Label* l = manage (new Label (_("commands")));
141 l->set_alignment (0, 0.5);
142 t->attach (*l, 2, 3, 0, 1);
144 t->attach (_save_undo_button, 0, 1, 1, 2, FILL);
145 _save_undo_spin.set_range (0, 512);
146 _save_undo_spin.set_increments (1, 10);
147 t->attach (_save_undo_spin, 1, 2, 1, 2, FILL | EXPAND);
148 l = manage (new Label (_("commands")));
149 l->set_alignment (0, 0.5);
150 t->attach (*l, 2, 3, 1, 2);
152 _box->pack_start (*t);
154 _limit_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_toggled));
155 _limit_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_changed));
156 _save_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_toggled));
157 _save_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_changed));
160 void parameter_changed (string const & p)
162 if (p == "history-depth") {
163 int32_t const d = _rc_config->get_history_depth();
164 _limit_undo_button.set_active (d != 0);
165 _limit_undo_spin.set_sensitive (d != 0);
166 _limit_undo_spin.set_value (d);
167 } else if (p == "save-history") {
168 bool const x = _rc_config->get_save_history ();
169 _save_undo_button.set_active (x);
170 _save_undo_spin.set_sensitive (x);
171 } else if (p == "save-history-depth") {
172 _save_undo_spin.set_value (_rc_config->get_saved_history_depth());
176 void set_state_from_config ()
178 parameter_changed ("save-history");
179 parameter_changed ("history-depth");
180 parameter_changed ("save-history-depth");
183 void limit_undo_toggled ()
185 bool const x = _limit_undo_button.get_active ();
186 _limit_undo_spin.set_sensitive (x);
187 int32_t const n = x ? 16 : 0;
188 _limit_undo_spin.set_value (n);
189 _rc_config->set_history_depth (n);
192 void limit_undo_changed ()
194 _rc_config->set_history_depth (_limit_undo_spin.get_value_as_int ());
197 void save_undo_toggled ()
199 bool const x = _save_undo_button.get_active ();
200 _rc_config->set_save_history (x);
203 void save_undo_changed ()
205 _rc_config->set_saved_history_depth (_save_undo_spin.get_value_as_int ());
208 private:
209 RCConfiguration* _rc_config;
210 CheckButton _limit_undo_button;
211 SpinButton _limit_undo_spin;
212 CheckButton _save_undo_button;
213 SpinButton _save_undo_spin;
218 static const struct {
219 const char *name;
220 guint modifier;
221 } modifiers[] = {
223 { "Unmodified", 0 },
225 #ifdef GTKOSX
227 /* Command = Meta
228 Option/Alt = Mod1
230 { "Shift", GDK_SHIFT_MASK },
231 { "Command", GDK_META_MASK },
232 { "Control", GDK_CONTROL_MASK },
233 { "Option", GDK_MOD1_MASK },
234 { "Command-Shift", GDK_META_MASK|GDK_SHIFT_MASK },
235 { "Command-Option", GDK_MOD1_MASK|GDK_META_MASK },
236 { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD1_MASK },
237 { "Shift-Command-Option", GDK_MOD5_MASK|GDK_SHIFT_MASK|GDK_META_MASK },
239 #else
240 { "Shift", GDK_SHIFT_MASK },
241 { "Control", GDK_CONTROL_MASK },
242 { "Alt (Mod1)", GDK_MOD1_MASK },
243 { "Control-Shift", GDK_CONTROL_MASK|GDK_SHIFT_MASK },
244 { "Control-Alt", GDK_CONTROL_MASK|GDK_MOD1_MASK },
245 { "Shift-Alt", GDK_SHIFT_MASK|GDK_MOD1_MASK },
246 { "Control-Shift-Alt", GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
247 { "Mod2", GDK_MOD2_MASK },
248 { "Mod3", GDK_MOD3_MASK },
249 { "Mod4", GDK_MOD4_MASK },
250 { "Mod5", GDK_MOD5_MASK },
251 #endif
252 { 0, 0 }
256 class KeyboardOptions : public OptionEditorBox
258 public:
259 KeyboardOptions () :
260 _delete_button_adjustment (3, 1, 12),
261 _delete_button_spin (_delete_button_adjustment),
262 _edit_button_adjustment (3, 1, 5),
263 _edit_button_spin (_edit_button_adjustment),
264 _insert_note_button_adjustment (3, 1, 5),
265 _insert_note_button_spin (_insert_note_button_adjustment)
269 /* internationalize and prepare for use with combos */
271 vector<string> dumb;
272 for (int i = 0; modifiers[i].name; ++i) {
273 dumb.push_back (_(modifiers[i].name));
276 set_popdown_strings (_edit_modifier_combo, dumb);
277 _edit_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_modifier_chosen));
279 for (int x = 0; modifiers[x].name; ++x) {
280 if (modifiers[x].modifier == Keyboard::edit_modifier ()) {
281 _edit_modifier_combo.set_active_text (_(modifiers[x].name));
282 break;
286 Table* t = manage (new Table (4, 4));
287 t->set_spacings (4);
289 Label* l = manage (new Label (_("Edit using:")));
290 l->set_name ("OptionsLabel");
291 l->set_alignment (0, 0.5);
293 t->attach (*l, 0, 1, 0, 1, FILL | EXPAND, FILL);
294 t->attach (_edit_modifier_combo, 1, 2, 0, 1, FILL | EXPAND, FILL);
296 l = manage (new Label (_("+ button")));
297 l->set_name ("OptionsLabel");
299 t->attach (*l, 3, 4, 0, 1, FILL | EXPAND, FILL);
300 t->attach (_edit_button_spin, 4, 5, 0, 1, FILL | EXPAND, FILL);
302 _edit_button_spin.set_name ("OptionsEntry");
303 _edit_button_adjustment.set_value (Keyboard::edit_button());
304 _edit_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_button_changed));
306 set_popdown_strings (_delete_modifier_combo, dumb);
307 _delete_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_modifier_chosen));
309 for (int x = 0; modifiers[x].name; ++x) {
310 if (modifiers[x].modifier == Keyboard::delete_modifier ()) {
311 _delete_modifier_combo.set_active_text (_(modifiers[x].name));
312 break;
316 l = manage (new Label (_("Delete using:")));
317 l->set_name ("OptionsLabel");
318 l->set_alignment (0, 0.5);
320 t->attach (*l, 0, 1, 1, 2, FILL | EXPAND, FILL);
321 t->attach (_delete_modifier_combo, 1, 2, 1, 2, FILL | EXPAND, FILL);
323 l = manage (new Label (_("+ button")));
324 l->set_name ("OptionsLabel");
326 t->attach (*l, 3, 4, 1, 2, FILL | EXPAND, FILL);
327 t->attach (_delete_button_spin, 4, 5, 1, 2, FILL | EXPAND, FILL);
329 _delete_button_spin.set_name ("OptionsEntry");
330 _delete_button_adjustment.set_value (Keyboard::delete_button());
331 _delete_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_button_changed));
334 set_popdown_strings (_insert_note_modifier_combo, dumb);
335 _insert_note_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::insert_note_modifier_chosen));
337 for (int x = 0; modifiers[x].name; ++x) {
338 if (modifiers[x].modifier == Keyboard::insert_note_modifier ()) {
339 _insert_note_modifier_combo.set_active_text (_(modifiers[x].name));
340 break;
344 l = manage (new Label (_("Insert note using:")));
345 l->set_name ("OptionsLabel");
346 l->set_alignment (0, 0.5);
348 t->attach (*l, 0, 1, 2, 3, FILL | EXPAND, FILL);
349 t->attach (_insert_note_modifier_combo, 1, 2, 2, 3, FILL | EXPAND, FILL);
351 l = manage (new Label (_("+ button")));
352 l->set_name ("OptionsLabel");
354 t->attach (*l, 3, 4, 2, 3, FILL | EXPAND, FILL);
355 t->attach (_insert_note_button_spin, 4, 5, 2, 3, FILL | EXPAND, FILL);
357 _insert_note_button_spin.set_name ("OptionsEntry");
358 _insert_note_button_adjustment.set_value (Keyboard::insert_note_button());
359 _insert_note_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::insert_note_button_changed));
362 set_popdown_strings (_snap_modifier_combo, dumb);
363 _snap_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::snap_modifier_chosen));
365 for (int x = 0; modifiers[x].name; ++x) {
366 if (modifiers[x].modifier == (guint) Keyboard::snap_modifier ()) {
367 _snap_modifier_combo.set_active_text (_(modifiers[x].name));
368 break;
372 l = manage (new Label (_("Toggle snap using:")));
373 l->set_name ("OptionsLabel");
374 l->set_alignment (0, 0.5);
376 t->attach (*l, 0, 1, 3, 4, FILL | EXPAND, FILL);
377 t->attach (_snap_modifier_combo, 1, 2, 3, 4, FILL | EXPAND, FILL);
379 vector<string> strs;
381 for (map<string,string>::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) {
382 strs.push_back (bf->first);
385 set_popdown_strings (_keyboard_layout_selector, strs);
386 _keyboard_layout_selector.set_active_text (Keyboard::current_binding_name());
387 _keyboard_layout_selector.signal_changed().connect (sigc::mem_fun (*this, &KeyboardOptions::bindings_changed));
389 l = manage (new Label (_("Keyboard layout:")));
390 l->set_name ("OptionsLabel");
391 l->set_alignment (0, 0.5);
393 t->attach (*l, 0, 1, 4, 5, FILL | EXPAND, FILL);
394 t->attach (_keyboard_layout_selector, 1, 2, 4, 5, FILL | EXPAND, FILL);
396 _box->pack_start (*t, false, false);
399 void parameter_changed (string const &)
401 /* XXX: these aren't really config options... */
404 void set_state_from_config ()
406 /* XXX: these aren't really config options... */
409 private:
411 void bindings_changed ()
413 string const txt = _keyboard_layout_selector.get_active_text();
415 /* XXX: config...? for all this keyboard stuff */
417 for (map<string,string>::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) {
418 if (txt == i->first) {
419 if (Keyboard::load_keybindings (i->second)) {
420 Keyboard::save_keybindings ();
426 void edit_modifier_chosen ()
428 string const txt = _edit_modifier_combo.get_active_text();
430 for (int i = 0; modifiers[i].name; ++i) {
431 if (txt == _(modifiers[i].name)) {
432 Keyboard::set_edit_modifier (modifiers[i].modifier);
433 break;
438 void delete_modifier_chosen ()
440 string const txt = _delete_modifier_combo.get_active_text();
442 for (int i = 0; modifiers[i].name; ++i) {
443 if (txt == _(modifiers[i].name)) {
444 Keyboard::set_delete_modifier (modifiers[i].modifier);
445 break;
450 void insert_note_modifier_chosen ()
452 string const txt = _insert_note_modifier_combo.get_active_text();
454 for (int i = 0; modifiers[i].name; ++i) {
455 if (txt == _(modifiers[i].name)) {
456 Keyboard::set_insert_note_modifier (modifiers[i].modifier);
457 break;
462 void snap_modifier_chosen ()
464 string const txt = _snap_modifier_combo.get_active_text();
466 for (int i = 0; modifiers[i].name; ++i) {
467 if (txt == _(modifiers[i].name)) {
468 Keyboard::set_snap_modifier (modifiers[i].modifier);
469 break;
474 void delete_button_changed ()
476 Keyboard::set_delete_button (_delete_button_spin.get_value_as_int());
479 void edit_button_changed ()
481 Keyboard::set_edit_button (_edit_button_spin.get_value_as_int());
484 void insert_note_button_changed ()
486 Keyboard::set_insert_note_button (_insert_note_button_spin.get_value_as_int());
489 ComboBoxText _keyboard_layout_selector;
490 ComboBoxText _edit_modifier_combo;
491 ComboBoxText _delete_modifier_combo;
492 ComboBoxText _insert_note_modifier_combo;
493 ComboBoxText _snap_modifier_combo;
494 Adjustment _delete_button_adjustment;
495 SpinButton _delete_button_spin;
496 Adjustment _edit_button_adjustment;
497 SpinButton _edit_button_spin;
498 Adjustment _insert_note_button_adjustment;
499 SpinButton _insert_note_button_spin;
503 class FontScalingOptions : public OptionEditorBox
505 public:
506 FontScalingOptions (RCConfiguration* c) :
507 _rc_config (c),
508 _dpi_adjustment (50, 50, 250, 1, 10),
509 _dpi_slider (_dpi_adjustment)
511 _dpi_adjustment.set_value (_rc_config->get_font_scale () / 1024);
513 Label* l = manage (new Label (_("Font scaling:")));
514 l->set_name ("OptionsLabel");
516 _dpi_slider.set_update_policy (UPDATE_DISCONTINUOUS);
517 HBox* h = manage (new HBox);
518 h->set_spacing (4);
519 h->pack_start (*l, false, false);
520 h->pack_start (_dpi_slider, true, true);
522 _box->pack_start (*h, false, false);
524 _dpi_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &FontScalingOptions::dpi_changed));
527 void parameter_changed (string const & p)
529 if (p == "font-scale") {
530 _dpi_adjustment.set_value (_rc_config->get_font_scale() / 1024);
534 void set_state_from_config ()
536 parameter_changed ("font-scale");
539 private:
541 void dpi_changed ()
543 _rc_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024));
544 /* XXX: should be triggered from the parameter changed signal */
545 reset_dpi ();
548 RCConfiguration* _rc_config;
549 Adjustment _dpi_adjustment;
550 HScale _dpi_slider;
553 class BufferingOptions : public OptionEditorBox
555 public:
556 BufferingOptions (RCConfiguration* c)
557 : _rc_config (c)
558 , _playback_adjustment (5, 1, 60, 1, 4)
559 , _capture_adjustment (5, 1, 60, 1, 4)
560 , _playback_slider (_playback_adjustment)
561 , _capture_slider (_capture_adjustment)
563 _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds());
565 Label* l = manage (new Label (_("Playback (seconds of buffering):")));
566 l->set_name ("OptionsLabel");
568 _playback_slider.set_update_policy (UPDATE_DISCONTINUOUS);
569 HBox* h = manage (new HBox);
570 h->set_spacing (4);
571 h->pack_start (*l, false, false);
572 h->pack_start (_playback_slider, true, true);
574 _box->pack_start (*h, false, false);
576 _capture_adjustment.set_value (_rc_config->get_audio_capture_buffer_seconds());
578 l = manage (new Label (_("Recording (seconds of buffering):")));
579 l->set_name ("OptionsLabel");
581 _capture_slider.set_update_policy (UPDATE_DISCONTINUOUS);
582 h = manage (new HBox);
583 h->set_spacing (4);
584 h->pack_start (*l, false, false);
585 h->pack_start (_capture_slider, true, true);
587 _box->pack_start (*h, false, false);
589 _capture_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &BufferingOptions::capture_changed));
590 _playback_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &BufferingOptions::playback_changed));
593 void parameter_changed (string const & p)
595 if (p == "playback-buffer-seconds") {
596 _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds());
597 } else if (p == "capture-buffer-seconds") {
598 _capture_adjustment.set_value (_rc_config->get_audio_capture_buffer_seconds());
602 void set_state_from_config ()
604 parameter_changed ("playback-buffer-seconds");
605 parameter_changed ("capture-buffer-seconds");
608 private:
610 void playback_changed ()
612 _rc_config->set_audio_playback_buffer_seconds ((long) _playback_adjustment.get_value());
615 void capture_changed ()
617 _rc_config->set_audio_capture_buffer_seconds ((long) _capture_adjustment.get_value());
620 RCConfiguration* _rc_config;
621 Adjustment _playback_adjustment;
622 Adjustment _capture_adjustment;
623 HScale _playback_slider;
624 HScale _capture_slider;
627 class ControlSurfacesOptions : public OptionEditorBox
629 public:
630 ControlSurfacesOptions (ArdourDialog& parent)
631 : _parent (parent)
633 _store = ListStore::create (_model);
634 _view.set_model (_store);
635 _view.append_column (_("Name"), _model.name);
636 _view.get_column(0)->set_resizable (true);
637 _view.get_column(0)->set_expand (true);
638 _view.append_column_editable (_("Enabled"), _model.enabled);
639 _view.append_column_editable (_("Feedback"), _model.feedback);
641 _box->pack_start (_view, false, false);
643 Label* label = manage (new Label);
644 label->set_markup (string_compose (X_("<i>%1</i>"), _("Double-click on a name to edit settings for an enabled protocol")));
646 _box->pack_start (*label, false, false);
647 label->show ();
649 _store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::model_changed));
650 _view.signal_button_press_event().connect_notify (sigc::mem_fun(*this, &ControlSurfacesOptions::edit_clicked));
653 void parameter_changed (std::string const &)
658 void set_state_from_config ()
660 _store->clear ();
662 ControlProtocolManager& m = ControlProtocolManager::instance ();
663 for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
665 if (!(*i)->mandatory) {
666 TreeModel::Row r = *_store->append ();
667 r[_model.name] = (*i)->name;
668 r[_model.enabled] = ((*i)->protocol || (*i)->requested);
669 r[_model.feedback] = ((*i)->protocol && (*i)->protocol->get_feedback ());
670 r[_model.protocol_info] = *i;
675 private:
677 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
679 TreeModel::Row r = *i;
681 ControlProtocolInfo* cpi = r[_model.protocol_info];
682 if (!cpi) {
683 return;
686 bool const was_enabled = (cpi->protocol != 0);
687 bool const is_enabled = r[_model.enabled];
689 if (was_enabled != is_enabled) {
690 if (!was_enabled) {
691 ControlProtocolManager::instance().instantiate (*cpi);
692 } else {
693 ControlProtocolManager::instance().teardown (*cpi);
697 bool const was_feedback = (cpi->protocol && cpi->protocol->get_feedback ());
698 bool const is_feedback = r[_model.feedback];
700 if (was_feedback != is_feedback && cpi->protocol) {
701 cpi->protocol->set_feedback (is_feedback);
705 void edit_clicked (GdkEventButton* ev)
707 if (ev->type != GDK_2BUTTON_PRESS) {
708 return;
711 std::string name;
712 ControlProtocolInfo* cpi;
713 TreeModel::Row row;
715 row = *(_view.get_selection()->get_selected());
717 Window* win = row[_model.editor];
718 if (win && !win->is_visible()) {
719 win->present ();
720 } else {
721 cpi = row[_model.protocol_info];
723 if (cpi && cpi->protocol && cpi->protocol->has_editor ()) {
724 Box* box = (Box*) cpi->protocol->get_gui ();
725 if (box) {
726 string title = row[_model.name];
727 ArdourDialog* win = new ArdourDialog (_parent, title);
728 win->get_vbox()->pack_start (*box, false, false);
729 box->show ();
730 win->present ();
731 row[_model.editor] = win;
737 class ControlSurfacesModelColumns : public TreeModelColumnRecord
739 public:
741 ControlSurfacesModelColumns ()
743 add (name);
744 add (enabled);
745 add (feedback);
746 add (protocol_info);
747 add (editor);
750 TreeModelColumn<string> name;
751 TreeModelColumn<bool> enabled;
752 TreeModelColumn<bool> feedback;
753 TreeModelColumn<ControlProtocolInfo*> protocol_info;
754 TreeModelColumn<Gtk::Window*> editor;
757 Glib::RefPtr<ListStore> _store;
758 ControlSurfacesModelColumns _model;
759 TreeView _view;
760 Gtk::Window& _parent;
764 RCOptionEditor::RCOptionEditor ()
765 : OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
766 , _rc_config (Config)
768 /* MISC */
770 uint32_t hwcpus = hardware_concurrency ();
772 if (hwcpus > 1) {
773 add_option (_("Misc"), new OptionEditorHeading (_("DSP CPU Utilization")));
775 ComboOption<int32_t>* procs = new ComboOption<int32_t> (
776 "processor-usage",
777 _("Signal processing uses"),
778 sigc::mem_fun (*_rc_config, &RCConfiguration::get_processor_usage),
779 sigc::mem_fun (*_rc_config, &RCConfiguration::set_processor_usage)
782 procs->add (-1, _("all but one processor"));
783 procs->add (0, _("all available processors"));
785 for (uint32_t i = 1; i <= hwcpus; ++i) {
786 procs->add (i, string_compose (_("%1 processors"), i));
789 add_option (_("Misc"), procs);
792 add_option (_("Misc"), new OptionEditorHeading (_("Metering")));
794 ComboOption<float>* mht = new ComboOption<float> (
795 "meter-hold",
796 _("Meter hold time"),
797 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_hold),
798 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_hold)
801 mht->add (MeterHoldOff, _("off"));
802 mht->add (MeterHoldShort, _("short"));
803 mht->add (MeterHoldMedium, _("medium"));
804 mht->add (MeterHoldLong, _("long"));
806 add_option (_("Misc"), mht);
808 ComboOption<float>* mfo = new ComboOption<float> (
809 "meter-falloff",
810 _("Meter fall-off"),
811 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_falloff),
812 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_falloff)
815 mfo->add (METER_FALLOFF_OFF, _("off"));
816 mfo->add (METER_FALLOFF_SLOWEST, _("slowest"));
817 mfo->add (METER_FALLOFF_SLOW, _("slow"));
818 mfo->add (METER_FALLOFF_MEDIUM, _("medium"));
819 mfo->add (METER_FALLOFF_FAST, _("fast"));
820 mfo->add (METER_FALLOFF_FASTER, _("faster"));
821 mfo->add (METER_FALLOFF_FASTEST, _("fastest"));
823 add_option (_("Misc"), mfo);
825 add_option (_("Misc"), new OptionEditorHeading (_("Undo")));
827 add_option (_("Misc"), new UndoOptions (_rc_config));
829 add_option (_("Misc"), new OptionEditorHeading (_("Misc")));
831 #ifndef GTKOSX
832 /* font scaling does nothing with GDK/Quartz */
833 add_option (_("Misc"), new FontScalingOptions (_rc_config));
834 #endif
836 add_option (_("Misc"),
837 new BoolOption (
838 "verify-remove-last-capture",
839 _("Verify removal of last capture"),
840 sigc::mem_fun (*_rc_config, &RCConfiguration::get_verify_remove_last_capture),
841 sigc::mem_fun (*_rc_config, &RCConfiguration::set_verify_remove_last_capture)
844 add_option (_("Misc"),
845 new BoolOption (
846 "periodic-safety-backups",
847 _("Make periodic backups of the session file"),
848 sigc::mem_fun (*_rc_config, &RCConfiguration::get_periodic_safety_backups),
849 sigc::mem_fun (*_rc_config, &RCConfiguration::set_periodic_safety_backups)
852 add_option (_("Misc"),
853 new BoolOption (
854 "sync-all-route-ordering",
855 _("Syncronise editor and mixer track order"),
856 sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_all_route_ordering),
857 sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_all_route_ordering)
860 add_option (_("Misc"),
861 new BoolOption (
862 "only-copy-imported-files",
863 _("Always copy imported files"),
864 sigc::mem_fun (*_rc_config, &RCConfiguration::get_only_copy_imported_files),
865 sigc::mem_fun (*_rc_config, &RCConfiguration::set_only_copy_imported_files)
868 add_option (_("Misc"),
869 new BoolOption (
870 "default-narrow_ms",
871 _("Use narrow mixer strips"),
872 sigc::mem_fun (*_rc_config, &RCConfiguration::get_default_narrow_ms),
873 sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_narrow_ms)
876 add_option (_("Misc"),
877 new BoolOption (
878 "name-new-markers",
879 _("Name new markers"),
880 sigc::mem_fun (*_rc_config, &RCConfiguration::get_name_new_markers),
881 sigc::mem_fun (*_rc_config, &RCConfiguration::set_name_new_markers)
884 add_option (_("Misc"), new OptionEditorHeading (_("Click")));
886 add_option (_("Misc"), new ClickOptions (_rc_config, this));
888 /* TRANSPORT */
890 add_option (_("Transport"),
891 new BoolOption (
892 "latched-record-enable",
893 _("Keep record-enable engaged on stop"),
894 sigc::mem_fun (*_rc_config, &RCConfiguration::get_latched_record_enable),
895 sigc::mem_fun (*_rc_config, &RCConfiguration::set_latched_record_enable)
898 add_option (_("Transport"),
899 new BoolOption (
900 "stop-recording-on-xrun",
901 _("Stop recording when an xrun occurs"),
902 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_recording_on_xrun),
903 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_recording_on_xrun)
906 add_option (_("Transport"),
907 new BoolOption (
908 "create-xrun-marker",
909 _("Create markers where xruns occur"),
910 sigc::mem_fun (*_rc_config, &RCConfiguration::get_create_xrun_marker),
911 sigc::mem_fun (*_rc_config, &RCConfiguration::set_create_xrun_marker)
914 add_option (_("Transport"),
915 new BoolOption (
916 "stop-at-session-end",
917 _("Stop at the end of the session"),
918 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_at_session_end),
919 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_at_session_end)
922 add_option (_("Transport"),
923 new BoolOption (
924 "seamless-loop",
925 _("Do seamless looping (not possible when slaved to MTC, JACK etc)"),
926 sigc::mem_fun (*_rc_config, &RCConfiguration::get_seamless_loop),
927 sigc::mem_fun (*_rc_config, &RCConfiguration::set_seamless_loop)
930 add_option (_("Transport"),
931 new BoolOption (
932 "primary-clock-delta-edit-cursor",
933 _("Primary clock delta to edit cursor"),
934 sigc::mem_fun (*_rc_config, &RCConfiguration::get_primary_clock_delta_edit_cursor),
935 sigc::mem_fun (*_rc_config, &RCConfiguration::set_primary_clock_delta_edit_cursor)
938 add_option (_("Transport"),
939 new BoolOption (
940 "secondary-clock-delta-edit-cursor",
941 _("Secondary clock delta to edit cursor"),
942 sigc::mem_fun (*_rc_config, &RCConfiguration::get_secondary_clock_delta_edit_cursor),
943 sigc::mem_fun (*_rc_config, &RCConfiguration::set_secondary_clock_delta_edit_cursor)
946 add_option (_("Transport"),
947 new BoolOption (
948 "disable-disarm-during-roll",
949 _("Disable per-track record disarm while rolling"),
950 sigc::mem_fun (*_rc_config, &RCConfiguration::get_disable_disarm_during_roll),
951 sigc::mem_fun (*_rc_config, &RCConfiguration::set_disable_disarm_during_roll)
954 add_option (_("Transport"),
955 new BoolOption (
956 "quieten_at_speed",
957 _("12dB gain reduction during fast-forward and fast-rewind"),
958 sigc::mem_fun (*_rc_config, &RCConfiguration::get_quieten_at_speed),
959 sigc::mem_fun (*_rc_config, &RCConfiguration::set_quieten_at_speed)
962 /* EDITOR */
964 add_option (_("Editor"),
965 new BoolOption (
966 "link-region-and-track-selection",
967 _("Link selection of regions and tracks"),
968 sigc::mem_fun (*_rc_config, &RCConfiguration::get_link_region_and_track_selection),
969 sigc::mem_fun (*_rc_config, &RCConfiguration::set_link_region_and_track_selection)
972 add_option (_("Editor"),
973 new BoolOption (
974 "automation-follows-regions",
975 _("Move relevant automation when audio regions are moved"),
976 sigc::mem_fun (*_rc_config, &RCConfiguration::get_automation_follows_regions),
977 sigc::mem_fun (*_rc_config, &RCConfiguration::set_automation_follows_regions)
980 add_option (_("Editor"),
981 new BoolOption (
982 "show-track-meters",
983 _("Show meters on tracks in the editor"),
984 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_track_meters),
985 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters)
988 add_option (_("Editor"),
989 new BoolOption (
990 "use-overlap-equivalency",
991 _("Use overlap equivalency for regions"),
992 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_overlap_equivalency),
993 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_overlap_equivalency)
996 add_option (_("Editor"),
997 new BoolOption (
998 "rubberbanding-snaps-to-grid",
999 _("Make rubberband selection rectangle snap to the grid"),
1000 sigc::mem_fun (*_rc_config, &RCConfiguration::get_rubberbanding_snaps_to_grid),
1001 sigc::mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
1004 add_option (_("Editor"),
1005 new BoolOption (
1006 "show-waveforms",
1007 _("Show waveforms in regions"),
1008 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
1009 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
1012 ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
1013 "waveform-scale",
1014 _("Waveform scale"),
1015 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
1016 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
1019 wfs->add (Linear, _("linear"));
1020 wfs->add (Logarithmic, _("logarithmic"));
1022 add_option (_("Editor"), wfs);
1024 ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
1025 "waveform-shape",
1026 _("Waveform shape"),
1027 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
1028 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
1031 wfsh->add (Traditional, _("traditional"));
1032 wfsh->add (Rectified, _("rectified"));
1034 add_option (_("Editor"), wfsh);
1036 add_option (_("Editor"),
1037 new BoolOption (
1038 "show-waveforms-while-recording",
1039 _("Show waveforms for audio while it is being recorded"),
1040 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms_while_recording),
1041 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms_while_recording)
1044 add_option (_("Editor"),
1045 new BoolOption (
1046 "show-zoom-tools",
1047 _("Show zoom toolbar"),
1048 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_zoom_tools),
1049 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_zoom_tools)
1052 add_option (_("Editor"),
1053 new BoolOption (
1054 "color-regions-using-track-color",
1055 _("Color regions using their track's color"),
1056 sigc::mem_fun (*_rc_config, &RCConfiguration::get_color_regions_using_track_color),
1057 sigc::mem_fun (*_rc_config, &RCConfiguration::set_color_regions_using_track_color)
1060 /* AUDIO */
1062 add_option (_("Audio"), new OptionEditorHeading (_("Buffering")));
1064 add_option (_("Audio"), new BufferingOptions (_rc_config));
1066 add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
1068 add_option (_("Audio"),
1069 new BoolOption (
1070 "use-monitor-bus",
1071 _("Use a monitor bus (allows AFL/PFL and more control)"),
1072 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_monitor_bus),
1073 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_monitor_bus)
1076 ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
1077 "monitoring-model",
1078 _("Record monitoring handled by"),
1079 sigc::mem_fun (*_rc_config, &RCConfiguration::get_monitoring_model),
1080 sigc::mem_fun (*_rc_config, &RCConfiguration::set_monitoring_model)
1083 #ifndef __APPLE__
1084 /* no JACK monitoring on CoreAudio */
1085 if (AudioEngine::instance()->can_request_hardware_monitoring()) {
1086 mm->add (HardwareMonitoring, _("JACK"));
1088 #endif
1089 mm->add (SoftwareMonitoring, _("ardour"));
1090 mm->add (ExternalMonitoring, _("audio hardware"));
1092 add_option (_("Audio"), mm);
1094 ComboOption<PFLPosition>* pp = new ComboOption<PFLPosition> (
1095 "pfl-position",
1096 _("PFL signals come from"),
1097 sigc::mem_fun (*_rc_config, &RCConfiguration::get_pfl_position),
1098 sigc::mem_fun (*_rc_config, &RCConfiguration::set_pfl_position)
1101 pp->add (PFLFromBeforeProcessors, _("before pre-fader processors"));
1102 pp->add (PFLFromAfterProcessors, _("pre-fader but after pre-fader processors"));
1104 add_option (_("Audio"), pp);
1106 ComboOption<AFLPosition>* pa = new ComboOption<AFLPosition> (
1107 "afl-position",
1108 _("AFL signals come from"),
1109 sigc::mem_fun (*_rc_config, &RCConfiguration::get_afl_position),
1110 sigc::mem_fun (*_rc_config, &RCConfiguration::set_afl_position)
1113 pa->add (AFLFromBeforeProcessors, _("post-fader but before post-fader processors"));
1114 pa->add (AFLFromAfterProcessors, _("after post-fader processors"));
1116 add_option (_("Audio"), pa);
1118 add_option (_("Audio"),
1119 new BoolOption (
1120 "tape-machine-mode",
1121 _("Tape machine mode"),
1122 sigc::mem_fun (*_rc_config, &RCConfiguration::get_tape_machine_mode),
1123 sigc::mem_fun (*_rc_config, &RCConfiguration::set_tape_machine_mode)
1126 add_option (_("Audio"), new OptionEditorHeading (_("Connection of tracks and busses")));
1128 add_option (_("Audio"),
1129 new BoolOption (
1130 "auto-connect-standard-busses",
1131 _("Auto-connect master/monitor busses"),
1132 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_connect_standard_busses),
1133 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_connect_standard_busses)
1136 ComboOption<AutoConnectOption>* iac = new ComboOption<AutoConnectOption> (
1137 "input-auto-connect",
1138 _("Connect track inputs"),
1139 sigc::mem_fun (*_rc_config, &RCConfiguration::get_input_auto_connect),
1140 sigc::mem_fun (*_rc_config, &RCConfiguration::set_input_auto_connect)
1143 iac->add (AutoConnectPhysical, _("automatically to physical inputs"));
1144 iac->add (ManualConnect, _("manually"));
1146 add_option (_("Audio"), iac);
1148 ComboOption<AutoConnectOption>* oac = new ComboOption<AutoConnectOption> (
1149 "output-auto-connect",
1150 _("Connect track and bus outputs"),
1151 sigc::mem_fun (*_rc_config, &RCConfiguration::get_output_auto_connect),
1152 sigc::mem_fun (*_rc_config, &RCConfiguration::set_output_auto_connect)
1155 oac->add (AutoConnectPhysical, _("automatically to physical outputs"));
1156 oac->add (AutoConnectMaster, _("automatically to master bus"));
1157 oac->add (ManualConnect, _("manually"));
1159 add_option (_("Audio"), oac);
1161 add_option (_("Audio"), new OptionEditorHeading (_("Denormals")));
1163 add_option (_("Audio"),
1164 new BoolOption (
1165 "denormal-protection",
1166 _("Use DC bias to protect against denormals"),
1167 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_protection),
1168 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_protection)
1171 ComboOption<DenormalModel>* dm = new ComboOption<DenormalModel> (
1172 "denormal-model",
1173 _("Processor handling"),
1174 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_model),
1175 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_model)
1178 dm->add (DenormalNone, _("no processor handling"));
1180 FPU fpu;
1182 if (fpu.has_flush_to_zero()) {
1183 dm->add (DenormalFTZ, _("use FlushToZero"));
1186 if (fpu.has_denormals_are_zero()) {
1187 dm->add (DenormalDAZ, _("use DenormalsAreZero"));
1190 if (fpu.has_flush_to_zero() && fpu.has_denormals_are_zero()) {
1191 dm->add (DenormalFTZDAZ, _("use FlushToZero and DenormalsAreZerO"));
1194 add_option (_("Audio"), dm);
1196 add_option (_("Audio"), new OptionEditorHeading (_("Plugins")));
1198 add_option (_("Audio"),
1199 new BoolOption (
1200 "plugins-stop-with-transport",
1201 _("Stop plugins when the transport is stopped"),
1202 sigc::mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
1203 sigc::mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
1206 add_option (_("Audio"),
1207 new BoolOption (
1208 "do-not-record-plugins",
1209 _("Disable plugins during recording"),
1210 sigc::mem_fun (*_rc_config, &RCConfiguration::get_do_not_record_plugins),
1211 sigc::mem_fun (*_rc_config, &RCConfiguration::set_do_not_record_plugins)
1214 add_option (_("Audio"),
1215 new BoolOption (
1216 "new-plugins-active",
1217 _("Make new plugins active"),
1218 sigc::mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
1219 sigc::mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
1222 add_option (_("Audio"),
1223 new BoolOption (
1224 "auto-analyse-audio",
1225 _("Enable automatic analysis of audio"),
1226 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_analyse_audio),
1227 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_analyse_audio)
1230 add_option (_("Audio"),
1231 new BoolOption (
1232 "replicate-missing-region-channels",
1233 _("Replicate missing region channels"),
1234 sigc::mem_fun (*_rc_config, &RCConfiguration::get_replicate_missing_region_channels),
1235 sigc::mem_fun (*_rc_config, &RCConfiguration::set_replicate_missing_region_channels)
1238 /* SOLO AND MUTE */
1240 add_option (_("Solo / mute"),
1241 new FaderOption (
1242 "solo-mute-gain",
1243 _("Solo mute cut (dB)"),
1244 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_gain),
1245 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_gain)
1248 _solo_control_is_listen_control = new BoolOption (
1249 "solo-control-is-listen-control",
1250 _("Solo controls are Listen controls"),
1251 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_control_is_listen_control),
1252 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_control_is_listen_control)
1255 add_option (_("Solo / mute"), _solo_control_is_listen_control);
1257 _listen_position = new ComboOption<ListenPosition> (
1258 "listen-position",
1259 _("Listen Position"),
1260 sigc::mem_fun (*_rc_config, &RCConfiguration::get_listen_position),
1261 sigc::mem_fun (*_rc_config, &RCConfiguration::set_listen_position)
1264 _listen_position->add (AfterFaderListen, _("after-fader listen"));
1265 _listen_position->add (PreFaderListen, _("pre-fader listen"));
1267 add_option (_("Solo / mute"), _listen_position);
1269 parameter_changed ("use-monitor-bus");
1271 add_option (_("Solo / mute"),
1272 new BoolOption (
1273 "exclusive-solo",
1274 _("Exclusive solo"),
1275 sigc::mem_fun (*_rc_config, &RCConfiguration::get_exclusive_solo),
1276 sigc::mem_fun (*_rc_config, &RCConfiguration::set_exclusive_solo)
1279 add_option (_("Solo / mute"),
1280 new BoolOption (
1281 "show-solo-mutes",
1282 _("Show solo muting"),
1283 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_solo_mutes),
1284 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_solo_mutes)
1287 add_option (_("Solo / mute"),
1288 new BoolOption (
1289 "solo-mute-override",
1290 _("Soloing overrides muting"),
1291 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_override),
1292 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_override)
1295 add_option (_("Solo / mute"), new OptionEditorHeading (_("Default track / bus muting options")));
1297 add_option (_("Solo / mute"),
1298 new BoolOption (
1299 "mute-affects-pre-fader",
1300 _("Mute affects pre-fader sends"),
1301 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_pre_fader),
1302 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_pre_fader)
1305 add_option (_("Solo / mute"),
1306 new BoolOption (
1307 "mute-affects-post-fader",
1308 _("Mute affects post-fader sends"),
1309 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_post_fader),
1310 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_post_fader)
1313 add_option (_("Solo / mute"),
1314 new BoolOption (
1315 "mute-affects-control-outs",
1316 _("Mute affects control outputs"),
1317 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_control_outs),
1318 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_control_outs)
1321 add_option (_("Solo / mute"),
1322 new BoolOption (
1323 "mute-affects-main-outs",
1324 _("Mute affects main outputs"),
1325 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_main_outs),
1326 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_main_outs)
1329 add_option (_("MIDI control"),
1330 new BoolOption (
1331 "send-midi-clock",
1332 _("Send MIDI Clock"),
1333 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_midi_clock),
1334 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_midi_clock)
1337 add_option (_("MIDI control"),
1338 new BoolOption (
1339 "send-mtc",
1340 _("Send MIDI Time Code"),
1341 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mtc),
1342 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mtc)
1345 add_option (_("MIDI control"),
1346 new SpinOption<int> (
1347 "mtc-qf-speed-tolerance",
1348 _("Percentage either side of normal transport speed to transmit MTC"),
1349 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mtc_qf_speed_tolerance),
1350 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mtc_qf_speed_tolerance),
1351 0, 20, 1, 5
1354 add_option (_("MIDI control"),
1355 new BoolOption (
1356 "mmc-control",
1357 _("Obey MIDI Machine Control commands"),
1358 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_control),
1359 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
1362 add_option (_("MIDI control"),
1363 new BoolOption (
1364 "send-mmc",
1365 _("Send MIDI Machine Control commands"),
1366 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mmc),
1367 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mmc)
1370 add_option (_("MIDI control"),
1371 new BoolOption (
1372 "midi-feedback",
1373 _("Send MIDI control feedback"),
1374 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_feedback),
1375 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_feedback)
1378 add_option (_("MIDI control"),
1379 new SpinOption<uint8_t> (
1380 "mmc-receive-device-id",
1381 _("Inbound MMC device ID"),
1382 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_receive_device_id),
1383 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_receive_device_id),
1384 0, 128, 1, 10
1387 add_option (_("MIDI control"),
1388 new SpinOption<uint8_t> (
1389 "mmc-send-device-id",
1390 _("Outbound MMC device ID"),
1391 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_send_device_id),
1392 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_send_device_id),
1393 0, 128, 1, 10
1396 add_option (_("MIDI control"),
1397 new SpinOption<int32_t> (
1398 "initial-program-change",
1399 _("Initial program change"),
1400 sigc::mem_fun (*_rc_config, &RCConfiguration::get_initial_program_change),
1401 sigc::mem_fun (*_rc_config, &RCConfiguration::set_initial_program_change),
1402 -1, 65536, 1, 10
1405 /* CONTROL SURFACES */
1407 add_option (_("Control surfaces"), new ControlSurfacesOptions (*this));
1409 ComboOption<RemoteModel>* rm = new ComboOption<RemoteModel> (
1410 "remote-model",
1411 _("Control surface remote ID"),
1412 sigc::mem_fun (*_rc_config, &RCConfiguration::get_remote_model),
1413 sigc::mem_fun (*_rc_config, &RCConfiguration::set_remote_model)
1416 rm->add (UserOrdered, _("assigned by user"));
1417 rm->add (MixerOrdered, _("follows order of mixer"));
1418 rm->add (EditorOrdered, _("follows order of editor"));
1420 add_option (_("Control surfaces"), rm);
1422 /* KEYBOARD */
1424 add_option (_("Keyboard"), new KeyboardOptions);
1427 void
1428 RCOptionEditor::parameter_changed (string const & p)
1430 OptionEditor::parameter_changed (p);
1432 if (p == "use-monitor-bus") {
1433 bool const s = Config->get_use_monitor_bus ();
1434 if (!s) {
1435 /* we can't use this if we don't have a monitor bus */
1436 Config->set_solo_control_is_listen_control (false);
1438 _solo_control_is_listen_control->set_sensitive (s);
1439 _listen_position->set_sensitive (s);