From f11645528089bca423bd9594f918b95783c68dd6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 12 May 2015 10:16:26 -0400 Subject: [PATCH] after changing session SR, reset all write sources to use new rate --- libs/ardour/session.cc | 5 +++-- libs/ardour/session_state.cc | 14 ++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d88b3b8408..6fdf21a392 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1924,7 +1924,8 @@ Session::set_frame_rate (framecnt_t frames_per_second) sync_time_vars(); clear_clicks (); - + reset_write_sources (false); + // XXX we need some equivalent to this, somehow // SndFileSource::setup_standard_crossfades (frames_per_second); @@ -5012,12 +5013,12 @@ void Session::reset_native_file_format () { boost::shared_ptr rl = routes.reader (); + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); if (tr) { /* don't save state as we do this, there's no point */ - _state_of_the_state = StateOfTheState (_state_of_the_state|InCleanup); tr->reset_write_sources (false); _state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index eca01cbe99..f0045fb0c2 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1908,17 +1908,15 @@ Session::get_sources_as_xml () void Session::reset_write_sources (bool mark_write_complete, bool force) { - boost::shared_ptr rl = routes.reader(); - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); - if (tr) { - - // block state saving + boost::shared_ptr rl = routes.reader(); + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); + if (tr) { _state_of_the_state = StateOfTheState (_state_of_the_state|InCleanup); tr->reset_write_sources(mark_write_complete, force); _state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup); - } - } + } + } } int -- 2.30.2