after changing session SR, reset all write sources to use new rate

This commit is contained in:
Paul Davis 2015-05-12 10:16:26 -04:00
parent c4e3135617
commit f116455280
2 changed files with 9 additions and 10 deletions

View File

@ -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<RouteList> rl = routes.reader ();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*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);

View File

@ -1908,17 +1908,15 @@ Session::get_sources_as_xml ()
void
Session::reset_write_sources (bool mark_write_complete, bool force)
{
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
if (tr) {
// block state saving
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*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