update main window title appropriately
This commit is contained in:
parent
d84f655495
commit
50e4ebff36
@ -800,11 +800,16 @@ ARDOUR_UI::autosave_session ()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::session_dirty_changed ()
|
||||||
|
{
|
||||||
|
update_autosave ();
|
||||||
|
update_title ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::update_autosave ()
|
ARDOUR_UI::update_autosave ()
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::update_autosave)
|
|
||||||
|
|
||||||
if (_session && _session->dirty()) {
|
if (_session && _session->dirty()) {
|
||||||
if (_autosave_connection.connected()) {
|
if (_autosave_connection.connected()) {
|
||||||
_autosave_connection.disconnect();
|
_autosave_connection.disconnect();
|
||||||
|
@ -396,6 +396,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||||||
void update_autosave();
|
void update_autosave();
|
||||||
sigc::connection _autosave_connection;
|
sigc::connection _autosave_connection;
|
||||||
|
|
||||||
|
void session_dirty_changed ();
|
||||||
|
void update_title ();
|
||||||
|
|
||||||
void map_transport_state ();
|
void map_transport_state ();
|
||||||
int32_t do_engine_start ();
|
int32_t do_engine_start ();
|
||||||
|
|
||||||
|
@ -32,10 +32,12 @@
|
|||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/basename.h"
|
#include "pbd/basename.h"
|
||||||
#include "pbd/fastlog.h"
|
#include "pbd/fastlog.h"
|
||||||
#include <gtkmm2ext/cairocell.h>
|
|
||||||
#include <gtkmm2ext/utils.h>
|
#include "gtkmm2ext/cairocell.h"
|
||||||
#include <gtkmm2ext/click_box.h>
|
#include "gtkmm2ext/utils.h"
|
||||||
#include <gtkmm2ext/tearoff.h>
|
#include "gtkmm2ext/click_box.h"
|
||||||
|
#include "gtkmm2ext/tearoff.h"
|
||||||
|
#include "gtkmm2ext/window_title.h"
|
||||||
|
|
||||||
#include "ardour/profile.h"
|
#include "ardour/profile.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
@ -795,4 +797,29 @@ ARDOUR_UI::toggle_follow_edits ()
|
|||||||
UIConfiguration::instance().set_follow_edits (tact->get_active ());
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -153,7 +153,7 @@ ARDOUR_UI::set_session (Session *s)
|
|||||||
_session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
|
_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->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->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->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());
|
_session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
|
||||||
@ -237,6 +237,8 @@ ARDOUR_UI::set_session (Session *s)
|
|||||||
editor_meter_peak_display.show();
|
editor_meter_peak_display.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_title ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -315,6 +317,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
|||||||
session_loaded = false;
|
session_loaded = false;
|
||||||
|
|
||||||
update_buffer_load ();
|
update_buffer_load ();
|
||||||
|
update_title ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user