Update sae bindings and menus.
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index cfdabc5b3a6afb3db9ae276898f3451fe7def6b9..7c00d89ec12667981c95c44554664441fd179ecd 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/window_title.h>
+#include <gtk/gtk.h>
 
 #include "ardour_ui.h"
 #include "public_editor.h"
@@ -73,6 +74,7 @@ ARDOUR_UI::create_editor ()
        }
 
        editor->Realized.connect (mem_fun (*this, &ARDOUR_UI::editor_realized));
+       editor->signal_window_state_event().connect (sigc::bind (mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), true));
 
        return 0;
 }
@@ -193,7 +195,7 @@ ARDOUR_UI::install_actions ()
        
        common_actions = ActionGroup::create (X_("Common"));
        ActionManager::register_action (main_actions, X_("WindowMenu"), _("Window"));
-       ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (mem_fun(*this, &ARDOUR_UI::finish)));
+       ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (hide_return (mem_fun(*this, &ARDOUR_UI::finish))));
 
         /* windows visibility actions */
 
@@ -201,6 +203,7 @@ ARDOUR_UI::install_actions ()
 
        ActionManager::register_action (common_actions, X_("goto-editor"), _("Show Editor"),  mem_fun(*this, &ARDOUR_UI::goto_editor_window));
        ActionManager::register_action (common_actions, X_("goto-mixer"), _("Show Mixer"),  mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
+       ActionManager::register_action (common_actions, X_("toggle-editor-mixer-on-top"), _("Toggle Editor Mixer on Top"),  mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer_on_top));
        ActionManager::register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Preferences"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
        act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Track/Bus Inspector"), mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
        ActionManager::session_sensitive_actions.push_back (act);
@@ -301,6 +304,9 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_action (transport_actions, X_("GotoEnd"), _("Goto End"), mem_fun(*this, &ARDOUR_UI::transport_goto_end));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
+       act = ActionManager::register_action (transport_actions, X_("GotoWallClock"), _("Goto Wall Clock"), mem_fun(*this, &ARDOUR_UI::transport_goto_wallclock));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::transport_sensitive_actions.push_back (act);
 
        act = ActionManager::register_action (transport_actions, X_("focus-on-clock"), _("Focus On Clock"), mem_fun(primary_clock, &AudioClock::focus));
        ActionManager::session_sensitive_actions.push_back (act);
@@ -456,6 +462,7 @@ ARDOUR_UI::install_actions ()
        ActionManager::register_toggle_action (option_actions, X_("AutoAnalyseAudio"), _("Auto-analyse new audio"), mem_fun (*this, &ARDOUR_UI::toggle_auto_analyse_audio));
 
        ActionManager::register_toggle_action (option_actions, X_("DefaultNarrowMS"), _("Use narrow mixer strips"), mem_fun (*this, &ARDOUR_UI::toggle_use_narrow_ms));
+       ActionManager::register_toggle_action (option_actions, X_("NameNewMarkers"), _("Name New Markers"), mem_fun (*this, &ARDOUR_UI::toggle_NameNewMarkers));
 
        RadioAction::Group denormal_group;
 
@@ -533,15 +540,24 @@ ARDOUR_UI::install_actions ()
 
        RadioAction::Group file_data_group;
 
+
        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 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 integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt16));
 
        RadioAction::Group monitoring_group;
 
-       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseHardwareMonitoring"), _("Hardware monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), HardwareMonitoring));
-       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseSoftwareMonitoring"), _("Software monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), SoftwareMonitoring));
-       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseExternalMonitoring"), _("External monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), ExternalMonitoring));
+       /* it would be nice not to even show this item, but that messes up the 
+          menus which are not dynamically modified at runtime. so we make it
+          sensitive only if it makes sense.
+       */
+
+       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseHardwareMonitoring"), _("JACK does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), HardwareMonitoring));
+       if (!engine->can_request_hardware_monitoring()) {
+               act->set_sensitive (false);
+       }
+       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseSoftwareMonitoring"), _("Ardour does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), SoftwareMonitoring));
+       act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseExternalMonitoring"), _("Audio Hardware does monitoring"), bind (mem_fun (*this, &ARDOUR_UI::set_monitor_model), ExternalMonitoring));
 
        RadioAction::Group solo_group;
 
@@ -843,3 +859,16 @@ ARDOUR_UI::setup_clock ()
 
        manage_window (*big_clock_window);
 }
+
+void
+ARDOUR_UI::float_big_clock (Gtk::Window* parent)
+{
+       if (big_clock_window) {
+               if (parent) {
+                       big_clock_window->set_transient_for (*parent);
+               } else {
+                       gtk_window_set_transient_for (big_clock_window->gobj(), (GtkWindow*) 0);
+               }
+       }
+}
+