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/audioengine.h>
30 #include <ardour/osc.h>
33 #include "ardour_ui.h"
35 #include "gui_thread.h"
36 #include "public_editor.h"
41 using namespace Gtkmm2ext;
42 using namespace ARDOUR;
47 ARDOUR_UI::toggle_time_master ()
49 ActionManager::toggle_config_state ("Transport", "ToggleTimeMaster", &Configuration::set_jack_time_master, &Configuration::get_jack_time_master);
53 ARDOUR_UI::toggle_send_mtc ()
55 ActionManager::toggle_config_state ("options", "SendMTC", &Configuration::set_send_mtc, &Configuration::get_send_mtc);
59 ARDOUR_UI::toggle_send_mmc ()
61 ActionManager::toggle_config_state ("options", "SendMMC", &Configuration::set_send_mmc, &Configuration::get_send_mmc);
65 ARDOUR_UI::toggle_send_midi_clock ()
67 ActionManager::toggle_config_state ("options", "SendMidiClock", &Configuration::set_send_midi_clock, &Configuration::get_send_midi_clock);
71 ARDOUR_UI::toggle_use_mmc ()
73 ActionManager::toggle_config_state ("options", "UseMMC", &Configuration::set_mmc_control, &Configuration::get_mmc_control);
77 ARDOUR_UI::toggle_use_osc ()
79 ActionManager::toggle_config_state ("options", "UseOSC", &Configuration::set_use_osc, &Configuration::get_use_osc);
83 ARDOUR_UI::toggle_send_midi_feedback ()
85 ActionManager::toggle_config_state ("options", "SendMIDIfeedback", &Configuration::set_midi_feedback, &Configuration::get_midi_feedback);
89 ARDOUR_UI::toggle_denormal_protection ()
91 ActionManager::toggle_config_state ("options", "DenormalProtection", &Configuration::set_denormal_protection, &Configuration::get_denormal_protection);
95 ARDOUR_UI::toggle_only_copy_imported_files ()
97 ActionManager::toggle_config_state ("options", "OnlyCopyImportedFiles", &Configuration::set_only_copy_imported_files, &Configuration::get_only_copy_imported_files);
102 ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
104 const char *action = 0;
108 action = X_("FileHeaderFormatBWF");
111 action = X_("FileHeaderFormatWAVE");
114 action = X_("FileHeaderFormatWAVE64");
117 action = X_("FileHeaderFormatiXML");
120 action = X_("FileHeaderFormatRF64");
123 action = X_("FileHeaderFormatCAF");
126 action = X_("FileHeaderFormatAIFF");
129 fatal << string_compose (_("programming error: %1"), "illegal file header format in ::set_native_file_header_format") << endmsg;
133 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
136 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
137 if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
138 Config->set_native_file_header_format (hf);
144 ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
146 const char* action = 0;
150 action = X_("FileDataFormatFloat");
153 action = X_("FileDataFormat24bit");
156 action = X_("FileDataFormat16bit");
159 fatal << string_compose (_("programming error: %1"), "illegal file data format in ::set_native_file_data_format") << endmsg;
163 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
166 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
167 if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
168 Config->set_native_file_data_format (sf);
174 ARDOUR_UI::set_input_auto_connect (AutoConnectOption option)
179 case AutoConnectPhysical:
180 action = X_("InputAutoConnectPhysical");
183 action = X_("InputAutoConnectManual");
186 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
189 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
191 if (ract && ract->get_active() && Config->get_input_auto_connect() != option) {
192 Config->set_input_auto_connect (option);
198 ARDOUR_UI::set_output_auto_connect (AutoConnectOption option)
203 case AutoConnectPhysical:
204 action = X_("OutputAutoConnectPhysical");
206 case AutoConnectMaster:
207 action = X_("OutputAutoConnectMaster");
210 action = X_("OutputAutoConnectManual");
213 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
216 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
218 if (ract && ract->get_active() && Config->get_output_auto_connect() != option) {
219 Config->set_output_auto_connect (option);
225 ARDOUR_UI::set_solo_model (SoloModel model)
227 const char* action = 0;
231 action = X_("SoloViaBus");
235 action = X_("SoloInPlace");
238 fatal << string_compose (_("programming error: unknown solo model in ARDOUR_UI::set_solo_model: %1"), model) << endmsg;
242 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
245 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
247 if (ract && ract->get_active() && Config->get_solo_model() != model) {
248 Config->set_solo_model (model);
255 ARDOUR_UI::set_remote_model (RemoteModel model)
257 const char* action = 0;
261 action = X_("RemoteUserDefined");
264 action = X_("RemoteMixerDefined");
267 action = X_("RemoteEditorDefined");
271 fatal << string_compose (_("programming error: unknown remote model in ARDOUR_UI::set_remote_model: %1"), model) << endmsg;
275 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
278 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
280 if (ract && ract->get_active() && Config->get_remote_model() != model) {
281 Config->set_remote_model (model);
288 ARDOUR_UI::set_monitor_model (MonitorModel model)
290 const char* action = 0;
293 case HardwareMonitoring:
294 action = X_("UseHardwareMonitoring");
297 case SoftwareMonitoring:
298 action = X_("UseSoftwareMonitoring");
300 case ExternalMonitoring:
301 action = X_("UseExternalMonitoring");
305 fatal << string_compose (_("programming error: unknown monitor model in ARDOUR_UI::set_monitor_model: %1"), model) << endmsg;
309 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
312 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
314 if (ract && ract->get_active() && Config->get_monitoring_model() != model) {
315 Config->set_monitoring_model (model);
322 ARDOUR_UI::set_denormal_model (DenormalModel model)
324 const char* action = 0;
328 action = X_("DenormalNone");
332 action = X_("DenormalFTZ");
336 action = X_("DenormalDAZ");
340 action = X_("DenormalFTZDAZ");
344 fatal << string_compose (_("programming error: unknown denormal model in ARDOUR_UI::set_denormal_model: %1"), model) << endmsg;
348 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
351 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
353 if (ract && ract->get_active() && Config->get_denormal_model() != model) {
354 Config->set_denormal_model (model);
361 ARDOUR_UI::toggle_auto_input ()
363 ActionManager::toggle_config_state ("Transport", "ToggleAutoInput", &Configuration::set_auto_input, &Configuration::get_auto_input);
367 ARDOUR_UI::toggle_auto_play ()
369 ActionManager::toggle_config_state ("Transport", "ToggleAutoPlay", &Configuration::set_auto_play, &Configuration::get_auto_play);
373 ARDOUR_UI::toggle_auto_return ()
375 ActionManager::toggle_config_state ("Transport", "ToggleAutoReturn", &Configuration::set_auto_return, &Configuration::get_auto_return);
379 ARDOUR_UI::toggle_click ()
381 ActionManager::toggle_config_state ("Transport", "ToggleClick", &Configuration::set_clicking, &Configuration::get_clicking);
385 ARDOUR_UI::toggle_session_auto_loop ()
388 if (session->get_play_loop()) {
389 if (session->transport_rolling()) {
392 session->request_play_loop (false);
395 session->request_play_loop (true);
401 ARDOUR_UI::unset_dual_punch ()
403 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
406 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
408 ignore_dual_punch = true;
409 tact->set_active (false);
410 ignore_dual_punch = false;
416 ARDOUR_UI::toggle_punch ()
418 if (ignore_dual_punch) {
422 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
426 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
432 /* drive the other two actions from this one */
434 Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
435 Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
437 if (in_action && out_action) {
438 Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
439 Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
440 tiact->set_active (tact->get_active());
441 toact->set_active (tact->get_active());
447 ARDOUR_UI::toggle_punch_in ()
449 ActionManager::toggle_config_state ("Transport", "TogglePunchIn", &Configuration::set_punch_in, &Configuration::get_punch_in);
453 ARDOUR_UI::toggle_punch_out ()
455 ActionManager::toggle_config_state ("Transport", "TogglePunchOut", &Configuration::set_punch_out, &Configuration::get_punch_out);
459 ARDOUR_UI::toggle_video_sync()
461 Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
463 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
464 Config->set_use_video_sync (tact->get_active());
469 ARDOUR_UI::toggle_editing_space()
471 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
473 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
474 if (tact->get_active()) {
475 maximise_editing_space ();
477 restore_editing_space ();
483 ARDOUR_UI::toggle_new_plugins_active ()
485 ActionManager::toggle_config_state ("options", "NewPluginsActive", &Configuration::set_new_plugins_active, &Configuration::get_new_plugins_active);
489 ARDOUR_UI::toggle_StopPluginsWithTransport()
491 ActionManager::toggle_config_state ("options", "StopPluginsWithTransport", &Configuration::set_plugins_stop_with_transport, &Configuration::get_plugins_stop_with_transport);
495 ARDOUR_UI::toggle_LatchedRecordEnable()
497 ActionManager::toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable, &Configuration::get_latched_record_enable);
501 ARDOUR_UI::toggle_RegionEquivalentsOverlap()
503 ActionManager::toggle_config_state ("options", "RegionEquivalentsOverlap", &Configuration::set_use_overlap_equivalency, &Configuration::get_use_overlap_equivalency);
507 ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
509 ActionManager::toggle_config_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::set_do_not_record_plugins, &Configuration::get_do_not_record_plugins);
513 ARDOUR_UI::toggle_VerifyRemoveLastCapture()
515 ActionManager::toggle_config_state ("options", "VerifyRemoveLastCapture", &Configuration::set_verify_remove_last_capture, &Configuration::get_verify_remove_last_capture);
519 ARDOUR_UI::toggle_PeriodicSafetyBackups()
521 ActionManager::toggle_config_state ("options", "PeriodicSafetyBackups", &Configuration::set_periodic_safety_backups, &Configuration::get_periodic_safety_backups);
525 ARDOUR_UI::toggle_StopRecordingOnXrun()
527 ActionManager::toggle_config_state ("options", "StopRecordingOnXrun", &Configuration::set_stop_recording_on_xrun, &Configuration::get_stop_recording_on_xrun);
531 ARDOUR_UI::toggle_CreateXrunMarker()
533 ActionManager::toggle_config_state ("options", "CreateXrunMarker", &Configuration::set_create_xrun_marker, &Configuration::get_create_xrun_marker);
537 ARDOUR_UI::toggle_sync_order_keys ()
539 ActionManager::toggle_config_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::set_sync_all_route_ordering, &Configuration::get_sync_all_route_ordering);
543 ARDOUR_UI::toggle_StopTransportAtEndOfSession()
545 ActionManager::toggle_config_state ("options", "StopTransportAtEndOfSession", &Configuration::set_stop_at_session_end, &Configuration::get_stop_at_session_end);
549 ARDOUR_UI::toggle_GainReduceFastTransport()
551 ActionManager::toggle_config_state ("options", "GainReduceFastTransport", &Configuration::set_quieten_at_speed, &Configuration::get_quieten_at_speed);
555 ARDOUR_UI::toggle_LatchedSolo()
557 ActionManager::toggle_config_state ("options", "LatchedSolo", &Configuration::set_solo_latched, &Configuration::get_solo_latched);
561 ARDOUR_UI::toggle_ShowSoloMutes()
563 ActionManager::toggle_config_state ("options", "ShowSoloMutes", &Configuration::set_show_solo_mutes, &Configuration::get_show_solo_mutes);
567 ARDOUR_UI::toggle_SoloMuteOverride()
569 ActionManager::toggle_config_state ("options", "SoloMuteOverride", &Configuration::set_solo_mute_override, &Configuration::get_solo_mute_override);
573 ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor()
575 ActionManager::toggle_config_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::set_primary_clock_delta_edit_cursor, &Configuration::get_primary_clock_delta_edit_cursor);
579 ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor()
581 ActionManager::toggle_config_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::set_secondary_clock_delta_edit_cursor, &Configuration::get_secondary_clock_delta_edit_cursor);
585 ARDOUR_UI::toggle_ShowTrackMeters()
587 ActionManager::toggle_config_state ("options", "ShowTrackMeters", &Configuration::set_show_track_meters, &Configuration::get_show_track_meters);
591 ARDOUR_UI::toggle_TapeMachineMode ()
593 ActionManager::toggle_config_state ("options", "ToggleTapeMachineMode", &Configuration::set_tape_machine_mode, &Configuration::get_tape_machine_mode);
597 ARDOUR_UI::toggle_use_narrow_ms()
599 ActionManager::toggle_config_state ("options", "DefaultNarrowMS", &Configuration::set_default_narrow_ms, &Configuration::get_default_narrow_ms);
603 ARDOUR_UI::toggle_NameNewMarkers()
605 ActionManager::toggle_config_state ("options", "NameNewMarkers", &Configuration::set_name_new_markers, &Configuration::get_name_new_markers);
609 ARDOUR_UI::toggle_rubberbanding_snaps_to_grid ()
611 ActionManager::toggle_config_state ("options", "RubberbandingSnapsToGrid", &Configuration::set_rubberbanding_snaps_to_grid, &Configuration::get_rubberbanding_snaps_to_grid);
615 ARDOUR_UI::toggle_auto_analyse_audio ()
617 ActionManager::toggle_config_state ("options", "AutoAnalyseAudio", &Configuration::set_auto_analyse_audio, &Configuration::get_auto_analyse_audio);
621 ARDOUR_UI::mtc_port_changed ()
624 bool have_midi_clock;
627 if (session->mtc_port()) {
632 if (session->midi_clock_port()) {
633 have_midi_clock = true;
635 have_midi_clock = false;
639 have_midi_clock = false;
642 positional_sync_strings.clear ();
643 positional_sync_strings.push_back (slave_source_to_string (None));
645 positional_sync_strings.push_back (slave_source_to_string (MTC));
647 if (have_midi_clock) {
648 positional_sync_strings.push_back (slave_source_to_string (MIDIClock));
650 positional_sync_strings.push_back (slave_source_to_string (JACK));
652 set_popdown_strings (sync_option_combo, positional_sync_strings);
656 ARDOUR_UI::setup_session_options ()
660 Config->ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
665 ARDOUR_UI::map_solo_model ()
669 if (Config->get_solo_model() == InverseMute) {
670 on = X_("SoloInPlace");
672 on = X_("SoloViaBus");
675 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
677 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
679 if (tact && !tact->get_active()) {
680 tact->set_active (true);
686 ARDOUR_UI::map_monitor_model ()
690 switch (Config->get_monitoring_model()) {
691 case HardwareMonitoring:
692 on = X_("UseHardwareMonitoring");
694 case SoftwareMonitoring:
695 on = X_("UseSoftwareMonitoring");
697 case ExternalMonitoring:
698 on = X_("UseExternalMonitoring");
702 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
704 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
706 if (tact && !tact->get_active()) {
707 tact->set_active (true);
713 ARDOUR_UI::map_denormal_protection ()
715 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("DenormalProtection"));
717 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
719 if (tact && !tact->get_active()) {
720 tact->set_active (Config->get_denormal_protection());
726 ARDOUR_UI::map_denormal_model ()
730 switch (Config->get_denormal_model()) {
732 on = X_("DenormalNone");
735 on = X_("DenormalFTZ");
738 on = X_("DenormalDAZ");
741 on = X_("DenormalFTZDAZ");
745 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
747 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
749 if (tact && !tact->get_active()) {
750 tact->set_active (true);
756 ARDOUR_UI::map_remote_model ()
760 switch (Config->get_remote_model()) {
762 on = X_("RemoteUserDefined");
765 on = X_("RemoteMixerDefined");
768 on = X_("RemoteEditorDefined");
772 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
774 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
776 if (tact && !tact->get_active()) {
777 tact->set_active (true);
783 ARDOUR_UI::map_file_header_format ()
785 const char* action = 0;
787 switch (Config->get_native_file_header_format()) {
789 action = X_("FileHeaderFormatBWF");
793 action = X_("FileHeaderFormatWAVE");
797 action = X_("FileHeaderFormatWAVE64");
801 action = X_("FileHeaderFormatiXML");
805 action = X_("FileHeaderFormatRF64");
809 action = X_("FileHeaderFormatCAF");
813 fatal << string_compose (_("programming error: unknown file header format passed to ARDOUR_UI::map_file_data_format: %1"),
814 Config->get_native_file_header_format()) << endmsg;
819 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
822 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
824 if (tact && !tact->get_active()) {
825 tact->set_active (true);
831 ARDOUR_UI::map_file_data_format ()
833 const char* action = 0;
835 switch (Config->get_native_file_data_format()) {
837 action = X_("FileDataFormatFloat");
841 action = X_("FileDataFormat24bit");
845 action = X_("FileDataFormat16bit");
849 fatal << string_compose (_("programming error: unknown file data format passed to ARDOUR_UI::map_file_data_format: %1"),
850 Config->get_native_file_data_format()) << endmsg;
855 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
858 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
860 if (tact && !tact->get_active()) {
861 tact->set_active (true);
867 ARDOUR_UI::map_input_auto_connect ()
871 if (Config->get_input_auto_connect() == (AutoConnectOption) 0) {
872 on = "InputAutoConnectManual";
874 on = "InputAutoConnectPhysical";
877 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
879 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
881 if (tact && !tact->get_active()) {
882 tact->set_active (true);
888 ARDOUR_UI::map_output_auto_connect ()
892 if (Config->get_output_auto_connect() == (AutoConnectOption) 0) {
893 on = "OutputAutoConnectManual";
894 } else if (Config->get_output_auto_connect() == AutoConnectPhysical) {
895 on = "OutputAutoConnectPhysical";
897 on = "OutputAutoConnectMaster";
900 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
902 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
904 if (tact && !tact->get_active()) {
905 tact->set_active (true);
911 ARDOUR_UI::map_only_copy_imported_files ()
913 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("OnlyCopyImportedFiles"));
915 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
917 if (tact && !tact->get_active()) {
918 tact->set_active (Config->get_only_copy_imported_files());
926 ARDOUR_UI::map_meter_falloff ()
928 const char* action = X_("MeterFalloffMedium");
930 float val = Config->get_meter_falloff ();
931 MeterFalloff code = meter_falloff_from_float(val);
934 case MeterFalloffOff:
935 action = X_("MeterFalloffOff");
937 case MeterFalloffSlowest:
938 action = X_("MeterFalloffSlowest");
940 case MeterFalloffSlow:
941 action = X_("MeterFalloffSlow");
943 case MeterFalloffMedium:
944 action = X_("MeterFalloffMedium");
946 case MeterFalloffFast:
947 action = X_("MeterFalloffFast");
949 case MeterFalloffFaster:
950 action = X_("MeterFalloffFaster");
952 case MeterFalloffFastest:
953 action = X_("MeterFalloffFastest");
957 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
960 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
961 if (ract && !ract->get_active()) {
962 ract->set_active (true);
968 ARDOUR_UI::map_meter_hold ()
970 const char* action = X_("MeterHoldMedium");
972 /* XXX hack alert. Fix this. Please */
974 float val = Config->get_meter_hold ();
975 MeterHold code = (MeterHold) (int) (floor (val));
979 action = X_("MeterHoldOff");
982 action = X_("MeterHoldShort");
984 case MeterHoldMedium:
985 action = X_("MeterHoldMedium");
988 action = X_("MeterHoldLong");
992 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
995 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
996 if (ract && !ract->get_active()) {
997 ract->set_active (true);
1003 ARDOUR_UI::set_meter_hold (MeterHold val)
1005 const char* action = 0;
1008 fval = meter_hold_to_float (val);
1012 action = X_("MeterHoldOff");
1014 case MeterHoldShort:
1015 action = X_("MeterHoldShort");
1017 case MeterHoldMedium:
1018 action = X_("MeterHoldMedium");
1021 action = X_("MeterHoldLong");
1025 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1028 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1029 if (ract && ract->get_active() && Config->get_meter_hold() != fval) {
1030 Config->set_meter_hold (fval);
1036 ARDOUR_UI::set_meter_falloff (MeterFalloff val)
1038 const char* action = 0;
1041 fval = meter_falloff_to_float (val);
1044 case MeterFalloffOff:
1045 action = X_("MeterFalloffOff");
1047 case MeterFalloffSlowest:
1048 action = X_("MeterFalloffSlowest");
1050 case MeterFalloffSlow:
1051 action = X_("MeterFalloffSlow");
1053 case MeterFalloffMedium:
1054 action = X_("MeterFalloffMedium");
1056 case MeterFalloffFast:
1057 action = X_("MeterFalloffFast");
1059 case MeterFalloffFaster:
1060 action = X_("MeterFalloffFaster");
1062 case MeterFalloffFastest:
1063 action = X_("MeterFalloffFastest");
1067 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1070 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1071 if (ract && ract->get_active() && Config->get_meter_falloff () != fval) {
1072 Config->set_meter_falloff (fval);
1078 ARDOUR_UI::parameter_changed (const char* parameter_name)
1080 ENSURE_GUI_THREAD (bind (mem_fun (*this, &ARDOUR_UI::parameter_changed), parameter_name));
1082 #define PARAM_IS(x) (!strcmp (parameter_name, (x)))
1084 if (PARAM_IS ("slave-source")) {
1086 sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
1088 switch (Config->get_slave_source()) {
1090 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
1091 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
1095 /* XXX need to make auto-play is off as well as insensitive */
1096 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
1097 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
1101 } else if (PARAM_IS ("send-mtc")) {
1103 ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
1105 } else if (PARAM_IS ("send-mmc")) {
1107 ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
1109 } else if (PARAM_IS ("use-osc")) {
1112 if (Config->get_use_osc()) {
1119 ActionManager::map_some_state ("options", "UseOSC", &Configuration::get_use_osc);
1121 } else if (PARAM_IS ("mmc-control")) {
1122 ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
1123 } else if (PARAM_IS ("midi-feedback")) {
1124 ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);
1125 } else if (PARAM_IS ("do-not-record-plugins")) {
1126 ActionManager::map_some_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::get_do_not_record_plugins);
1127 } else if (PARAM_IS ("latched-record-enable")) {
1128 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1129 } else if (PARAM_IS ("solo-latched")) {
1130 ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
1131 } else if (PARAM_IS ("show-solo-mutes")) {
1132 ActionManager::map_some_state ("options", "ShowSoloMutes", &Configuration::get_show_solo_mutes);
1133 } else if (PARAM_IS ("solo-mute-override")) {
1134 ActionManager::map_some_state ("options", "SoloMuteOverride", &Configuration::get_solo_mute_override);
1135 } else if (PARAM_IS ("solo-model")) {
1137 } else if (PARAM_IS ("auto-play")) {
1138 ActionManager::map_some_state ("Transport", "ToggleAutoPlay", &Configuration::get_auto_play);
1139 } else if (PARAM_IS ("auto-return")) {
1140 ActionManager::map_some_state ("Transport", "ToggleAutoReturn", &Configuration::get_auto_return);
1141 } else if (PARAM_IS ("auto-input")) {
1142 ActionManager::map_some_state ("Transport", "ToggleAutoInput", &Configuration::get_auto_input);
1143 } else if (PARAM_IS ("tape-machine-mode")) {
1144 ActionManager::map_some_state ("options", "ToggleTapeMachineMode", &Configuration::get_tape_machine_mode);
1145 } else if (PARAM_IS ("punch-out")) {
1146 ActionManager::map_some_state ("Transport", "TogglePunchOut", &Configuration::get_punch_out);
1147 if (!Config->get_punch_out()) {
1148 unset_dual_punch ();
1150 } else if (PARAM_IS ("punch-in")) {
1151 ActionManager::map_some_state ("Transport", "TogglePunchIn", &Configuration::get_punch_in);
1152 if (!Config->get_punch_in()) {
1153 unset_dual_punch ();
1155 } else if (PARAM_IS ("clicking")) {
1156 ActionManager::map_some_state ("Transport", "ToggleClick", &Configuration::get_clicking);
1157 } else if (PARAM_IS ("jack-time-master")) {
1158 ActionManager::map_some_state ("Transport", "ToggleTimeMaster", &Configuration::get_jack_time_master);
1159 } else if (PARAM_IS ("plugins-stop-with-transport")) {
1160 ActionManager::map_some_state ("options", "StopPluginsWithTransport", &Configuration::get_plugins_stop_with_transport);
1161 } else if (PARAM_IS ("new-plugins-active")) {
1162 ActionManager::map_some_state ("options", "NewPluginsActive", &Configuration::get_new_plugins_active);
1163 } else if (PARAM_IS ("latched-record-enable")) {
1164 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1165 } else if (PARAM_IS ("verify-remove-last-capture")) {
1166 ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
1167 } else if (PARAM_IS ("periodic-safety-backups")) {
1168 ActionManager::map_some_state ("options", "PeriodicSafetyBackups", &Configuration::get_periodic_safety_backups);
1169 } else if (PARAM_IS ("stop-recording-on-xrun")) {
1170 ActionManager::map_some_state ("options", "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun);
1171 } else if (PARAM_IS ("create-xrun-marker")) {
1172 ActionManager::map_some_state ("options", "CreateXrunMarker", &Configuration::get_create_xrun_marker);
1173 } else if (PARAM_IS ("sync-all-route-ordering")) {
1174 ActionManager::map_some_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::get_sync_all_route_ordering);
1175 } else if (PARAM_IS ("stop-at-session-end")) {
1176 ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
1177 } else if (PARAM_IS ("monitoring-model")) {
1178 map_monitor_model ();
1179 } else if (PARAM_IS ("denormal-model")) {
1180 map_denormal_model ();
1181 } else if (PARAM_IS ("denormal-protection")) {
1182 map_denormal_protection ();
1183 } else if (PARAM_IS ("remote-model")) {
1184 map_remote_model ();
1185 } else if (PARAM_IS ("use-video-sync")) {
1186 ActionManager::map_some_state ("Transport", "ToggleVideoSync", &Configuration::get_use_video_sync);
1187 } else if (PARAM_IS ("quieten-at-speed")) {
1188 ActionManager::map_some_state ("options", "GainReduceFastTransport", &Configuration::get_quieten_at_speed);
1189 } else if (PARAM_IS ("shuttle-behaviour")) {
1191 switch (Config->get_shuttle_behaviour ()) {
1193 shuttle_style_button.set_active_text (_("sprung"));
1194 shuttle_fract = 0.0;
1195 shuttle_box.queue_draw ();
1197 if (session->transport_rolling()) {
1198 shuttle_fract = SHUTTLE_FRACT_SPEED1;
1199 session->request_transport_speed (1.0);
1204 shuttle_style_button.set_active_text (_("wheel"));
1208 } else if (PARAM_IS ("shuttle-units")) {
1210 switch (Config->get_shuttle_units()) {
1212 shuttle_units_button.set_label("% ");
1215 shuttle_units_button.set_label(_("ST"));
1218 } else if (PARAM_IS ("input-auto-connect")) {
1219 map_input_auto_connect ();
1220 } else if (PARAM_IS ("output-auto-connect")) {
1221 map_output_auto_connect ();
1222 } else if (PARAM_IS ("native-file-header-format")) {
1223 map_file_header_format ();
1224 } else if (PARAM_IS ("native-file-data-format")) {
1225 map_file_data_format ();
1226 } else if (PARAM_IS ("meter-hold")) {
1228 } else if (PARAM_IS ("meter-falloff")) {
1229 map_meter_falloff ();
1230 } else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-format")) {
1232 primary_clock.set (session->audible_frame(), true);
1233 secondary_clock.set (session->audible_frame(), true);
1235 primary_clock.set (0, true);
1236 secondary_clock.set (0, true);
1238 } else if (PARAM_IS ("use-overlap-equivalency")) {
1239 ActionManager::map_some_state ("options", "RegionEquivalentsOverlap", &Configuration::get_use_overlap_equivalency);
1240 } else if (PARAM_IS ("primary-clock-delta-edit-cursor")) {
1241 ActionManager::map_some_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::get_primary_clock_delta_edit_cursor);
1242 } else if (PARAM_IS ("secondary-clock-delta-edit-cursor")) {
1243 ActionManager::map_some_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::get_secondary_clock_delta_edit_cursor);
1244 } else if (PARAM_IS ("only-copy-imported-files")) {
1245 map_only_copy_imported_files ();
1246 } else if (PARAM_IS ("show-track-meters")) {
1247 ActionManager::map_some_state ("options", "ShowTrackMeters", &Configuration::get_show_track_meters);
1248 editor->toggle_meter_updating();
1249 } else if (PARAM_IS ("default-narrow_ms")) {
1250 ActionManager::map_some_state ("options", "DefaultNarrowMS", &Configuration::get_default_narrow_ms);
1251 } else if (PARAM_IS ("rubberbanding-snaps-to-grid")) {
1252 ActionManager::map_some_state ("options", "RubberbandingSnapsToGrid", &Configuration::get_rubberbanding_snaps_to_grid);