summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-05 01:13:36 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-05 01:13:36 +0000
commitc36132271b9c217af2242fc490b0cd05ce9a641d (patch)
treef9fee41a1943beb7eec68fdfc37569f9d9e3cf28 /libs
parent82167000805df6924b16ced23c79edfe4934a3b7 (diff)
Do MMC on playhead drag more efficiently by not doing an actual locate.
git-svn-id: svn://localhost/ardour2/branches/3.0@7370 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/session_transport.cc16
2 files changed, 12 insertions, 6 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 4e2f116697..77b75a819a 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -788,6 +788,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<SessionPlaylists> playlists;
+ void send_mmc_locate (nframes64_t);
+
protected:
friend class AudioEngine;
void set_block_size (nframes_t nframes);
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 8af9f0ca7b..cc90dc3c7d 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -183,11 +183,9 @@ Session::realtime_stop (bool abort, bool clear_state)
// FIXME: where should this really be? [DR]
//send_full_time_code();
- Timecode::Time time;
- timecode_time_subframes (_transport_frame, time);
_mmc->send (MIDI::MachineControlCommand (MIDI::MachineControl::cmdStop));
- _mmc->send (MIDI::MachineControlCommand (time));
+ send_mmc_locate (_transport_frame);
if (_transport_speed < 0.0f) {
todo = (PostTransportWork (todo | PostTransportStop | PostTransportReverse));
@@ -896,9 +894,7 @@ Session::locate (nframes64_t target_frame, bool with_roll, bool with_flush, bool
_send_timecode_update = true;
if (with_mmc) {
- Timecode::Time time;
- timecode_time_subframes (_transport_frame, time);
- _mmc->send (MIDI::MachineControlCommand (time));
+ send_mmc_locate (_transport_frame);
}
Located (); /* EMIT SIGNAL */
@@ -1568,3 +1564,11 @@ Session::maybe_stop (nframes_t limit)
}
return false;
}
+
+void
+Session::send_mmc_locate (nframes64_t t)
+{
+ Timecode::Time time;
+ timecode_time_subframes (t, time);
+ _mmc->send (MIDI::MachineControlCommand (time));
+}