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
This commit is contained in:
Carl Hetherington 2010-07-05 01:13:36 +00:00
parent 8216700080
commit c36132271b
3 changed files with 13 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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));
}