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