884ad008ca919a924e4ac2699bf7bf98aad11140
[ardour.git] / gtk2_ardour / ardour_ui_options.cc
1 /*
2     Copyright (C) 2005 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #include <pbd/convert.h>
22 #include <pbd/stacktrace.h>
23
24 #include <gtkmm2ext/utils.h>
25
26 #include <ardour/configuration.h>
27 #include <ardour/session.h>
28 #include <ardour/audioengine.h>
29
30 #include "ardour_ui.h"
31 #include "actions.h"
32 #include "gui_thread.h"
33
34 #include "i18n.h"
35
36 using namespace Gtk;
37 using namespace Gtkmm2ext;
38 using namespace ARDOUR;
39 using namespace PBD;
40 using namespace sigc;
41
42 void
43 ARDOUR_UI::toggle_time_master ()
44 {
45         ActionManager::toggle_config_state ("Transport", "ToggleTimeMaster", &Configuration::set_jack_time_master, &Configuration::get_jack_time_master);
46 }
47
48 void
49 ARDOUR_UI::toggle_send_mtc ()
50 {
51         ActionManager::toggle_config_state ("options", "SendMTC", &Configuration::set_send_mtc, &Configuration::get_send_mtc);
52 }
53
54 void
55 ARDOUR_UI::toggle_send_mmc ()
56 {
57         ActionManager::toggle_config_state ("options", "SendMMC", &Configuration::set_send_mmc, &Configuration::get_send_mmc);
58 }
59
60 void
61 ARDOUR_UI::toggle_use_mmc ()
62 {
63         ActionManager::toggle_config_state ("options", "UseMMC", &Configuration::set_mmc_control, &Configuration::get_mmc_control);
64 }
65
66 void
67 ARDOUR_UI::toggle_use_midi_control ()
68 {
69         ActionManager::toggle_config_state ("options", "UseMIDIcontrol", &Configuration::set_midi_control, &Configuration::get_midi_control);
70 }
71
72 void
73 ARDOUR_UI::toggle_send_midi_feedback ()
74 {
75         ActionManager::toggle_config_state ("options", "SendMIDIfeedback", &Configuration::set_midi_feedback, &Configuration::get_midi_feedback);
76 }
77
78 void
79 ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
80 {
81         const char *action;
82
83         switch (hf) {
84         case BWF:
85                 action = X_("FileHeaderFormatBWF");
86                 break;
87         case WAVE:
88                 action = X_("FileHeaderFormatWAVE");
89                 break;
90         case WAVE64:
91                 action = X_("FileHeaderFormatWAVE64");
92                 break;
93         case iXML:
94                 action = X_("FileHeaderFormatiXML");
95                 break;
96         case RF64:
97                 action = X_("FileHeaderFormatRF64");
98                 break;
99         case CAF:
100                 action = X_("FileHeaderFormatCAF");
101                 break;
102         case AIFF:
103                 action = X_("FileHeaderFormatAIFF");
104                 break;
105         default:
106                 fatal << string_compose (_("programming error: %1"), "illegal file header format in ::set_native_file_header_format") << endmsg;
107                 /*NOTREACHED*/  
108         }
109
110         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
111
112         if (act) {
113                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
114                 if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
115                         Config->set_native_file_header_format (hf);
116                 }
117         }
118 }
119
120 void
121 ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
122 {
123         const char* action;
124
125         switch (sf) {
126         case FormatFloat:
127                 action = X_("FileDataFormatFloat");
128                 break;
129         case FormatInt24:
130                 action = X_("FileDataFormat24bit");
131                 break;
132         default:
133                 fatal << string_compose (_("programming error: %1"), "illegal file data format in ::set_native_file_data_format") << endmsg;
134                 /*NOTREACHED*/
135         }
136
137         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
138
139         if (act) {
140                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
141                 if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
142                         Config->set_native_file_data_format (sf);
143                 }
144         }
145 }
146
147 void
148 ARDOUR_UI::set_input_auto_connect (AutoConnectOption option)
149 {
150         const char* action;
151         
152         switch (option) {
153         case AutoConnectPhysical:
154                 action = X_("InputAutoConnectPhysical");
155                 break;
156         default:
157                 action = X_("InputAutoConnectManual");
158         }
159
160         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
161
162         if (act) {
163                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
164
165                 if (ract && ract->get_active() && Config->get_input_auto_connect() != option) {
166                         Config->set_input_auto_connect (option);
167                 }
168         }
169 }
170
171 void
172 ARDOUR_UI::set_output_auto_connect (AutoConnectOption option)
173 {
174         const char* action;
175         
176         switch (option) {
177         case AutoConnectPhysical:
178                 action = X_("OutputAutoConnectPhysical");
179                 break;
180         case AutoConnectMaster:
181                 action = X_("OutputAutoConnectMaster");
182                 break;
183         default:
184                 action = X_("OutputAutoConnectManual");
185         }
186
187         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
188
189         if (act) {
190                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
191
192                 if (ract && ract->get_active() && Config->get_output_auto_connect() != option) {
193                         Config->set_output_auto_connect (option);
194                 }
195         }
196 }
197
198 void
199 ARDOUR_UI::set_solo_model (SoloModel model)
200 {
201         const char* action = 0;
202
203         switch (model) {
204         case SoloBus:
205                 action = X_("SoloViaBus");
206                 break;
207                 
208         case InverseMute:
209                 action = X_("SoloInPlace");
210                 break;
211         default:
212                 fatal << string_compose (_("programming error: unknown solo model in ARDOUR_UI::set_solo_model: %1"), model) << endmsg;
213                 /*NOTREACHED*/
214         }
215
216         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
217
218         if (act) {
219                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
220
221                 if (ract && ract->get_active() && Config->get_solo_model() != model) {
222                         Config->set_solo_model (model);
223                 }
224         }
225
226 }
227
228 void
229 ARDOUR_UI::set_monitor_model (MonitorModel model)
230 {
231         const char* action = 0;
232
233         switch (model) {
234         case HardwareMonitoring:
235                 action = X_("UseHardwareMonitoring");
236                 break;
237                 
238         case SoftwareMonitoring:
239                 action = X_("UseSoftwareMonitoring");
240                 break;
241         case ExternalMonitoring:
242                 action = X_("UseExternalMonitoring");
243                 break;
244
245         default:
246                 fatal << string_compose (_("programming error: unknown monitor model in ARDOUR_UI::set_monitor_model: %1"), model) << endmsg;
247                 /*NOTREACHED*/
248         }
249
250         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
251
252         if (act) {
253                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
254
255                 if (ract && ract->get_active() && Config->get_monitoring_model() != model) {
256                         Config->set_monitoring_model (model);
257                 }
258         }
259
260 }
261
262 void
263 ARDOUR_UI::toggle_auto_input ()
264 {
265         ActionManager::toggle_config_state ("Transport", "ToggleAutoInput", &Configuration::set_auto_input, &Configuration::get_auto_input);
266 }
267
268 void
269 ARDOUR_UI::toggle_auto_play ()
270 {
271         ActionManager::toggle_config_state ("Transport", "ToggleAutoPlay", &Configuration::set_auto_play, &Configuration::get_auto_play);
272 }
273
274 void
275 ARDOUR_UI::toggle_auto_return ()
276 {
277         ActionManager::toggle_config_state ("Transport", "ToggleAutoReturn", &Configuration::set_auto_return, &Configuration::get_auto_return);
278 }
279
280 void
281 ARDOUR_UI::toggle_click ()
282 {
283         ActionManager::toggle_config_state ("Transport", "ToggleClick", &Configuration::set_clicking, &Configuration::get_clicking);
284 }
285
286 void
287 ARDOUR_UI::toggle_session_auto_loop ()
288 {
289         if (session) {
290                 if (session->get_play_loop()) {
291                         if (session->transport_rolling()) {
292                                 transport_roll();
293                         } else {
294                                 session->request_play_loop (false);
295                         }
296                 } else {
297                         session->request_play_loop (true);
298                 }
299         }
300 }
301
302 void
303 ARDOUR_UI::toggle_punch_in ()
304 {
305         ActionManager::toggle_config_state ("Transport", "TogglePunchIn", &Configuration::set_punch_in, &Configuration::get_punch_in);
306 }
307
308 void
309 ARDOUR_UI::toggle_punch_out ()
310 {
311         ActionManager::toggle_config_state ("Transport", "TogglePunchOut", &Configuration::set_punch_out, &Configuration::get_punch_out);
312 }
313
314 void
315 ARDOUR_UI::toggle_video_sync()
316 {
317         Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
318         if (act) {
319                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
320                 Config->set_use_video_sync (tact->get_active());
321         }
322 }
323
324 void
325 ARDOUR_UI::toggle_editing_space()
326 {
327         Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
328         if (act) {
329                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
330                 if (tact->get_active()) {
331                         maximise_editing_space ();
332                 } else {
333                         restore_editing_space ();
334                 }
335         }
336 }
337
338 void
339 ARDOUR_UI::toggle_StopPluginsWithTransport()
340 {
341         ActionManager::toggle_config_state ("options", "StopPluginsWithTransport", &Configuration::set_plugins_stop_with_transport, &Configuration::get_plugins_stop_with_transport);
342 }
343
344 void
345 ARDOUR_UI::toggle_LatchedRecordEnable()
346 {
347         ActionManager::toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable, &Configuration::get_latched_record_enable);
348 }
349
350 void
351 ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
352 {
353         ActionManager::toggle_config_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::set_do_not_record_plugins, &Configuration::get_do_not_record_plugins);
354 }
355
356 void
357 ARDOUR_UI::toggle_VerifyRemoveLastCapture()
358 {
359         ActionManager::toggle_config_state ("options", "VerifyRemoveLastCapture", &Configuration::set_verify_remove_last_capture, &Configuration::get_verify_remove_last_capture);
360 }
361
362 void
363 ARDOUR_UI::toggle_StopRecordingOnXrun()
364 {
365         ActionManager::toggle_config_state ("options", "StopRecordingOnXrun", &Configuration::set_stop_recording_on_xrun, &Configuration::get_stop_recording_on_xrun);
366 }
367
368 void
369 ARDOUR_UI::toggle_StopTransportAtEndOfSession()
370 {
371         ActionManager::toggle_config_state ("options", "StopTransportAtEndOfSession", &Configuration::set_stop_at_session_end, &Configuration::get_stop_at_session_end);
372 }
373
374 void
375 ARDOUR_UI::toggle_GainReduceFastTransport()
376 {
377         ActionManager::toggle_config_state ("options", "GainReduceFastTransport", &Configuration::set_quieten_at_speed, &Configuration::get_quieten_at_speed);
378 }
379
380 void
381 ARDOUR_UI::toggle_LatchedSolo()
382 {
383         ActionManager::toggle_config_state ("options", "LatchedSolo", &Configuration::set_solo_latched, &Configuration::get_solo_latched);
384 }
385
386 void
387 ARDOUR_UI::mtc_port_changed ()
388 {
389         bool have_mtc;
390
391         if (session) {
392                 if (session->mtc_port()) {
393                         have_mtc = true;
394                 } else {
395                         have_mtc = false;
396                 }
397         } else {
398                 have_mtc = false;
399         }
400
401         positional_sync_strings.clear ();
402         positional_sync_strings.push_back (slave_source_to_string (None));
403         if (have_mtc) {
404                 positional_sync_strings.push_back (slave_source_to_string (MTC));
405         }
406         positional_sync_strings.push_back (slave_source_to_string (JACK));
407         
408         set_popdown_strings (sync_option_combo, positional_sync_strings);
409 }
410
411 void
412 ARDOUR_UI::setup_session_options ()
413 {
414         mtc_port_changed ();
415
416         Config->ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
417 }
418
419
420 void
421 ARDOUR_UI::map_solo_model ()
422 {
423         const char* on;
424
425         if (Config->get_solo_model() == InverseMute) {
426                 on = X_("SoloInPlace");
427         } else {
428                 on = X_("SoloViaBus");
429         }
430
431         Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
432         if (act) {
433                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
434
435                 if (tact && !tact->get_active()) {
436                         tact->set_active (true);
437                 }
438         }
439 }
440
441 void
442 ARDOUR_UI::map_monitor_model ()
443 {
444         const char* on = 0;
445
446         switch (Config->get_monitoring_model()) {
447         case HardwareMonitoring:
448                 on = X_("UseHardwareMonitoring");
449                 break;
450         case SoftwareMonitoring:
451                 on = X_("UseSoftwareMonitoring");
452                 break;
453         case ExternalMonitoring:
454                 on = X_("UseExternalMonitoring");
455                 break;
456         }
457
458         Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
459         if (act) {
460                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
461
462                 if (tact && !tact->get_active()) {
463                         tact->set_active (true);
464                 }
465         }
466 }
467
468 void
469 ARDOUR_UI::map_file_header_format ()
470 {
471         const char* action = 0;
472
473         switch (Config->get_native_file_header_format()) {
474         case BWF:
475                 action = X_("FileHeaderFormatBWF");
476                 break;
477
478         case WAVE:
479                 action = X_("FileHeaderFormatWAVE");
480                 break;
481
482         case WAVE64:
483                 action = X_("FileHeaderFormatWAVE64");
484                 break;
485
486         case iXML:
487                 action = X_("FileHeaderFormatiXML");
488                 break;
489
490         case RF64:
491                 action = X_("FileHeaderFormatRF64");
492                 break;
493
494         case CAF:
495                 action = X_("FileHeaderFormatCAF");
496                 break;
497
498         default:
499                 fatal << string_compose (_("programming error: unknown file header format passed to ARDOUR_UI::map_file_data_format: %1"), 
500                                          Config->get_native_file_header_format()) << endmsg;
501                 /*NOTREACHED*/
502         }
503
504
505         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
506
507         if (act) {
508                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
509
510                 if (tact && !tact->get_active()) {
511                         tact->set_active (true);
512                 }
513         }
514 }
515
516 void
517 ARDOUR_UI::map_file_data_format ()
518 {
519         const char* action = 0;
520
521         switch (Config->get_native_file_data_format()) {
522         case FormatFloat:
523                 action = X_("FileDataFormatFloat");
524                 break;
525
526         case FormatInt24:
527                 action = X_("FileDataFormat24bit");
528                 break;
529
530         default:
531                 fatal << string_compose (_("programming error: unknown file data format passed to ARDOUR_UI::map_file_data_format: %1"), 
532                                          Config->get_native_file_data_format()) << endmsg;
533                 /*NOTREACHED*/
534         }
535
536
537         Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
538
539         if (act) {
540                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
541
542                 if (tact && !tact->get_active()) {
543                         tact->set_active (true);
544                 }
545         }
546 }
547
548 void
549 ARDOUR_UI::map_input_auto_connect ()
550 {
551         const char* on;
552
553         if (Config->get_input_auto_connect() == (AutoConnectOption) 0) {
554                 on = "InputAutoConnectManual";
555         } else {
556                 on = "InputAutoConnectPhysical";
557         }
558
559         Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
560         if (act) {
561                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
562
563                 if (tact && !tact->get_active()) {
564                         tact->set_active (true);
565                 }
566         }
567 }
568
569 void
570 ARDOUR_UI::map_output_auto_connect ()
571 {
572         const char* on;
573
574         if (Config->get_output_auto_connect() == (AutoConnectOption) 0) {
575                 on = "OutputAutoConnectManual";
576         } else if (Config->get_output_auto_connect() == AutoConnectPhysical) {
577                 on = "OutputAutoConnectPhysical";
578         } else {
579                 on = "OutputAutoConnectMaster";
580         }
581
582         Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
583         if (act) {
584                 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
585                 
586                 if (tact && !tact->get_active()) {
587                         tact->set_active (true);
588                 }
589         }
590 }
591
592 void
593 ARDOUR_UI::map_meter_falloff ()
594 {
595         const char* action = X_("MeterFalloffMedium");
596
597         float val = Config->get_meter_falloff ();
598         MeterFalloff code = meter_falloff_from_float(val);
599
600         switch (code) {
601         case MeterFalloffOff:
602                 action = X_("MeterFalloffOff");
603                 break;
604         case MeterFalloffSlowest:
605                 action = X_("MeterFalloffSlowest");
606                 break;
607         case MeterFalloffSlow:
608                 action = X_("MeterFalloffSlow");
609                 break;
610         case MeterFalloffMedium:
611                 action = X_("MeterFalloffMedium");
612                 break;
613         case MeterFalloffFast:
614                 action = X_("MeterFalloffFast");
615                 break;
616         case MeterFalloffFaster:
617                 action = X_("MeterFalloffFaster");
618                 break;
619         case MeterFalloffFastest:
620                 action = X_("MeterFalloffFastest");
621                 break;
622         }
623
624         Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
625
626         if (act) {
627                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
628                 if (ract && !ract->get_active()) {
629                         ract->set_active (true);
630                 }
631         }
632 }
633
634 void
635 ARDOUR_UI::map_meter_hold ()
636 {
637         const char* action = X_("MeterHoldMedium");
638
639         /* XXX hack alert. Fix this. Please */
640
641         float val = Config->get_meter_hold ();
642         MeterHold code = (MeterHold) (int) (floor (val));
643
644         switch (code) {
645         case MeterHoldOff:
646                 action = X_("MeterHoldOff");
647                 break;
648         case MeterHoldShort:
649                 action = X_("MeterHoldShort");
650                 break;
651         case MeterHoldMedium:
652                 action = X_("MeterHoldMedium");
653                 break;
654         case MeterHoldLong:
655                 action = X_("MeterHoldLong");
656                 break;
657         }
658
659         Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
660
661         if (act) {
662                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
663                 if (ract && !ract->get_active()) {
664                         ract->set_active (true);
665                 }
666         }
667 }
668
669 void 
670 ARDOUR_UI::set_meter_hold (MeterHold val)
671 {
672         const char* action = 0;
673         float fval;
674
675         fval = meter_hold_to_float (val);
676
677         switch (val) {
678         case MeterHoldOff:
679                 action = X_("MeterHoldOff");
680                 break;
681         case MeterHoldShort:
682                 action = X_("MeterHoldShort");
683                 break;
684         case MeterHoldMedium:
685                 action = X_("MeterHoldMedium");
686                 break;
687         case MeterHoldLong:
688                 action = X_("MeterHoldLong");
689                 break;
690         }
691
692         Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
693         
694         if (act) {
695                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
696                 if (ract && ract->get_active() && Config->get_meter_hold() != fval) {
697                         Config->set_meter_hold (fval);
698                 }
699         }
700 }
701
702 void
703 ARDOUR_UI::set_meter_falloff (MeterFalloff val)
704 {
705         const char* action = 0;
706         float fval;
707
708         fval = meter_falloff_to_float (val);
709
710         switch (val) {
711         case MeterFalloffOff:
712                 action = X_("MeterFalloffOff");
713                 break;
714         case MeterFalloffSlowest:
715                 action = X_("MeterFalloffSlowest");
716                 break;
717         case MeterFalloffSlow:
718                 action = X_("MeterFalloffSlow");
719                 break;
720         case MeterFalloffMedium:
721                 action = X_("MeterFalloffMedium");
722                 break;
723         case MeterFalloffFast:
724                 action = X_("MeterFalloffFast");
725                 break;
726         case MeterFalloffFaster:
727                 action = X_("MeterFalloffFaster");
728                 break;
729         case MeterFalloffFastest:
730                 action = X_("MeterFalloffFastest");
731                 break;
732         }
733
734         Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
735
736         if (act) {
737                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
738                 if (ract && ract->get_active() && Config->get_meter_falloff () != fval) {
739                         Config->set_meter_falloff (fval);
740                 }
741         }
742 }
743
744 void
745 ARDOUR_UI::parameter_changed (const char* parameter_name)
746 {
747         ENSURE_GUI_THREAD (bind (mem_fun (*this, &ARDOUR_UI::parameter_changed), parameter_name));
748
749 #define PARAM_IS(x) (!strcmp (parameter_name, (x)))
750         
751         if (PARAM_IS ("slave-source")) {
752
753                 sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
754
755         } else if (PARAM_IS ("send-mtc")) {
756
757                 ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
758
759         } else if (PARAM_IS ("send-mmc")) {
760
761                 ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
762
763         } else if (PARAM_IS ("mmc-control")) {
764                 ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
765         } else if (PARAM_IS ("midi-feedback")) {
766                 ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);
767         } else if (PARAM_IS ("midi-control")) {
768                 ActionManager::map_some_state ("options", "UseMIDIcontrol", &Configuration::get_midi_control);
769         } else if (PARAM_IS ("do-not-record-plugins")) {
770                 ActionManager::map_some_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::get_do_not_record_plugins);
771         } else if (PARAM_IS ("latched-record-enable")) {
772                 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
773         } else if (PARAM_IS ("solo-latched")) {
774                 ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
775         } else if (PARAM_IS ("solo-model")) {
776                 map_solo_model ();
777         } else if (PARAM_IS ("auto-play")) {
778                 ActionManager::map_some_state ("Transport", "ToggleAutoPlay", &Configuration::get_auto_play);
779         } else if (PARAM_IS ("auto-return")) {
780                 ActionManager::map_some_state ("Transport", "ToggleAutoReturn", &Configuration::get_auto_return);
781         } else if (PARAM_IS ("auto-input")) {
782                 ActionManager::map_some_state ("Transport", "ToggleAutoInput", &Configuration::get_auto_input);
783         } else if (PARAM_IS ("punch-out")) {
784                 ActionManager::map_some_state ("Transport", "TogglePunchOut", &Configuration::get_punch_out);
785         } else if (PARAM_IS ("punch-in")) {
786                 ActionManager::map_some_state ("Transport", "TogglePunchIn", &Configuration::get_punch_in);
787         } else if (PARAM_IS ("clicking")) {
788                 ActionManager::map_some_state ("Transport", "ToggleClick", &Configuration::get_clicking);
789         } else if (PARAM_IS ("jack-time-master")) {
790                 ActionManager::map_some_state ("Transport",  "ToggleTimeMaster", &Configuration::get_jack_time_master);
791         } else if (PARAM_IS ("plugins-stop-with-transport")) {
792                 ActionManager::map_some_state ("options",  "StopPluginsWithTransport", &Configuration::get_plugins_stop_with_transport);
793         } else if (PARAM_IS ("latched-record-enable")) {
794                 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
795         } else if (PARAM_IS ("verify-remove-last-capture")) {
796                 ActionManager::map_some_state ("options",  "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
797         } else if (PARAM_IS ("stop-recording-on-xrun")) {
798                 ActionManager::map_some_state ("options",  "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun);
799         } else if (PARAM_IS ("stop-at-session-end")) {
800                 ActionManager::map_some_state ("options",  "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
801         } else if (PARAM_IS ("monitoring-model")) {
802                 map_monitor_model ();
803         } else if (PARAM_IS ("use-video-sync")) {
804                 ActionManager::map_some_state ("Transport",  "ToggleVideoSync", &Configuration::get_use_video_sync);
805         } else if (PARAM_IS ("quieten-at-speed")) {
806                 ActionManager::map_some_state ("options",  "GainReduceFastTransport", &Configuration::get_quieten_at_speed);
807         } else if (PARAM_IS ("shuttle-behaviour")) {
808
809                 switch (Config->get_shuttle_behaviour ()) {
810                 case Sprung:
811                         shuttle_style_button.set_active_text (_("sprung"));
812                         shuttle_fract = 0.0;
813                         shuttle_box.queue_draw ();
814                         if (session) {
815                                 if (session->transport_rolling()) {
816                                         shuttle_fract = SHUTTLE_FRACT_SPEED1;
817                                         session->request_transport_speed (1.0);
818                                 }
819                         }
820                         break;
821                 case Wheel:
822                         shuttle_style_button.set_active_text (_("wheel"));
823                         break;
824                 }
825
826         } else if (PARAM_IS ("shuttle-units")) {
827                 
828                 switch (Config->get_shuttle_units()) {
829                 case Percentage:
830                         shuttle_units_button.set_label("% ");
831                         break;
832                 case Semitones:
833                         shuttle_units_button.set_label(_("ST"));
834                         break;
835                 }
836         } else if (PARAM_IS ("input-auto-connect")) {
837                 map_input_auto_connect ();
838         } else if (PARAM_IS ("output-auto-connect")) {
839                 map_output_auto_connect ();
840         } else if (PARAM_IS ("native-file-header-format")) {
841                 map_file_header_format ();
842         } else if (PARAM_IS ("native-file-data-format")) {
843                 map_file_data_format ();
844         } else if (PARAM_IS ("meter-hold")) {
845                 map_meter_hold ();
846         } else if (PARAM_IS ("meter-falloff")) {
847                 map_meter_falloff ();
848         } else if (PARAM_IS ("verify-remove-last-capture")) {
849                 ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
850         } else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-format")) {
851                 if (session) {
852                         primary_clock.set (session->audible_frame(), true);
853                         secondary_clock.set (session->audible_frame(), true);
854                 } else {
855                         primary_clock.set (0, true);
856                         secondary_clock.set (0, true);
857                 }
858         }
859
860 #undef PARAM_IS
861 }