copy contents of analysis, plugins, automation and externals folders during save-as
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 7c3db7a7e3d6bab572dc6bf46c497e8dd250cb4e..53b309609b6dc5860408854ede94e1157035931f 100644 (file)
@@ -495,6 +495,8 @@ ARDOUR_UI::build_menu_bar ()
        timecode_format_label.set_use_markup ();
        cpu_load_label.set_name ("CPULoad");
        cpu_load_label.set_use_markup ();
+       xrun_label.set_name ("XrunLabel");
+       xrun_label.set_use_markup ();
        buffer_load_label.set_name ("BufferLoad");
        buffer_load_label.set_use_markup ();
        sample_rate_label.set_name ("SampleRate");
@@ -523,6 +525,7 @@ ARDOUR_UI::build_menu_bar ()
 
        hbox->pack_end (wall_clock_label, false, false, 2);
        hbox->pack_end (disk_space_label, false, false, 4);
+       hbox->pack_end (xrun_label, false, false, 4);
        hbox->pack_end (cpu_load_label, false, false, 4);
        hbox->pack_end (buffer_load_label, false, false, 4);
        hbox->pack_end (sample_rate_label, false, false, 4);
@@ -539,12 +542,14 @@ ARDOUR_UI::build_menu_bar ()
 #endif
        _status_bar_visibility.add (&disk_space_label,      X_("Disk"),      _("Disk Space"), disk_space);
        _status_bar_visibility.add (&cpu_load_label,        X_("DSP"),       _("DSP"), true);
+       _status_bar_visibility.add (&xrun_label,            X_("XRun"),      _("X-run"), false);
        _status_bar_visibility.add (&buffer_load_label,     X_("Buffers"),   _("Buffers"), true);
        _status_bar_visibility.add (&sample_rate_label,     X_("Audio"),     _("Audio"), true);
        _status_bar_visibility.add (&timecode_format_label, X_("TCFormat"),  _("Timecode Format"), true);
        _status_bar_visibility.add (&format_label,          X_("Format"),    _("File Format"), true);
 
        ev->signal_button_press_event().connect (sigc::mem_fun (_status_bar_visibility, &VisibilityGroup::button_press_event));
+       ev->signal_button_release_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::xrun_button_release));
 }
 
 void
@@ -660,6 +665,7 @@ ARDOUR_UI::resize_text_widgets ()
 {
        set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
        set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
+       set_size_request_to_display_given_text (xrun_label, "X: 9999", 2, 2);
 }
 
 void
@@ -670,3 +676,17 @@ ARDOUR_UI::focus_on_clock ()
                primary_clock->focus ();
        }
 }
+
+bool
+ARDOUR_UI::xrun_button_release (GdkEventButton* ev)
+{
+       if (ev->button != 1 || !Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
+               return false;
+       }
+
+       if (_session) {
+               _session->reset_xrun_count ();
+               update_xrun_count ();
+       }
+       return true;
+}