}
void
-ARDOUR_UI::update_autosave ()
+ARDOUR_UI::session_dirty_changed ()
{
- ENSURE_GUI_THREAD (*this, &ARDOUR_UI::update_autosave)
+ update_autosave ();
+ update_title ();
+}
+void
+ARDOUR_UI::update_autosave ()
+{
if (_session && _session->dirty()) {
if (_autosave_connection.connected()) {
_autosave_connection.disconnect();
void update_autosave();
sigc::connection _autosave_connection;
+ void session_dirty_changed ();
+ void update_title ();
+
void map_transport_state ();
int32_t do_engine_start ();
#include "pbd/error.h"
#include "pbd/basename.h"
#include "pbd/fastlog.h"
-#include <gtkmm2ext/cairocell.h>
-#include <gtkmm2ext/utils.h>
-#include <gtkmm2ext/click_box.h>
-#include <gtkmm2ext/tearoff.h>
+
+#include "gtkmm2ext/cairocell.h"
+#include "gtkmm2ext/utils.h"
+#include "gtkmm2ext/click_box.h"
+#include "gtkmm2ext/tearoff.h"
+#include "gtkmm2ext/window_title.h"
#include "ardour/profile.h"
#include "ardour/session.h"
UIConfiguration::instance().set_follow_edits (tact->get_active ());
}
+void
+ARDOUR_UI::update_title ()
+{
+ if (_session) {
+ bool dirty = _session->dirty();
+ string session_name;
+
+ if (_session->snap_name() != _session->name()) {
+ session_name = _session->snap_name();
+ } else {
+ session_name = _session->name();
+ }
+
+ if (dirty) {
+ session_name = "*" + session_name;
+ }
+
+ WindowTitle title (session_name);
+ title += Glib::get_application_name();
+ _main_window.set_title (title.get_string());
+ } else {
+ WindowTitle title (Glib::get_application_name());
+ _main_window.set_title (title.get_string());
+ }
+}
_session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
_session->StepEditStatusChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::step_edit_status_change, this, _1), gui_context());
_session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());
- _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_autosave, this), gui_context());
+ _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dirty_changed, this), gui_context());
_session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
_session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
editor_meter_peak_display.show();
}
}
+
+ update_title ();
}
int
session_loaded = false;
update_buffer_load ();
-
+ update_title ();
+
return 0;
}