summaryrefslogtreecommitdiff
path: root/libs/ardour/session_transport.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_transport.cc')
-rw-r--r--libs/ardour/session_transport.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 61a741d0fb..cc94595f8c 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -138,7 +138,7 @@ Session::realtime_stop (bool abort)
// FIXME: where should this really be? [DR]
//send_full_time_code();
- deliver_mmc (MIDI::MachineControl::cmdStop, _transport_frame);
+ deliver_mmc (MIDI::MachineControl::cmdStop, 0);
deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
if (_transport_speed < 0.0f) {
@@ -658,6 +658,25 @@ Session::start_locate (nframes_t target_frame, bool with_roll, bool with_flush,
}
}
+int
+Session::micro_locate (nframes_t distance)
+{
+ boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
+
+ for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
+ if (!(*i)->can_internal_playback_seek (distance)) {
+ return -1;
+ }
+ }
+
+ for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
+ (*i)->internal_playback_seek (distance);
+ }
+
+ _transport_frame += distance;
+ return 0;
+}
+
void
Session::locate (nframes_t target_frame, bool with_roll, bool with_flush, bool with_loop)
{
@@ -1314,6 +1333,11 @@ Session::update_latency_compensation (bool with_stop, bool abort)
_worst_track_latency = 0;
+#undef DEBUG_LATENCY
+#ifdef DEBUG_LATENCY
+ cerr << "\n---------------------------------\nUPDATE LATENCY\n";
+#endif
+
boost::shared_ptr<RouteList> r = routes.reader ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
@@ -1340,6 +1364,10 @@ Session::update_latency_compensation (bool with_stop, bool abort)
_engine.update_total_latencies ();
}
+#ifdef DEBUG_LATENCY
+ cerr << "\tworst was " << _worst_track_latency << endl;
+#endif
+
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
(*i)->set_latency_delay (_worst_track_latency);
}