1 #include <gtkmm/liststore.h>
2 #include <gtkmm/stock.h>
3 #include <gtkmm/scale.h>
4 #include <gtkmm2ext/utils.h>
5 #include <gtkmm2ext/slider_controller.h>
7 #include "midi++/manager.h"
8 #include "midi++/factory.h"
10 #include "ardour/rc_configuration.h"
11 #include "ardour/control_protocol_manager.h"
12 #include "control_protocol/control_protocol.h"
13 #include "rc_option_editor.h"
15 #include "midi_port_dialog.h"
23 using namespace Gtkmm2ext;
25 using namespace ARDOUR;
27 class MIDIPorts : public OptionEditorBox
30 MIDIPorts (RCConfiguration* c, list<ComboOption<string>* > const & o)
32 _add_port_button (Stock::ADD),
35 _store = ListStore::create (_model);
36 _view.set_model (_store);
37 _view.append_column (_("Name"), _model.name);
38 _view.get_column(0)->set_resizable (true);
39 _view.get_column(0)->set_expand (true);
40 _view.append_column_editable (_("Online"), _model.online);
41 _view.append_column_editable (_("Trace input"), _model.trace_input);
42 _view.append_column_editable (_("Trace output"), _model.trace_output);
44 HBox* h = manage (new HBox);
46 h->pack_start (_view, true, true);
48 VBox* v = manage (new VBox);
50 v->pack_start (_add_port_button, false, false);
51 h->pack_start (*v, false, false);
53 _box->pack_start (*h);
57 _store->signal_row_changed().connect (mem_fun (*this, &MIDIPorts::model_changed));
59 _add_port_button.signal_clicked().connect (mem_fun (*this, &MIDIPorts::add_port_clicked));
62 void parameter_changed (string const &) {}
63 void set_state_from_config () {}
67 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
69 TreeModel::Row r = *i;
71 MIDI::Port* port = r[_model.port];
78 if (r[_model.online] == port->input()->offline()) {
79 port->input()->set_offline (!r[_model.online]);
82 if (r[_model.trace_input] != port->input()->tracing()) {
83 port->input()->trace (r[_model.trace_input], &cerr, string (port->name()) + _(" input: "));
89 if (r[_model.trace_output] != port->output()->tracing()) {
90 port->output()->trace (r[_model.trace_output], &cerr, string (port->name()) + _(" output: "));
96 void setup_ports_combo (ComboOption<string>* c)
99 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
100 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
101 c->add ((*i)->name(), (*i)->name());
105 void ports_changed ()
107 /* XXX: why is this coming from here? */
108 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
112 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
114 TreeModel::Row r = *_store->append ();
116 r[_model.name] = (*i)->name();
119 r[_model.online] = !(*i)->input()->offline();
120 (*i)->input()->OfflineStatusChanged.connect (bind (mem_fun (*this, &MIDIPorts::port_offline_changed), (*i)));
121 r[_model.trace_input] = (*i)->input()->tracing();
124 if ((*i)->output()) {
125 r[_model.trace_output] = (*i)->output()->tracing();
128 r[_model.port] = (*i);
131 for (list<ComboOption<string>* >::iterator i = _port_combos.begin(); i != _port_combos.end(); ++i) {
132 setup_ports_combo (*i);
136 void port_offline_changed (MIDI::Port* p)
142 for (TreeModel::Children::iterator i = _store->children().begin(); i != _store->children().end(); ++i) {
143 if ((*i)[_model.port] == p) {
144 (*i)[_model.online] = !p->input()->offline();
149 void add_port_clicked ()
151 MidiPortDialog dialog;
153 dialog.set_position (WIN_POS_MOUSE);
157 int const r = dialog.run ();
160 case RESPONSE_ACCEPT:
167 Glib::ustring const mode = dialog.port_mode_combo.get_active_text ();
170 if (mode == _("input")) {
172 } else if (mode == (_("output"))) {
178 XMLNode node (X_("MIDI-port"));
180 node.add_property ("tag", dialog.port_name.get_text());
181 node.add_property ("device", X_("ardour")); // XXX this can't be right for all types
182 node.add_property ("type", MIDI::PortFactory::default_port_type());
183 node.add_property ("mode", smod);
185 if (MIDI::Manager::instance()->add_port (node) != 0) {
190 class MIDIModelColumns : public TreeModelColumnRecord
202 TreeModelColumn<string> name;
203 TreeModelColumn<bool> online;
204 TreeModelColumn<bool> trace_input;
205 TreeModelColumn<bool> trace_output;
206 TreeModelColumn<MIDI::Port*> port;
209 RCConfiguration* _rc_config;
210 Glib::RefPtr<ListStore> _store;
211 MIDIModelColumns _model;
213 Button _add_port_button;
214 ComboBoxText _mtc_combo;
215 ComboBoxText _midi_clock_combo;
216 ComboBoxText _mmc_combo;
217 ComboBoxText _mpc_combo;
218 list<ComboOption<string>* > _port_combos;
222 class ClickOptions : public OptionEditorBox
225 ClickOptions (RCConfiguration* c, ArdourDialog* p)
229 Table* t = manage (new Table (2, 3));
232 Label* l = manage (new Label (_("Click audio file:")));
233 l->set_alignment (0, 0.5);
234 t->attach (*l, 0, 1, 0, 1, FILL);
235 t->attach (_click_path_entry, 1, 2, 0, 1, FILL);
236 Button* b = manage (new Button (_("Browse...")));
237 b->signal_clicked().connect (mem_fun (*this, &ClickOptions::click_browse_clicked));
238 t->attach (*b, 2, 3, 0, 1, FILL);
240 l = manage (new Label (_("Click emphasis audio file:")));
241 l->set_alignment (0, 0.5);
242 t->attach (*l, 0, 1, 1, 2, FILL);
243 t->attach (_click_emphasis_path_entry, 1, 2, 1, 2, FILL);
244 b = manage (new Button (_("Browse...")));
245 b->signal_clicked().connect (mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked));
246 t->attach (*b, 2, 3, 1, 2, FILL);
248 _box->pack_start (*t, false, false);
251 void parameter_changed (string const & p)
253 if (p == "click-sound") {
254 _click_path_entry.set_text (_rc_config->get_click_sound());
255 } else if (p == "click-emphasis-sound") {
256 _click_emphasis_path_entry.set_text (_rc_config->get_click_emphasis_sound());
260 void set_state_from_config ()
262 parameter_changed ("click-sound");
263 parameter_changed ("click-emphasis-sound");
268 void click_browse_clicked ()
270 SoundFileChooser sfdb (*_parent, _("Choose Click"));
275 if (sfdb.run () == RESPONSE_OK) {
276 click_chosen (sfdb.get_filename());
280 void click_chosen (string const & path)
282 _click_path_entry.set_text (path);
283 _rc_config->set_click_sound (path);
286 void click_emphasis_browse_clicked ()
288 SoundFileChooser sfdb (*_parent, _("Choose Click Emphasis"));
293 if (sfdb.run () == RESPONSE_OK) {
294 click_emphasis_chosen (sfdb.get_filename());
298 void click_emphasis_chosen (string const & path)
300 _click_emphasis_path_entry.set_text (path);
301 _rc_config->set_click_emphasis_sound (path);
304 RCConfiguration* _rc_config;
305 ArdourDialog* _parent;
306 Entry _click_path_entry;
307 Entry _click_emphasis_path_entry;
310 class UndoOptions : public OptionEditorBox
313 UndoOptions (RCConfiguration* c) :
315 _limit_undo_button (_("Limit undo history to")),
316 _save_undo_button (_("Save undo history of"))
318 Table* t = new Table (2, 3);
321 t->attach (_limit_undo_button, 0, 1, 0, 1, FILL);
322 _limit_undo_spin.set_range (0, 512);
323 _limit_undo_spin.set_increments (1, 10);
324 t->attach (_limit_undo_spin, 1, 2, 0, 1, FILL | EXPAND);
325 Label* l = manage (new Label (_("commands")));
326 l->set_alignment (0, 0.5);
327 t->attach (*l, 2, 3, 0, 1);
329 t->attach (_save_undo_button, 0, 1, 1, 2, FILL);
330 _save_undo_spin.set_range (0, 512);
331 _save_undo_spin.set_increments (1, 10);
332 t->attach (_save_undo_spin, 1, 2, 1, 2, FILL | EXPAND);
333 l = manage (new Label (_("commands")));
334 l->set_alignment (0, 0.5);
335 t->attach (*l, 2, 3, 1, 2);
337 _box->pack_start (*t);
339 _limit_undo_button.signal_toggled().connect (mem_fun (*this, &UndoOptions::limit_undo_toggled));
340 _limit_undo_spin.signal_value_changed().connect (mem_fun (*this, &UndoOptions::limit_undo_changed));
341 _save_undo_button.signal_toggled().connect (mem_fun (*this, &UndoOptions::save_undo_toggled));
342 _save_undo_spin.signal_value_changed().connect (mem_fun (*this, &UndoOptions::save_undo_changed));
345 void parameter_changed (string const & p)
347 if (p == "history-depth") {
348 int32_t const d = _rc_config->get_history_depth();
349 _limit_undo_button.set_active (d != 0);
350 _limit_undo_spin.set_sensitive (d != 0);
351 _limit_undo_spin.set_value (d);
352 } else if (p == "save-history") {
353 bool const x = _rc_config->get_save_history ();
354 _save_undo_button.set_active (x);
355 _save_undo_spin.set_sensitive (x);
356 } else if (p == "save-history-depth") {
357 _save_undo_spin.set_value (_rc_config->get_saved_history_depth());
361 void set_state_from_config ()
363 parameter_changed ("save-history");
364 parameter_changed ("history-depth");
365 parameter_changed ("save-history-depth");
368 void limit_undo_toggled ()
370 bool const x = _limit_undo_button.get_active ();
371 _limit_undo_spin.set_sensitive (x);
372 int32_t const n = x ? 16 : 0;
373 _limit_undo_spin.set_value (n);
374 _rc_config->set_history_depth (n);
377 void limit_undo_changed ()
379 _rc_config->set_history_depth (_limit_undo_spin.get_value_as_int ());
382 void save_undo_toggled ()
384 bool const x = _save_undo_button.get_active ();
385 _rc_config->set_save_history (x);
388 void save_undo_changed ()
390 _rc_config->set_saved_history_depth (_save_undo_spin.get_value_as_int ());
394 RCConfiguration* _rc_config;
395 CheckButton _limit_undo_button;
396 SpinButton _limit_undo_spin;
397 CheckButton _save_undo_button;
398 SpinButton _save_undo_spin;
403 static const struct {
415 { "Shift", GDK_SHIFT_MASK },
416 { "Command", GDK_META_MASK },
417 { "Control", GDK_CONTROL_MASK },
418 { "Option", GDK_MOD1_MASK },
419 { "Command-Shift", GDK_MOD1_MASK|GDK_SHIFT_MASK },
420 { "Command-Option", GDK_MOD1_MASK|GDK_MOD5_MASK },
421 { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD5_MASK },
422 { "Shift-Command-Option", GDK_MOD5_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
425 { "Shift", GDK_SHIFT_MASK },
426 { "Control", GDK_CONTROL_MASK },
427 { "Alt (Mod1)", GDK_MOD1_MASK },
428 { "Control-Shift", GDK_CONTROL_MASK|GDK_SHIFT_MASK },
429 { "Control-Alt", GDK_CONTROL_MASK|GDK_MOD1_MASK },
430 { "Shift-Alt", GDK_SHIFT_MASK|GDK_MOD1_MASK },
431 { "Control-Shift-Alt", GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
432 { "Mod2", GDK_MOD2_MASK },
433 { "Mod3", GDK_MOD3_MASK },
434 { "Mod4", GDK_MOD4_MASK },
435 { "Mod5", GDK_MOD5_MASK },
441 class KeyboardOptions : public OptionEditorBox
445 _delete_button_adjustment (3, 1, 12),
446 _delete_button_spin (_delete_button_adjustment),
447 _edit_button_adjustment (3, 1, 5),
448 _edit_button_spin (_edit_button_adjustment)
451 /* internationalize and prepare for use with combos */
454 for (int i = 0; modifiers[i].name; ++i) {
455 dumb.push_back (_(modifiers[i].name));
458 set_popdown_strings (_edit_modifier_combo, dumb);
459 _edit_modifier_combo.signal_changed().connect (mem_fun(*this, &KeyboardOptions::edit_modifier_chosen));
461 for (int x = 0; modifiers[x].name; ++x) {
462 if (modifiers[x].modifier == Keyboard::edit_modifier ()) {
463 _edit_modifier_combo.set_active_text (_(modifiers[x].name));
468 Table* t = manage (new Table (4, 4));
471 Label* l = manage (new Label (_("Edit using:")));
472 l->set_name ("OptionsLabel");
473 l->set_alignment (0, 0.5);
475 t->attach (*l, 0, 1, 0, 1, FILL | EXPAND, FILL);
476 t->attach (_edit_modifier_combo, 1, 2, 0, 1, FILL | EXPAND, FILL);
478 l = manage (new Label (_("+ button")));
479 l->set_name ("OptionsLabel");
481 t->attach (*l, 3, 4, 0, 1, FILL | EXPAND, FILL);
482 t->attach (_edit_button_spin, 4, 5, 0, 1, FILL | EXPAND, FILL);
484 _edit_button_spin.set_name ("OptionsEntry");
485 _edit_button_adjustment.set_value (Keyboard::edit_button());
486 _edit_button_adjustment.signal_value_changed().connect (mem_fun(*this, &KeyboardOptions::edit_button_changed));
488 set_popdown_strings (_delete_modifier_combo, dumb);
489 _delete_modifier_combo.signal_changed().connect (mem_fun(*this, &KeyboardOptions::delete_modifier_chosen));
491 for (int x = 0; modifiers[x].name; ++x) {
492 if (modifiers[x].modifier == Keyboard::delete_modifier ()) {
493 _delete_modifier_combo.set_active_text (_(modifiers[x].name));
498 l = manage (new Label (_("Delete using:")));
499 l->set_name ("OptionsLabel");
500 l->set_alignment (0, 0.5);
502 t->attach (*l, 0, 1, 1, 2, FILL | EXPAND, FILL);
503 t->attach (_delete_modifier_combo, 1, 2, 1, 2, FILL | EXPAND, FILL);
505 l = manage (new Label (_("+ button")));
506 l->set_name ("OptionsLabel");
508 t->attach (*l, 3, 4, 1, 2, FILL | EXPAND, FILL);
509 t->attach (_delete_button_spin, 4, 5, 1, 2, FILL | EXPAND, FILL);
511 _delete_button_spin.set_name ("OptionsEntry");
512 _delete_button_adjustment.set_value (Keyboard::delete_button());
513 _delete_button_adjustment.signal_value_changed().connect (mem_fun(*this, &KeyboardOptions::delete_button_changed));
515 set_popdown_strings (_snap_modifier_combo, dumb);
516 _snap_modifier_combo.signal_changed().connect (mem_fun(*this, &KeyboardOptions::snap_modifier_chosen));
518 for (int x = 0; modifiers[x].name; ++x) {
519 if (modifiers[x].modifier == (guint) Keyboard::snap_modifier ()) {
520 _snap_modifier_combo.set_active_text (_(modifiers[x].name));
525 l = manage (new Label (_("Toggle snap using:")));
526 l->set_name ("OptionsLabel");
527 l->set_alignment (0, 0.5);
529 t->attach (*l, 0, 1, 2, 3, FILL | EXPAND, FILL);
530 t->attach (_snap_modifier_combo, 1, 2, 2, 3, FILL | EXPAND, FILL);
534 for (map<string,string>::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) {
535 strs.push_back (bf->first);
538 set_popdown_strings (_keyboard_layout_selector, strs);
539 _keyboard_layout_selector.set_active_text (Keyboard::current_binding_name());
540 _keyboard_layout_selector.signal_changed().connect (mem_fun (*this, &KeyboardOptions::bindings_changed));
542 l = manage (new Label (_("Keyboard layout:")));
543 l->set_name ("OptionsLabel");
544 l->set_alignment (0, 0.5);
546 t->attach (*l, 0, 1, 3, 4, FILL | EXPAND, FILL);
547 t->attach (_keyboard_layout_selector, 1, 2, 3, 4, FILL | EXPAND, FILL);
549 _box->pack_start (*t, false, false);
552 void parameter_changed (string const &)
554 /* XXX: these aren't really config options... */
557 void set_state_from_config ()
559 /* XXX: these aren't really config options... */
564 void bindings_changed ()
566 string const txt = _keyboard_layout_selector.get_active_text();
568 /* XXX: config...? for all this keyboard stuff */
570 for (map<string,string>::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) {
571 if (txt == i->first) {
572 if (Keyboard::load_keybindings (i->second)) {
573 Keyboard::save_keybindings ();
579 void edit_modifier_chosen ()
581 string const txt = _edit_modifier_combo.get_active_text();
583 for (int i = 0; modifiers[i].name; ++i) {
584 if (txt == _(modifiers[i].name)) {
585 Keyboard::set_edit_modifier (modifiers[i].modifier);
591 void delete_modifier_chosen ()
593 string const txt = _delete_modifier_combo.get_active_text();
595 for (int i = 0; modifiers[i].name; ++i) {
596 if (txt == _(modifiers[i].name)) {
597 Keyboard::set_delete_modifier (modifiers[i].modifier);
603 void snap_modifier_chosen ()
605 string const txt = _snap_modifier_combo.get_active_text();
607 for (int i = 0; modifiers[i].name; ++i) {
608 if (txt == _(modifiers[i].name)) {
609 Keyboard::set_snap_modifier (modifiers[i].modifier);
615 void delete_button_changed ()
617 Keyboard::set_delete_button (_delete_button_spin.get_value_as_int());
620 void edit_button_changed ()
622 Keyboard::set_edit_button (_edit_button_spin.get_value_as_int());
625 ComboBoxText _keyboard_layout_selector;
626 ComboBoxText _edit_modifier_combo;
627 ComboBoxText _delete_modifier_combo;
628 ComboBoxText _snap_modifier_combo;
629 Adjustment _delete_button_adjustment;
630 SpinButton _delete_button_spin;
631 Adjustment _edit_button_adjustment;
632 SpinButton _edit_button_spin;
635 class FontScalingOptions : public OptionEditorBox
638 FontScalingOptions (RCConfiguration* c) :
640 _dpi_adjustment (50, 50, 250, 1, 10),
641 _dpi_slider (_dpi_adjustment)
643 _dpi_adjustment.set_value (_rc_config->get_font_scale () / 1024);
645 Label* l = manage (new Label (_("Font scaling:")));
646 l->set_name ("OptionsLabel");
648 _dpi_slider.set_update_policy (UPDATE_DISCONTINUOUS);
649 HBox* h = manage (new HBox);
651 h->pack_start (*l, false, false);
652 h->pack_start (_dpi_slider, true, true);
654 _box->pack_start (*h, false, false);
656 _dpi_adjustment.signal_value_changed().connect (mem_fun (*this, &FontScalingOptions::dpi_changed));
659 void parameter_changed (string const & p)
661 if (p == "font-scale") {
662 _dpi_adjustment.set_value (_rc_config->get_font_scale() / 1024);
666 void set_state_from_config ()
668 parameter_changed ("font-scale");
675 _rc_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024));
676 /* XXX: should be triggered from the parameter changed signal */
680 RCConfiguration* _rc_config;
681 Adjustment _dpi_adjustment;
685 class SoloMuteOptions : public OptionEditorBox
688 SoloMuteOptions (RCConfiguration* c) :
690 // 0.781787 is the value needed for gain to be set to 0.
691 _db_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1)
694 if ((pix = ::get_icon ("fader_belt_h")) == 0) {
695 throw failed_constructor();
698 _db_slider = manage (new HSliderController (pix,
703 parameter_changed ("solo-mute-gain");
705 Label* l = manage (new Label (_("Solo mute cut (dB):")));
706 l->set_name ("OptionsLabel");
708 HBox* h = manage (new HBox);
710 h->pack_start (*l, false, false);
711 h->pack_start (*_db_slider, false, false);
712 h->pack_start (_db_display, false, false);
714 set_size_request_to_display_given_text (_db_display, "-99.0", 12, 12);
716 _box->pack_start (*h, false, false);
718 _db_adjustment.signal_value_changed().connect (mem_fun (*this, &SoloMuteOptions::db_changed));
721 void parameter_changed (string const & p)
723 if (p == "solo-mute-gain") {
724 gain_t val = _rc_config->get_solo_mute_gain();
726 _db_adjustment.set_value (gain_to_slider_position (val));
731 snprintf (buf, sizeof (buf), "-inf");
733 snprintf (buf, sizeof (buf), "%.2f", accurate_coefficient_to_dB (val));
736 _db_display.set_text (buf);
740 void set_state_from_config ()
742 parameter_changed ("solo-mute-gain");
749 _rc_config->set_solo_mute_gain (slider_position_to_gain (_db_adjustment.get_value()));
752 RCConfiguration* _rc_config;
753 Adjustment _db_adjustment;
754 Gtkmm2ext::HSliderController* _db_slider;
755 Glib::RefPtr<Gdk::Pixbuf> pix;
760 class ControlSurfacesOptions : public OptionEditorBox
763 ControlSurfacesOptions ()
765 _store = ListStore::create (_model);
766 _view.set_model (_store);
767 _view.append_column (_("Name"), _model.name);
768 _view.get_column(0)->set_resizable (true);
769 _view.get_column(0)->set_expand (true);
770 _view.append_column_editable (_("Enabled"), _model.enabled);
771 _view.append_column_editable (_("Feedback"), _model.feedback);
773 _box->pack_start (_view, false, false);
775 _store->signal_row_changed().connect (mem_fun (*this, &ControlSurfacesOptions::model_changed));
778 void parameter_changed (std::string const &)
783 void set_state_from_config ()
787 ControlProtocolManager& m = ControlProtocolManager::instance ();
788 for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
790 if (!(*i)->mandatory) {
791 TreeModel::Row r = *_store->append ();
792 r[_model.name] = (*i)->name;
793 r[_model.enabled] = ((*i)->protocol || (*i)->requested);
794 r[_model.feedback] = ((*i)->protocol && (*i)->protocol->get_feedback ());
795 r[_model.protocol_info] = *i;
802 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
804 TreeModel::Row r = *i;
806 ControlProtocolInfo* cpi = r[_model.protocol_info];
811 bool const was_enabled = (cpi->protocol != 0);
812 bool const is_enabled = r[_model.enabled];
814 if (was_enabled != is_enabled) {
816 ControlProtocolManager::instance().instantiate (*cpi);
818 ControlProtocolManager::instance().teardown (*cpi);
822 bool const was_feedback = (cpi->protocol && cpi->protocol->get_feedback ());
823 bool const is_feedback = r[_model.feedback];
825 if (was_feedback != is_feedback && cpi->protocol) {
826 cpi->protocol->set_feedback (is_feedback);
830 class ControlSurfacesModelColumns : public TreeModelColumnRecord
834 ControlSurfacesModelColumns ()
842 TreeModelColumn<string> name;
843 TreeModelColumn<bool> enabled;
844 TreeModelColumn<bool> feedback;
845 TreeModelColumn<ControlProtocolInfo*> protocol_info;
848 Glib::RefPtr<ListStore> _store;
849 ControlSurfacesModelColumns _model;
854 RCOptionEditor::RCOptionEditor ()
855 : OptionEditor (Config, _("Ardour Preferences")),
860 add_option (_("Misc"), new OptionEditorHeading (_("Metering")));
862 ComboOption<float>* mht = new ComboOption<float> (
864 _("Meter hold time"),
865 mem_fun (*_rc_config, &RCConfiguration::get_meter_hold),
866 mem_fun (*_rc_config, &RCConfiguration::set_meter_hold)
869 mht->add (MeterHoldOff, _("off"));
870 mht->add (MeterHoldShort, _("short"));
871 mht->add (MeterHoldMedium, _("medium"));
872 mht->add (MeterHoldLong, _("long"));
874 add_option (_("Misc"), mht);
876 ComboOption<float>* mfo = new ComboOption<float> (
879 mem_fun (*_rc_config, &RCConfiguration::get_meter_falloff),
880 mem_fun (*_rc_config, &RCConfiguration::set_meter_falloff)
883 mfo->add (METER_FALLOFF_OFF, _("off"));
884 mfo->add (METER_FALLOFF_SLOWEST, _("slowest"));
885 mfo->add (METER_FALLOFF_SLOW, _("slow"));
886 mfo->add (METER_FALLOFF_MEDIUM, _("medium"));
887 mfo->add (METER_FALLOFF_FAST, _("fast"));
888 mfo->add (METER_FALLOFF_FASTER, _("faster"));
889 mfo->add (METER_FALLOFF_FASTEST, _("fastest"));
891 add_option (_("Misc"), mfo);
893 add_option (_("Misc"), new OptionEditorHeading (_("Undo")));
895 add_option (_("Misc"), new UndoOptions (_rc_config));
897 add_option (_("Misc"), new OptionEditorHeading (_("Misc")));
900 /* font scaling does nothing with GDK/Quartz */
901 add_option (_("Misc"), new FontScalingOptions (_rc_config));
904 add_option (_("Misc"),
906 "verify-remove-last-capture",
907 _("Verify removal of last capture"),
908 mem_fun (*_rc_config, &RCConfiguration::get_verify_remove_last_capture),
909 mem_fun (*_rc_config, &RCConfiguration::set_verify_remove_last_capture)
912 add_option (_("Misc"),
914 "periodic-safety-backups",
915 _("Make periodic backups of the session file"),
916 mem_fun (*_rc_config, &RCConfiguration::get_periodic_safety_backups),
917 mem_fun (*_rc_config, &RCConfiguration::set_periodic_safety_backups)
920 add_option (_("Misc"),
922 "sync-all-route-ordering",
923 _("Syncronise editor and mixer track order"),
924 mem_fun (*_rc_config, &RCConfiguration::get_sync_all_route_ordering),
925 mem_fun (*_rc_config, &RCConfiguration::set_sync_all_route_ordering)
928 add_option (_("Misc"),
930 "only-copy-imported-files",
931 _("Always copy imported files"),
932 mem_fun (*_rc_config, &RCConfiguration::get_only_copy_imported_files),
933 mem_fun (*_rc_config, &RCConfiguration::set_only_copy_imported_files)
936 add_option (_("Misc"),
939 _("Use narrow mixer strips"),
940 mem_fun (*_rc_config, &RCConfiguration::get_default_narrow_ms),
941 mem_fun (*_rc_config, &RCConfiguration::set_default_narrow_ms)
944 add_option (_("Misc"),
947 _("Name new markers"),
948 mem_fun (*_rc_config, &RCConfiguration::get_name_new_markers),
949 mem_fun (*_rc_config, &RCConfiguration::set_name_new_markers)
954 add_option (_("Transport"),
956 "latched-record-enable",
957 _("Keep record-enable engaged on stop"),
958 mem_fun (*_rc_config, &RCConfiguration::get_latched_record_enable),
959 mem_fun (*_rc_config, &RCConfiguration::set_latched_record_enable)
962 add_option (_("Transport"),
964 "stop-recording-on-xrun",
965 _("Stop recording when an xrun occurs"),
966 mem_fun (*_rc_config, &RCConfiguration::get_stop_recording_on_xrun),
967 mem_fun (*_rc_config, &RCConfiguration::set_stop_recording_on_xrun)
970 add_option (_("Transport"),
972 "create-xrun-marker",
973 _("Create markers where xruns occur"),
974 mem_fun (*_rc_config, &RCConfiguration::get_create_xrun_marker),
975 mem_fun (*_rc_config, &RCConfiguration::set_create_xrun_marker)
978 add_option (_("Transport"),
980 "stop-at-session-end",
981 _("Stop at the end of the session"),
982 mem_fun (*_rc_config, &RCConfiguration::get_stop_at_session_end),
983 mem_fun (*_rc_config, &RCConfiguration::set_stop_at_session_end)
986 add_option (_("Transport"),
988 "primary-clock-delta-edit-cursor",
989 _("Primary clock delta to edit cursor"),
990 mem_fun (*_rc_config, &RCConfiguration::get_primary_clock_delta_edit_cursor),
991 mem_fun (*_rc_config, &RCConfiguration::set_primary_clock_delta_edit_cursor)
994 add_option (_("Transport"),
996 "secondary-clock-delta-edit-cursor",
997 _("Secondary clock delta to edit cursor"),
998 mem_fun (*_rc_config, &RCConfiguration::get_secondary_clock_delta_edit_cursor),
999 mem_fun (*_rc_config, &RCConfiguration::set_secondary_clock_delta_edit_cursor)
1002 add_option (_("Transport"),
1004 "disable-disarm-during-roll",
1005 _("Disable record disarm when transport is rolling"),
1006 mem_fun (*_rc_config, &RCConfiguration::get_disable_disarm_during_roll),
1007 mem_fun (*_rc_config, &RCConfiguration::set_disable_disarm_during_roll)
1012 add_option (_("Editor"),
1014 "link-region-and-track-selection",
1015 _("Link selection of regions and tracks"),
1016 mem_fun (*_rc_config, &RCConfiguration::get_link_region_and_track_selection),
1017 mem_fun (*_rc_config, &RCConfiguration::set_link_region_and_track_selection)
1020 add_option (_("Editor"),
1022 "automation-follows-regions",
1023 _("Move relevant automation when regions are moved"),
1024 mem_fun (*_rc_config, &RCConfiguration::get_automation_follows_regions),
1025 mem_fun (*_rc_config, &RCConfiguration::set_automation_follows_regions)
1028 add_option (_("Editor"),
1030 "show-track-meters",
1031 _("Show meters on tracks in the editor"),
1032 mem_fun (*_rc_config, &RCConfiguration::get_show_track_meters),
1033 mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters)
1036 add_option (_("Editor"),
1038 "use-overlap-equivalency",
1039 _("Use overlap equivalency for regions"),
1040 mem_fun (*_rc_config, &RCConfiguration::get_use_overlap_equivalency),
1041 mem_fun (*_rc_config, &RCConfiguration::set_use_overlap_equivalency)
1044 add_option (_("Editor"),
1046 "rubberbanding-snaps-to-grid",
1047 _("Make rubberband selection rectangle snap to the grid"),
1048 mem_fun (*_rc_config, &RCConfiguration::get_rubberbanding_snaps_to_grid),
1049 mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
1052 add_option (_("Editor"),
1055 _("Show waveforms in regions"),
1056 mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
1057 mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
1060 ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
1062 _("Waveform scale"),
1063 mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
1064 mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
1067 wfs->add (Linear, _("linear"));
1068 wfs->add (Logarithmic, _("logarithmic"));
1070 add_option (_("Editor"), wfs);
1072 ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
1074 _("Waveform shape"),
1075 mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
1076 mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
1079 wfsh->add (Traditional, _("traditional"));
1080 wfsh->add (Rectified, _("rectified"));
1082 add_option (_("Editor"), wfsh);
1086 add_option (_("Audio"), new OptionEditorHeading (_("Solo")));
1089 add_option (_("Audio"),
1091 "solo-control-is-listen-control",
1092 _("Solo controls are Listen controls"),
1093 mem_fun (*_rc_config, &RCConfiguration::get_solo_control_is_listen_control),
1094 mem_fun (*_rc_config, &RCConfiguration::set_solo_control_is_listen_control)
1097 ComboOption<ListenPosition>* lp = new ComboOption<ListenPosition> (
1099 _("Listen Position"),
1100 mem_fun (*_rc_config, &RCConfiguration::get_listen_position),
1101 mem_fun (*_rc_config, &RCConfiguration::set_listen_position)
1104 lp->add (AfterFaderListen, _("after-fader listen"));
1105 lp->add (PreFaderListen, _("pre-fader listen"));
1107 add_option (_("Audio"), lp);
1108 add_option (_("Audio"), new SoloMuteOptions (_rc_config));
1110 add_option (_("Audio"),
1114 mem_fun (*_rc_config, &RCConfiguration::get_solo_latched),
1115 mem_fun (*_rc_config, &RCConfiguration::set_solo_latched)
1118 add_option (_("Audio"),
1121 _("Show solo muting"),
1122 mem_fun (*_rc_config, &RCConfiguration::get_show_solo_mutes),
1123 mem_fun (*_rc_config, &RCConfiguration::set_show_solo_mutes)
1126 add_option (_("Audio"),
1128 "solo-mute-override",
1129 _("Override muting"),
1130 mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_override),
1131 mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_override)
1134 add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
1136 ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
1138 _("Monitoring handled by"),
1139 mem_fun (*_rc_config, &RCConfiguration::get_monitoring_model),
1140 mem_fun (*_rc_config, &RCConfiguration::set_monitoring_model)
1143 mm->add (HardwareMonitoring, _("JACK"));
1144 mm->add (SoftwareMonitoring, _("ardour"));
1145 mm->add (ExternalMonitoring, _("audio hardware"));
1147 add_option (_("Audio"), mm);
1149 add_option (_("Audio"),
1151 "tape-machine-mode",
1152 _("Tape machine mode"),
1153 mem_fun (*_rc_config, &RCConfiguration::get_tape_machine_mode),
1154 mem_fun (*_rc_config, &RCConfiguration::set_tape_machine_mode)
1157 add_option (_("Audio"), new OptionEditorHeading (_("Connection of tracks and busses")));
1159 add_option (_("Audio"),
1161 "auto-connect-standard-busses",
1162 _("Auto-connect master/monitor busses"),
1163 mem_fun (*_rc_config, &RCConfiguration::get_auto_connect_standard_busses),
1164 mem_fun (*_rc_config, &RCConfiguration::set_auto_connect_standard_busses)
1167 ComboOption<AutoConnectOption>* iac = new ComboOption<AutoConnectOption> (
1168 "input-auto-connect",
1169 _("Connect track and bus inputs"),
1170 mem_fun (*_rc_config, &RCConfiguration::get_input_auto_connect),
1171 mem_fun (*_rc_config, &RCConfiguration::set_input_auto_connect)
1174 iac->add (AutoConnectPhysical, _("automatically to physical inputs"));
1175 iac->add (ManualConnect, _("manually"));
1177 add_option (_("Audio"), iac);
1179 ComboOption<AutoConnectOption>* oac = new ComboOption<AutoConnectOption> (
1180 "output-auto-connect",
1181 _("Connect track and bus outputs"),
1182 mem_fun (*_rc_config, &RCConfiguration::get_output_auto_connect),
1183 mem_fun (*_rc_config, &RCConfiguration::set_output_auto_connect)
1186 oac->add (AutoConnectPhysical, _("automatically to physical outputs"));
1187 oac->add (AutoConnectMaster, _("automatically to master outputs"));
1188 oac->add (ManualConnect, _("manually"));
1190 add_option (_("Audio"), oac);
1192 add_option (_("Audio"), new OptionEditorHeading (_("Denormals")));
1194 add_option (_("Audio"),
1196 "denormal-protection",
1197 _("Use DC bias to protect against denormals"),
1198 mem_fun (*_rc_config, &RCConfiguration::get_denormal_protection),
1199 mem_fun (*_rc_config, &RCConfiguration::set_denormal_protection)
1202 ComboOption<DenormalModel>* dm = new ComboOption<DenormalModel> (
1204 _("Processor handling"),
1205 mem_fun (*_rc_config, &RCConfiguration::get_denormal_model),
1206 mem_fun (*_rc_config, &RCConfiguration::set_denormal_model)
1209 dm->add (DenormalNone, _("no processor handling"));
1213 if (fpu.has_flush_to_zero()) {
1214 dm->add (DenormalFTZ, _("use FlushToZero"));
1217 if (fpu.has_denormals_are_zero()) {
1218 dm->add (DenormalDAZ, _("use DenormalsAreZero"));
1221 if (fpu.has_flush_to_zero() && fpu.has_denormals_are_zero()) {
1222 dm->add (DenormalFTZDAZ, _("use FlushToZero and DenormalsAreZerO"));
1225 add_option (_("Audio"), dm);
1227 add_option (_("Audio"), new OptionEditorHeading (_("Plugins")));
1229 add_option (_("Audio"),
1231 "plugins-stop-with-transport",
1232 _("Stop plugins when the transport is stopped"),
1233 mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
1234 mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
1237 add_option (_("Audio"),
1239 "do-not-record-plugins",
1240 _("Disable plugins during recording"),
1241 mem_fun (*_rc_config, &RCConfiguration::get_do_not_record_plugins),
1242 mem_fun (*_rc_config, &RCConfiguration::set_do_not_record_plugins)
1245 add_option (_("Audio"),
1247 "new-plugins-active",
1248 _("Make new plugins active"),
1249 mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
1250 mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
1253 add_option (_("Audio"),
1255 "auto-analyse-audio",
1256 _("Enable automatic analysis of audio"),
1257 mem_fun (*_rc_config, &RCConfiguration::get_auto_analyse_audio),
1258 mem_fun (*_rc_config, &RCConfiguration::set_auto_analyse_audio)
1263 list<ComboOption<string>* > midi_combos;
1265 midi_combos.push_back (new ComboOption<string> (
1267 _("Send/Receive MTC via"),
1268 mem_fun (*_rc_config, &RCConfiguration::get_mtc_port_name),
1269 mem_fun (*_rc_config, &RCConfiguration::set_mtc_port_name)
1272 midi_combos.push_back (new ComboOption<string> (
1273 "midi-clock-port-name",
1274 _("Send/Receive MIDI clock via"),
1275 mem_fun (*_rc_config, &RCConfiguration::get_midi_clock_port_name),
1276 mem_fun (*_rc_config, &RCConfiguration::set_midi_clock_port_name)
1279 midi_combos.push_back (new ComboOption<string> (
1281 _("Send/Receive MMC via"),
1282 mem_fun (*_rc_config, &RCConfiguration::get_mmc_port_name),
1283 mem_fun (*_rc_config, &RCConfiguration::set_mmc_port_name)
1286 midi_combos.push_back (new ComboOption<string> (
1288 _("Send/Receive MIDI parameter control via"),
1289 mem_fun (*_rc_config, &RCConfiguration::get_midi_port_name),
1290 mem_fun (*_rc_config, &RCConfiguration::set_midi_port_name)
1293 add_option (_("MIDI control"), new MIDIPorts (_rc_config, midi_combos));
1295 for (list<ComboOption<string>* >::iterator i = midi_combos.begin(); i != midi_combos.end(); ++i) {
1296 add_option (_("MIDI control"), *i);
1299 add_option (_("MIDI control"),
1302 _("Obey MIDI Machine Control commands"),
1303 mem_fun (*_rc_config, &RCConfiguration::get_mmc_control),
1304 mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
1308 add_option (_("MIDI control"),
1311 _("Send MIDI Machine Control commands"),
1312 mem_fun (*_rc_config, &RCConfiguration::get_send_mmc),
1313 mem_fun (*_rc_config, &RCConfiguration::set_send_mmc)
1316 add_option (_("MIDI control"),
1319 _("Send MIDI control feedback"),
1320 mem_fun (*_rc_config, &RCConfiguration::get_midi_feedback),
1321 mem_fun (*_rc_config, &RCConfiguration::set_midi_feedback)
1324 add_option (_("MIDI control"),
1325 new SpinOption<uint8_t> (
1326 "mmc-receive-device-id",
1327 _("Inbound MMC device ID"),
1328 mem_fun (*_rc_config, &RCConfiguration::get_mmc_receive_device_id),
1329 mem_fun (*_rc_config, &RCConfiguration::set_mmc_receive_device_id),
1333 add_option (_("MIDI control"),
1334 new SpinOption<uint8_t> (
1335 "mmc-send-device-id",
1336 _("Outbound MMC device ID"),
1337 mem_fun (*_rc_config, &RCConfiguration::get_mmc_send_device_id),
1338 mem_fun (*_rc_config, &RCConfiguration::set_mmc_send_device_id),
1342 add_option (_("MIDI control"),
1343 new SpinOption<int32_t> (
1344 "initial-program-change",
1345 _("Initial program change"),
1346 mem_fun (*_rc_config, &RCConfiguration::get_initial_program_change),
1347 mem_fun (*_rc_config, &RCConfiguration::set_initial_program_change),
1351 /* CONTROL SURFACES */
1353 add_option (_("Control surfaces"), new ControlSurfacesOptions);
1355 ComboOption<RemoteModel>* rm = new ComboOption<RemoteModel> (
1357 _("Control surface remote ID"),
1358 mem_fun (*_rc_config, &RCConfiguration::get_remote_model),
1359 mem_fun (*_rc_config, &RCConfiguration::set_remote_model)
1362 rm->add (UserOrdered, _("assigned by user"));
1363 rm->add (MixerOrdered, _("follows order of mixer"));
1364 rm->add (EditorOrdered, _("follows order of editor"));
1366 add_option (_("Control surfaces"), rm);
1370 add_option (_("Click"), new ClickOptions (_rc_config, this));
1374 add_option (_("Keyboard"), new KeyboardOptions);