copy contents of analysis, plugins, automation and externals folders during save-as
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 0b237526ac7cddbe108248dac6deb483f7048faa..53b309609b6dc5860408854ede94e1157035931f 100644 (file)
@@ -138,14 +138,18 @@ ARDOUR_UI::install_actions ()
                                              sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
        act->set_sensitive (false);
        act = ActionManager::register_action (main_actions, X_("ExportVideo"), _("Export To Video File"),
-                       hide_return (sigc::bind (sigc::mem_fun(*editor, &PublicEditor::export_video), false)));
+                       hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::export_video), false)));
        ActionManager::session_sensitive_actions.push_back (act);
 
-       act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
+       act = ActionManager::register_action (main_actions, X_("SnapshotStay"), _("Snapshot (& keep working on current version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::write_sensitive_actions.push_back (act);
 
-       act = ActionManager::register_action (main_actions, X_("SaveAs"), _("Save As..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), true));
+       act = ActionManager::register_action (main_actions, X_("SnapshotSwitch"), _("Snapshot (& switch to new version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), true));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::write_sensitive_actions.push_back (act);
+
+       act = ActionManager::register_action (main_actions, X_("SaveAs"), _("Save As..."), sigc::mem_fun(*this, &ARDOUR_UI::save_session_as));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::write_sensitive_actions.push_back (act);
 
@@ -267,7 +271,7 @@ if (Profile->get_mixbus())
        act = ActionManager::register_action (transport_actions, X_("Loop"), _("Play Loop Range"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_auto_loop));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
-       act = ActionManager::register_action (transport_actions, X_("PlaySelection"), _("Play Selected Range"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_selection));
+       act = ActionManager::register_action (transport_actions, X_("PlaySelection"), _("Play Selection"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_selection));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
        act = ActionManager::register_action (transport_actions, X_("PlayPreroll"), _("Play Selection w/Preroll"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_preroll));
@@ -491,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");
@@ -514,29 +520,36 @@ ARDOUR_UI::build_menu_bar ()
 #endif
                disk_space = true;
        }
-       
+
+       hbox->pack_end (error_alert_button, false, false, 2);
+
        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);
        hbox->pack_end (timecode_format_label, false, false, 4);
        hbox->pack_end (format_label, false, false, 4);
 
-       menu_hbox.pack_end (*ev, false, false, 6);
+       menu_hbox.pack_end (*ev, false, false, 2);
 
        menu_bar_base.set_name ("MainMenuBar");
        menu_bar_base.add (menu_hbox);
 
+#ifndef GTKOSX
        _status_bar_visibility.add (&wall_clock_label,      X_("WallClock"), _("Wall Clock"), wall_clock);
+#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
@@ -652,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
@@ -662,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;
+}