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