diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 13:17:53 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 15:17:42 -0400 |
commit | 56465fda106a7350741d476282abee68da94b9bb (patch) | |
tree | 1cd16f7b2247170dd85a4a333d8a61b308eb8df2 /libs/ardour | |
parent | cd6a9cfe38e78665e9de8c51392098bcbf4cc39b (diff) |
move engine dialog from a widget to an actual dialog; emit Session::AudioEngineSetupRequired when loading a session if it is necessary
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/session.h | 5 | ||||
-rw-r--r-- | libs/ardour/session.cc | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index ded5a07f91..7ef7fde07a 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -555,6 +555,11 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi int remove_last_capture (); + /** handlers should return 0 for "everything OK", and any other value for + * "cannot setup audioengine". + */ + static PBD::Signal0<int> AudioEngineSetupRequired; + /** handlers should return -1 for "stop cleanup", 0 for "yes, delete this playlist", 1 for "no, don't delete this playlist". diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 4dc5a07a77..2d57fcfba8 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -106,6 +106,7 @@ using namespace PBD; bool Session::_disable_all_loaded_plugins = false; +PBD::Signal0<int> Session::AudioEngineSetupRequired; PBD::Signal1<void,std::string> Session::Dialog; PBD::Signal0<int> Session::AskAboutPendingState; PBD::Signal2<int, framecnt_t, framecnt_t> Session::AskAboutSampleRateMismatch; @@ -154,6 +155,17 @@ Session::Session (AudioEngine &eng, , _have_rec_enabled_track (false) , _suspend_timecode_transmission (0) { + if (_engine.current_backend() == 0 || _engine.setup_required()) { + boost::optional<int> r = AudioEngineSetupRequired (); + if (r.get_value_or (-1) != 0) { + throw failed_constructor(); + } + } + + if (!_engine.connected()) { + throw failed_constructor(); + } + _locations = new Locations (*this); ltc_encoder = NULL; @@ -175,10 +187,6 @@ Session::Session (AudioEngine &eng, interpolation.add_channel_to (0, 0); - if (!eng.connected()) { - throw failed_constructor(); - } - n_physical_outputs = _engine.n_physical_outputs (); n_physical_inputs = _engine.n_physical_inputs (); |