Fix setup of gain envelope visible menu item.
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 156125e01c4b35e7d8183efd534df0eedd41dd84..382d8b7ca4716a6ad48fc594b70dfd135b28789b 100644 (file)
@@ -62,6 +62,7 @@
 #include "ardour/ardour.h"
 #include "ardour/callback.h"
 #include "ardour/profile.h"
+#include "ardour/plugin_manager.h"
 #include "ardour/session_directory.h"
 #include "ardour/session_route.h"
 #include "ardour/session_state_utils.h"
@@ -136,12 +137,12 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        : Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
 
        , gui_object_state (new GUIObjectState)
-       , primary_clock (new AudioClock (X_("primary"), false, X_("TransportClockDisplay"), true, true, false, true))
-       , secondary_clock (new AudioClock (X_("secondary"), false, X_("SecondaryClockDisplay"), true, true, false, true))
+       , primary_clock (new AudioClock (X_("primary"), false, X_("transport"), true, true, false, true))
+       , secondary_clock (new AudioClock (X_("secondary"), false, X_("secondary"), true, true, false, true))
 
          /* big clock */
 
-       , big_clock (new AudioClock (X_("bigclock"), false, "BigClockNonRecording", true, true, false, false))
+       , big_clock (new AudioClock (X_("bigclock"), false, "big", true, true, false, false))
 
          /* transport */
 
@@ -157,14 +158,14 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        , auto_play_button (ArdourButton::led_default_elements)
        , auto_input_button (ArdourButton::led_default_elements)
 
-       , time_master_button (_("time\nmaster"))
-
-       , auditioning_alert_button (_("AUDITION"))
-       , solo_alert_button (_("SOLO"))
+       , auditioning_alert_button (_("audition"))
+       , solo_alert_button (_("solo"))
+       , feedback_alert_button (_("feedback"))
 
        , error_log_button (_("Errors"))
 
        , _status_bar_visibility (X_("status-bar"))
+       , _feedback_exists (false)
 
 {
        using namespace Gtk::Menu_Helpers;
@@ -236,16 +237,11 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        play_selection_button.set_name ("transport button");
        rec_button.set_name ("transport recenable button");
        join_play_range_button.set_name ("transport button");
+       midi_panic_button.set_name ("transport button");
 
-       roll_button.set_tweaks (ArdourButton::ShowHover);
-       stop_button.set_tweaks (ArdourButton::ShowHover);
-       auto_loop_button.set_tweaks (ArdourButton::ShowHover);
-       play_selection_button.set_tweaks (ArdourButton::ShowHover);
-       rec_button.set_tweaks (ArdourButton::ShowHover);
-       join_play_range_button.set_tweaks (ArdourButton::ShowHover);
-
-       goto_start_button.set_tweaks (ArdourButton::Tweaks(ArdourButton::ShowClick|ArdourButton::ShowHover));
-       goto_end_button.set_tweaks (ArdourButton::Tweaks(ArdourButton::ShowClick|ArdourButton::ShowHover));
+       goto_start_button.set_tweaks (ArdourButton::ShowClick);
+       goto_end_button.set_tweaks (ArdourButton::ShowClick);
+       midi_panic_button.set_tweaks (ArdourButton::ShowClick);
        
        last_configure_time= 0;
        last_peak_grab = 0;
@@ -272,6 +268,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        /* tell the user about feedback */
 
        ARDOUR::Session::FeedbackDetected.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::feedback_detected, this), gui_context ());
+       ARDOUR::Session::SuccessfulGraphSort.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::successful_graph_sort, this), gui_context ());
 
        /* handle requests to deal with missing files */
 
@@ -343,6 +340,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        _process_thread = new ProcessThread ();
        _process_thread->init ();
+
+       DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
 }
 
 /** @return true if a session was chosen and `apply' clicked, otherwise false if `cancel' was clicked */
@@ -416,7 +415,10 @@ ARDOUR_UI::post_engine ()
 
        ARDOUR::init_post_engine ();
 
+       /* load up the UI manager */
+
        ActionManager::init ();
+
        _tooltips.enable();
 
        if (setup_windows ()) {
@@ -1019,29 +1021,29 @@ ARDOUR_UI::update_format ()
        }
 
        stringstream s;
-       s << "File: <span foreground=\"green\">";
+       s << _("File:") << X_(" <span foreground=\"green\">");
 
        switch (_session->config.get_native_file_header_format ()) {
        case BWF:
-               s << "BWF";
+               s << _("BWF");
                break;
        case WAVE:
-               s << "WAV";
+               s << _("WAV");
                break;
        case WAVE64:
-               s << "WAV64";
+               s << _("WAV64");
                break;
        case CAF:
-               s << "CAF";
+               s << _("CAF");
                break;
        case AIFF:
-               s << "AIFF";
+               s << _("AIFF");
                break;
        case iXML:
-               s << "iXML";
+               s << _("iXML");
                break;
        case RF64:
-               s << "RF64";
+               s << _("RF64");
                break;
        }
 
