Fix crash when NullAutomation is created (which shouldn't be happening, but hey...).
[ardour.git] / gtk2_ardour / ardour_ui2.cc
index fcb721a9f05027262eb8ff9b7b2cd7627fc00dcf..60f390501e77195f236f3ccff469165612e47e2e 100644 (file)
@@ -115,7 +115,7 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuff
        } else if (strcmp (prefix, _("[INFO]: ")) == 0) {
                text = "<span color=\"green\" weight=\"bold\">";
        } else {
-               text = "<span color=\"blue\" weight=\"bold\">???";
+               text = "<span color=\"white\" weight=\"bold\">???";
        }
 
        text += prefix;
@@ -192,6 +192,10 @@ ARDOUR_UI::setup_transport ()
        transport_tearoff = manage (new TearOff (transport_tearoff_hbox));
        transport_tearoff->set_name ("TransportBase");
 
+       if (Profile->get_sae()) {
+               transport_tearoff->set_can_be_torn_off (false);
+       }
+
        transport_hbox.pack_start (*transport_tearoff, true, false);
 
        transport_base.set_name ("TransportBase");
@@ -316,6 +320,7 @@ ARDOUR_UI::setup_transport ()
 
        primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
        secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
+       big_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
 
        ARDOUR_UI::instance()->tooltips().set_tip (primary_clock, _("Primary clock"));
        ARDOUR_UI::instance()->tooltips().set_tip (secondary_clock, _("secondary clock"));
@@ -398,7 +403,9 @@ ARDOUR_UI::setup_transport ()
        transport_tearoff_hbox.pack_start (*svbox, false, false, 3);
 
        transport_tearoff_hbox.pack_start (auto_loop_button, false, false);
-       transport_tearoff_hbox.pack_start (play_selection_button, false, false);
+       if (!Profile->get_sae()) {
+               transport_tearoff_hbox.pack_start (play_selection_button, false, false);
+       }
        transport_tearoff_hbox.pack_start (roll_button, false, false);
        transport_tearoff_hbox.pack_start (stop_button, false, false);
        transport_tearoff_hbox.pack_start (rec_button, false, false, 6);
@@ -408,12 +415,16 @@ ARDOUR_UI::setup_transport ()
        if (!ARDOUR::Profile->get_small_screen()) {
                clock_box->pack_start (secondary_clock, false, false);
        }
-       VBox* time_controls_box = manage (new VBox);
-       time_controls_box->pack_start (sync_option_combo, false, false);
-       time_controls_box->pack_start (time_master_button, false, false);
-       clock_box->pack_start (*time_controls_box, false, false, 1);
+
+       if (!Profile->get_sae()) {
+               VBox* time_controls_box = manage (new VBox);
+               time_controls_box->pack_start (sync_option_combo, false, false);
+               time_controls_box->pack_start (time_master_button, false, false);
+               clock_box->pack_start (*time_controls_box, false, false, 1);
+       }
+
        transport_tearoff_hbox.pack_start (*clock_box, false, false, 0);
-       
+
        HBox* toggle_box = manage(new HBox);
        
        VBox* punch_box = manage (new VBox);
@@ -443,6 +454,11 @@ ARDOUR_UI::setup_transport ()
 
        transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
        transport_tearoff_hbox.pack_start (alert_box, false, false);
+       
+       if (Profile->get_sae()) {
+               Image* img = manage (new Image ((::get_icon (X_("sae")))));
+               transport_tearoff_hbox.pack_end (*img, false, false, 6);
+       }
 }
 
 void
@@ -744,17 +760,13 @@ ARDOUR_UI::set_shuttle_fract (double f)
 void
 ARDOUR_UI::use_shuttle_fract (bool force)
 {
-       struct timeval now;
-       struct timeval diff;
+       microseconds_t now = get_microseconds();
        
        /* do not attempt to submit a motion-driven transport speed request
           more than once per process cycle.
         */
 
-       gettimeofday (&now, 0);
-       timersub (&now, &last_shuttle_request, &diff);
-
-       if (!force && (diff.tv_usec + (diff.tv_sec * 1000000)) < engine->usecs_per_cycle()) {
+       if (!force && (last_shuttle_request - now) < (microseconds_t) engine->usecs_per_cycle()) {
                return;
        }
        
@@ -869,6 +881,8 @@ ARDOUR_UI::editor_realized ()
        set_size_request_to_display_given_text (speed_display_box, _("-0.55"), 2, 2);
        const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button
        set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10);
+       cerr << "I commented out line line 881 in ardour_ui2.cc, because it made ardour crash somewhere in Gnome::Canvas::Text" << endl;
+       //reset_dpi();
 }
 
 void