Respond to JACK session quit request. Fixes #3491.
authorCarl Hetherington <carl@carlh.net>
Thu, 7 Oct 2010 12:12:16 +0000 (12:12 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 7 Oct 2010 12:12:16 +0000 (12:12 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7878 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
libs/ardour/ardour/session.h
libs/ardour/session.cc
libs/ardour/session_state.cc

index 85111c2b5354cd05ae0c521629057bf2b47f05af..df03e955fa3e77bf360973a2a9b10e5ae424b83e 100644 (file)
@@ -260,6 +260,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
        ARDOUR::Session::AskAboutSampleRateMismatch.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::sr_mismatch_dialog, this, _1, _2));
 
+       /* handle requests to quit (coming from JACK session) */
+       
+       ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::finish, this), gui_context ());
+
        /* lets get this party started */
 
        try {
index 93d15b843972fb83e24685692b4fc8355ffb4069..d10e01d18fec6f59e692afb51c878a2ec847b5a4 100644 (file)
@@ -785,6 +785,9 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void request_resume_timecode_transmission ();
        bool timecode_transmission_suspended () const;
 
+       /** Emitted when the session wants Ardour to quit */
+       static PBD::Signal0<void> Quit;
+
   protected:
        friend class AudioEngine;
        void set_block_size (nframes_t nframes);
index fb8649d1a02d5dbb41717a3c739b087de6e51bbd..8a3eb6a6c68c164a5932ac5ab4f3eecf6269d308 100644 (file)
@@ -125,6 +125,7 @@ PBD::Signal0<void> Session::AutoBindingOn;
 PBD::Signal0<void> Session::AutoBindingOff;
 PBD::Signal2<void,std::string, std::string> Session::Exported;
 PBD::Signal1<int,boost::shared_ptr<Playlist> > Session::AskAboutPlaylistDeletion;
+PBD::Signal0<void> Session::Quit;
 
 static void clean_up_session_event (SessionEvent* ev) { delete ev; }
 const SessionEvent::RTeventCallback Session::rt_cleanup (clean_up_session_event);
index 097fd2a1160baff6760fffb6535c38ac63e21378..4ae40653295d7cf10da0606ac0a299eb572d9a37 100644 (file)
@@ -746,7 +746,7 @@ Session::jack_session_event (jack_session_event_t * event)
        jack_session_reply (_engine.jack(), event);
 
        if (event->type == JackSessionSaveAndQuit) {
-                // TODO: make ardour quit.
+               Quit (); /* EMIT SIGNAL */
        }
 
        jack_session_event_free( event );