Do MMC on playhead drag more efficiently by not doing an actual locate.
authorCarl Hetherington <carl@carlh.net>
Mon, 5 Jul 2010 01:13:36 +0000 (01:13 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 5 Jul 2010 01:13:36 +0000 (01:13 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7370 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_drag.cc
libs/ardour/ardour/session.h
libs/ardour/session_transport.cc

index e447e894dc7e4f33b00d94d47fcece1f1880332a..b01c79ad916cee972b5b0bdfdaad176859857c9a 100644 (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);
        }
        
 
index 4e2f116697e4f6fcbfd5a40a2af00446ab3657e1..77b75a819a60bddc905c34f275c8fa206f677f1d 100644 (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);
index 8af9f0ca7b772fd32e590dbcec017e908e08c534..cc90dc3c7d3674aae6c7b95ba419565ed6ad6a93 100644 (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));
+}