diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-21 16:46:02 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-09-21 16:46:02 +0000 |
commit | 29a3ff4aa267e8eee6e437bf3a1842a3a2beeeae (patch) | |
tree | 0268e2ffb8cde0983eb6e44d3b6f068e32139e5c /libs | |
parent | 42d8e5ddc107675c19a95ed3d68e3d8219629e10 (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 2 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 9 | ||||
-rw-r--r-- | libs/ardour/session.cc | 21 |
3 files changed, 30 insertions, 2 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 7325c13592..e855411a48 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -169,6 +169,8 @@ class AudioEngine : public sigc::trackable int reset_timebase (); + void update_latencies (); + /* start/stop freewheeling */ int freewheel (bool onoff); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 7b519a9ddb..bbe188590d 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -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); + } +} diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 11ba8682c7..5f38fb7a0b 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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 (); + } } |