summaryrefslogtreecommitdiff
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
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
-rw-r--r--gtk2_ardour/editor_drag.cc3
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/session_transport.cc16
3 files changed, 13 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index e447e894dc..b01c79ad91 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -2138,8 +2138,7 @@ CursorDrag::motion (GdkEvent* event, bool)
_editor->show_verbose_time_cursor (_cursor->current_frame, 10);
if (_editor->session() && _item == &_editor->playhead_cursor->canvas_item) {
- _editor->session()->request_locate (_editor->playhead_cursor->current_frame, false);
- _editor->_pending_locate_request = true;
+ _editor->session()->send_mmc_locate (_editor->playhead_cursor->current_frame);
}
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));
+}