First appearance of MIDI edit tool bar. Toggles when delete held, but otherwise...
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 7f0ddeef78f04ea00686229f4b4e714f1c9b3d7f..41665cffbbd71799e3ec3c438c5263d90895a26e 100644 (file)
 */
 
 #include <pbd/pathscanner.h>
+#include <pbd/fpu.h>
+
+#include <glibmm/miscutils.h>
 
 #include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/window_title.h>
 
 #include "ardour_ui.h"
 #include "public_editor.h"
@@ -34,6 +38,7 @@
 #include "actions.h"
 
 #include <ardour/session.h>
+#include <ardour/profile.h>
 #include <ardour/audioengine.h>
 #include <ardour/control_protocol_manager.h>
 
@@ -75,7 +80,6 @@ ARDOUR_UI::install_actions ()
        /* menus + submenus that need action items */
 
        ActionManager::register_action (main_actions, X_("Session"), _("Session"));
-       ActionManager::register_action (main_actions, X_("Export"), _("Export"));
        ActionManager::register_action (main_actions, X_("Cleanup"), _("Cleanup"));
        ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
        ActionManager::register_action (main_actions, X_("Options"), _("Options"));
@@ -86,9 +90,11 @@ ARDOUR_UI::install_actions ()
        ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header"));
        ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data"));
        ActionManager::register_action (main_actions, X_("ControlSurfaces"), _("Control Surfaces"));
+       ActionManager::register_action (main_actions, X_("Plugins"), _("Plugins"));
        ActionManager::register_action (main_actions, X_("Metering"), _("Metering"));
        ActionManager::register_action (main_actions, X_("MeteringFallOffRate"), _("Fall off rate"));
        ActionManager::register_action (main_actions, X_("MeteringHoldTime"), _("Hold Time"));
+       ActionManager::register_action (main_actions, X_("Denormals"), _("Denormal Handling"));
 
        /* the real actions */
 
@@ -104,7 +110,7 @@ ARDOUR_UI::install_actions ()
        ActionManager::session_sensitive_actions.push_back (act);
 
        
-       /* <CMT Additions> */
+#ifdef WITH_CMT
 
        PathScanner scanner;
        vector<string*>* results = scanner (getenv ("PATH"), "AniComp", false, false);
@@ -117,7 +123,7 @@ ARDOUR_UI::install_actions ()
                delete results;
        }
 
-       /* </CMT Additions> */
+#endif
 
        act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot"),  mem_fun(*this, &ARDOUR_UI::snapshot_session));
        ActionManager::session_sensitive_actions.push_back (act);
@@ -199,7 +205,7 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
        ActionManager::session_sensitive_actions.push_back (act);
        act = ActionManager::register_action (common_actions, X_("About"), _("About"),  mem_fun(*this, &ARDOUR_UI::show_splash));
-       act = ActionManager::register_toggle_action (common_actions, X_("ToggleColorManager"), _("Colors"), mem_fun(*this, &ARDOUR_UI::toggle_color_manager));
+       act = ActionManager::register_toggle_action (common_actions, X_("ToggleThemeManager"), _("Theme Manager"), mem_fun(*this, &ARDOUR_UI::toggle_theme_manager));
        ActionManager::session_sensitive_actions.push_back (act);
        act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("Add Audio Track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal, 1));
        ActionManager::session_sensitive_actions.push_back (act);
@@ -394,8 +400,6 @@ ARDOUR_UI::install_actions ()
        ActionManager::session_sensitive_actions.push_back (act);
        act = ActionManager::register_toggle_action (option_actions, X_("SendMIDIfeedback"), _("Send MIDI feedback"), mem_fun (*this, &ARDOUR_UI::toggle_send_midi_feedback));
        ActionManager::session_sensitive_actions.push_back (act);
-       act = ActionManager::register_toggle_action (option_actions, X_("UseMIDIcontrol"), _("Use MIDI control"), mem_fun (*this, &ARDOUR_UI::toggle_use_midi_control));
-       ActionManager::session_sensitive_actions.push_back (act);
 
        act = ActionManager::register_toggle_action (option_actions, X_("UseOSC"), _("Use OSC"), mem_fun (*this, &ARDOUR_UI::toggle_use_osc));
 #ifndef HAVE_LIBLO
@@ -404,11 +408,35 @@ ARDOUR_UI::install_actions ()
 
        ActionManager::register_toggle_action (option_actions, X_("StopPluginsWithTransport"), _("Stop plugins with transport"), mem_fun (*this, &ARDOUR_UI::toggle_StopPluginsWithTransport));
        ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture));
+       ActionManager::register_toggle_action (option_actions, X_("PeriodicSafetyBackups"), _("Make periodic safety backups"), mem_fun (*this, &ARDOUR_UI::toggle_PeriodicSafetyBackups));
        ActionManager::register_toggle_action (option_actions, X_("StopRecordingOnXrun"), _("Stop recording on xrun"), mem_fun (*this, &ARDOUR_UI::toggle_StopRecordingOnXrun));
        ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession));
        ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
        ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
        ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