@@ -1049,17 +1051,17 @@ ARDOUR_UI::update_format ()
        
        switch (_session->config.get_native_file_data_format ()) {
        case FormatFloat:
-               s << "32-float";
+               s << _("32-float");
                break;
        case FormatInt24:
-               s << "24-int";
+               s << _("24-int");
                break;
        case FormatInt16:
-               s << "16-int";
+               s << _("16-int");
                break;
        }
 
-       s << "</span>";
+       s << X_("</span>");
 
        format_label.set_markup (s.str ());
 }
@@ -1069,7 +1071,7 @@ ARDOUR_UI::update_cpu_load ()
 {
        char buf[64];
 
-       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::build_menu_bar
+       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
           should also be changed.
        */
 
@@ -1086,7 +1088,7 @@ ARDOUR_UI::update_buffer_load ()
        uint32_t const playback = _session ? _session->playback_load () : 100;
        uint32_t const capture = _session ? _session->capture_load () : 100;
 
-       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::build_menu_bar
+       /* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
           should also be changed.
        */
        
@@ -1671,7 +1673,7 @@ ARDOUR_UI::transport_record (bool roll)
                switch (_session->record_status()) {
                case Session::Disabled:
                        if (_session->ntracks() == 0) {
-                               MessageDialog msg (*editor, _("Please create 1 or more track\nbefore trying to record.\nCheck the Session menu."));
+                               MessageDialog msg (*editor, _("Please create one or more tracks before trying to record.\nYou can do this with the \"Add Track or Bus\" option in the Session menu."));
                                msg.run ();
                                return;
                        }
@@ -2509,8 +2511,6 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s
                        bus_profile.input_ac = AutoConnectOption (0);
                }
 
-               /// @todo some minor tweaks.
-
                bus_profile.output_ac = AutoConnectOption (0);
 
                if (_startup->connect_outputs ()) {
@@ -3050,7 +3050,7 @@ ARDOUR_UI::display_cleanup_results (ARDOUR::CleanupReport& rep, const gchar* lis
                                    _("No files were ready for clean-up"),
                                    true,
                                    Gtk::MESSAGE_INFO,
-                                   (Gtk::ButtonsType)(Gtk::BUTTONS_OK)  );
+                                   Gtk::BUTTONS_OK);
                msgd.set_title (_("Clean-up"));
                msgd.set_secondary_text (_("If this seems suprising, \n\
 check for any existing snapshots.\n\
@@ -3176,7 +3176,7 @@ ARDOUR_UI::cleanup ()
        MessageDialog checker (_("Are you sure you want to clean-up?"),
                                true,
                                Gtk::MESSAGE_QUESTION,
-                               (Gtk::ButtonsType)(Gtk::BUTTONS_NONE));
+                               Gtk::BUTTONS_NONE);
 
        checker.set_title (_("Clean-up"));
 
@@ -3596,13 +3596,13 @@ void
 ARDOUR_UI::update_transport_clocks (framepos_t pos)
 {
        if (Config->get_primary_clock_delta_edit_cursor()) {
-               primary_clock->set (pos, false, editor->get_preferred_edit_position(), 1);
+               primary_clock->set (pos, false, editor->get_preferred_edit_position());
        } else {
-               primary_clock->set (pos, 0, true);
+               primary_clock->set (pos);
        }
 
        if (Config->get_secondary_clock_delta_edit_cursor()) {
-               secondary_clock->set (pos, false, editor->get_preferred_edit_position(), 2);
+               secondary_clock->set (pos, false, editor->get_preferred_edit_position());
        } else {
                secondary_clock->set (pos);
        }
@@ -3638,13 +3638,10 @@ ARDOUR_UI::record_state_changed ()
                return;
        }
 
-       Session::RecordState const r = _session->record_status ();
-       bool const h = _session->have_rec_enabled_track ();
-
-       if (r == Session::Recording && h)  {
-               big_clock->set_widget_name ("BigClockRecording");
+       if (_session->record_status () == Session::Recording && _session->have_rec_enabled_track ()) {
+               big_clock->set_active (true);
        } else {
-               big_clock->set_widget_name ("BigClockNonRecording");
+               big_clock->set_active (false);
        }
 }
 
@@ -3885,11 +3882,19 @@ ARDOUR_UI::drop_process_buffers ()
 void
 ARDOUR_UI::feedback_detected ()
 {
-       MessageDialog d (
-               _("Something you have just done has generated a feedback path within Ardour's "
-                 "routing.  Until this feedback is removed, Ardour's output will be as it was "
-                  "before you made the feedback-generating connection.")
-               );
+       _feedback_exists = true;
+}
+
+void
+ARDOUR_UI::successful_graph_sort ()
+{
+       _feedback_exists = false;
+}
 
-       d.run ();
+void
+ARDOUR_UI::midi_panic ()
+{
+       if (_session) {
+               _session->midi_panic();
+       }
 }