A few cleanups and rearrangements in the RC options. Add options for default mute...
[ArdourMidi.git] / gtk2_ardour / rc_option_editor.cc
blobed4369987be9a6138294262e538618ad927f54fa
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 "pbd/fpu.h"
9 #include "midi++/manager.h"
10 #include "midi++/factory.h"
12 #include "ardour/audioengine.h"
13 #include "ardour/dB.h"
14 #include "ardour/rc_configuration.h"
15 #include "ardour/control_protocol_manager.h"
16 #include "control_protocol/control_protocol.h"
18 #include "gui_thread.h"
19 #include "midi_tracer.h"
20 #include "rc_option_editor.h"
21 #include "utils.h"
22 #include "midi_port_dialog.h"
23 #include "sfdb_ui.h"
24 #include "keyboard.h"
25 #include "i18n.h"
27 using namespace std;
28 using namespace Gtk;
29 using namespace Gtkmm2ext;
30 using namespace PBD;
31 using namespace ARDOUR;
33 class MIDIPorts : public OptionEditorBox
35 public:
36 MIDIPorts (RCConfiguration* c, list<ComboOption<string>* > const & o)
37 : _rc_config (c),
38 _add_port_button (Stock::ADD),
39 _port_combos (o)
41 _store = ListStore::create (_model);
42 _view.set_model (_store);
43 _view.append_column (_("Name"), _model.name);
44 _view.get_column(0)->set_resizable (true);
45 _view.get_column(0)->set_expand (true);
46 _view.append_column_editable (_("Online"), _model.online);
47 _view.append_column_editable (_("Trace input"), _model.trace_input);
48 _view.append_column_editable (_("Trace output"), _model.trace_output);
50 HBox* h = manage (new HBox);
51 h->set_spacing (4);
52 h->pack_start (_view, true, true);
54 VBox* v = manage (new VBox);
55 v->set_spacing (4);
56 v->pack_start (_add_port_button, false, false);
57 h->pack_start (*v, false, false);
59 _box->pack_start (*h);
61 ports_changed ();
63 _store->signal_row_changed().connect (sigc::mem_fun (*this, &MIDIPorts::model_changed));
65 _add_port_button.signal_clicked().connect (sigc::mem_fun (*this, &MIDIPorts::add_port_clicked));
68 void parameter_changed (string const &) {}
69 void set_state_from_config () {}
71 private:
73 typedef std::map<MIDI::Port*,MidiTracer*> PortTraceMap;
74 PortTraceMap port_input_trace_map;
75 PortTraceMap port_output_trace_map;
77 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
79 TreeModel::Row r = *i;
81 MIDI::Port* port = r[_model.port];
82 if (!port) {
83 return;
86 if (port->input()) {
88 if (r[_model.online] == port->input()->offline()) {
89 port->input()->set_offline (!r[_model.online]);
92 if (r[_model.trace_input] != port->input()->tracing()) {
93 PortTraceMap::iterator x = port_input_trace_map.find (port);
94 MidiTracer* mt;
96 if (x == port_input_trace_map.end()) {
97 mt = new MidiTracer (port->name() + string (" [input]"), *port->input());
98 port_input_trace_map.insert (pair<MIDI::Port*,MidiTracer*> (port, mt));
99 } else {
100 mt = x->second;
102 mt->present ();
106 if (port->output()) {
108 if (r[_model.trace_output] != port->output()->tracing()) {
109 PortTraceMap::iterator x = port_output_trace_map.find (port);
110 MidiTracer* mt;
112 if (x == port_output_trace_map.end()) {
113 mt = new MidiTracer (port->name() + string (" [output]"), *port->output());
114 port_output_trace_map.insert (pair<MIDI::Port*,MidiTracer*> (port, mt));
115 } else {
116 mt = x->second;
118 mt->present ();
124 void setup_ports_combo (ComboOption<string>* c)
126 c->clear ();
127 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
128 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
129 c->add ((*i)->name(), (*i)->name());
133 void ports_changed ()
135 /* XXX: why is this coming from here? */
136 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
138 _store->clear ();
139 port_connections.drop_connections ();
141 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
143 TreeModel::Row r = *_store->append ();
145 r[_model.name] = (*i)->name();
147 if ((*i)->input()) {
148 r[_model.online] = !(*i)->input()->offline();
149 (*i)->input()->OfflineStatusChanged.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&MIDIPorts::port_offline_changed, this, (*i)), gui_context());
150 r[_model.trace_input] = (*i)->input()->tracing();
153 if ((*i)->output()) {
154 r[_model.trace_output] = (*i)->output()->tracing();
157 r[_model.port] = (*i);
160 for (list<ComboOption<string>* >::iterator i = _port_combos.begin(); i != _port_combos.end(); ++i) {
161 setup_ports_combo (*i);
165 void port_offline_changed (MIDI::Port* p)
167 if (!p->input()) {
168 return;
171 for (TreeModel::Children::iterator i = _store->children().begin(); i != _store->children().end(); ++i) {
172 if ((*i)[_model.port] == p) {
173 (*i)[_model.online] = !p->input()->offline();
178 void add_port_clicked ()
180 MidiPortDialog dialog;
182 dialog.set_position (WIN_POS_MOUSE);
184 dialog.show ();
186 int const r = dialog.run ();
188 switch (r) {
189 case RESPONSE_ACCEPT:
190 break;
191 default:
192 return;
193 break;
196 Glib::ustring const mode = dialog.port_mode_combo.get_active_text ();
197 string smod;
199 if (mode == _("input")) {
200 smod = X_("input");
201 } else if (mode == (_("output"))) {
202 smod = X_("output");
203 } else {
204 smod = "duplex";
207 XMLNode node (X_("MIDI-port"));
209 node.add_property ("tag", dialog.port_name.get_text());
210 node.add_property ("device", X_("ardour")); // XXX this can't be right for all types
211 node.add_property ("type", MIDI::PortFactory::default_port_type());
212 node.add_property ("mode", smod);
214 if (MIDI::Manager::instance()->add_port (node) != 0) {
215 cerr << " there are now " << MIDI::Manager::instance()->nports() << endl;
216 ports_changed ();
220 class MIDIModelColumns : public TreeModelColumnRecord
222 public:
223 MIDIModelColumns ()
225 add (name);
226 add (online);
227 add (trace_input);
228 add (trace_output);
229 add (port);
232 TreeModelColumn<string> name;
233 TreeModelColumn<bool> online;
234 TreeModelColumn<bool> trace_input;
235 TreeModelColumn<bool> trace_output;
236 TreeModelColumn<MIDI::Port*> port;
239 RCConfiguration* _rc_config;
240 Glib::RefPtr<ListStore> _store;
241 MIDIModelColumns _model;
242 TreeView _view;
243 Button _add_port_button;
244 ComboBoxText _mtc_combo;
245 ComboBoxText _midi_clock_combo;
246 ComboBoxText _mmc_combo;
247 ComboBoxText _mpc_combo;
248 list<ComboOption<string>* > _port_combos;
249 PBD::ScopedConnectionList port_connections;
253 class ClickOptions : public OptionEditorBox
255 public:
256 ClickOptions (RCConfiguration* c, ArdourDialog* p)
257 : _rc_config (c),
258 _parent (p)
260 Table* t = manage (new Table (2, 3));
261 t->set_spacings (4);
263 Label* l = manage (new Label (_("Click audio file:")));
264 l->set_alignment (0, 0.5);
265 t->attach (*l, 0, 1, 0, 1, FILL);
266 t->attach (_click_path_entry, 1, 2, 0, 1, FILL);
267 Button* b = manage (new Button (_("Browse...")));
268 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_browse_clicked));
269 t->attach (*b, 2, 3, 0, 1, FILL);
271 l = manage (new Label (_("Click emphasis audio file:")));
272 l->set_alignment (0, 0.5);
273 t->attach (*l, 0, 1, 1, 2, FILL);
274 t->attach (_click_emphasis_path_entry, 1, 2, 1, 2, FILL);
275 b = manage (new Button (_("Browse...")));
276 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked));
277 t->attach (*b, 2, 3, 1, 2, FILL);
279 _box->pack_start (*t, false, false);
282 void parameter_changed (string const & p)
284 if (p == "click-sound") {
285 _click_path_entry.set_text (_rc_config->get_click_sound());
286 } else if (p == "click-emphasis-sound") {
287 _click_emphasis_path_entry.set_text (_rc_config->get_click_emphasis_sound());
291 void set_state_from_config ()
293 parameter_changed ("click-sound");
294 parameter_changed ("click-emphasis-sound");
297 private:
299 void click_browse_clicked ()
301 SoundFileChooser sfdb (*_parent, _("Choose Click"));
303 sfdb.show_all ();
304 sfdb.present ();
306 if (sfdb.run () == RESPONSE_OK) {
307 click_chosen (sfdb.get_filename());
311 void click_chosen (string const & path)
313 _click_path_entry.set_text (path);
314 _rc_config->set_click_sound (path);
317 void click_emphasis_browse_clicked ()
319 SoundFileChooser sfdb (*_parent, _("Choose Click Emphasis"));
321 sfdb.show_all ();
322 sfdb.present ();
324 if (sfdb.run () == RESPONSE_OK) {
325 click_emphasis_chosen (sfdb.get_filename());
329 void click_emphasis_chosen (string const & path)
331 _click_emphasis_path_entry.set_text (path);
332 _rc_config->set_click_emphasis_sound (path);
335 RCConfiguration* _rc_config;
336 ArdourDialog* _parent;
337 Entry _click_path_entry;
338 Entry _click_emphasis_path_entry;
341 class UndoOptions : public OptionEditorBox
343 public:
344 UndoOptions (RCConfiguration* c) :
345 _rc_config (c),
346 _limit_undo_button (_("Limit undo history to")),
347 _save_undo_button (_("Save undo history of"))
349 Table* t = new Table (2, 3);
350 t->set_spacings (4);
352 t->attach (_limit_undo_button, 0, 1, 0, 1, FILL);
353 _limit_undo_spin.set_range (0, 512);
354 _limit_undo_spin.set_increments (1, 10);
355 t->attach (_limit_undo_spin, 1, 2, 0, 1, FILL | EXPAND);
356 Label* l = manage (new Label (_("commands")));
357 l->set_alignment (0, 0.5);
358 t->attach (*l, 2, 3, 0, 1);
360 t->attach (_save_undo_button, 0, 1, 1, 2, FILL);
361 _save_undo_spin.set_range (0, 512);
362 _save_undo_spin.set_increments (1, 10);
363 t->attach (_save_undo_spin, 1, 2, 1, 2, FILL | EXPAND);
364 l = manage (new Label (_("commands")));
365 l->set_alignment (0, 0.5);
366 t->attach (*l, 2, 3, 1, 2);
368 _box->pack_start (*t);
370 _limit_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_toggled));
371 _limit_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_changed));
372 _save_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_toggled));
373 _save_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_changed));
376 void parameter_changed (string const & p)
378 if (p == "history-depth") {
379 int32_t const d = _rc_config->get_history_depth();
380 _limit_undo_button.set_active (d != 0);
381 _limit_undo_spin.set_sensitive (d != 0);
382 _limit_undo_spin.set_value (d);
383 } else if (p == "save-history") {
384 bool const x = _rc_config->get_save_history ();
385 _save_undo_button.set_active (x);
386 _save_undo_spin.set_sensitive (x);
387 } else if (p == "save-history-depth") {
388 _save_undo_spin.set_value (_rc_config->get_saved_history_depth());
392 void set_state_from_config ()
394 parameter_changed ("save-history");
395 parameter_changed ("history-depth");
396 parameter_changed ("save-history-depth");
399 void limit_undo_toggled ()
401 bool const x = _limit_undo_button.get_active ();
402 _limit_undo_spin.set_sensitive (x);
403 int32_t const n = x ? 16 : 0;
404 _limit_undo_spin.set_value (n);
405 _rc_config->set_history_depth (n);
408 void limit_undo_changed ()
410 _rc_config->set_history_depth (_limit_undo_spin.get_value_as_int ());
413 void save_undo_toggled ()
415 bool const x = _save_undo_button.get_active ();
416 _rc_config->set_save_history (x);
419 void save_undo_changed ()
421 _rc_config->set_saved_history_depth (_save_undo_spin.get_value_as_int ());
424 private:
425 RCConfiguration* _rc_config;
426 CheckButton _limit_undo_button;
427 SpinButton _limit_undo_spin;
428 CheckButton _save_undo_button;
429 SpinButton _save_undo_spin;
434 static const struct {
435 const char *name;
436 guint modifier;
437 } modifiers[] = {
439 { "Unmodified", 0 },
441 #ifdef GTKOSX
443 /* Command = Meta
444 Option/Alt = Mod1
446 { "Shift", GDK_SHIFT_MASK },
447 { "Command", GDK_META_MASK },
448 { "Control", GDK_CONTROL_MASK },
449 { "Option", GDK_MOD1_MASK },
450 { "Command-Shift", GDK_META_MASK|GDK_SHIFT_MASK },
451 { "Command-Option", GDK_MOD1_MASK|GDK_META_MASK },
452 { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD1_MASK },
453 { "Shift-Command-Option", GDK_MOD5_MASK|GDK_SHIFT_MASK|GDK_META_MASK },
455 #else
456 { "Shift", GDK_SHIFT_MASK },
457 { "Control", GDK_CONTROL_MASK },
458 { "Alt (Mod1)", GDK_MOD1_MASK },
459 { "Control-Shift", GDK_CONTROL_MASK|GDK_SHIFT_MASK },
460 { "Control-Alt", GDK_CONTROL_MASK|GDK_MOD1_MASK },
461 { "Shift-Alt", GDK_SHIFT_MASK|GDK_MOD1_MASK },
462 { "Control-Shift-Alt", GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
463 { "Mod2", GDK_MOD2_MASK },
464 { "Mod3", GDK_MOD3_MASK },
465 { "Mod4", GDK_MOD4_MASK },
466 { "Mod5", GDK_MOD5_MASK },
467 #endif
468 { 0, 0 }
472 class KeyboardOptions : public OptionEditorBox
474 public:
475 KeyboardOptions () :
476 _delete_button_adjustment (3, 1, 12),
477 _delete_button_spin (_delete_button_adjustment),
478 _edit_button_adjustment (3, 1, 5),
479 _edit_button_spin (_edit_button_adjustment)
482 /* internationalize and prepare for use with combos */
484 vector<string> dumb;
485 for (int i = 0; modifiers[i].name; ++i) {
486 dumb.push_back (_(modifiers[i].name));
489 set_popdown_strings (_edit_modifier_combo, dumb);
490 _edit_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_modifier_chosen));
492 for (int x = 0; modifiers[x].name; ++x) {
493 if (modifiers[x].modifier == Keyboard::edit_modifier ()) {
494 _edit_modifier_combo.set_active_text (_(modifiers[x].name));
495 break;
499 Table* t = manage (new Table (4, 4));
500 t->set_spacings (4);
502 Label* l = manage (new Label (_("Edit using:")));
503 l->set_name ("OptionsLabel");
504 l->set_alignment (0, 0.5);
506 t->attach (*l, 0, 1, 0, 1, FILL | EXPAND, FILL);
507 t->attach (_edit_modifier_combo, 1, 2, 0, 1, FILL | EXPAND, FILL);
509 l = manage (new Label (_("+ button")));
510 l->set_name ("OptionsLabel");
512 t->attach (*l, 3, 4, 0, 1, FILL | EXPAND, FILL);
513 t->attach (_edit_button_spin, 4, 5, 0, 1, FILL | EXPAND, FILL);
515 _edit_button_spin.set_name ("OptionsEntry");
516 _edit_button_adjustment.set_value (Keyboard::edit_button());
517 _edit_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_button_changed));
519 set_popdown_strings (_delete_modifier_combo, dumb);
520 _delete_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_modifier_chosen));
522 for (int x = 0; modifiers[x].name; ++x) {
523 if (modifiers[x].modifier == Keyboard::delete_modifier ()) {
524 _delete_modifier_combo.set_active_text (_(modifiers[x].name));
525 break;
529 l = manage (new Label (_("Delete using:")));
530 l->set_name ("OptionsLabel");
531 l->set_alignment (0, 0.5);
533 t->attach (*l, 0, 1, 1, 2, FILL | EXPAND, FILL);
534 t->attach (_delete_modifier_combo, 1, 2, 1, 2, FILL | EXPAND, FILL);
536 l = manage (new Label (_("+ button")));
537 l->set_name ("OptionsLabel");
539 t->attach (*l, 3, 4, 1, 2, FILL | EXPAND, FILL);
540 t->attach (_delete_button_spin, 4, 5, 1, 2, FILL | EXPAND, FILL);
542 _delete_button_spin.set_name ("OptionsEntry");
543 _delete_button_adjustment.set_value (Keyboard::delete_button());
544 _delete_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_button_changed));
546 set_popdown_strings (_snap_modifier_combo, dumb);
547 _snap_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::snap_modifier_chosen));
549 for (int x = 0; modifiers[x].name; ++x) {
550 if (modifiers[x].modifier == (guint) Keyboard::snap_modifier ()) {
551 _snap_modifier_combo.set_active_text (_(modifiers[x].name));
552 break;
556 l = manage (new Label (_("Toggle snap using:")));
557 l->set_name ("OptionsLabel");
558 l->set_alignment (0, 0.5);
560 t->attach (*l, 0, 1, 2, 3, FILL | EXPAND, FILL);
561 t->attach (_snap_modifier_combo, 1, 2, 2, 3, FILL | EXPAND, FILL);
563 vector<string> strs;
565 for (map<string,string>::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) {
566 strs.push_back (bf->first);
569 set_popdown_strings (_keyboard_layout_selector, strs);
570 _keyboard_layout_selector.set_active_text (Keyboard::current_binding_name());
571 _keyboard_layout_selector.signal_changed().connect (sigc::mem_fun (*this, &KeyboardOptions::bindings_changed));
573 l = manage (new Label (_("Keyboard layout:")));
574 l->set_name ("OptionsLabel");
575 l->set_alignment (0, 0.5);
577 t->attach (*l, 0, 1, 3, 4, FILL | EXPAND, FILL);
578 t->attach (_keyboard_layout_selector, 1, 2, 3, 4, FILL | EXPAND, FILL);
580 _box->pack_start (*t, false, false);
583 void parameter_changed (string const &)
585 /* XXX: these aren't really config options... */
588 void set_state_from_config ()
590 /* XXX: these aren't really config options... */
593 private:
595 void bindings_changed ()
597 string const txt = _keyboard_layout_selector.get_active_text();
599 /* XXX: config...? for all this keyboard stuff */
601 for (map<string,string>::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) {
602 if (txt == i->first) {
603 if (Keyboard::load_keybindings (i->second)) {
604 Keyboard::save_keybindings ();
610 void edit_modifier_chosen ()
612 string const txt = _edit_modifier_combo.get_active_text();
614 for (int i = 0; modifiers[i].name; ++i) {
615 if (txt == _(modifiers[i].name)) {
616 Keyboard::set_edit_modifier (modifiers[i].modifier);
617 break;
622 void delete_modifier_chosen ()
624 string const txt = _delete_modifier_combo.get_active_text();
626 for (int i = 0; modifiers[i].name; ++i) {
627 if (txt == _(modifiers[i].name)) {
628 Keyboard::set_delete_modifier (modifiers[i].modifier);
629 break;
634 void snap_modifier_chosen ()
636 string const txt = _snap_modifier_combo.get_active_text();
638 for (int i = 0; modifiers[i].name; ++i) {
639 if (txt == _(modifiers[i].name)) {
640 Keyboard::set_snap_modifier (modifiers[i].modifier);
641 break;
646 void delete_button_changed ()
648 Keyboard::set_delete_button (_delete_button_spin.get_value_as_int());
651 void edit_button_changed ()
653 Keyboard::set_edit_button (_edit_button_spin.get_value_as_int());
656 ComboBoxText _keyboard_layout_selector;
657 ComboBoxText _edit_modifier_combo;
658 ComboBoxText _delete_modifier_combo;
659 ComboBoxText _snap_modifier_combo;
660 Adjustment _delete_button_adjustment;
661 SpinButton _delete_button_spin;
662 Adjustment _edit_button_adjustment;
663 SpinButton _edit_button_spin;
666 class FontScalingOptions : public OptionEditorBox
668 public:
669 FontScalingOptions (RCConfiguration* c) :
670 _rc_config (c),
671 _dpi_adjustment (50, 50, 250, 1, 10),
672 _dpi_slider (_dpi_adjustment)
674 _dpi_adjustment.set_value (_rc_config->get_font_scale () / 1024);
676 Label* l = manage (new Label (_("Font scaling:")));
677 l->set_name ("OptionsLabel");
679 _dpi_slider.set_update_policy (UPDATE_DISCONTINUOUS);
680 HBox* h = manage (new HBox);
681 h->set_spacing (4);
682 h->pack_start (*l, false, false);
683 h->pack_start (_dpi_slider, true, true);
685 _box->pack_start (*h, false, false);
687 _dpi_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &FontScalingOptions::dpi_changed));
690 void parameter_changed (string const & p)
692 if (p == "font-scale") {
693 _dpi_adjustment.set_value (_rc_config->get_font_scale() / 1024);
697 void set_state_from_config ()
699 parameter_changed ("font-scale");
702 private:
704 void dpi_changed ()
706 _rc_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024));
707 /* XXX: should be triggered from the parameter changed signal */
708 reset_dpi ();
711 RCConfiguration* _rc_config;
712 Adjustment _dpi_adjustment;
713 HScale _dpi_slider;
716 class ControlSurfacesOptions : public OptionEditorBox
718 public:
719 ControlSurfacesOptions (ArdourDialog& parent)
720 : _parent (parent)
722 _store = ListStore::create (_model);
723 _view.set_model (_store);
724 _view.append_column (_("Name"), _model.name);
725 _view.get_column(0)->set_resizable (true);
726 _view.get_column(0)->set_expand (true);
727 _view.append_column_editable (_("Enabled"), _model.enabled);
728 _view.append_column_editable (_("Feedback"), _model.feedback);
730 _box->pack_start (_view, false, false);
732 Label* label = manage (new Label);
733 label->set_markup (string_compose (X_("<i>%1</i>"), _("Double-click on a name to edit settings for an enabled protocol")));
735 _box->pack_start (*label, false, false);
736 label->show ();
738 _store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::model_changed));
739 _view.signal_button_press_event().connect_notify (sigc::mem_fun(*this, &ControlSurfacesOptions::edit_clicked));
742 void parameter_changed (std::string const &)
747 void set_state_from_config ()
749 _store->clear ();
751 ControlProtocolManager& m = ControlProtocolManager::instance ();
752 for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
754 if (!(*i)->mandatory) {
755 TreeModel::Row r = *_store->append ();
756 r[_model.name] = (*i)->name;
757 r[_model.enabled] = ((*i)->protocol || (*i)->requested);
758 r[_model.feedback] = ((*i)->protocol && (*i)->protocol->get_feedback ());
759 r[_model.protocol_info] = *i;
764 private:
766 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
768 TreeModel::Row r = *i;
770 ControlProtocolInfo* cpi = r[_model.protocol_info];
771 if (!cpi) {
772 return;
775 bool const was_enabled = (cpi->protocol != 0);
776 bool const is_enabled = r[_model.enabled];
778 if (was_enabled != is_enabled) {
779 if (!was_enabled) {
780 ControlProtocolManager::instance().instantiate (*cpi);
781 } else {
782 ControlProtocolManager::instance().teardown (*cpi);
786 bool const was_feedback = (cpi->protocol && cpi->protocol->get_feedback ());
787 bool const is_feedback = r[_model.feedback];
789 if (was_feedback != is_feedback && cpi->protocol) {
790 cpi->protocol->set_feedback (is_feedback);
794 void edit_clicked (GdkEventButton* ev)
796 if (ev->type != GDK_2BUTTON_PRESS) {
797 return;
800 std::string name;
801 ControlProtocolInfo* cpi;
802 TreeModel::Row row;
804 row = *(_view.get_selection()->get_selected());
806 Window* win = row[_model.editor];
807 if (win && !win->is_visible()) {
808 win->present ();
809 } else {
810 cpi = row[_model.protocol_info];
812 if (cpi && cpi->protocol && cpi->protocol->has_editor ()) {
813 Box* box = (Box*) cpi->protocol->get_gui ();
814 if (box) {
815 string title = row[_model.name];
816 ArdourDialog* win = new ArdourDialog (_parent, title);
817 win->get_vbox()->pack_start (*box, false, false);
818 box->show ();
819 win->present ();
820 row[_model.editor] = win;
826 class ControlSurfacesModelColumns : public TreeModelColumnRecord
828 public:
830 ControlSurfacesModelColumns ()
832 add (name);
833 add (enabled);
834 add (feedback);
835 add (protocol_info);
836 add (editor);
839 TreeModelColumn<string> name;
840 TreeModelColumn<bool> enabled;
841 TreeModelColumn<bool> feedback;
842 TreeModelColumn<ControlProtocolInfo*> protocol_info;
843 TreeModelColumn<Gtk::Window*> editor;
846 Glib::RefPtr<ListStore> _store;
847 ControlSurfacesModelColumns _model;
848 TreeView _view;
849 Gtk::Window& _parent;
853 RCOptionEditor::RCOptionEditor ()
854 : OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
855 , _rc_config (Config)
857 /* MISC */
859 add_option (_("Misc"), new OptionEditorHeading (_("Metering")));
861 ComboOption<float>* mht = new ComboOption<float> (
862 "meter-hold",
863 _("Meter hold time"),
864 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_hold),
865 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_hold)
868 mht->add (MeterHoldOff, _("off"));
869 mht->add (MeterHoldShort, _("short"));
870 mht->add (MeterHoldMedium, _("medium"));
871 mht->add (MeterHoldLong, _("long"));
873 add_option (_("Misc"), mht);
875 ComboOption<float>* mfo = new ComboOption<float> (
876 "meter-falloff",
877 _("Meter fall-off"),
878 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_falloff),
879 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_falloff)
882 mfo->add (METER_FALLOFF_OFF, _("off"));
883 mfo->add (METER_FALLOFF_SLOWEST, _("slowest"));
884 mfo->add (METER_FALLOFF_SLOW, _("slow"));
885 mfo->add (METER_FALLOFF_MEDIUM, _("medium"));
886 mfo->add (METER_FALLOFF_FAST, _("fast"));
887 mfo->add (METER_FALLOFF_FASTER, _("faster"));
888 mfo->add (METER_FALLOFF_FASTEST, _("fastest"));
890 add_option (_("Misc"), mfo);
892 add_option (_("Misc"), new OptionEditorHeading (_("Undo")));
894 add_option (_("Misc"), new UndoOptions (_rc_config));
896 add_option (_("Misc"), new OptionEditorHeading (_("Misc")));
898 #ifndef GTKOSX
899 /* font scaling does nothing with GDK/Quartz */
900 add_option (_("Misc"), new FontScalingOptions (_rc_config));
901 #endif
903 add_option (_("Misc"),
904 new BoolOption (
905 "verify-remove-last-capture",
906 _("Verify removal of last capture"),
907 sigc::mem_fun (*_rc_config, &RCConfiguration::get_verify_remove_last_capture),
908 sigc::mem_fun (*_rc_config, &RCConfiguration::set_verify_remove_last_capture)
911 add_option (_("Misc"),
912 new BoolOption (
913 "periodic-safety-backups",
914 _("Make periodic backups of the session file"),
915 sigc::mem_fun (*_rc_config, &RCConfiguration::get_periodic_safety_backups),
916 sigc::mem_fun (*_rc_config, &RCConfiguration::set_periodic_safety_backups)
919 add_option (_("Misc"),
920 new BoolOption (
921 "sync-all-route-ordering",
922 _("Syncronise editor and mixer track order"),
923 sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_all_route_ordering),
924 sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_all_route_ordering)
927 add_option (_("Misc"),
928 new BoolOption (
929 "only-copy-imported-files",
930 _("Always copy imported files"),
931 sigc::mem_fun (*_rc_config, &RCConfiguration::get_only_copy_imported_files),
932 sigc::mem_fun (*_rc_config, &RCConfiguration::set_only_copy_imported_files)
935 add_option (_("Misc"),
936 new BoolOption (
937 "default-narrow_ms",
938 _("Use narrow mixer strips"),
939 sigc::mem_fun (*_rc_config, &RCConfiguration::get_default_narrow_ms),
940 sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_narrow_ms)
943 add_option (_("Misc"),
944 new BoolOption (
945 "name-new-markers",
946 _("Name new markers"),
947 sigc::mem_fun (*_rc_config, &RCConfiguration::get_name_new_markers),
948 sigc::mem_fun (*_rc_config, &RCConfiguration::set_name_new_markers)
951 add_option (_("Misc"), new OptionEditorHeading (_("Click")));
953 add_option (_("Misc"), new ClickOptions (_rc_config, this));
955 /* TRANSPORT */
957 add_option (_("Transport"),
958 new BoolOption (
959 "latched-record-enable",
960 _("Keep record-enable engaged on stop"),
961 sigc::mem_fun (*_rc_config, &RCConfiguration::get_latched_record_enable),
962 sigc::mem_fun (*_rc_config, &RCConfiguration::set_latched_record_enable)
965 add_option (_("Transport"),
966 new BoolOption (
967 "stop-recording-on-xrun",
968 _("Stop recording when an xrun occurs"),
969 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_recording_on_xrun),
970 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_recording_on_xrun)
973 add_option (_("Transport"),
974 new BoolOption (
975 "create-xrun-marker",
976 _("Create markers where xruns occur"),
977 sigc::mem_fun (*_rc_config, &RCConfiguration::get_create_xrun_marker),
978 sigc::mem_fun (*_rc_config, &RCConfiguration::set_create_xrun_marker)
981 add_option (_("Transport"),
982 new BoolOption (
983 "stop-at-session-end",
984 _("Stop at the end of the session"),
985 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_at_session_end),
986 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_at_session_end)
989 add_option (_("Transport"),
990 new BoolOption (
991 "primary-clock-delta-edit-cursor",
992 _("Primary clock delta to edit cursor"),
993 sigc::mem_fun (*_rc_config, &RCConfiguration::get_primary_clock_delta_edit_cursor),
994 sigc::mem_fun (*_rc_config, &RCConfiguration::set_primary_clock_delta_edit_cursor)
997 add_option (_("Transport"),
998 new BoolOption (
999 "secondary-clock-delta-edit-cursor",
1000 _("Secondary clock delta to edit cursor"),
1001 sigc::mem_fun (*_rc_config, &RCConfiguration::get_secondary_clock_delta_edit_cursor),
1002 sigc::mem_fun (*_rc_config, &RCConfiguration::set_secondary_clock_delta_edit_cursor)
1005 add_option (_("Transport"),
1006 new BoolOption (
1007 "disable-disarm-during-roll",
1008 _("Disable per-track record disarm while rolling"),
1009 sigc::mem_fun (*_rc_config, &RCConfiguration::get_disable_disarm_during_roll),
1010 sigc::mem_fun (*_rc_config, &RCConfiguration::set_disable_disarm_during_roll)
1013 add_option (_("Transport"),
1014 new BoolOption (
1015 "quieten_at_speed",
1016 _("12dB gain reduction during fast-forward and fast-rewind"),
1017 sigc::mem_fun (*_rc_config, &RCConfiguration::get_quieten_at_speed),
1018 sigc::mem_fun (*_rc_config, &RCConfiguration::set_quieten_at_speed)
1021 /* EDITOR */
1023 add_option (_("Editor"),
1024 new BoolOption (
1025 "link-region-and-track-selection",
1026 _("Link selection of regions and tracks"),
1027 sigc::mem_fun (*_rc_config, &RCConfiguration::get_link_region_and_track_selection),
1028 sigc::mem_fun (*_rc_config, &RCConfiguration::set_link_region_and_track_selection)
1031 add_option (_("Editor"),
1032 new BoolOption (
1033 "automation-follows-regions",
1034 _("Move relevant automation when regions are moved"),
1035 sigc::mem_fun (*_rc_config, &RCConfiguration::get_automation_follows_regions),
1036 sigc::mem_fun (*_rc_config, &RCConfiguration::set_automation_follows_regions)
1039 add_option (_("Editor"),
1040 new BoolOption (
1041 "show-track-meters",
1042 _("Show meters on tracks in the editor"),
1043 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_track_meters),
1044 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters)
1047 add_option (_("Editor"),
1048 new BoolOption (
1049 "use-overlap-equivalency",
1050 _("Use overlap equivalency for regions"),
1051 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_overlap_equivalency),
1052 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_overlap_equivalency)
1055 add_option (_("Editor"),
1056 new BoolOption (
1057 "rubberbanding-snaps-to-grid",
1058 _("Make rubberband selection rectangle snap to the grid"),
1059 sigc::mem_fun (*_rc_config, &RCConfiguration::get_rubberbanding_snaps_to_grid),
1060 sigc::mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
1063 add_option (_("Editor"),
1064 new BoolOption (
1065 "show-waveforms",
1066 _("Show waveforms in regions"),
1067 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
1068 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
1071 ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
1072 "waveform-scale",
1073 _("Waveform scale"),
1074 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
1075 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
1078 wfs->add (Linear, _("linear"));
1079 wfs->add (Logarithmic, _("logarithmic"));
1081 add_option (_("Editor"), wfs);
1083 ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
1084 "waveform-shape",
1085 _("Waveform shape"),
1086 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
1087 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
1090 wfsh->add (Traditional, _("traditional"));
1091 wfsh->add (Rectified, _("rectified"));
1093 add_option (_("Editor"), wfsh);
1095 add_option (_("Editor"),
1096 new BoolOption (
1097 "show-waveforms-while-recording",
1098 _("Show waveforms for audio while it is being recorded"),
1099 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms_while_recording),
1100 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms_while_recording)
1103 /* AUDIO */
1105 add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
1107 add_option (_("Audio"),
1108 new BoolOption (
1109 "use-monitor-bus",
1110 _("Use a monitor bus (allows AFL/PFL and more control)"),
1111 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_monitor_bus),
1112 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_monitor_bus)
1115 ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
1116 "monitoring-model",
1117 _("Monitoring handled by"),
1118 sigc::mem_fun (*_rc_config, &RCConfiguration::get_monitoring_model),
1119 sigc::mem_fun (*_rc_config, &RCConfiguration::set_monitoring_model)
1122 #ifndef __APPLE__
1123 /* no JACK monitoring on CoreAudio */
1124 if (AudioEngine::instance()->can_request_hardware_monitoring()) {
1125 mm->add (HardwareMonitoring, _("JACK"));
1127 #endif
1128 mm->add (SoftwareMonitoring, _("ardour"));
1129 mm->add (ExternalMonitoring, _("audio hardware"));
1131 add_option (_("Audio"), mm);
1133 add_option (_("Audio"),
1134 new BoolOption (
1135 "tape-machine-mode",
1136 _("Tape machine mode"),
1137 sigc::mem_fun (*_rc_config, &RCConfiguration::get_tape_machine_mode),
1138 sigc::mem_fun (*_rc_config, &RCConfiguration::set_tape_machine_mode)
1141 add_option (_("Audio"), new OptionEditorHeading (_("Connection of tracks and busses")));
1143 add_option (_("Audio"),
1144 new BoolOption (
1145 "auto-connect-standard-busses",
1146 _("Auto-connect master/monitor busses"),
1147 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_connect_standard_busses),
1148 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_connect_standard_busses)
1151 ComboOption<AutoConnectOption>* iac = new ComboOption<AutoConnectOption> (
1152 "input-auto-connect",
1153 _("Connect track and bus inputs"),
1154 sigc::mem_fun (*_rc_config, &RCConfiguration::get_input_auto_connect),
1155 sigc::mem_fun (*_rc_config, &RCConfiguration::set_input_auto_connect)
1158 iac->add (AutoConnectPhysical, _("automatically to physical inputs"));
1159 iac->add (ManualConnect, _("manually"));
1161 add_option (_("Audio"), iac);
1163 ComboOption<AutoConnectOption>* oac = new ComboOption<AutoConnectOption> (
1164 "output-auto-connect",
1165 _("Connect track and bus outputs"),
1166 sigc::mem_fun (*_rc_config, &RCConfiguration::get_output_auto_connect),
1167 sigc::mem_fun (*_rc_config, &RCConfiguration::set_output_auto_connect)
1170 oac->add (AutoConnectPhysical, _("automatically to physical outputs"));
1171 oac->add (AutoConnectMaster, _("automatically to master outputs"));
1172 oac->add (ManualConnect, _("manually"));
1174 add_option (_("Audio"), oac);
1176 add_option (_("Audio"), new OptionEditorHeading (_("Denormals")));
1178 add_option (_("Audio"),
1179 new BoolOption (
1180 "denormal-protection",
1181 _("Use DC bias to protect against denormals"),
1182 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_protection),
1183 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_protection)
1186 ComboOption<DenormalModel>* dm = new ComboOption<DenormalModel> (
1187 "denormal-model",
1188 _("Processor handling"),
1189 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_model),
1190 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_model)
1193 dm->add (DenormalNone, _("no processor handling"));
1195 FPU fpu;
1197 if (fpu.has_flush_to_zero()) {
1198 dm->add (DenormalFTZ, _("use FlushToZero"));
1201 if (fpu.has_denormals_are_zero()) {
1202 dm->add (DenormalDAZ, _("use DenormalsAreZero"));
1205 if (fpu.has_flush_to_zero() && fpu.has_denormals_are_zero()) {
1206 dm->add (DenormalFTZDAZ, _("use FlushToZero and DenormalsAreZerO"));
1209 add_option (_("Audio"), dm);
1211 add_option (_("Audio"), new OptionEditorHeading (_("Plugins")));
1213 add_option (_("Audio"),
1214 new BoolOption (
1215 "plugins-stop-with-transport",
1216 _("Stop plugins when the transport is stopped"),
1217 sigc::mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
1218 sigc::mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
1221 add_option (_("Audio"),
1222 new BoolOption (
1223 "do-not-record-plugins",
1224 _("Disable plugins during recording"),
1225 sigc::mem_fun (*_rc_config, &RCConfiguration::get_do_not_record_plugins),
1226 sigc::mem_fun (*_rc_config, &RCConfiguration::set_do_not_record_plugins)
1229 add_option (_("Audio"),
1230 new BoolOption (
1231 "new-plugins-active",
1232 _("Make new plugins active"),
1233 sigc::mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
1234 sigc::mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
1237 add_option (_("Audio"),
1238 new BoolOption (
1239 "auto-analyse-audio",
1240 _("Enable automatic analysis of audio"),
1241 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_analyse_audio),
1242 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_analyse_audio)
1245 /* SOLO AND MUTE */
1247 cout << "FUCK: " << _rc_config->get_solo_mute_gain() << "\n";
1249 add_option (_("Solo / mute"),
1250 new FaderOption (
1251 "solo-mute-gain",
1252 _("Solo mute cut (dB)"),
1253 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_gain),
1254 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_gain)
1257 add_option (_("Solo / mute"),
1258 new BoolOption (
1259 "solo-control-is-listen-control",
1260 _("Solo controls are Listen controls"),
1261 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_control_is_listen_control),
1262 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_control_is_listen_control)
1265 ComboOption<ListenPosition>* lp = new ComboOption<ListenPosition> (
1266 "listen-position",
1267 _("Listen Position"),
1268 sigc::mem_fun (*_rc_config, &RCConfiguration::get_listen_position),
1269 sigc::mem_fun (*_rc_config, &RCConfiguration::set_listen_position)
1272 lp->add (AfterFaderListen, _("after-fader listen"));
1273 lp->add (PreFaderListen, _("pre-fader listen"));
1275 add_option (_("Solo / mute"), lp);
1277 add_option (_("Solo / mute"),
1278 new BoolOption (
1279 "exclusive-solo",
1280 _("Exclusive solo"),
1281 sigc::mem_fun (*_rc_config, &RCConfiguration::get_exclusive_solo),
1282 sigc::mem_fun (*_rc_config, &RCConfiguration::set_exclusive_solo)
1285 add_option (_("Solo / mute"),
1286 new BoolOption (
1287 "show-solo-mutes",
1288 _("Show solo muting"),
1289 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_solo_mutes),
1290 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_solo_mutes)
1293 add_option (_("Solo / mute"),
1294 new BoolOption (
1295 "solo-mute-override",
1296 _("Soloing overrides muting"),
1297 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_override),
1298 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_override)
1301 add_option (_("Solo / mute"), new OptionEditorHeading (_("Default track / bus muting options")));
1303 add_option (_("Solo / mute"),
1304 new BoolOption (
1305 "mute-affects-pre-fader",
1306 _("Mute affects pre-fader sends"),
1307 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_pre_fader),
1308 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_pre_fader)
1311 add_option (_("Solo / mute"),
1312 new BoolOption (
1313 "mute-affects-post-fader",
1314 _("Mute affects post-fader sends"),
1315 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_post_fader),
1316 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_post_fader)
1319 add_option (_("Solo / mute"),
1320 new BoolOption (
1321 "mute-affects-control-outs",
1322 _("Mute affects control outputs"),
1323 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_control_outs),
1324 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_control_outs)
1327 add_option (_("Solo / mute"),
1328 new BoolOption (
1329 "mute-affects-main-outs",
1330 _("Mute affects main outputs"),
1331 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_main_outs),
1332 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_main_outs)
1335 /* MIDI CONTROL */
1337 list<ComboOption<string>* > midi_combos;
1339 midi_combos.push_back (new ComboOption<string> (
1340 "mtc-port-name",
1341 _("Send/Receive MTC via"),
1342 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mtc_port_name),
1343 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mtc_port_name)
1346 midi_combos.push_back (new ComboOption<string> (
1347 "midi-clock-port-name",
1348 _("Send/Receive MIDI clock via"),
1349 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_clock_port_name),
1350 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_clock_port_name)
1353 midi_combos.push_back (new ComboOption<string> (
1354 "mmc-port-name",
1355 _("Send/Receive MMC via"),
1356 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_port_name),
1357 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_port_name)
1360 midi_combos.push_back (new ComboOption<string> (
1361 "midi-port-name",
1362 _("Send/Receive MIDI parameter control via"),
1363 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_port_name),
1364 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_port_name)
1367 add_option (_("MIDI control"), new MIDIPorts (_rc_config, midi_combos));
1369 for (list<ComboOption<string>* >::iterator i = midi_combos.begin(); i != midi_combos.end(); ++i) {
1370 add_option (_("MIDI control"), *i);
1373 add_option (_("MIDI control"),
1374 new BoolOption (
1375 "send-mtc",
1376 _("Send MIDI Time Code"),
1377 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mtc),
1378 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mtc)
1381 add_option (_("MIDI control"),
1382 new BoolOption (
1383 "mmc-control",
1384 _("Obey MIDI Machine Control commands"),
1385 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_control),
1386 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
1390 add_option (_("MIDI control"),
1391 new BoolOption (
1392 "send-mmc",
1393 _("Send MIDI Machine Control commands"),
1394 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mmc),
1395 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mmc)
1398 add_option (_("MIDI control"),
1399 new BoolOption (
1400 "midi-feedback",
1401 _("Send MIDI control feedback"),
1402 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_feedback),
1403 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_feedback)
1406 add_option (_("MIDI control"),
1407 new SpinOption<uint8_t> (
1408 "mmc-receive-device-id",
1409 _("Inbound MMC device ID"),
1410 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_receive_device_id),
1411 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_receive_device_id),
1412 0, 128, 1, 10
1415 add_option (_("MIDI control"),
1416 new SpinOption<uint8_t> (
1417 "mmc-send-device-id",
1418 _("Outbound MMC device ID"),
1419 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_send_device_id),
1420 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_send_device_id),
1421 0, 128, 1, 10
1424 add_option (_("MIDI control"),
1425 new SpinOption<int32_t> (
1426 "initial-program-change",
1427 _("Initial program change"),
1428 sigc::mem_fun (*_rc_config, &RCConfiguration::get_initial_program_change),
1429 sigc::mem_fun (*_rc_config, &RCConfiguration::set_initial_program_change),
1430 -1, 65536, 1, 10
1433 /* CONTROL SURFACES */
1435 add_option (_("Control surfaces"), new ControlSurfacesOptions (*this));
1437 ComboOption<RemoteModel>* rm = new ComboOption<RemoteModel> (
1438 "remote-model",
1439 _("Control surface remote ID"),
1440 sigc::mem_fun (*_rc_config, &RCConfiguration::get_remote_model),
1441 sigc::mem_fun (*_rc_config, &RCConfiguration::set_remote_model)
1444 rm->add (UserOrdered, _("assigned by user"));
1445 rm->add (MixerOrdered, _("follows order of mixer"));
1446 rm->add (EditorOrdered, _("follows order of editor"));
1448 add_option (_("Control surfaces"), rm);
1450 /* KEYBOARD */
1452 add_option (_("Keyboard"), new KeyboardOptions);