diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-17 14:10:27 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-09-17 14:10:27 +0000 |
commit | 9bca2cd6f869c7651418b21d0523ed6ac19390cc (patch) | |
tree | 2f7234d65a63d4dbf78b07dadada16a2dc2cf8fe /libs | |
parent | 58c2acc99ef442f1a7627d6746f10084889f478a (diff) |
more NSD hacks, including a new exception thrown when loading a session at a different SR than JACK, and the user opts not to load it
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5672 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 6 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 42095004fc..eb806c8b7f 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -656,6 +656,12 @@ class Session : public PBD::StatefulDestructible static sigc::signal<int,nframes_t, nframes_t> AskAboutSampleRateMismatch; + class SRMismatchRejected : public std::exception { + public: + SRMismatchRejected () {} + const char* what() const throw() { return "Sample rate mismatch rejected"; } + }; + /* handlers should return !0 for use pending state, 0 for ignore it. */ diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6e13e3977f..537086bc9e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1158,10 +1158,10 @@ Session::set_state (const XMLNode& node) if ((prop = node.property (X_("sample-rate"))) != 0) { _nominal_frame_rate = atoi (prop->value()); - + if (_nominal_frame_rate != _current_frame_rate) { if (AskAboutSampleRateMismatch (_nominal_frame_rate, _current_frame_rate)) { - return -1; + throw SRMismatchRejected(); } } } |