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_seamless_loop ()
76 ActionManager::toggle_config_state ("options", "toggle-seamless-loop", &Configuration::set_seamless_loop, &Configuration::get_seamless_loop);
80 ARDOUR_UI::toggle_send_midi_feedback ()
82 ActionManager::toggle_config_state ("options", "SendMIDIfeedback", &Configuration::set_midi_feedback, &Configuration::get_midi_feedback);
86 ARDOUR_UI::toggle_denormal_protection ()
88 ActionManager::toggle_config_state ("options", "DenormalProtection", &Configuration::set_denormal_protection, &Configuration::get_denormal_protection);
92 ARDOUR_UI::toggle_only_copy_imported_files ()
94 ActionManager::toggle_config_state ("options", "OnlyCopyImportedFiles", &Configuration::set_only_copy_imported_files, &Configuration::get_only_copy_imported_files);
98 ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
100 const char *action = 0;
104 action = X_("FileHeaderFormatBWF");
107 action = X_("FileHeaderFormatWAVE");
110 action = X_("FileHeaderFormatWAVE64");
113 action = X_("FileHeaderFormatiXML");
116 action = X_("FileHeaderFormatRF64");
119 action = X_("FileHeaderFormatCAF");
122 action = X_("FileHeaderFormatAIFF");
125 fatal << string_compose (_("programming error: %1"), "illegal file header format in ::set_native_file_header_format") << endmsg;
129 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
132 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
133 if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
134 Config->set_native_file_header_format (hf);
140 ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
142 const char* action = 0;
146 action = X_("FileDataFormatFloat");
149 action = X_("FileDataFormat24bit");
152 action = X_("FileDataFormat16bit");
155 fatal << string_compose (_("programming error: %1"), "illegal file data format in ::set_native_file_data_format") << endmsg;
159 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
162 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
163 if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
164 Config->set_native_file_data_format (sf);
170 ARDOUR_UI::set_input_auto_connect (AutoConnectOption option)
175 case AutoConnectPhysical:
176 action = X_("InputAutoConnectPhysical");
179 action = X_("InputAutoConnectManual");
182 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
185 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
187 if (ract && ract->get_active() && Config->get_input_auto_connect() != option) {
188 Config->set_input_auto_connect (option);
194 ARDOUR_UI::set_output_auto_connect (AutoConnectOption option)
199 case AutoConnectPhysical:
200 action = X_("OutputAutoConnectPhysical");
202 case AutoConnectMaster:
203 action = X_("OutputAutoConnectMaster");
206 action = X_("OutputAutoConnectManual");
209 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
212 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
214 if (ract && ract->get_active() && Config->get_output_auto_connect() != option) {
215 Config->set_output_auto_connect (option);
221 ARDOUR_UI::set_solo_model (SoloModel model)
223 const char* action = 0;
227 action = X_("SoloViaBus");
231 action = X_("SoloInPlace");
234 fatal << string_compose (_("programming error: unknown solo model in ARDOUR_UI::set_solo_model: %1"), model) << endmsg;
238 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
241 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
243 if (ract && ract->get_active() && Config->get_solo_model() != model) {
244 Config->set_solo_model (model);
251 ARDOUR_UI::set_remote_model (RemoteModel model)
253 const char* action = 0;
257 action = X_("RemoteUserDefined");
260 action = X_("RemoteMixerDefined");
263 action = X_("RemoteEditorDefined");
267 fatal << string_compose (_("programming error: unknown remote model in ARDOUR_UI::set_remote_model: %1"), model) << endmsg;
271 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
274 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
276 if (ract && ract->get_active() && Config->get_remote_model() != model) {
277 Config->set_remote_model (model);
284 ARDOUR_UI::set_monitor_model (MonitorModel model)
286 const char* action = 0;
289 case HardwareMonitoring:
290 action = X_("UseHardwareMonitoring");
293 case SoftwareMonitoring:
294 action = X_("UseSoftwareMonitoring");
296 case ExternalMonitoring:
297 action = X_("UseExternalMonitoring");
301 fatal << string_compose (_("programming error: unknown monitor model in ARDOUR_UI::set_monitor_model: %1"), model) << endmsg;
305 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
308 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
310 if (ract && ract->get_active() && Config->get_monitoring_model() != model) {
311 Config->set_monitoring_model (model);
318 ARDOUR_UI::set_denormal_model (DenormalModel model)
320 const char* action = 0;
324 action = X_("DenormalNone");
328 action = X_("DenormalFTZ");
332 action = X_("DenormalDAZ");
336 action = X_("DenormalFTZDAZ");
340 fatal << string_compose (_("programming error: unknown denormal model in ARDOUR_UI::set_denormal_model: %1"), model) << endmsg;
344 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
347 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
349 if (ract && ract->get_active() && Config->get_denormal_model() != model) {
350 Config->set_denormal_model (model);
357 ARDOUR_UI::toggle_auto_input ()
359 ActionManager::toggle_config_state ("Transport", "ToggleAutoInput", &Configuration::set_auto_input, &Configuration::get_auto_input);
363 ARDOUR_UI::toggle_auto_play ()
365 ActionManager::toggle_config_state ("Transport", "ToggleAutoPlay", &Configuration::set_auto_play, &Configuration::get_auto_play);
369 ARDOUR_UI::toggle_auto_return ()
371 ActionManager::toggle_config_state ("Transport", "ToggleAutoReturn", &Configuration::set_auto_return, &Configuration::get_auto_return);
375 ARDOUR_UI::toggle_click ()
377 ActionManager::toggle_config_state ("Transport", "ToggleClick", &Configuration::set_clicking, &Configuration::get_clicking);
381 ARDOUR_UI::unset_dual_punch ()
383 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
386 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
388 ignore_dual_punch = true;
389 tact->set_active (false);
390 ignore_dual_punch = false;
396 ARDOUR_UI::toggle_punch ()
398 if (ignore_dual_punch) {
402 Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
406 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
412 /* drive the other two actions from this one */
414 Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
415 Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
417 if (in_action && out_action) {
418 Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
419 Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
420 tiact->set_active (tact->get_active());
421 toact->set_active (tact->get_active());
427 ARDOUR_UI::toggle_punch_in ()
429 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchIn"));
434 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
439 if (tact->get_active() != Config->get_punch_in()) {
440 Config->set_punch_in (tact->get_active ());
443 if (tact->get_active()) {
444 /* if punch-in is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
445 to avoid confusing the user */
446 show_loop_punch_ruler_and_disallow_hide ();
449 reenable_hide_loop_punch_ruler_if_appropriate ();
453 ARDOUR_UI::toggle_punch_out ()
455 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchOut"));
460 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
465 if (tact->get_active() != Config->get_punch_out()) {
466 Config->set_punch_out (tact->get_active ());
469 if (tact->get_active()) {
470 /* if punch-out is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
471 to avoid confusing the user */
472 show_loop_punch_ruler_and_disallow_hide ();
474 reenable_hide_loop_punch_ruler_if_appropriate ();
478 ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide ()
480 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
485 act->set_sensitive (false);
487 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
492 if (!tact->get_active()) {
497 /* This is a bit of a silly name for a method */
499 ARDOUR_UI::reenable_hide_loop_punch_ruler_if_appropriate ()
501 if (!Config->get_punch_in() && !Config->get_punch_out()) {
502 /* if punch in/out are now both off, reallow hiding of the loop/punch ruler */
503 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
505 act->set_sensitive (true);
511 ARDOUR_UI::toggle_video_sync()
513 Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
515 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
516 Config->set_use_video_sync (tact->get_active());
521 ARDOUR_UI::toggle_editing_space()
523 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
525 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
526 if (tact->get_active()) {
527 maximise_editing_space ();
529 restore_editing_space ();
535 ARDOUR_UI::toggle_new_plugins_active ()
537 ActionManager::toggle_config_state ("options", "NewPluginsActive", &Configuration::set_new_plugins_active, &Configuration::get_new_plugins_active);
541 ARDOUR_UI::toggle_StopPluginsWithTransport()
543 ActionManager::toggle_config_state ("options", "StopPluginsWithTransport", &Configuration::set_plugins_stop_with_transport, &Configuration::get_plugins_stop_with_transport);
547 ARDOUR_UI::toggle_LatchedRecordEnable()
549 ActionManager::toggle_config_state ("options", "LatchedRecordEnable", &Configuration::set_latched_record_enable, &Configuration::get_latched_record_enable);
553 ARDOUR_UI::toggle_RegionEquivalentsOverlap()
555 ActionManager::toggle_config_state ("options", "RegionEquivalentsOverlap", &Configuration::set_use_overlap_equivalency, &Configuration::get_use_overlap_equivalency);
559 ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording()
561 ActionManager::toggle_config_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::set_do_not_record_plugins, &Configuration::get_do_not_record_plugins);
565 ARDOUR_UI::toggle_VerifyRemoveLastCapture()
567 ActionManager::toggle_config_state ("options", "VerifyRemoveLastCapture", &Configuration::set_verify_remove_last_capture, &Configuration::get_verify_remove_last_capture);
571 ARDOUR_UI::toggle_PeriodicSafetyBackups()
573 ActionManager::toggle_config_state ("options", "PeriodicSafetyBackups", &Configuration::set_periodic_safety_backups, &Configuration::get_periodic_safety_backups);
577 ARDOUR_UI::toggle_StopRecordingOnXrun()
579 ActionManager::toggle_config_state ("options", "StopRecordingOnXrun", &Configuration::set_stop_recording_on_xrun, &Configuration::get_stop_recording_on_xrun);
583 ARDOUR_UI::toggle_CreateXrunMarker()
585 ActionManager::toggle_config_state ("options", "CreateXrunMarker", &Configuration::set_create_xrun_marker, &Configuration::get_create_xrun_marker);
589 ARDOUR_UI::toggle_sync_order_keys ()
591 ActionManager::toggle_config_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::set_sync_all_route_ordering, &Configuration::get_sync_all_route_ordering);
595 ARDOUR_UI::toggle_StopTransportAtEndOfSession()
597 ActionManager::toggle_config_state ("options", "StopTransportAtEndOfSession", &Configuration::set_stop_at_session_end, &Configuration::get_stop_at_session_end);
601 ARDOUR_UI::toggle_GainReduceFastTransport()
603 ActionManager::toggle_config_state ("options", "GainReduceFastTransport", &Configuration::set_quieten_at_speed, &Configuration::get_quieten_at_speed);
607 ARDOUR_UI::toggle_LatchedSolo()
609 ActionManager::toggle_config_state ("options", "LatchedSolo", &Configuration::set_solo_latched, &Configuration::get_solo_latched);
613 ARDOUR_UI::toggle_ShowSoloMutes()
615 ActionManager::toggle_config_state ("options", "ShowSoloMutes", &Configuration::set_show_solo_mutes, &Configuration::get_show_solo_mutes);
619 ARDOUR_UI::toggle_SoloMuteOverride()
621 ActionManager::toggle_config_state ("options", "SoloMuteOverride", &Configuration::set_solo_mute_override, &Configuration::get_solo_mute_override);
625 ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor()
627 ActionManager::toggle_config_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::set_primary_clock_delta_edit_cursor, &Configuration::get_primary_clock_delta_edit_cursor);
631 ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor()
633 ActionManager::toggle_config_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::set_secondary_clock_delta_edit_cursor, &Configuration::get_secondary_clock_delta_edit_cursor);
637 ARDOUR_UI::toggle_ShowTrackMeters()
639 ActionManager::toggle_config_state ("options", "ShowTrackMeters", &Configuration::set_show_track_meters, &Configuration::get_show_track_meters);
643 ARDOUR_UI::toggle_TapeMachineMode ()
645 ActionManager::toggle_config_state ("options", "ToggleTapeMachineMode", &Configuration::set_tape_machine_mode, &Configuration::get_tape_machine_mode);
649 ARDOUR_UI::toggle_use_narrow_ms()
651 ActionManager::toggle_config_state ("options", "DefaultNarrowMS", &Configuration::set_default_narrow_ms, &Configuration::get_default_narrow_ms);
655 ARDOUR_UI::toggle_NameNewMarkers()
657 ActionManager::toggle_config_state ("options", "NameNewMarkers", &Configuration::set_name_new_markers, &Configuration::get_name_new_markers);
661 ARDOUR_UI::toggle_rubberbanding_snaps_to_grid ()
663 ActionManager::toggle_config_state ("options", "RubberbandingSnapsToGrid", &Configuration::set_rubberbanding_snaps_to_grid, &Configuration::get_rubberbanding_snaps_to_grid);
667 ARDOUR_UI::toggle_auto_analyse_audio ()
669 ActionManager::toggle_config_state ("options", "AutoAnalyseAudio", &Configuration::set_auto_analyse_audio, &Configuration::get_auto_analyse_audio);
673 ARDOUR_UI::mtc_port_changed ()
678 if (session->mtc_port()) {
687 positional_sync_strings.clear ();
688 positional_sync_strings.push_back (slave_source_to_string (None));
690 positional_sync_strings.push_back (slave_source_to_string (MTC));
692 positional_sync_strings.push_back (slave_source_to_string (JACK));
694 set_popdown_strings (sync_option_combo, positional_sync_strings);
698 ARDOUR_UI::setup_session_options ()
702 Config->ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
707 ARDOUR_UI::map_solo_model ()
711 if (Config->get_solo_model() == InverseMute) {
712 on = X_("SoloInPlace");
714 on = X_("SoloViaBus");
717 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
719 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
721 if (tact && !tact->get_active()) {
722 tact->set_active (true);
728 ARDOUR_UI::map_monitor_model ()
732 switch (Config->get_monitoring_model()) {
733 case HardwareMonitoring:
734 on = X_("UseHardwareMonitoring");
736 case SoftwareMonitoring:
737 on = X_("UseSoftwareMonitoring");
739 case ExternalMonitoring:
740 on = X_("UseExternalMonitoring");
744 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
746 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
748 if (tact && !tact->get_active()) {
749 tact->set_active (true);
755 ARDOUR_UI::map_denormal_protection ()
757 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("DenormalProtection"));
759 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
761 if (tact && !tact->get_active()) {
762 tact->set_active (Config->get_denormal_protection());
768 ARDOUR_UI::map_denormal_model ()
772 switch (Config->get_denormal_model()) {
774 on = X_("DenormalNone");
777 on = X_("DenormalFTZ");
780 on = X_("DenormalDAZ");
783 on = X_("DenormalFTZDAZ");
787 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
789 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
791 if (tact && !tact->get_active()) {
792 tact->set_active (true);
798 ARDOUR_UI::map_remote_model ()
802 switch (Config->get_remote_model()) {
804 on = X_("RemoteUserDefined");
807 on = X_("RemoteMixerDefined");
810 on = X_("RemoteEditorDefined");
814 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
816 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
818 if (tact && !tact->get_active()) {
819 tact->set_active (true);
825 ARDOUR_UI::map_file_header_format ()
827 const char* action = 0;
829 switch (Config->get_native_file_header_format()) {
831 action = X_("FileHeaderFormatBWF");
835 action = X_("FileHeaderFormatWAVE");
839 action = X_("FileHeaderFormatWAVE64");
843 action = X_("FileHeaderFormatiXML");
847 action = X_("FileHeaderFormatRF64");
851 action = X_("FileHeaderFormatCAF");
855 fatal << string_compose (_("programming error: unknown file header format passed to ARDOUR_UI::map_file_data_format: %1"),
856 Config->get_native_file_header_format()) << endmsg;
861 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
864 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
866 if (tact && !tact->get_active()) {
867 tact->set_active (true);
873 ARDOUR_UI::map_file_data_format ()
875 const char* action = 0;
877 switch (Config->get_native_file_data_format()) {
879 action = X_("FileDataFormatFloat");
883 action = X_("FileDataFormat24bit");
887 action = X_("FileDataFormat16bit");
891 fatal << string_compose (_("programming error: unknown file data format passed to ARDOUR_UI::map_file_data_format: %1"),
892 Config->get_native_file_data_format()) << endmsg;
897 Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
900 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
902 if (tact && !tact->get_active()) {
903 tact->set_active (true);
909 ARDOUR_UI::map_input_auto_connect ()
913 if (Config->get_input_auto_connect() == (AutoConnectOption) 0) {
914 on = "InputAutoConnectManual";
916 on = "InputAutoConnectPhysical";
919 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
921 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
923 if (tact && !tact->get_active()) {
924 tact->set_active (true);
930 ARDOUR_UI::map_output_auto_connect ()
934 if (Config->get_output_auto_connect() == (AutoConnectOption) 0) {
935 on = "OutputAutoConnectManual";
936 } else if (Config->get_output_auto_connect() == AutoConnectPhysical) {
937 on = "OutputAutoConnectPhysical";
939 on = "OutputAutoConnectMaster";
942 Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
944 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
946 if (tact && !tact->get_active()) {
947 tact->set_active (true);
953 ARDOUR_UI::map_only_copy_imported_files ()
955 Glib::RefPtr<Action> act = ActionManager::get_action ("options", X_("OnlyCopyImportedFiles"));
957 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
959 if (tact && !tact->get_active()) {
960 tact->set_active (Config->get_only_copy_imported_files());
967 ARDOUR_UI::map_meter_falloff ()
969 const char* action = X_("MeterFalloffMedium");
971 float val = Config->get_meter_falloff ();
972 MeterFalloff code = meter_falloff_from_float(val);
975 case MeterFalloffOff:
976 action = X_("MeterFalloffOff");
978 case MeterFalloffSlowest:
979 action = X_("MeterFalloffSlowest");
981 case MeterFalloffSlow:
982 action = X_("MeterFalloffSlow");
984 case MeterFalloffMedium:
985 action = X_("MeterFalloffMedium");
987 case MeterFalloffFast:
988 action = X_("MeterFalloffFast");
990 case MeterFalloffFaster:
991 action = X_("MeterFalloffFaster");
993 case MeterFalloffFastest:
994 action = X_("MeterFalloffFastest");
998 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1001 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1002 if (ract && !ract->get_active()) {
1003 ract->set_active (true);
1009 ARDOUR_UI::map_meter_hold ()
1011 const char* action = X_("MeterHoldMedium");
1013 /* XXX hack alert. Fix this. Please */
1015 float val = Config->get_meter_hold ();
1016 MeterHold code = (MeterHold) (int) (floor (val));
1020 action = X_("MeterHoldOff");
1022 case MeterHoldShort:
1023 action = X_("MeterHoldShort");
1025 case MeterHoldMedium:
1026 action = X_("MeterHoldMedium");
1029 action = X_("MeterHoldLong");
1033 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1036 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1037 if (ract && !ract->get_active()) {
1038 ract->set_active (true);
1044 ARDOUR_UI::set_meter_hold (MeterHold val)
1046 const char* action = 0;
1049 fval = meter_hold_to_float (val);
1053 action = X_("MeterHoldOff");
1055 case MeterHoldShort:
1056 action = X_("MeterHoldShort");
1058 case MeterHoldMedium:
1059 action = X_("MeterHoldMedium");
1062 action = X_("MeterHoldLong");
1066 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1069 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1070 if (ract && ract->get_active() && Config->get_meter_hold() != fval) {
1071 Config->set_meter_hold (fval);
1077 ARDOUR_UI::set_meter_falloff (MeterFalloff val)
1079 const char* action = 0;
1082 fval = meter_falloff_to_float (val);
1085 case MeterFalloffOff:
1086 action = X_("MeterFalloffOff");
1088 case MeterFalloffSlowest:
1089 action = X_("MeterFalloffSlowest");
1091 case MeterFalloffSlow:
1092 action = X_("MeterFalloffSlow");
1094 case MeterFalloffMedium:
1095 action = X_("MeterFalloffMedium");
1097 case MeterFalloffFast:
1098 action = X_("MeterFalloffFast");
1100 case MeterFalloffFaster:
1101 action = X_("MeterFalloffFaster");
1103 case MeterFalloffFastest:
1104 action = X_("MeterFalloffFastest");
1108 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), action);
1111 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
1112 if (ract && ract->get_active() && Config->get_meter_falloff () != fval) {
1113 Config->set_meter_falloff (fval);
1119 ARDOUR_UI::parameter_changed (const char* parameter_name)
1121 ENSURE_GUI_THREAD (bind (mem_fun (*this, &ARDOUR_UI::parameter_changed), parameter_name));
1123 #define PARAM_IS(x) (!strcmp (parameter_name, (x)))
1125 if (PARAM_IS ("slave-source")) {
1127 sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
1129 switch (Config->get_slave_source()) {
1131 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
1132 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
1136 /* XXX need to make auto-play is off as well as insensitive */
1137 ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
1138 ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
1142 } else if (PARAM_IS ("send-mtc")) {
1144 ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
1146 } else if (PARAM_IS ("send-mmc")) {
1149 ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
1151 } else if (PARAM_IS ("use-osc")) {
1154 if (Config->get_use_osc()) {
1161 ActionManager::map_some_state ("options", "UseOSC", &Configuration::get_use_osc);
1163 } else if (PARAM_IS ("seamless-loop")) {
1164 ActionManager::map_some_state ("options", "toggle-seamless-loop", &Configuration::get_seamless_loop);
1166 } else if (PARAM_IS ("mmc-control")) {
1167 ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
1169 } else if (PARAM_IS ("midi-feedback")) {
1170 ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);
1171 } else if (PARAM_IS ("do-not-record-plugins")) {
1172 ActionManager::map_some_state ("options", "DoNotRunPluginsWhileRecording", &Configuration::get_do_not_record_plugins);
1173 } else if (PARAM_IS ("latched-record-enable")) {
1174 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1175 } else if (PARAM_IS ("solo-latched")) {
1176 ActionManager::map_some_state ("options", "LatchedSolo", &Configuration::get_solo_latched);
1177 } else if (PARAM_IS ("show-solo-mutes")) {
1178 ActionManager::map_some_state ("options", "ShowSoloMutes", &Configuration::get_show_solo_mutes);
1179 } else if (PARAM_IS ("solo-mute-override")) {
1180 ActionManager::map_some_state ("options", "SoloMuteOverride", &Configuration::get_solo_mute_override);
1181 } else if (PARAM_IS ("solo-model")) {
1183 } else if (PARAM_IS ("auto-play")) {
1184 ActionManager::map_some_state ("Transport", "ToggleAutoPlay", &Configuration::get_auto_play);
1185 } else if (PARAM_IS ("auto-return")) {
1186 ActionManager::map_some_state ("Transport", "ToggleAutoReturn", &Configuration::get_auto_return);
1187 } else if (PARAM_IS ("auto-input")) {
1188 ActionManager::map_some_state ("Transport", "ToggleAutoInput", &Configuration::get_auto_input);
1189 } else if (PARAM_IS ("tape-machine-mode")) {
1190 ActionManager::map_some_state ("options", "ToggleTapeMachineMode", &Configuration::get_tape_machine_mode);
1191 } else if (PARAM_IS ("punch-out")) {
1192 ActionManager::map_some_state ("Transport", "TogglePunchOut", &Configuration::get_punch_out);
1193 if (!Config->get_punch_out()) {
1194 unset_dual_punch ();
1196 } else if (PARAM_IS ("punch-in")) {
1197 ActionManager::map_some_state ("Transport", "TogglePunchIn", &Configuration::get_punch_in);
1198 if (!Config->get_punch_in()) {
1199 unset_dual_punch ();
1201 } else if (PARAM_IS ("clicking")) {
1202 ActionManager::map_some_state ("Transport", "ToggleClick", &Configuration::get_clicking);
1203 } else if (PARAM_IS ("jack-time-master")) {
1204 ActionManager::map_some_state ("Transport", "ToggleTimeMaster", &Configuration::get_jack_time_master);
1205 } else if (PARAM_IS ("plugins-stop-with-transport")) {
1206 ActionManager::map_some_state ("options", "StopPluginsWithTransport", &Configuration::get_plugins_stop_with_transport);
1207 } else if (PARAM_IS ("new-plugins-active")) {
1208 ActionManager::map_some_state ("options", "NewPluginsActive", &Configuration::get_new_plugins_active);
1209 } else if (PARAM_IS ("latched-record-enable")) {
1210 ActionManager::map_some_state ("options", "LatchedRecordEnable", &Configuration::get_latched_record_enable);
1211 } else if (PARAM_IS ("verify-remove-last-capture")) {
1212 ActionManager::map_some_state ("options", "VerifyRemoveLastCapture", &Configuration::get_verify_remove_last_capture);
1213 } else if (PARAM_IS ("periodic-safety-backups")) {
1214 ActionManager::map_some_state ("options", "PeriodicSafetyBackups", &Configuration::get_periodic_safety_backups);
1215 } else if (PARAM_IS ("stop-recording-on-xrun")) {
1216 ActionManager::map_some_state ("options", "StopRecordingOnXrun", &Configuration::get_stop_recording_on_xrun);
1217 } else if (PARAM_IS ("create-xrun-marker")) {
1218 ActionManager::map_some_state ("options", "CreateXrunMarker", &Configuration::get_create_xrun_marker);
1219 } else if (PARAM_IS ("sync-all-route-ordering")) {
1220 ActionManager::map_some_state ("options", "SyncEditorAndMixerTrackOrder", &Configuration::get_sync_all_route_ordering);
1221 } else if (PARAM_IS ("stop-at-session-end")) {
1222 ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
1223 } else if (PARAM_IS ("monitoring-model")) {
1224 map_monitor_model ();
1225 } else if (PARAM_IS ("denormal-model")) {
1226 map_denormal_model ();
1227 } else if (PARAM_IS ("denormal-protection")) {
1228 map_denormal_protection ();
1229 } else if (PARAM_IS ("remote-model")) {
1230 map_remote_model ();
1231 } else if (PARAM_IS ("use-video-sync")) {
1232 ActionManager::map_some_state ("Transport", "ToggleVideoSync", &Configuration::get_use_video_sync);
1233 } else if (PARAM_IS ("quieten-at-speed")) {
1234 ActionManager::map_some_state ("options", "GainReduceFastTransport", &Configuration::get_quieten_at_speed);
1235 } else if (PARAM_IS ("shuttle-behaviour")) {
1237 switch (Config->get_shuttle_behaviour ()) {
1239 shuttle_style_button.set_active_text (_("sprung"));
1240 shuttle_fract = 0.0;
1241 shuttle_box.queue_draw ();
1243 if (session->transport_rolling()) {
1244 shuttle_fract = SHUTTLE_FRACT_SPEED1;
1245 session->request_transport_speed (1.0);
1250 shuttle_style_button.set_active_text (_("wheel"));
1254 } else if (PARAM_IS ("shuttle-units")) {
1256 switch (Config->get_shuttle_units()) {
1258 shuttle_units_button.set_label("% ");
1261 shuttle_units_button.set_label(_("ST"));
1264 } else if (PARAM_IS ("input-auto-connect")) {
1265 map_input_auto_connect ();
1266 } else if (PARAM_IS ("output-auto-connect")) {
1267 map_output_auto_connect ();
1268 } else if (PARAM_IS ("native-file-header-format")) {
1269 map_file_header_format ();
1270 } else if (PARAM_IS ("native-file-data-format")) {
1271 map_file_data_format ();
1272 } else if (PARAM_IS ("meter-hold")) {
1274 } else if (PARAM_IS ("meter-falloff")) {
1275 map_meter_falloff ();
1276 } else if (PARAM_IS ("video-pullup") || PARAM_IS ("smpte-format")) {
1278 primary_clock.set (session->audible_frame(), true);
1279 secondary_clock.set (session->audible_frame(), true);
1281 primary_clock.set (0, true);
1282 secondary_clock.set (0, true);
1284 } else if (PARAM_IS ("use-overlap-equivalency")) {
1285 ActionManager::map_some_state ("options", "RegionEquivalentsOverlap", &Configuration::get_use_overlap_equivalency);
1286 } else if (PARAM_IS ("primary-clock-delta-edit-cursor")) {
1287 ActionManager::map_some_state ("options", "PrimaryClockDeltaEditCursor", &Configuration::get_primary_clock_delta_edit_cursor);
1288 } else if (PARAM_IS ("secondary-clock-delta-edit-cursor")) {
1289 ActionManager::map_some_state ("options", "SecondaryClockDeltaEditCursor", &Configuration::get_secondary_clock_delta_edit_cursor);
1290 } else if (PARAM_IS ("only-copy-imported-files")) {
1291 map_only_copy_imported_files ();
1292 } else if (PARAM_IS ("show-track-meters")) {
1293 ActionManager::map_some_state ("options", "ShowTrackMeters", &Configuration::get_show_track_meters);
1294 editor->toggle_meter_updating();
1295 } else if (PARAM_IS ("default-narrow_ms")) {
1296 ActionManager::map_some_state ("options", "DefaultNarrowMS", &Configuration::get_default_narrow_ms);
1297 } else if (PARAM_IS ("rubberbanding-snaps-to-grid")) {
1298 ActionManager::map_some_state ("options", "RubberbandingSnapsToGrid", &Configuration::get_rubberbanding_snaps_to_grid);