fix math bug with numthreads computation
[ardour2.git] / gtk2_ardour / rc_option_editor.cc
blob14fca7a4173a4e2b24fdcacbc26295c868f8ac0b
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"
8 #include "pbd/cpus.h"
10 #include "midi++/manager.h"
11 #include "midi++/factory.h"
13 #include "ardour/audioengine.h"
14 #include "ardour/dB.h"
15 #include "ardour/rc_configuration.h"
16 #include "ardour/control_protocol_manager.h"
17 #include "control_protocol/control_protocol.h"
19 #include "gui_thread.h"
20 #include "midi_tracer.h"
21 #include "rc_option_editor.h"
22 #include "utils.h"
23 #include "midi_port_dialog.h"
24 #include "sfdb_ui.h"
25 #include "keyboard.h"
26 #include "i18n.h"
28 using namespace std;
29 using namespace Gtk;
30 using namespace Gtkmm2ext;
31 using namespace PBD;
32 using namespace ARDOUR;
34 class MIDIPorts : public OptionEditorBox
36 public:
37 MIDIPorts (RCConfiguration* c, list<ComboOption<string>* > const & o)
38 : _rc_config (c),
39 _add_port_button (Stock::ADD),
40 _port_combos (o)
42 _store = ListStore::create (_model);
43 _view.set_model (_store);
44 _view.append_column (_("Name"), _model.name);
45 _view.get_column(0)->set_resizable (true);
46 _view.get_column(0)->set_expand (true);
47 _view.append_column_editable (_("Online"), _model.online);
48 _view.append_column_editable (_("Trace input"), _model.trace_input);
49 _view.append_column_editable (_("Trace output"), _model.trace_output);
51 HBox* h = manage (new HBox);
52 h->set_spacing (4);
53 h->pack_start (_view, true, true);
55 VBox* v = manage (new VBox);
56 v->set_spacing (4);
57 v->pack_start (_add_port_button, false, false);
58 h->pack_start (*v, false, false);
60 _box->pack_start (*h);
62 ports_changed ();
64 _store->signal_row_changed().connect (sigc::mem_fun (*this, &MIDIPorts::model_changed));
66 _add_port_button.signal_clicked().connect (sigc::mem_fun (*this, &MIDIPorts::add_port_clicked));
69 void parameter_changed (string const &) {}
70 void set_state_from_config () {}
72 private:
74 typedef std::map<MIDI::Port*,MidiTracer*> PortTraceMap;
75 PortTraceMap port_input_trace_map;
76 PortTraceMap port_output_trace_map;
78 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
80 TreeModel::Row r = *i;
82 MIDI::Port* port = r[_model.port];
83 if (!port) {
84 return;
87 if (port->input()) {
89 if (r[_model.online] == port->input()->offline()) {
90 port->input()->set_offline (!r[_model.online]);
93 if (r[_model.trace_input] != port->input()->tracing()) {
94 PortTraceMap::iterator x = port_input_trace_map.find (port);
95 MidiTracer* mt;
97 if (x == port_input_trace_map.end()) {
98 mt = new MidiTracer (port->name() + string (" [input]"), *port->input());
99 port_input_trace_map.insert (pair<MIDI::Port*,MidiTracer*> (port, mt));
100 } else {
101 mt = x->second;
103 mt->present ();
107 if (port->output()) {
109 if (r[_model.trace_output] != port->output()->tracing()) {
110 PortTraceMap::iterator x = port_output_trace_map.find (port);
111 MidiTracer* mt;
113 if (x == port_output_trace_map.end()) {
114 mt = new MidiTracer (port->name() + string (" [output]"), *port->output());
115 port_output_trace_map.insert (pair<MIDI::Port*,MidiTracer*> (port, mt));
116 } else {
117 mt = x->second;
119 mt->present ();
125 void setup_ports_combo (ComboOption<string>* c)
127 c->clear ();
128 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
129 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
130 c->add ((*i)->name(), (*i)->name());
134 void ports_changed ()
136 /* XXX: why is this coming from here? */
137 MIDI::Manager::PortList const & ports = MIDI::Manager::instance()->get_midi_ports ();
139 _store->clear ();
140 port_connections.drop_connections ();
142 for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
144 TreeModel::Row r = *_store->append ();
146 r[_model.name] = (*i)->name();
148 if ((*i)->input()) {
149 r[_model.online] = !(*i)->input()->offline();
150 (*i)->input()->OfflineStatusChanged.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&MIDIPorts::port_offline_changed, this, (*i)), gui_context());
151 r[_model.trace_input] = (*i)->input()->tracing();
154 if ((*i)->output()) {
155 r[_model.trace_output] = (*i)->output()->tracing();
158 r[_model.port] = (*i);
161 for (list<ComboOption<string>* >::iterator i = _port_combos.begin(); i != _port_combos.end(); ++i) {
162 setup_ports_combo (*i);
166 void port_offline_changed (MIDI::Port* p)
168 if (!p->input()) {
169 return;
172 for (TreeModel::Children::iterator i = _store->children().begin(); i != _store->children().end(); ++i) {
173 if ((*i)[_model.port] == p) {
174 (*i)[_model.online] = !p->input()->offline();
179 void add_port_clicked ()
181 MidiPortDialog dialog;
183 dialog.set_position (WIN_POS_MOUSE);
185 dialog.show ();
187 int const r = dialog.run ();
189 switch (r) {
190 case RESPONSE_ACCEPT:
191 break;
192 default:
193 return;
194 break;
197 Glib::ustring const mode = dialog.port_mode_combo.get_active_text ();
198 string smod;
200 if (mode == _("input")) {
201 smod = X_("input");
202 } else if (mode == (_("output"))) {
203 smod = X_("output");
204 } else {
205 smod = "duplex";
208 XMLNode node (X_("MIDI-port"));
210 node.add_property ("tag", dialog.port_name.get_text());
211 node.add_property ("device", X_("ardour")); // XXX this can't be right for all types
212 node.add_property ("type", MIDI::PortFactory::default_port_type());
213 node.add_property ("mode", smod);
215 if (MIDI::Manager::instance()->add_port (node) != 0) {
216 cerr << " there are now " << MIDI::Manager::instance()->nports() << endl;
217 ports_changed ();
221 class MIDIModelColumns : public TreeModelColumnRecord
223 public:
224 MIDIModelColumns ()
226 add (name);
227 add (online);
228 add (trace_input);
229 add (trace_output);
230 add (port);
233 TreeModelColumn<string> name;
234 TreeModelColumn<bool> online;
235 TreeModelColumn<bool> trace_input;
236 TreeModelColumn<bool> trace_output;
237 TreeModelColumn<MIDI::Port*> port;
240 RCConfiguration* _rc_config;
241 Glib::RefPtr<ListStore> _store;
242 MIDIModelColumns _model;
243 TreeView _view;
244 Button _add_port_button;
245 ComboBoxText _mtc_combo;
246 ComboBoxText _midi_clock_combo;
247 ComboBoxText _mmc_combo;
248 ComboBoxText _mpc_combo;
249 list<ComboOption<string>* > _port_combos;
250 PBD::ScopedConnectionList port_connections;
254 class ClickOptions : public OptionEditorBox
256 public:
257 ClickOptions (RCConfiguration* c, ArdourDialog* p)
258 : _rc_config (c),
259 _parent (p)
261 Table* t = manage (new Table (2, 3));
262 t->set_spacings (4);
264 Label* l = manage (new Label (_("Click audio file:")));
265 l->set_alignment (0, 0.5);
266 t->attach (*l, 0, 1, 0, 1, FILL);
267 t->attach (_click_path_entry, 1, 2, 0, 1, FILL);
268 Button* b = manage (new Button (_("Browse...")));
269 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_browse_clicked));
270 t->attach (*b, 2, 3, 0, 1, FILL);
272 l = manage (new Label (_("Click emphasis audio file:")));
273 l->set_alignment (0, 0.5);
274 t->attach (*l, 0, 1, 1, 2, FILL);
275 t->attach (_click_emphasis_path_entry, 1, 2, 1, 2, FILL);
276 b = manage (new Button (_("Browse...")));
277 b->signal_clicked().connect (sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked));
278 t->attach (*b, 2, 3, 1, 2, FILL);
280 _box->pack_start (*t, false, false);
283 void parameter_changed (string const & p)
285 if (p == "click-sound") {
286 _click_path_entry.set_text (_rc_config->get_click_sound());
287 } else if (p == "click-emphasis-sound") {
288 _click_emphasis_path_entry.set_text (_rc_config->get_click_emphasis_sound());
292 void set_state_from_config ()
294 parameter_changed ("click-sound");
295 parameter_changed ("click-emphasis-sound");
298 private:
300 void click_browse_clicked ()
302 SoundFileChooser sfdb (*_parent, _("Choose Click"));
304 sfdb.show_all ();
305 sfdb.present ();
307 if (sfdb.run () == RESPONSE_OK) {
308 click_chosen (sfdb.get_filename());
312 void click_chosen (string const & path)
314 _click_path_entry.set_text (path);
315 _rc_config->set_click_sound (path);
318 void click_emphasis_browse_clicked ()
320 SoundFileChooser sfdb (*_parent, _("Choose Click Emphasis"));
322 sfdb.show_all ();
323 sfdb.present ();
325 if (sfdb.run () == RESPONSE_OK) {
326 click_emphasis_chosen (sfdb.get_filename());
330 void click_emphasis_chosen (string const & path)
332 _click_emphasis_path_entry.set_text (path);
333 _rc_config->set_click_emphasis_sound (path);
336 RCConfiguration* _rc_config;
337 ArdourDialog* _parent;
338 Entry _click_path_entry;
339 Entry _click_emphasis_path_entry;
342 class UndoOptions : public OptionEditorBox
344 public:
345 UndoOptions (RCConfiguration* c) :
346 _rc_config (c),
347 _limit_undo_button (_("Limit undo history to")),
348 _save_undo_button (_("Save undo history of"))
350 Table* t = new Table (2, 3);
351 t->set_spacings (4);
353 t->attach (_limit_undo_button, 0, 1, 0, 1, FILL);
354 _limit_undo_spin.set_range (0, 512);
355 _limit_undo_spin.set_increments (1, 10);
356 t->attach (_limit_undo_spin, 1, 2, 0, 1, FILL | EXPAND);
357 Label* l = manage (new Label (_("commands")));
358 l->set_alignment (0, 0.5);
359 t->attach (*l, 2, 3, 0, 1);
361 t->attach (_save_undo_button, 0, 1, 1, 2, FILL);
362 _save_undo_spin.set_range (0, 512);
363 _save_undo_spin.set_increments (1, 10);
364 t->attach (_save_undo_spin, 1, 2, 1, 2, FILL | EXPAND);
365 l = manage (new Label (_("commands")));
366 l->set_alignment (0, 0.5);
367 t->attach (*l, 2, 3, 1, 2);
369 _box->pack_start (*t);
371 _limit_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_toggled));
372 _limit_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::limit_undo_changed));
373 _save_undo_button.signal_toggled().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_toggled));
374 _save_undo_spin.signal_value_changed().connect (sigc::mem_fun (*this, &UndoOptions::save_undo_changed));
377 void parameter_changed (string const & p)
379 if (p == "history-depth") {
380 int32_t const d = _rc_config->get_history_depth();
381 _limit_undo_button.set_active (d != 0);
382 _limit_undo_spin.set_sensitive (d != 0);
383 _limit_undo_spin.set_value (d);
384 } else if (p == "save-history") {
385 bool const x = _rc_config->get_save_history ();
386 _save_undo_button.set_active (x);
387 _save_undo_spin.set_sensitive (x);
388 } else if (p == "save-history-depth") {
389 _save_undo_spin.set_value (_rc_config->get_saved_history_depth());
393 void set_state_from_config ()
395 parameter_changed ("save-history");
396 parameter_changed ("history-depth");
397 parameter_changed ("save-history-depth");
400 void limit_undo_toggled ()
402 bool const x = _limit_undo_button.get_active ();
403 _limit_undo_spin.set_sensitive (x);
404 int32_t const n = x ? 16 : 0;
405 _limit_undo_spin.set_value (n);
406 _rc_config->set_history_depth (n);
409 void limit_undo_changed ()
411 _rc_config->set_history_depth (_limit_undo_spin.get_value_as_int ());
414 void save_undo_toggled ()
416 bool const x = _save_undo_button.get_active ();
417 _rc_config->set_save_history (x);
420 void save_undo_changed ()
422 _rc_config->set_saved_history_depth (_save_undo_spin.get_value_as_int ());
425 private:
426 RCConfiguration* _rc_config;
427 CheckButton _limit_undo_button;
428 SpinButton _limit_undo_spin;
429 CheckButton _save_undo_button;
430 SpinButton _save_undo_spin;
435 static const struct {
436 const char *name;
437 guint modifier;
438 } modifiers[] = {
440 { "Unmodified", 0 },
442 #ifdef GTKOSX
444 /* Command = Meta
445 Option/Alt = Mod1
447 { "Shift", GDK_SHIFT_MASK },
448 { "Command", GDK_META_MASK },
449 { "Control", GDK_CONTROL_MASK },
450 { "Option", GDK_MOD1_MASK },
451 { "Command-Shift", GDK_META_MASK|GDK_SHIFT_MASK },
452 { "Command-Option", GDK_MOD1_MASK|GDK_META_MASK },
453 { "Shift-Option", GDK_SHIFT_MASK|GDK_MOD1_MASK },
454 { "Shift-Command-Option", GDK_MOD5_MASK|GDK_SHIFT_MASK|GDK_META_MASK },
456 #else
457 { "Shift", GDK_SHIFT_MASK },
458 { "Control", GDK_CONTROL_MASK },
459 { "Alt (Mod1)", GDK_MOD1_MASK },
460 { "Control-Shift", GDK_CONTROL_MASK|GDK_SHIFT_MASK },
461 { "Control-Alt", GDK_CONTROL_MASK|GDK_MOD1_MASK },
462 { "Shift-Alt", GDK_SHIFT_MASK|GDK_MOD1_MASK },
463 { "Control-Shift-Alt", GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_MOD1_MASK },
464 { "Mod2", GDK_MOD2_MASK },
465 { "Mod3", GDK_MOD3_MASK },
466 { "Mod4", GDK_MOD4_MASK },
467 { "Mod5", GDK_MOD5_MASK },
468 #endif
469 { 0, 0 }
473 class KeyboardOptions : public OptionEditorBox
475 public:
476 KeyboardOptions () :
477 _delete_button_adjustment (3, 1, 12),
478 _delete_button_spin (_delete_button_adjustment),
479 _edit_button_adjustment (3, 1, 5),
480 _edit_button_spin (_edit_button_adjustment)
483 /* internationalize and prepare for use with combos */
485 vector<string> dumb;
486 for (int i = 0; modifiers[i].name; ++i) {
487 dumb.push_back (_(modifiers[i].name));
490 set_popdown_strings (_edit_modifier_combo, dumb);
491 _edit_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_modifier_chosen));
493 for (int x = 0; modifiers[x].name; ++x) {
494 if (modifiers[x].modifier == Keyboard::edit_modifier ()) {
495 _edit_modifier_combo.set_active_text (_(modifiers[x].name));
496 break;
500 Table* t = manage (new Table (4, 4));
501 t->set_spacings (4);
503 Label* l = manage (new Label (_("Edit using:")));
504 l->set_name ("OptionsLabel");
505 l->set_alignment (0, 0.5);
507 t->attach (*l, 0, 1, 0, 1, FILL | EXPAND, FILL);
508 t->attach (_edit_modifier_combo, 1, 2, 0, 1, FILL | EXPAND, FILL);
510 l = manage (new Label (_("+ button")));
511 l->set_name ("OptionsLabel");
513 t->attach (*l, 3, 4, 0, 1, FILL | EXPAND, FILL);
514 t->attach (_edit_button_spin, 4, 5, 0, 1, FILL | EXPAND, FILL);
516 _edit_button_spin.set_name ("OptionsEntry");
517 _edit_button_adjustment.set_value (Keyboard::edit_button());
518 _edit_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::edit_button_changed));
520 set_popdown_strings (_delete_modifier_combo, dumb);
521 _delete_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_modifier_chosen));
523 for (int x = 0; modifiers[x].name; ++x) {
524 if (modifiers[x].modifier == Keyboard::delete_modifier ()) {
525 _delete_modifier_combo.set_active_text (_(modifiers[x].name));
526 break;
530 l = manage (new Label (_("Delete using:")));
531 l->set_name ("OptionsLabel");
532 l->set_alignment (0, 0.5);
534 t->attach (*l, 0, 1, 1, 2, FILL | EXPAND, FILL);
535 t->attach (_delete_modifier_combo, 1, 2, 1, 2, FILL | EXPAND, FILL);
537 l = manage (new Label (_("+ button")));
538 l->set_name ("OptionsLabel");
540 t->attach (*l, 3, 4, 1, 2, FILL | EXPAND, FILL);
541 t->attach (_delete_button_spin, 4, 5, 1, 2, FILL | EXPAND, FILL);
543 _delete_button_spin.set_name ("OptionsEntry");
544 _delete_button_adjustment.set_value (Keyboard::delete_button());
545 _delete_button_adjustment.signal_value_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::delete_button_changed));
547 set_popdown_strings (_snap_modifier_combo, dumb);
548 _snap_modifier_combo.signal_changed().connect (sigc::mem_fun(*this, &KeyboardOptions::snap_modifier_chosen));
550 for (int x = 0; modifiers[x].name; ++x) {
551 if (modifiers[x].modifier == (guint) Keyboard::snap_modifier ()) {
552 _snap_modifier_combo.set_active_text (_(modifiers[x].name));
553 break;
557 l = manage (new Label (_("Toggle snap using:")));
558 l->set_name ("OptionsLabel");
559 l->set_alignment (0, 0.5);
561 t->attach (*l, 0, 1, 2, 3, FILL | EXPAND, FILL);
562 t->attach (_snap_modifier_combo, 1, 2, 2, 3, FILL | EXPAND, FILL);
564 vector<string> strs;
566 for (map<string,string>::iterator bf = Keyboard::binding_files.begin(); bf != Keyboard::binding_files.end(); ++bf) {
567 strs.push_back (bf->first);
570 set_popdown_strings (_keyboard_layout_selector, strs);
571 _keyboard_layout_selector.set_active_text (Keyboard::current_binding_name());
572 _keyboard_layout_selector.signal_changed().connect (sigc::mem_fun (*this, &KeyboardOptions::bindings_changed));
574 l = manage (new Label (_("Keyboard layout:")));
575 l->set_name ("OptionsLabel");
576 l->set_alignment (0, 0.5);
578 t->attach (*l, 0, 1, 3, 4, FILL | EXPAND, FILL);
579 t->attach (_keyboard_layout_selector, 1, 2, 3, 4, FILL | EXPAND, FILL);
581 _box->pack_start (*t, false, false);
584 void parameter_changed (string const &)
586 /* XXX: these aren't really config options... */
589 void set_state_from_config ()
591 /* XXX: these aren't really config options... */
594 private:
596 void bindings_changed ()
598 string const txt = _keyboard_layout_selector.get_active_text();
600 /* XXX: config...? for all this keyboard stuff */
602 for (map<string,string>::iterator i = Keyboard::binding_files.begin(); i != Keyboard::binding_files.end(); ++i) {
603 if (txt == i->first) {
604 if (Keyboard::load_keybindings (i->second)) {
605 Keyboard::save_keybindings ();
611 void edit_modifier_chosen ()
613 string const txt = _edit_modifier_combo.get_active_text();
615 for (int i = 0; modifiers[i].name; ++i) {
616 if (txt == _(modifiers[i].name)) {
617 Keyboard::set_edit_modifier (modifiers[i].modifier);
618 break;
623 void delete_modifier_chosen ()
625 string const txt = _delete_modifier_combo.get_active_text();
627 for (int i = 0; modifiers[i].name; ++i) {
628 if (txt == _(modifiers[i].name)) {
629 Keyboard::set_delete_modifier (modifiers[i].modifier);
630 break;
635 void snap_modifier_chosen ()
637 string const txt = _snap_modifier_combo.get_active_text();
639 for (int i = 0; modifiers[i].name; ++i) {
640 if (txt == _(modifiers[i].name)) {
641 Keyboard::set_snap_modifier (modifiers[i].modifier);
642 break;
647 void delete_button_changed ()
649 Keyboard::set_delete_button (_delete_button_spin.get_value_as_int());
652 void edit_button_changed ()
654 Keyboard::set_edit_button (_edit_button_spin.get_value_as_int());
657 ComboBoxText _keyboard_layout_selector;
658 ComboBoxText _edit_modifier_combo;
659 ComboBoxText _delete_modifier_combo;
660 ComboBoxText _snap_modifier_combo;
661 Adjustment _delete_button_adjustment;
662 SpinButton _delete_button_spin;
663 Adjustment _edit_button_adjustment;
664 SpinButton _edit_button_spin;
667 class FontScalingOptions : public OptionEditorBox
669 public:
670 FontScalingOptions (RCConfiguration* c) :
671 _rc_config (c),
672 _dpi_adjustment (50, 50, 250, 1, 10),
673 _dpi_slider (_dpi_adjustment)
675 _dpi_adjustment.set_value (_rc_config->get_font_scale () / 1024);
677 Label* l = manage (new Label (_("Font scaling:")));
678 l->set_name ("OptionsLabel");
680 _dpi_slider.set_update_policy (UPDATE_DISCONTINUOUS);
681 HBox* h = manage (new HBox);
682 h->set_spacing (4);
683 h->pack_start (*l, false, false);
684 h->pack_start (_dpi_slider, true, true);
686 _box->pack_start (*h, false, false);
688 _dpi_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &FontScalingOptions::dpi_changed));
691 void parameter_changed (string const & p)
693 if (p == "font-scale") {
694 _dpi_adjustment.set_value (_rc_config->get_font_scale() / 1024);
698 void set_state_from_config ()
700 parameter_changed ("font-scale");
703 private:
705 void dpi_changed ()
707 _rc_config->set_font_scale ((long) floor (_dpi_adjustment.get_value() * 1024));
708 /* XXX: should be triggered from the parameter changed signal */
709 reset_dpi ();
712 RCConfiguration* _rc_config;
713 Adjustment _dpi_adjustment;
714 HScale _dpi_slider;
717 class BufferingOptions : public OptionEditorBox
719 public:
720 BufferingOptions (RCConfiguration* c)
721 : _rc_config (c)
722 , _playback_adjustment (5, 1, 60, 1, 4)
723 , _capture_adjustment (5, 1, 60, 1, 4)
724 , _playback_slider (_playback_adjustment)
725 , _capture_slider (_capture_adjustment)
727 _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds());
729 Label* l = manage (new Label (_("Playback (seconds of buffering):")));
730 l->set_name ("OptionsLabel");
732 _playback_slider.set_update_policy (UPDATE_DISCONTINUOUS);
733 HBox* h = manage (new HBox);
734 h->set_spacing (4);
735 h->pack_start (*l, false, false);
736 h->pack_start (_playback_slider, true, true);
738 _box->pack_start (*h, false, false);
740 _capture_adjustment.set_value (_rc_config->get_audio_capture_buffer_seconds());
742 l = manage (new Label (_("Recording (seconds of buffering):")));
743 l->set_name ("OptionsLabel");
745 _capture_slider.set_update_policy (UPDATE_DISCONTINUOUS);
746 h = manage (new HBox);
747 h->set_spacing (4);
748 h->pack_start (*l, false, false);
749 h->pack_start (_capture_slider, true, true);
751 _box->pack_start (*h, false, false);
753 _capture_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &BufferingOptions::capture_changed));
754 _playback_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &BufferingOptions::playback_changed));
757 void parameter_changed (string const & p)
759 if (p == "playback-buffer-seconds") {
760 _playback_adjustment.set_value (_rc_config->get_audio_playback_buffer_seconds());
761 } else if (p == "capture-buffer-seconds") {
762 _capture_adjustment.set_value (_rc_config->get_audio_capture_buffer_seconds());
766 void set_state_from_config ()
768 parameter_changed ("playback-buffer-seconds");
769 parameter_changed ("capture-buffer-seconds");
772 private:
774 void playback_changed ()
776 _rc_config->set_audio_playback_buffer_seconds ((long) _playback_adjustment.get_value());
779 void capture_changed ()
781 _rc_config->set_audio_capture_buffer_seconds ((long) _capture_adjustment.get_value());
784 RCConfiguration* _rc_config;
785 Adjustment _playback_adjustment;
786 Adjustment _capture_adjustment;
787 HScale _playback_slider;
788 HScale _capture_slider;
791 class ControlSurfacesOptions : public OptionEditorBox
793 public:
794 ControlSurfacesOptions (ArdourDialog& parent)
795 : _parent (parent)
797 _store = ListStore::create (_model);
798 _view.set_model (_store);
799 _view.append_column (_("Name"), _model.name);
800 _view.get_column(0)->set_resizable (true);
801 _view.get_column(0)->set_expand (true);
802 _view.append_column_editable (_("Enabled"), _model.enabled);
803 _view.append_column_editable (_("Feedback"), _model.feedback);
805 _box->pack_start (_view, false, false);
807 Label* label = manage (new Label);
808 label->set_markup (string_compose (X_("<i>%1</i>"), _("Double-click on a name to edit settings for an enabled protocol")));
810 _box->pack_start (*label, false, false);
811 label->show ();
813 _store->signal_row_changed().connect (sigc::mem_fun (*this, &ControlSurfacesOptions::model_changed));
814 _view.signal_button_press_event().connect_notify (sigc::mem_fun(*this, &ControlSurfacesOptions::edit_clicked));
817 void parameter_changed (std::string const &)
822 void set_state_from_config ()
824 _store->clear ();
826 ControlProtocolManager& m = ControlProtocolManager::instance ();
827 for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
829 if (!(*i)->mandatory) {
830 TreeModel::Row r = *_store->append ();
831 r[_model.name] = (*i)->name;
832 r[_model.enabled] = ((*i)->protocol || (*i)->requested);
833 r[_model.feedback] = ((*i)->protocol && (*i)->protocol->get_feedback ());
834 r[_model.protocol_info] = *i;
839 private:
841 void model_changed (TreeModel::Path const &, TreeModel::iterator const & i)
843 TreeModel::Row r = *i;
845 ControlProtocolInfo* cpi = r[_model.protocol_info];
846 if (!cpi) {
847 return;
850 bool const was_enabled = (cpi->protocol != 0);
851 bool const is_enabled = r[_model.enabled];
853 if (was_enabled != is_enabled) {
854 if (!was_enabled) {
855 ControlProtocolManager::instance().instantiate (*cpi);
856 } else {
857 ControlProtocolManager::instance().teardown (*cpi);
861 bool const was_feedback = (cpi->protocol && cpi->protocol->get_feedback ());
862 bool const is_feedback = r[_model.feedback];
864 if (was_feedback != is_feedback && cpi->protocol) {
865 cpi->protocol->set_feedback (is_feedback);
869 void edit_clicked (GdkEventButton* ev)
871 if (ev->type != GDK_2BUTTON_PRESS) {
872 return;
875 std::string name;
876 ControlProtocolInfo* cpi;
877 TreeModel::Row row;
879 row = *(_view.get_selection()->get_selected());
881 Window* win = row[_model.editor];
882 if (win && !win->is_visible()) {
883 win->present ();
884 } else {
885 cpi = row[_model.protocol_info];
887 if (cpi && cpi->protocol && cpi->protocol->has_editor ()) {
888 Box* box = (Box*) cpi->protocol->get_gui ();
889 if (box) {
890 string title = row[_model.name];
891 ArdourDialog* win = new ArdourDialog (_parent, title);
892 win->get_vbox()->pack_start (*box, false, false);
893 box->show ();
894 win->present ();
895 row[_model.editor] = win;
901 class ControlSurfacesModelColumns : public TreeModelColumnRecord
903 public:
905 ControlSurfacesModelColumns ()
907 add (name);
908 add (enabled);
909 add (feedback);
910 add (protocol_info);
911 add (editor);
914 TreeModelColumn<string> name;
915 TreeModelColumn<bool> enabled;
916 TreeModelColumn<bool> feedback;
917 TreeModelColumn<ControlProtocolInfo*> protocol_info;
918 TreeModelColumn<Gtk::Window*> editor;
921 Glib::RefPtr<ListStore> _store;
922 ControlSurfacesModelColumns _model;
923 TreeView _view;
924 Gtk::Window& _parent;
928 RCOptionEditor::RCOptionEditor ()
929 : OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
930 , _rc_config (Config)
932 /* MISC */
934 uint32_t hwcpus = hardware_concurrency ();
936 if (hwcpus > 1) {
937 add_option (_("Misc"), new OptionEditorHeading (_("DSP CPU Utilization")));
939 ComboOption<uint32_t>* procs = new ComboOption<uint32_t> (
940 "processor-usage",
941 _("Signal processing uses: "),
942 sigc::mem_fun (*_rc_config, &RCConfiguration::get_processor_usage),
943 sigc::mem_fun (*_rc_config, &RCConfiguration::set_processor_usage)
946 procs->add (-1, _("All but one"));
947 procs->add (0, _("All available processors"));
949 for (uint32_t i = 2; i < hwcpus; ++i) {
950 procs->add (1, string_compose (_("%1 processors"), i));
953 add_option (_("Misc"), procs);
956 add_option (_("Misc"), new OptionEditorHeading (_("Metering")));
958 ComboOption<float>* mht = new ComboOption<float> (
959 "meter-hold",
960 _("Meter hold time"),
961 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_hold),
962 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_hold)
965 mht->add (MeterHoldOff, _("off"));
966 mht->add (MeterHoldShort, _("short"));
967 mht->add (MeterHoldMedium, _("medium"));
968 mht->add (MeterHoldLong, _("long"));
970 add_option (_("Misc"), mht);
972 ComboOption<float>* mfo = new ComboOption<float> (
973 "meter-falloff",
974 _("Meter fall-off"),
975 sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_falloff),
976 sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_falloff)
979 mfo->add (METER_FALLOFF_OFF, _("off"));
980 mfo->add (METER_FALLOFF_SLOWEST, _("slowest"));
981 mfo->add (METER_FALLOFF_SLOW, _("slow"));
982 mfo->add (METER_FALLOFF_MEDIUM, _("medium"));
983 mfo->add (METER_FALLOFF_FAST, _("fast"));
984 mfo->add (METER_FALLOFF_FASTER, _("faster"));
985 mfo->add (METER_FALLOFF_FASTEST, _("fastest"));
987 add_option (_("Misc"), mfo);
989 add_option (_("Misc"), new OptionEditorHeading (_("Undo")));
991 add_option (_("Misc"), new UndoOptions (_rc_config));
993 add_option (_("Misc"), new OptionEditorHeading (_("Misc")));
995 #ifndef GTKOSX
996 /* font scaling does nothing with GDK/Quartz */
997 add_option (_("Misc"), new FontScalingOptions (_rc_config));
998 #endif
1000 add_option (_("Misc"),
1001 new BoolOption (
1002 "verify-remove-last-capture",
1003 _("Verify removal of last capture"),
1004 sigc::mem_fun (*_rc_config, &RCConfiguration::get_verify_remove_last_capture),
1005 sigc::mem_fun (*_rc_config, &RCConfiguration::set_verify_remove_last_capture)
1008 add_option (_("Misc"),
1009 new BoolOption (
1010 "periodic-safety-backups",
1011 _("Make periodic backups of the session file"),
1012 sigc::mem_fun (*_rc_config, &RCConfiguration::get_periodic_safety_backups),
1013 sigc::mem_fun (*_rc_config, &RCConfiguration::set_periodic_safety_backups)
1016 add_option (_("Misc"),
1017 new BoolOption (
1018 "sync-all-route-ordering",
1019 _("Syncronise editor and mixer track order"),
1020 sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_all_route_ordering),
1021 sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_all_route_ordering)
1024 add_option (_("Misc"),
1025 new BoolOption (
1026 "only-copy-imported-files",
1027 _("Always copy imported files"),
1028 sigc::mem_fun (*_rc_config, &RCConfiguration::get_only_copy_imported_files),
1029 sigc::mem_fun (*_rc_config, &RCConfiguration::set_only_copy_imported_files)
1032 add_option (_("Misc"),
1033 new BoolOption (
1034 "default-narrow_ms",
1035 _("Use narrow mixer strips"),
1036 sigc::mem_fun (*_rc_config, &RCConfiguration::get_default_narrow_ms),
1037 sigc::mem_fun (*_rc_config, &RCConfiguration::set_default_narrow_ms)
1040 add_option (_("Misc"),
1041 new BoolOption (
1042 "name-new-markers",
1043 _("Name new markers"),
1044 sigc::mem_fun (*_rc_config, &RCConfiguration::get_name_new_markers),
1045 sigc::mem_fun (*_rc_config, &RCConfiguration::set_name_new_markers)
1048 add_option (_("Misc"), new OptionEditorHeading (_("Click")));
1050 add_option (_("Misc"), new ClickOptions (_rc_config, this));
1052 /* TRANSPORT */
1054 add_option (_("Transport"),
1055 new BoolOption (
1056 "latched-record-enable",
1057 _("Keep record-enable engaged on stop"),
1058 sigc::mem_fun (*_rc_config, &RCConfiguration::get_latched_record_enable),
1059 sigc::mem_fun (*_rc_config, &RCConfiguration::set_latched_record_enable)
1062 add_option (_("Transport"),
1063 new BoolOption (
1064 "stop-recording-on-xrun",
1065 _("Stop recording when an xrun occurs"),
1066 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_recording_on_xrun),
1067 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_recording_on_xrun)
1070 add_option (_("Transport"),
1071 new BoolOption (
1072 "create-xrun-marker",
1073 _("Create markers where xruns occur"),
1074 sigc::mem_fun (*_rc_config, &RCConfiguration::get_create_xrun_marker),
1075 sigc::mem_fun (*_rc_config, &RCConfiguration::set_create_xrun_marker)
1078 add_option (_("Transport"),
1079 new BoolOption (
1080 "stop-at-session-end",
1081 _("Stop at the end of the session"),
1082 sigc::mem_fun (*_rc_config, &RCConfiguration::get_stop_at_session_end),
1083 sigc::mem_fun (*_rc_config, &RCConfiguration::set_stop_at_session_end)
1086 add_option (_("Transport"),
1087 new BoolOption (
1088 "primary-clock-delta-edit-cursor",
1089 _("Primary clock delta to edit cursor"),
1090 sigc::mem_fun (*_rc_config, &RCConfiguration::get_primary_clock_delta_edit_cursor),
1091 sigc::mem_fun (*_rc_config, &RCConfiguration::set_primary_clock_delta_edit_cursor)
1094 add_option (_("Transport"),
1095 new BoolOption (
1096 "secondary-clock-delta-edit-cursor",
1097 _("Secondary clock delta to edit cursor"),
1098 sigc::mem_fun (*_rc_config, &RCConfiguration::get_secondary_clock_delta_edit_cursor),
1099 sigc::mem_fun (*_rc_config, &RCConfiguration::set_secondary_clock_delta_edit_cursor)
1102 add_option (_("Transport"),
1103 new BoolOption (
1104 "disable-disarm-during-roll",
1105 _("Disable per-track record disarm while rolling"),
1106 sigc::mem_fun (*_rc_config, &RCConfiguration::get_disable_disarm_during_roll),
1107 sigc::mem_fun (*_rc_config, &RCConfiguration::set_disable_disarm_during_roll)
1110 add_option (_("Transport"),
1111 new BoolOption (
1112 "quieten_at_speed",
1113 _("12dB gain reduction during fast-forward and fast-rewind"),
1114 sigc::mem_fun (*_rc_config, &RCConfiguration::get_quieten_at_speed),
1115 sigc::mem_fun (*_rc_config, &RCConfiguration::set_quieten_at_speed)
1118 /* EDITOR */
1120 add_option (_("Editor"),
1121 new BoolOption (
1122 "link-region-and-track-selection",
1123 _("Link selection of regions and tracks"),
1124 sigc::mem_fun (*_rc_config, &RCConfiguration::get_link_region_and_track_selection),
1125 sigc::mem_fun (*_rc_config, &RCConfiguration::set_link_region_and_track_selection)
1128 add_option (_("Editor"),
1129 new BoolOption (
1130 "automation-follows-regions",
1131 _("Move relevant automation when regions are moved"),
1132 sigc::mem_fun (*_rc_config, &RCConfiguration::get_automation_follows_regions),
1133 sigc::mem_fun (*_rc_config, &RCConfiguration::set_automation_follows_regions)
1136 add_option (_("Editor"),
1137 new BoolOption (
1138 "show-track-meters",
1139 _("Show meters on tracks in the editor"),
1140 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_track_meters),
1141 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters)
1144 add_option (_("Editor"),
1145 new BoolOption (
1146 "use-overlap-equivalency",
1147 _("Use overlap equivalency for regions"),
1148 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_overlap_equivalency),
1149 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_overlap_equivalency)
1152 add_option (_("Editor"),
1153 new BoolOption (
1154 "rubberbanding-snaps-to-grid",
1155 _("Make rubberband selection rectangle snap to the grid"),
1156 sigc::mem_fun (*_rc_config, &RCConfiguration::get_rubberbanding_snaps_to_grid),
1157 sigc::mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
1160 add_option (_("Editor"),
1161 new BoolOption (
1162 "show-waveforms",
1163 _("Show waveforms in regions"),
1164 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
1165 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
1168 ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
1169 "waveform-scale",
1170 _("Waveform scale"),
1171 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
1172 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
1175 wfs->add (Linear, _("linear"));
1176 wfs->add (Logarithmic, _("logarithmic"));
1178 add_option (_("Editor"), wfs);
1180 ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
1181 "waveform-shape",
1182 _("Waveform shape"),
1183 sigc::mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
1184 sigc::mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
1187 wfsh->add (Traditional, _("traditional"));
1188 wfsh->add (Rectified, _("rectified"));
1190 add_option (_("Editor"), wfsh);
1192 add_option (_("Editor"),
1193 new BoolOption (
1194 "show-waveforms-while-recording",
1195 _("Show waveforms for audio while it is being recorded"),
1196 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms_while_recording),
1197 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms_while_recording)
1200 /* AUDIO */
1202 add_option (_("Audio"), new OptionEditorHeading (_("Buffering")));
1204 add_option (_("Audio"), new BufferingOptions (_rc_config));
1206 add_option (_("Audio"), new OptionEditorHeading (_("Monitoring")));
1208 add_option (_("Audio"),
1209 new BoolOption (
1210 "use-monitor-bus",
1211 _("Use a monitor bus (allows AFL/PFL and more control)"),
1212 sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_monitor_bus),
1213 sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_monitor_bus)
1216 ComboOption<MonitorModel>* mm = new ComboOption<MonitorModel> (
1217 "monitoring-model",
1218 _("Monitoring handled by"),
1219 sigc::mem_fun (*_rc_config, &RCConfiguration::get_monitoring_model),
1220 sigc::mem_fun (*_rc_config, &RCConfiguration::set_monitoring_model)
1223 #ifndef __APPLE__
1224 /* no JACK monitoring on CoreAudio */
1225 if (AudioEngine::instance()->can_request_hardware_monitoring()) {
1226 mm->add (HardwareMonitoring, _("JACK"));
1228 #endif
1229 mm->add (SoftwareMonitoring, _("ardour"));
1230 mm->add (ExternalMonitoring, _("audio hardware"));
1232 add_option (_("Audio"), mm);
1234 add_option (_("Audio"),
1235 new BoolOption (
1236 "tape-machine-mode",
1237 _("Tape machine mode"),
1238 sigc::mem_fun (*_rc_config, &RCConfiguration::get_tape_machine_mode),
1239 sigc::mem_fun (*_rc_config, &RCConfiguration::set_tape_machine_mode)
1242 add_option (_("Audio"), new OptionEditorHeading (_("Connection of tracks and busses")));
1244 add_option (_("Audio"),
1245 new BoolOption (
1246 "auto-connect-standard-busses",
1247 _("Auto-connect master/monitor busses"),
1248 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_connect_standard_busses),
1249 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_connect_standard_busses)
1252 ComboOption<AutoConnectOption>* iac = new ComboOption<AutoConnectOption> (
1253 "input-auto-connect",
1254 _("Connect track and bus inputs"),
1255 sigc::mem_fun (*_rc_config, &RCConfiguration::get_input_auto_connect),
1256 sigc::mem_fun (*_rc_config, &RCConfiguration::set_input_auto_connect)
1259 iac->add (AutoConnectPhysical, _("automatically to physical inputs"));
1260 iac->add (ManualConnect, _("manually"));
1262 add_option (_("Audio"), iac);
1264 ComboOption<AutoConnectOption>* oac = new ComboOption<AutoConnectOption> (
1265 "output-auto-connect",
1266 _("Connect track and bus outputs"),
1267 sigc::mem_fun (*_rc_config, &RCConfiguration::get_output_auto_connect),
1268 sigc::mem_fun (*_rc_config, &RCConfiguration::set_output_auto_connect)
1271 oac->add (AutoConnectPhysical, _("automatically to physical outputs"));
1272 oac->add (AutoConnectMaster, _("automatically to master outputs"));
1273 oac->add (ManualConnect, _("manually"));
1275 add_option (_("Audio"), oac);
1277 add_option (_("Audio"), new OptionEditorHeading (_("Denormals")));
1279 add_option (_("Audio"),
1280 new BoolOption (
1281 "denormal-protection",
1282 _("Use DC bias to protect against denormals"),
1283 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_protection),
1284 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_protection)
1287 ComboOption<DenormalModel>* dm = new ComboOption<DenormalModel> (
1288 "denormal-model",
1289 _("Processor handling"),
1290 sigc::mem_fun (*_rc_config, &RCConfiguration::get_denormal_model),
1291 sigc::mem_fun (*_rc_config, &RCConfiguration::set_denormal_model)
1294 dm->add (DenormalNone, _("no processor handling"));
1296 FPU fpu;
1298 if (fpu.has_flush_to_zero()) {
1299 dm->add (DenormalFTZ, _("use FlushToZero"));
1302 if (fpu.has_denormals_are_zero()) {
1303 dm->add (DenormalDAZ, _("use DenormalsAreZero"));
1306 if (fpu.has_flush_to_zero() && fpu.has_denormals_are_zero()) {
1307 dm->add (DenormalFTZDAZ, _("use FlushToZero and DenormalsAreZerO"));
1310 add_option (_("Audio"), dm);
1312 add_option (_("Audio"), new OptionEditorHeading (_("Plugins")));
1314 add_option (_("Audio"),
1315 new BoolOption (
1316 "plugins-stop-with-transport",
1317 _("Stop plugins when the transport is stopped"),
1318 sigc::mem_fun (*_rc_config, &RCConfiguration::get_plugins_stop_with_transport),
1319 sigc::mem_fun (*_rc_config, &RCConfiguration::set_plugins_stop_with_transport)
1322 add_option (_("Audio"),
1323 new BoolOption (
1324 "do-not-record-plugins",
1325 _("Disable plugins during recording"),
1326 sigc::mem_fun (*_rc_config, &RCConfiguration::get_do_not_record_plugins),
1327 sigc::mem_fun (*_rc_config, &RCConfiguration::set_do_not_record_plugins)
1330 add_option (_("Audio"),
1331 new BoolOption (
1332 "new-plugins-active",
1333 _("Make new plugins active"),
1334 sigc::mem_fun (*_rc_config, &RCConfiguration::get_new_plugins_active),
1335 sigc::mem_fun (*_rc_config, &RCConfiguration::set_new_plugins_active)
1338 add_option (_("Audio"),
1339 new BoolOption (
1340 "auto-analyse-audio",
1341 _("Enable automatic analysis of audio"),
1342 sigc::mem_fun (*_rc_config, &RCConfiguration::get_auto_analyse_audio),
1343 sigc::mem_fun (*_rc_config, &RCConfiguration::set_auto_analyse_audio)
1346 /* SOLO AND MUTE */
1348 add_option (_("Solo / mute"),
1349 new FaderOption (
1350 "solo-mute-gain",
1351 _("Solo mute cut (dB)"),
1352 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_gain),
1353 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_gain)
1356 add_option (_("Solo / mute"),
1357 new BoolOption (
1358 "solo-control-is-listen-control",
1359 _("Solo controls are Listen controls"),
1360 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_control_is_listen_control),
1361 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_control_is_listen_control)
1364 ComboOption<ListenPosition>* lp = new ComboOption<ListenPosition> (
1365 "listen-position",
1366 _("Listen Position"),
1367 sigc::mem_fun (*_rc_config, &RCConfiguration::get_listen_position),
1368 sigc::mem_fun (*_rc_config, &RCConfiguration::set_listen_position)
1371 lp->add (AfterFaderListen, _("after-fader listen"));
1372 lp->add (PreFaderListen, _("pre-fader listen"));
1374 add_option (_("Solo / mute"), lp);
1376 add_option (_("Solo / mute"),
1377 new BoolOption (
1378 "exclusive-solo",
1379 _("Exclusive solo"),
1380 sigc::mem_fun (*_rc_config, &RCConfiguration::get_exclusive_solo),
1381 sigc::mem_fun (*_rc_config, &RCConfiguration::set_exclusive_solo)
1384 add_option (_("Solo / mute"),
1385 new BoolOption (
1386 "show-solo-mutes",
1387 _("Show solo muting"),
1388 sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_solo_mutes),
1389 sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_solo_mutes)
1392 add_option (_("Solo / mute"),
1393 new BoolOption (
1394 "solo-mute-override",
1395 _("Soloing overrides muting"),
1396 sigc::mem_fun (*_rc_config, &RCConfiguration::get_solo_mute_override),
1397 sigc::mem_fun (*_rc_config, &RCConfiguration::set_solo_mute_override)
1400 add_option (_("Solo / mute"), new OptionEditorHeading (_("Default track / bus muting options")));
1402 add_option (_("Solo / mute"),
1403 new BoolOption (
1404 "mute-affects-pre-fader",
1405 _("Mute affects pre-fader sends"),
1406 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_pre_fader),
1407 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_pre_fader)
1410 add_option (_("Solo / mute"),
1411 new BoolOption (
1412 "mute-affects-post-fader",
1413 _("Mute affects post-fader sends"),
1414 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_post_fader),
1415 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_post_fader)
1418 add_option (_("Solo / mute"),
1419 new BoolOption (
1420 "mute-affects-control-outs",
1421 _("Mute affects control outputs"),
1422 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_control_outs),
1423 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_control_outs)
1426 add_option (_("Solo / mute"),
1427 new BoolOption (
1428 "mute-affects-main-outs",
1429 _("Mute affects main outputs"),
1430 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mute_affects_main_outs),
1431 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mute_affects_main_outs)
1434 /* MIDI CONTROL */
1436 list<ComboOption<string>* > midi_combos;
1438 midi_combos.push_back (new ComboOption<string> (
1439 "mtc-port-name",
1440 _("Send/Receive MTC via"),
1441 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mtc_port_name),
1442 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mtc_port_name)
1445 midi_combos.push_back (new ComboOption<string> (
1446 "midi-clock-port-name",
1447 _("Send/Receive MIDI clock via"),
1448 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_clock_port_name),
1449 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_clock_port_name)
1452 midi_combos.push_back (new ComboOption<string> (
1453 "mmc-port-name",
1454 _("Send/Receive MMC via"),
1455 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_port_name),
1456 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_port_name)
1459 midi_combos.push_back (new ComboOption<string> (
1460 "midi-port-name",
1461 _("Send/Receive MIDI parameter control via"),
1462 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_port_name),
1463 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_port_name)
1466 add_option (_("MIDI control"), new MIDIPorts (_rc_config, midi_combos));
1468 for (list<ComboOption<string>* >::iterator i = midi_combos.begin(); i != midi_combos.end(); ++i) {
1469 add_option (_("MIDI control"), *i);
1472 add_option (_("MIDI control"),
1473 new BoolOption (
1474 "send-mtc",
1475 _("Send MIDI Time Code"),
1476 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mtc),
1477 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mtc)
1480 add_option (_("MIDI control"),
1481 new BoolOption (
1482 "mmc-control",
1483 _("Obey MIDI Machine Control commands"),
1484 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_control),
1485 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_control)
1489 add_option (_("MIDI control"),
1490 new BoolOption (
1491 "send-mmc",
1492 _("Send MIDI Machine Control commands"),
1493 sigc::mem_fun (*_rc_config, &RCConfiguration::get_send_mmc),
1494 sigc::mem_fun (*_rc_config, &RCConfiguration::set_send_mmc)
1497 add_option (_("MIDI control"),
1498 new BoolOption (
1499 "midi-feedback",
1500 _("Send MIDI control feedback"),
1501 sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_feedback),
1502 sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_feedback)
1505 add_option (_("MIDI control"),
1506 new SpinOption<uint8_t> (
1507 "mmc-receive-device-id",
1508 _("Inbound MMC device ID"),
1509 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_receive_device_id),
1510 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_receive_device_id),
1511 0, 128, 1, 10
1514 add_option (_("MIDI control"),
1515 new SpinOption<uint8_t> (
1516 "mmc-send-device-id",
1517 _("Outbound MMC device ID"),
1518 sigc::mem_fun (*_rc_config, &RCConfiguration::get_mmc_send_device_id),
1519 sigc::mem_fun (*_rc_config, &RCConfiguration::set_mmc_send_device_id),
1520 0, 128, 1, 10
1523 add_option (_("MIDI control"),
1524 new SpinOption<int32_t> (
1525 "initial-program-change",
1526 _("Initial program change"),
1527 sigc::mem_fun (*_rc_config, &RCConfiguration::get_initial_program_change),
1528 sigc::mem_fun (*_rc_config, &RCConfiguration::set_initial_program_change),
1529 -1, 65536, 1, 10
1532 /* CONTROL SURFACES */
1534 add_option (_("Control surfaces"), new ControlSurfacesOptions (*this));
1536 ComboOption<RemoteModel>* rm = new ComboOption<RemoteModel> (
1537 "remote-model",
1538 _("Control surface remote ID"),
1539 sigc::mem_fun (*_rc_config, &RCConfiguration::get_remote_model),
1540 sigc::mem_fun (*_rc_config, &RCConfiguration::set_remote_model)
1543 rm->add (UserOrdered, _("assigned by user"));
1544 rm->add (MixerOrdered, _("follows order of mixer"));
1545 rm->add (EditorOrdered, _("follows order of editor"));
1547 add_option (_("Control surfaces"), rm);
1549 /* KEYBOARD */
1551 add_option (_("Keyboard"), new KeyboardOptions);