diff options
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(); } } } |