2 Copyright (C) 2005 Paul Davis
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.
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.
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.
20 #include <pbd/convert.h>
21 #include <pbd/stacktrace.h>
23 #include <gtkmm2ext/utils.h>
25 #include <ardour/configuration.h>
26 #include <ardour/session.h>
27 #include <ardour/osc.h>
28 #include <ardour/audioengine.h>
30 #include "ardour_ui.h"
32 #include "gui_thread.h"
33 #include "public_editor.h"
38 using namespace Gtkmm2ext;
39 using namespace ARDOUR;
44 ARDOUR_UI::toggle_time_master ()
46 ActionManager::toggle_config_state ("Transport", "ToggleTimeMaster", &Configuration::set_jack_time_master, &Configuration::get_jack_time_master);
50 ARDOUR_UI::toggle_send_mtc ()
52 ActionManager::toggle_config_state ("options", "SendMTC", &Configuration::set_send_mtc, &Configuration::get_send_mtc);
56 ARDOUR_UI::toggle_send_mmc ()
58 ActionManager::toggle_config_state ("options", "SendMMC", &Configuration::set_send_mmc, &Configuration::get_send_mmc);
62 ARDOUR_UI::toggle_use_mmc ()
64 ActionManager::toggle_config_state ("options", "UseMMC", &Configuration::set_mmc_control, &Configuration::get_mmc_control);
68 ARDOUR_UI::toggle_use_osc ()
70 ActionManager::toggle_config_state ("options", "UseOSC", &Configuration::set_use_osc, &Configuration::get_use_osc);
74 ARDOUR_UI::toggle_send_midi_feedback ()
76 ActionManager::toggle_config_state ("options", "SendMIDIfeedback", &Configuration::set_midi_feedback, &Configuration::get_midi_feedback);
80 ARDOUR_UI::toggle_denormal_protection ()
82 ActionManager::toggle_config_state ("options", "DenormalProtection", &Configuration::set_denormal_protection, &Configuration::get_denormal_protection);
86 ARDOUR_UI::toggle_only_copy_imported_files ()
88 ActionManager::toggle_config_state ("options", "OnlyCopyImportedFiles", &Configuration::set_only_copy_imported_files, &Configuration::get_only_copy_imported_files);
92 ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
94 const char *action = 0;
98 action = X_("FileHeaderFormatBWF");
101 action = X_("FileHeaderFormatWAVE");
104 action = X_("FileHeaderFormatWAVE64");
107 action = X_("FileHeaderFormatiXML");
110 action = X_("FileHeaderFormatRF64");
113 action = X_("FileHeaderFormatCAF");
116 action = X_("FileHeaderFormatAIFF");
119 fatal << string_compose (_("programming error: %1"), "illegal file header format in ::set_native_file_header_format") << endmsg;
123 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
126 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
127 if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
128 Config->set_native_file_header_format (hf);
134 ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
136 const char* action = 0;
140 action = X_("FileDataFormatFloat");
143 action = X_("FileDataFormat24bit");
146 action = X_("FileDataFormat16bit");
149 fatal << string_compose (_("programming error: %1"), "illegal file data format in ::set_native_file_data_format") << endmsg;
153 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
156 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
157 if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
158 Config->set_native_file_data_format (sf);
164 ARDOUR_UI::set_input_auto_connect (AutoConnectOption option)
169 case AutoConnectPhysical:
170 action = X_("InputAutoConnectPhysical");
173 action = X_("InputAutoConnectManual");
176 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
179 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
181 if (ract && ract->get_active() && Config->get_input_auto_connect() != option) {
182 Config->set_input_auto_connect (option);
188 ARDOUR_UI::set_output_auto_connect (AutoConnectOption option)
193 case AutoConnectPhysical:
194 action = X_("OutputAutoConnectPhysical");
196 case AutoConnectMaster:
197 action = X_("OutputAutoConnectMaster");
200 action = X_("OutputAutoConnectManual");
203 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
206 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
208 if (ract && ract->get_active() && Config->get_output_auto_connect() != option) {
209 Config->set_output_auto_connect (option);
215 ARDOUR_UI::set_solo_model (SoloModel model)
217 const char* action = 0;
221 action = X_("SoloViaBus");
225 action = X_("SoloInPlace");
228 fatal << string_compose (_("programming error: unknown solo model in ARDOUR_UI::set_solo_model: %1"), model) << endmsg;
232 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
235 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
237 if (ract && ract->get_active() && Config->get_solo_model() != model) {
238 Config->set_solo_model (model);
245 ARDOUR_UI::set_remote_model (RemoteModel model)
247 const char* action = 0;
251 action = X_("RemoteUserDefined");
254 action = X_("RemoteMixerDefined");
257 action = X_("RemoteEditorDefined");
261 fatal << string_compose (_("programming error: unknown remote model in ARDOUR_UI::set_remote_model: %1"), model) << endmsg;
265 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
268 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
270 if (ract && ract->get_active() && Config->get_remote_model() != model) {
271 Config->set_remote_model (model);
278 ARDOUR_UI::set_monitor_model (MonitorModel model)
280 const char* action = 0;
283 case HardwareMonitoring:
284 action = X_("UseHardwareMonitoring");
287 case SoftwareMonitoring:
288 action = X_("UseSoftwareMonitoring");
290 case ExternalMonitoring:
291 action = X_("UseExternalMonitoring");
295 fatal << string_compose (_("programming error: unknown monitor model in ARDOUR_UI::set_monitor_model: %1"), model) << endmsg;
299 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
302 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
304 if (ract && ract->get_active() && Config->get_monitoring_model() != model) {
305 Config->set_monitoring_model (model);
312 ARDOUR_UI::set_denormal_model (DenormalModel model)
314 const char* action = 0;
318 action = X_("DenormalNone");
322 action = X_("DenormalFTZ");
326 action = X_("DenormalDAZ");
330 action = X_("DenormalFTZDAZ");
334 fatal << string_compose (_("programming error: unknown denormal model in ARDOUR_UI::set_denormal_model: %1"), model) << endmsg;
338 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
341 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
343 if (ract && ract->get_active() && Config->get_denormal_model() != model) {
344 Config->set_denormal_model (model);
351 ARDOUR_UI::toggle_auto_input ()
353 ActionManager::toggle_config_state ("Transport", "ToggleAutoInput", &Configuration::set_auto_input, &Configuration::get_auto_input);
357 ARDOUR_UI::toggle_auto_play ()
359 ActionManager::toggle_config_state ("Transport", "ToggleAutoPlay", &Configuration::set_auto_play, &Configuration::get_auto_play);
363 ARDOUR_UI::toggle_auto_return ()
365 ActionManager::toggle_config_state ("Transport", "ToggleAutoReturn", &Configuration::set_auto_return, &Configuration::get_auto_return);
369 ARDOUR_UI::toggle_click ()
371 ActionManager::toggle_config_state ("Transport", "ToggleClick", &Configuration::set_clicking, &Configuration::get_clicking);
375 ARDOUR_UI::toggle_session_auto_loop ()
378 if (session->get_play_loop()) {
379 if (session->transport_rolling()) {
382 session->request_play_loop (false);
385 session->request_play_loop (true);
391 ARDOUR_UI::unset_dual_punch ()
393 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
396 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
398 ignore_dual_punch = true;
399 tact->set_active (false);
400 ignore_dual_punch = false;
406 ARDOUR_UI::toggle_punch ()
408 if (ignore_dual_punch) {
412 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
416 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
422 /* drive the other two actions from this one */
424 Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
425 Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
427 if (in_action && out_action) {
428 Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
429 Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
430 tiact->set_active (tact->get_active());
431 toact->set_active (tact->get_active());
437 ARDOUR_UI::toggle_punch_in ()
439 ActionManager::toggle_config_state ("Transport", "TogglePunchIn", &Configuration::set_punch_in, &Configuration::get_punch_in);
443 ARDOUR_UI::toggle_punch_out ()
445 ActionManager::toggle_config_state ("Transport", "TogglePunchOut", &Configuration::set_punch_out, &Configuration::get_punch_out);
449 ARDOUR_UI::toggle_video_sync()
451 Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
453 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
454 Config->set_use_video_sync (tact->get_active());
459 ARDOUR_UI::toggle_editing_space()
461 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
463 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
464 if (tact->get_active()) {
465 maximise_editing_space ();
467 restore_editing_space ();
473 ARDOUR_UI::toggle_new_plugins_active ()
475 ActionManager::toggle_config_state ("options", "NewPluginsActive", &Configuration::set_new_plugins_active, &Configuration::get_new_plugins_active);
479 ARDOUR_UI::toggle_StopPluginsWithTransport()
481 ActionManager::toggle_config_state ("options", "StopPluginsWithTransport", &Configuration::set_plugins_stop_with_transport, &Configuration::get_plugins_stop_with_transport);
485 ARDOUR_UI::toggle_LatchedRecordEnable()
487 ActionManager::toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable, &Configuration::get_latched_record_enable);
491 ARDOUR_UI::toggle_RegionEquivalentsOverlap()
493 ActionManager::toggle_config_state ("options", "RegionEquivalentsOverlap", &Configuration::set_use_overlap_equivalency, &Configuration::get_use_overlap_equivalency);
497 ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
499 ActionManager::toggle_config_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::set_do_not_record_plugins, &Configuration::get_do_not_record_plugins);
503 ARDOUR_UI::toggle_VerifyRemoveLastCapture()
505 ActionManager::toggle_config_state ("options", "VerifyRemoveLastCapture", &Configuration::set_verify_remove_last_capture, &Configuration::get_verify_remove_last_capture);
509 ARDOUR_UI::toggle_PeriodicSafetyBackups()
511 ActionManager::toggle_config_state ("options", "PeriodicSafetyBackups", &Configuration::set_periodic_safety_backups, &Configuration::get_periodic_safety_backups);
515 ARDOUR_UI::toggle_StopRecordingOnXrun()
517 ActionManager::toggle_config_state ("options", "StopRecordingOnXrun", &Configuration::set_stop_recording_on_xrun, &Configuration::get_stop_recording_on_xrun);
521 ARDOUR_UI::toggle_CreateXrunMarker()
523 ActionManager::toggle_config_state ("options", "CreateXrunMarker", &Configuration::set_create_xrun_marker, &Configuration::get_create_xrun_marker);
527 ARDOUR_UI::toggle_sync_order_keys ()
529 ActionManager::toggle_config_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::set_sync_all_route_ordering, &Configuration::get_sync_all_route_ordering);
533 ARDOUR_UI::toggle_StopTransportAtEndOfSession()
535 ActionManager::toggle_config_state ("options", "StopTransportAtEndOfSession", &Configuration::set_stop_at_session_end, &Configuration::get_stop_at_session_end);
539 ARDOUR_UI::toggle_GainReduceFastTransport()
541 ActionManager::toggle_config_state ("options", "GainReduceFastTransport", &Configuration::set_quieten_at_speed, &Configuration::get_quieten_at_speed);
545 ARDOUR_UI::toggle_LatchedSolo()
547 ActionManager::toggle_config_state ("options", "LatchedSolo", &Configuration::set_solo_latched, &Configuration::get_solo_latched);
551 ARDOUR_UI::toggle_ShowSoloMutes()
553 ActionManager::toggle_config_state ("options", "ShowSoloMutes", &Configuration::set_show_solo_mutes, &Configuration::get_show_solo_mutes);
557 ARDOUR_UI::toggle_SoloMuteOverride()
559 ActionManager::toggle_config_state ("options", "SoloMuteOverride", &Configuration::set_solo_mute_override, &Configuration::get_solo_mute_override);
563 ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor()
565 ActionManager::toggle_config_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::set_primary_clock_delta_edit_cursor, &Configuration::get_primary_clock_delta_edit_cursor);
569 ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor()
571 ActionManager::toggle_config_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::set_secondary_clock_delta_edit_cursor, &Configuration::get_secondary_clock_delta_edit_cursor);
575 ARDOUR_UI::toggle_ShowTrackMeters()
577 ActionManager::toggle_config_state ("options", "ShowTrackMeters", &Configuration::set_show_track_meters, &Configuration::get_show_track_meters);
581 ARDOUR_UI::toggle_TapeMachineMode ()
583 ActionManager::toggle_config_state ("options", "ToggleTapeMachineMode", &Configuration::set_tape_machine_mode, &Configuration::get_tape_machine_mode);
587 ARDOUR_UI::toggle_use_narrow_ms()
589 ActionManager::toggle_config_state ("options", "DefaultNarrowMS", &Configuration::set_default_narrow_ms, &Configuration::get_default_narrow_ms);
593 ARDOUR_UI::toggle_NameNewMarkers()
595 ActionManager::toggle_config_state ("options", "NameNewMarkers", &Configuration::set_name_new_markers, &Configuration::get_name_new_markers);
599 ARDOUR_UI::toggle_rubberbanding_snaps_to_grid ()
601 ActionManager::toggle_config_state ("options", "RubberbandingSnapsToGrid", &Configuration::set_rubberbanding_snaps_to_grid, &Configuration::get_rubberbanding_snaps_to_grid);
605 ARDOUR_UI::toggle_auto_analyse_audio ()
607 ActionManager::toggle_config_state ("options", "AutoAnalyseAudio", &Configuration::set_auto_analyse_audio, &Configuration::get_auto_analyse_audio);
611 ARDOUR_UI::mtc_port_changed ()
616 if (session->mtc_port()) {
625 positional_sync_strings.clear ();
626 positional_sync_strings.push_back (slave_source_to_string (None));
628 positional_sync_strings.push_back (slave_source_to_string (MTC));
630 positional_sync_strings.push_back (slave_source_to_string (JACK));
632 set_popdown_strings (sync_option_combo, positional_sync_strings);
636 ARDOUR_UI::setup_session_options ()
640 Config->ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
645 ARDOUR_UI::map_solo_model ()
649 if (Config->get_solo_model() == InverseMute) {
650 on = X_("SoloInPlace");
652 on = X_("SoloViaBus");
655 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
657 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
659 if (tact && !tact->get_active()) {
660 tact->set_active (true);
666 ARDOUR_UI::map_monitor_model ()
670 switch (Config->get_monitoring_model()) {
671 case HardwareMonitoring:
672 on = X_("UseHardwareMonitoring");
674 case SoftwareMonitoring:
675 on = X_("UseSoftwareMonitoring");
677 case ExternalMonitoring:
678 on = X_("UseExternalMonitoring");
682 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
684 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
686 if (tact && !tact->get_active()) {
687 tact->set_active (true);
693 ARDOUR_UI::map_denormal_protection ()
695 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("DenormalProtection"));
697 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
699 if (tact && !tact->get_active()) {
700 tact->set_active (Config->get_denormal_protection());
706 ARDOUR_UI::map_denormal_model ()
710 switch (Config->get_denormal_model()) {
712 on = X_("DenormalNone");
715 on = X_("DenormalFTZ");
718 on = X_("DenormalDAZ");
721 on = X_("DenormalFTZDAZ");
725 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
727 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
729 if (tact && !tact->get_active()) {
730 tact->set_active (true);
736 ARDOUR_UI::map_remote_model ()
740 switch (Config->get_remote_model()) {
742 on = X_("RemoteUserDefined");
745 on = X_("RemoteMixerDefined");
748 on = X_("RemoteEditorDefined");
752 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
754 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
756 if (tact && !tact->get_active()) {
757 tact->set_active (true);
763 ARDOUR_UI::map_file_header_format ()
765 const char* action = 0;
767 switch (Config->get_native_file_header_format()) {
769 action = X_("FileHeaderFormatBWF");
773 action = X_("FileHeaderFormatWAVE");
777 action = X_("FileHeaderFormatWAVE64");
781 action = X_("FileHeaderFormatiXML");
785 action = X_("FileHeaderFormatRF64");
789 action = X_("FileHeaderFormatCAF");
793 fatal << string_compose (_("programming error: unknown file header format passed to ARDOUR_UI::map_file_data_format: %1"),
794 Config->get_native_file_header_format()) << endmsg;
799 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
802 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
804 if (tact && !tact->get_active()) {
805 tact->set_active (true);
811 ARDOUR_UI::map_file_data_format ()
813 const char* action = 0;
815 switch (Config->get_native_file_data_format()) {
817 action = X_("FileDataFormatFloat");
821 action = X_("FileDataFormat24bit");
825 action = X_("FileDataFormat16bit");
829 fatal << string_compose (_("programming error: unknown file data format passed to ARDOUR_UI::map_file_data_format: %1"),
830 Config->get_native_file_data_format()) << endmsg;
835 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
838 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
840 if (tact && !tact->get_active()) {
841 tact->set_active (true);
847 ARDOUR_UI::map_input_auto_connect ()
851 if (Config->get_input_auto_connect() == (AutoConnectOption) 0) {
852 on = "InputAutoConnectManual";
854 on = "InputAutoConnectPhysical";
857 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
859 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
861 if (tact && !tact->get_active()) {
862 tact->set_active (true);
868 ARDOUR_UI::map_output_auto_connect ()
872 if (Config->get_output_auto_connect() == (AutoConnectOption) 0) {
873 on = "OutputAutoConnectManual";
874 } else if (Config->get_output_auto_connect() == AutoConnectPhysical) {
875 on = "OutputAutoConnectPhysical";
877 on = "OutputAutoConnectMaster";
880 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
882 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
884 if (tact && !tact->get_active()) {
885 tact->set_active (true);
891 ARDOUR_UI::map_only_copy_imported_files ()
893 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("OnlyCopyImportedFiles"));
895 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
897 if (tact && !tact->get_active()) {
898 tact->set_active (Config->get_only_copy_imported_files());
905 ARDOUR_UI::map_meter_falloff ()
907 const char* action = X_("MeterFalloffMedium");
909 float val = Config->get_meter_falloff ();
910 MeterFalloff code = meter_falloff_from_float(val);
913 case MeterFalloffOff:
914 action = X_("MeterFalloffOff");
916 case MeterFalloffSlowest:
917 action = X_("MeterFalloffSlowest");
919 case MeterFalloffSlow:
920 action = X_("MeterFalloffSlow");
922 case MeterFalloffMedium:
923 action = X_("MeterFalloffMedium");
925 case MeterFalloffFast:
926 action = X_("MeterFalloffFast");
928 case MeterFalloffFaster:
929 action = X_("MeterFalloffFaster");
931 case MeterFalloffFastest:
932 action = X_("MeterFalloffFastest");
936 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
939 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
940 if (ract && !ract->get_active()) {
941 ract->set_active (true);
947 ARDOUR_UI::map_meter_hold ()
949 const char* action = X_("MeterHoldMedium");
951 /* XXX hack alert. Fix this. Please */
953 float val = Config->get_meter_hold ();
954 MeterHold code = (MeterHold) (int) (floor (val));
958 action = X_("MeterHoldOff");
961 action = X_("MeterHoldShort");
963 case MeterHoldMedium:
964 action = X_("MeterHoldMedium");
967 action = X_("MeterHoldLong");
971 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
974 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
975 if (ract && !ract->get_active()) {
976 ract->set_active (true);
982 ARDOUR_UI::set_meter_hold (MeterHold val)
984 const char* action = 0;
987 fval = meter_hold_to_float (val);
991 action = X_("MeterHoldOff");
994 action = X_("MeterHoldShort");
996 case MeterHoldMedium:
997 action = X_("MeterHoldMedium");
1000 action = X_("MeterHoldLong");
1004 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1007 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1008 if (ract && ract->get_active() && Config->get_meter_hold() != fval) {
1009 Config->set_meter_hold (fval);
1015 ARDOUR_UI::set_meter_falloff (MeterFalloff val)
1017 const char* action = 0;
1020 fval = meter_falloff_to_float (val);
1023 case MeterFalloffOff:
1024 action = X_("MeterFalloffOff");
1026 case MeterFalloffSlowest:
1027 action = X_("MeterFalloffSlowest");
1029 case MeterFalloffSlow:
1030 action = X_("MeterFalloffSlow");
1032 case MeterFalloffMedium:
1033 action = X_("MeterFalloffMedium");
1035 case MeterFalloffFast:
1036 action = X_("MeterFalloffFast");
1038 case MeterFalloffFaster:
1039 action = X_("MeterFalloffFaster");
1041 case MeterFalloffFastest:
1042 action = X_("MeterFalloffFastest");
1046 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1049 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1050 if (ract && ract->get_active() && Config->get_meter_falloff () != fval) {
1051 Config->set_meter_falloff (fval);
1057 ARDOUR_UI::parameter_changed (const char* parameter_name)
1059 ENSURE_GUI_THREAD (bind (mem_fun (*this, &ARDOUR_UI::parameter_changed), parameter_name));
1061 #define PARAM_IS(x) (!strcmp (parameter_name, (x)))
1063 if (PARAM_IS ("slave-source")) {
1065 sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
1067 switch (Config->get_slave_source()) {
1069 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
1070 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
1074 /* XXX need to make auto-play is off as well as insensitive */
1075 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
1076 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
1080 } else if (PARAM_IS ("send-mtc")) {
1082 ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
1084 } else if (PARAM_IS ("send-mmc")) {
1087 ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
1089 } else if (PARAM_IS ("use-osc")) {
1092 if (Config->get_use_osc()) {
1099 ActionManager::map_some_state ("options", "UseOSC", &Configuration::get_use_osc);
1101 } else if (PARAM_IS ("mmc-control")) {
1102 ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
1104 } else if (PARAM_IS ("midi-feedback")) {
1105 ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);
1106 } else if (PARAM_IS ("do-not-record-plugins")) {
1107 ActionManager::map_some_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::get_do_not_record_plugins);
1108 } else if (PARAM_IS ("latched-record-enable")) {
1109 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1110 } else if (PARAM_IS ("solo-latched")) {
1111 ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
1112 } else if (PARAM_IS ("show-solo-mutes")) {
1113 ActionManager::map_some_state ("options", "ShowSoloMutes", &Configuration::get_show_solo_mutes);
1114 } else if (PARAM_IS ("solo-mute-override")) {
1115 ActionManager::map_some_state ("options", "SoloMuteOverride", &Configuration::get_solo_mute_override);
1116 } else if (PARAM_IS ("solo-model")) {
1118 } else if (PARAM_IS ("auto-play")) {
1119 ActionManager::map_some_state ("Transport", "ToggleAutoPlay", &Configuration::get_auto_play);
1120 } else if (PARAM_IS ("auto-return")) {
1121 ActionManager::map_some_state ("Transport", "ToggleAutoReturn", &Configuration::get_auto_return);
1122 } else if (PARAM_IS ("auto-input")) {
1123 ActionManager::map_some_state ("Transport", "ToggleAutoInput", &Configuration::get_auto_input);
1124 } else if (PARAM_IS ("tape-machine-mode")) {
1125 ActionManager::map_some_state ("options", "ToggleTapeMachineMode", &Configuration::get_tape_machine_mode);
1126 } else if (PARAM_IS ("punch-out")) {
1127 ActionManager::map_some_state ("Transport", "TogglePunchOut", &Configuration::get_punch_out);
1128 if (!Config->get_punch_out()) {
1129 unset_dual_punch ();
1131 } else if (PARAM_IS ("punch-in")) {
1132 ActionManager::map_some_state ("Transport", "TogglePunchIn", &Configuration::get_punch_in);
1133 if (!Config->get_punch_in()) {
1134 unset_dual_punch ();
1136 } else if (PARAM_IS ("clicking")) {
1137 ActionManager::map_some_state ("Transport", "ToggleClick", &Configuration::get_clicking);
1138 } else if (PARAM_IS ("jack-time-master")) {
1139 ActionManager::map_some_state ("Transport", "ToggleTimeMaster", &Configuration::get_jack_time_master);
1140 } else if (PARAM_IS ("plugins-stop-with-transport")) {
1141 ActionManager::map_some_state ("options", "StopPluginsWithTransport", &Configuration::get_plugins_stop_with_transport);
1142 } else if (PARAM_IS ("new-plugins-active")) {
1143 ActionManager::map_some_state ("options", "NewPluginsActive", &Configuration::get_new_plugins_active);
1144 } else if (PARAM_IS ("latched-record-enable")) {
1145 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1146 } else if (PARAM_IS ("verify-remove-last-capture")) {
1147 ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
1148 } else if (PARAM_IS ("periodic-safety-backups")) {
1149 ActionManager::map_some_state ("options", "PeriodicSafetyBackups", &Configuration::get_periodic_safety_backups);
1150 } else if (PARAM_IS ("stop-recording-on-xrun")) {
1151 ActionManager::map_some_state ("options", "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun);
1152 } else if (PARAM_IS ("create-xrun-marker")) {
1153 ActionManager::map_some_state ("options", "CreateXrunMarker", &Configuration::get_create_xrun_marker);
1154 } else if (PARAM_IS ("sync-all-route-ordering")) {
1155 ActionManager::map_some_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::get_sync_all_route_ordering);
1156 } else if (PARAM_IS ("stop-at-session-end")) {
1157 ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
1158 } else if (PARAM_IS ("monitoring-model")) {
1159 map_monitor_model ();
1160 } else if (PARAM_IS ("denormal-model")) {
1161 map_denormal_model ();
1162 } else if (PARAM_IS ("denormal-protection")) {
1163 map_denormal_protection ();
1164 } else if (PARAM_IS ("remote-model")) {
1165 map_remote_model ();
1166 } else if (PARAM_IS ("use-video-sync")) {
1167 ActionManager::map_some_state ("Transport", "ToggleVideoSync", &Configuration::get_use_video_sync);
1168 } else if (PARAM_IS ("quieten-at-speed")) {
1169 ActionManager::map_some_state ("options", "GainReduceFastTransport", &Configuration::get_quieten_at_speed);
1170 } else if (PARAM_IS ("shuttle-behaviour")) {
1172 switch (Config->get_shuttle_behaviour ()) {
1174 shuttle_style_button.set_active_text (_("sprung"));
1175 shuttle_fract = 0.0;
1176 shuttle_box.queue_draw ();
1178 if (session->transport_rolling()) {
1179 shuttle_fract = SHUTTLE_FRACT_SPEED1;
1180 session->request_transport_speed (1.0);
1185 shuttle_style_button.set_active_text (_("wheel"));
1189 } else if (PARAM_IS ("shuttle-units")) {
1191 switch (Config->get_shuttle_units()) {
1193 shuttle_units_button.set_label("% ");
1196 shuttle_units_button.set_label(_("ST"));
1199 } else if (PARAM_IS ("input-auto-connect")) {
1200 map_input_auto_connect ();
1201 } else if (PARAM_IS ("output-auto-connect")) {
1202 map_output_auto_connect ();
1203 } else if (PARAM_IS ("native-file-header-format")) {
1204 map_file_header_format ();
1205 } else if (PARAM_IS ("native-file-data-format")) {
1206 map_file_data_format ();
1207 } else if (PARAM_IS ("meter-hold")) {
1209 } else if (PARAM_IS ("meter-falloff")) {
1210 map_meter_falloff ();
1211 } else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-format")) {
1213 primary_clock.set (session->audible_frame(), true);
1214 secondary_clock.set (session->audible_frame(), true);
1216 primary_clock.set (0, true);
1217 secondary_clock.set (0, true);
1219 } else if (PARAM_IS ("use-overlap-equivalency")) {
1220 ActionManager::map_some_state ("options", "RegionEquivalentsOverlap", &Configuration::get_use_overlap_equivalency);
1221 } else if (PARAM_IS ("primary-clock-delta-edit-cursor")) {
1222 ActionManager::map_some_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::get_primary_clock_delta_edit_cursor);
1223 } else if (PARAM_IS ("secondary-clock-delta-edit-cursor")) {
1224 ActionManager::map_some_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::get_secondary_clock_delta_edit_cursor);
1225 } else if (PARAM_IS ("only-copy-imported-files")) {
1226 map_only_copy_imported_files ();
1227 } else if (PARAM_IS ("show-track-meters")) {
1228 ActionManager::map_some_state ("options", "ShowTrackMeters", &Configuration::get_show_track_meters);
1229 editor->toggle_meter_updating();
1230 } else if (PARAM_IS ("default-narrow_ms")) {
1231 ActionManager::map_some_state ("options", "DefaultNarrowMS", &Configuration::get_default_narrow_ms);
1232 } else if (PARAM_IS ("rubberbanding-snaps-to-grid")) {
1233 ActionManager::map_some_state ("options", "RubberbandingSnapsToGrid", &Configuration::get_rubberbanding_snaps_to_grid);