add notification if Engine Rate changes and mismatches session's SR
This commit is contained in:
parent
888614b714
commit
b2149de37b
|
@ -726,6 +726,9 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
|
|||
*/
|
||||
static PBD::Signal2<int, framecnt_t, framecnt_t> AskAboutSampleRateMismatch;
|
||||
|
||||
/** non interactive message */
|
||||
static PBD::Signal2<void, framecnt_t, framecnt_t> NotifyAboutSampleRateMismatch;
|
||||
|
||||
/** handlers should return !0 for use pending state, 0 for ignore it.
|
||||
*/
|
||||
static PBD::Signal0<int> AskAboutPendingState;
|
||||
|
|
|
@ -131,6 +131,7 @@ PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired;
|
|||
PBD::Signal1<void,std::string> Session::Dialog;
|
||||
PBD::Signal0<int> Session::AskAboutPendingState;
|
||||
PBD::Signal2<int, framecnt_t, framecnt_t> Session::AskAboutSampleRateMismatch;
|
||||
PBD::Signal2<void, framecnt_t, framecnt_t> Session::NotifyAboutSampleRateMismatch;
|
||||
PBD::Signal0<void> Session::SendFeedback;
|
||||
PBD::Signal3<int,Session*,std::string,DataType> Session::MissingFile;
|
||||
|
||||
|
@ -2027,6 +2028,9 @@ Session::set_frame_rate (framecnt_t frames_per_second)
|
|||
if (_base_frame_rate == 0) {
|
||||
_base_frame_rate = frames_per_second;
|
||||
}
|
||||
else if (_base_frame_rate != frames_per_second && frames_per_second != _nominal_frame_rate) {
|
||||
NotifyAboutSampleRateMismatch (_base_frame_rate, frames_per_second);
|
||||
}
|
||||
_nominal_frame_rate = frames_per_second;
|
||||
|
||||
sync_time_vars();
|
||||
|
|
|
@ -1316,8 +1316,9 @@ Session::set_state (const XMLNode& node, int version)
|
|||
_base_frame_rate = atoi (prop->value());
|
||||
_nominal_frame_rate = _base_frame_rate;
|
||||
|
||||
if (_nominal_frame_rate != _current_frame_rate) {
|
||||
boost::optional<int> r = AskAboutSampleRateMismatch (_nominal_frame_rate, _current_frame_rate);
|
||||
assert (AudioEngine::instance()->running ());
|
||||
if (_base_frame_rate != AudioEngine::instance()->sample_rate ()) {
|
||||
boost::optional<int> r = AskAboutSampleRateMismatch (_base_frame_rate, _current_frame_rate);
|
||||
if (r.get_value_or (0)) {
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue