13
0

add handler for, and connect to, Session::SaveSessionRequested

This commit is contained in:
Paul Davis 2015-01-24 19:17:13 -05:00
parent ab3ec791ea
commit 0b5ceaca4e
3 changed files with 9 additions and 0 deletions

View File

@ -677,6 +677,13 @@ ARDOUR_UI::get_transport_controllable_state ()
return *node;
}
void
ARDOUR_UI::save_session_at_its_request (std::string snapshot_name)
{
if (_session) {
_session->save_state (snapshot_name);
}
}
gint
ARDOUR_UI::autosave_session ()

View File

@ -346,6 +346,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
int ask_about_saving_session (const std::vector<std::string>& actions);
void save_session_at_its_request (std::string);
/* periodic safety backup, to be precise */
gint autosave_session();
void update_autosave();

View File

@ -148,6 +148,7 @@ ARDOUR_UI::set_session (Session *s)
blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ARDOUR_UI::blink_handler));
_session->SaveSessionRequested.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::save_session_at_its_request, this, _1), 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->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());