+       ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor));
+       ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor));      
+
+       RadioAction::Group denormal_group;
+
+       ActionManager::register_toggle_action (option_actions, X_("DenormalProtection"), _("Use DC bias"), mem_fun (*this, &ARDOUR_UI::toggle_denormal_protection));
+       
+       FPU fpu;
+
+       ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalNone"), _("No processor handling"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalNone));
+
+       act = ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalFTZ"), _("Use FlushToZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZ));
+       if (!fpu.has_flush_to_zero()) {
+               act->set_sensitive (false);
+       }
+       act = ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalDAZ"), _("Use DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalDAZ));
+       if (!fpu.has_denormals_are_zero()) {
+               act->set_sensitive (false);
+       }
+       act = ActionManager::register_radio_action (option_actions, denormal_group, X_("DenormalFTZDAZ"), _("Use FlushToZero & DenormalsAreZero"), bind (mem_fun (*this, &ARDOUR_UI::set_denormal_model), DenormalFTZDAZ));
+       if (!fpu.has_flush_to_zero() || !fpu.has_denormals_are_zero()) {
+               act->set_sensitive (false);
+       }
 
        act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
        ActionManager::session_sensitive_actions.push_back (act);
@@ -418,6 +446,11 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
        ActionManager::session_sensitive_actions.push_back (act);
 
+       act = ActionManager::register_action (option_actions, X_("DisableAllPlugins"), _("Disable All Plugins"), mem_fun (*this, &ARDOUR_UI::disable_all_plugins));
+       ActionManager::session_sensitive_actions.push_back (act);
+       act = ActionManager::register_action (option_actions, X_("ABAllPlugins"), _("A/B All Plugins"), mem_fun (*this, &ARDOUR_UI::ab_all_plugins));
+       ActionManager::session_sensitive_actions.push_back (act);
+
        /* !!! REMEMBER THAT RADIO ACTIONS HAVE TO BE HANDLED WITH MORE FINESSE THAN SIMPLE TOGGLES !!! */
 
        RadioAction::Group meter_falloff_group;
@@ -449,6 +482,7 @@ ARDOUR_UI::install_actions ()
 
        act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormatFloat"), X_("32-bit floating point"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatFloat));
        act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat24bit"), X_("24-bit signed integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt24));
+       act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat16bit"), X_("16-bit signed integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt16));
 
        RadioAction::Group monitoring_group;
 
@@ -676,8 +710,11 @@ ARDOUR_UI::build_menu_bar ()
         * until the Menu GObject class is registered, which happens
         * when the first menu instance is created.
         */
-       Gtk::Settings::get_default()->property_gtk_can_change_accels() = true;  
-       
+       // XXX bug in gtkmm causes this to popup an error message
+       // Gtk::Settings::get_default()->property_gtk_can_change_accels() = true;       
+       // so use this instead ...
+       gtk_settings_set_long_property (gtk_settings_get_default(), "gtk-can-change-accels", 1, "Ardour:designers");
+
        wall_clock_box.add (wall_clock_label);
        wall_clock_box.set_name ("WallClock");
        wall_clock_label.set_name ("WallClock");
@@ -699,11 +736,13 @@ ARDOUR_UI::build_menu_bar ()
        sample_rate_label.set_name ("SampleRate");
 
        menu_hbox.pack_start (*menu_bar, true, true);
-       menu_hbox.pack_end (wall_clock_box, false, false, 10);
-       menu_hbox.pack_end (disk_space_box, false, false, 10);
-       menu_hbox.pack_end (cpu_load_box, false, false, 10);
-       menu_hbox.pack_end (buffer_load_box, false, false, 10);
-       menu_hbox.pack_end (sample_rate_box, false, false, 10);
+       if (!Profile->get_small_screen()) {
+               menu_hbox.pack_end (wall_clock_box, false, false, 2);
+               menu_hbox.pack_end (disk_space_box, false, false, 4);
+       }
+       menu_hbox.pack_end (cpu_load_box, false, false, 4);
+       menu_hbox.pack_end (buffer_load_box, false, false, 4);
+       menu_hbox.pack_end (sample_rate_box, false, false, 4);
 
        menu_bar_base.set_name ("MainMenuBar");
        menu_bar_base.add (menu_hbox);
@@ -718,7 +757,10 @@ ARDOUR_UI::setup_clock ()
        
        big_clock_window->set_border_width (0);
        big_clock_window->add  (big_clock);
-       big_clock_window->set_title (_("ardour: clock"));
+
+       WindowTitle title(Glib::get_application_name());
+       title += _("Clock");
+       big_clock_window->set_title (title.get_string());
        big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
        big_clock_window->signal_realize().connect (bind (sigc::ptr_fun (set_decoration), big_clock_window,  (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
        big_clock_window->signal_unmap().connect (bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleBigClock")));