reinstante code to setup latency related stuff after plugin changes etc (removed when back-porting 3.0 code)

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@10107 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-09-21 16:46:02 +00:00
parent 42d8e5ddc1
commit 29a3ff4aa2
3 changed files with 30 additions and 2 deletions

View file

@ -169,6 +169,8 @@ class AudioEngine : public sigc::trackable
int reset_timebase ();
void update_latencies ();
/* start/stop freewheeling */
int freewheel (bool onoff);

View file

@ -1432,3 +1432,12 @@ AudioEngine::port_is_mine (const string& portname) const
}
return true;
}
void
AudioEngine::update_latencies ()
{
if (jack_recompute_total_latencies) {
GET_PRIVATE_JACK_POINTER (_jack);
jack_recompute_total_latencies (_priv_jack);
}
}

View file

@ -4413,6 +4413,8 @@ Session::sync_order_keys (const char* base)
void
Session::update_latency (bool playback)
{
// cerr << "::update latency (playback = " << playback << ")\n";
if (_state_of_the_state & (InitialConnecting|Deletion)) {
return;
}
@ -4535,7 +4537,7 @@ Session::set_worst_playback_latency ()
_worst_output_latency = max (_worst_output_latency, (*i)->output_latency());
}
cerr << "Session: worst output latency = " << _worst_output_latency << endl;
// cerr << "Session: worst output latency = " << _worst_output_latency << endl;
}
void
@ -4557,7 +4559,7 @@ Session::set_worst_capture_latency ()
_worst_input_latency = max (_worst_input_latency, (*i)->input_latency());
}
cerr << "Session: worst input latency = " << _worst_input_latency << endl;
// cerr << "Session: worst input latency = " << _worst_input_latency << endl;
}
void
@ -4583,5 +4585,20 @@ Session::update_latency_compensation (bool force_whole_graph)
_worst_track_latency = max (tl, _worst_track_latency);
}
}
if (some_track_latency_changed || force_whole_graph) {
_engine.update_latencies ();
}
set_worst_io_latencies ();
/* reflect any changes in latencies into capture offsets
*/
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
(*i)->set_capture_offset ();
}
}