summaryrefslogtreecommitdiff
path: root/libs/ardour/session_transport.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-03-14 20:33:47 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-03-14 20:33:47 +0000
commit1e4c1388c32d76c99f111b58b0820b8d1ecd6fbe (patch)
treeae68797a5b31834935cf3030ddb0a4e3028a4966 /libs/ardour/session_transport.cc
parent06b4092ad0a564b9560f34635942b8ecb73d7cca (diff)
more fun and games with latency compensation, and so forth ... not done yet
git-svn-id: svn://localhost/ardour2/branches/3.0@9149 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_transport.cc')
-rw-r--r--libs/ardour/session_transport.cc70
1 files changed, 6 insertions, 64 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 26a4592f0e..252262efcd 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -490,7 +490,11 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
if (_engine.running()) {
- update_latency_compensation (true, abort);
+ PostTransportWork ptw = post_transport_work ();
+ for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
+ (*i)->nonrealtime_handle_transport_stopped (abort, (ptw & PostTransportLocate), (!(ptw & PostTransportLocate) || pending_locate_flush));
+ }
+ update_latency_compensation ();
}
bool const auto_return_enabled =
@@ -1461,73 +1465,11 @@ Session::route_processors_changed (RouteProcessorChange c)
return;
}
- update_latency_compensation (false, false);
+ update_latency_compensation ();
resort_routes ();
}
void
-Session::update_latency_compensation (bool with_stop, bool abort, bool force_whole_graph)
-{
- bool update_jack = false;
- PostTransportWork ptw;
-
- if (_state_of_the_state & Deletion) {
- return;
- }
-
- _worst_track_latency = 0;
- ptw = post_transport_work();
-
- DEBUG_TRACE(DEBUG::Latency, "---------------------------- update latency compensation\n\n")
-
- boost::shared_ptr<RouteList> r = routes.reader ();
-
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
-
- if (with_stop) {
- (*i)->nonrealtime_handle_transport_stopped (abort, (ptw & PostTransportLocate), (!(ptw & PostTransportLocate) || pending_locate_flush));
- }
-
- framecnt_t old_latency = (*i)->signal_latency ();
- framecnt_t new_latency = (*i)->update_signal_latency ();
-
- if (old_latency != new_latency) {
- update_jack = true;
- }
-
- if (!(*i)->is_hidden() && ((*i)->active())) {
- _worst_track_latency = max (_worst_track_latency, new_latency);
- }
- }
-
- if (force_whole_graph || update_jack) {
- /* trigger a full recompute of latency numbers for the graph
- */
- _engine.update_total_latencies ();
- }
-
- DEBUG_TRACE(DEBUG::Latency, string_compose("worst case route internal latency was %1\n", _worst_track_latency));
-
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- (*i)->set_latency_compensation (_worst_track_latency);
- }
-
- set_worst_io_latencies ();
-
- /* reflect any changes in latencies into capture offsets
- */
-
- 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) {
- tr->set_capture_offset ();
- }
- }
- DEBUG_TRACE(DEBUG::Latency, "---------------------------- DONE update latency compensation\n\n")
-}
-
-void
Session::allow_auto_play (bool yn)
{
auto_play_legal = yn;