derive ArdourButton LED inactive color from active color, rather than requiring expli...
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 03ca13745f0892021fe866d8df48a92e5bcd8887..f4c5bdd81c11cc8b799df8a7a21184e49f3f9b36 100644 (file)
@@ -150,7 +150,6 @@ using namespace Gtk;
 using namespace std;
 
 ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
-UIConfiguration *ARDOUR_UI::ui_config = 0;
 
 sigc::signal<void,bool> ARDOUR_UI::Blink;
 sigc::signal<void>      ARDOUR_UI::RapidScreenUpdate;
@@ -162,7 +161,7 @@ sigc::signal<void>      ARDOUR_UI::CloseAllDialogs;
 ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
 
        : Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
-       
+       , ui_config (new UIConfiguration)
        , gui_object_state (new GUIObjectState)
 
        , primary_clock (new MainClock (X_("primary"), false, X_("transport"), true, true, true, false, true))
@@ -233,8 +232,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
                theArdourUI = this;
        }
 
-       ui_config = new UIConfiguration();
-
        ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
        boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
        ui_config->map_parameters (pc);
@@ -575,9 +572,7 @@ ARDOUR_UI::post_engine ()
 
 ARDOUR_UI::~ARDOUR_UI ()
 {
-       if (ui_config->dirty()) {
-               ui_config->save_state();
-       }
+       ui_config->save_state();
 
        stop_video_server();
 
@@ -1307,7 +1302,7 @@ ARDOUR_UI::update_cpu_load ()
           should also be changed.
        */
 
-       float const c = AudioEngine::instance()->get_dsp_load ();
+       double const c = AudioEngine::instance()->get_dsp_load ();
        snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c);
        cpu_load_label.set_markup (buf);
 }
@@ -2280,7 +2275,7 @@ ARDOUR_UI::map_transport_state ()
 void
 ARDOUR_UI::update_clocks ()
 {
-       if (!editor || !editor->dragging_playhead()) {
+       if (editor && !editor->dragging_playhead()) {
                Clock (_session->audible_frame(), false, editor->get_preferred_edit_position()); /* EMIT_SIGNAL */
        }
 }
@@ -3902,8 +3897,8 @@ ARDOUR_UI::create_xrun_marker (framepos_t where)
 void
 ARDOUR_UI::halt_on_xrun_message ()
 {
-       MessageDialog msg (*editor,
-                          _("Recording was stopped because your system could not keep up."));
+        cerr << "HALT on xrun\n";
+       MessageDialog msg (*editor, _("Recording was stopped because your system could not keep up."));
        msg.run ();
 }
 
@@ -4029,6 +4024,8 @@ ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin, bool can_ca
                scan_dlg->get_vbox()->pack_start (*scan_tbox, PACK_SHRINK, 4);
        }
 
+       assert(scan_dlg && scan_tbox && cancel_button);
+
        if (type == X_("closeme")) {
                scan_dlg->hide();
        } else {