13
0

Transmit MTC on playhead drag, as per #3239.

git-svn-id: svn://localhost/ardour2/branches/3.0@7389 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-07-07 23:48:46 +00:00
parent 28e3215afa
commit 10ef65b696
5 changed files with 11 additions and 8 deletions

View File

@ -2138,7 +2138,9 @@ 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()->send_mmc_locate (_editor->playhead_cursor->current_frame);
nframes64_t const f = _editor->playhead_cursor->current_frame;
_editor->session()->send_mmc_locate (f);
_editor->session()->send_full_time_code (f);
}

View File

@ -783,6 +783,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<SessionPlaylists> playlists;
void send_mmc_locate (nframes64_t);
int send_full_time_code (nframes64_t);
protected:
friend class AudioEngine;
@ -1133,7 +1134,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
bool _send_timecode_update; ///< Flag to send a full frame (Timecode) MTC message this cycle
int send_full_time_code(nframes_t nframes);
int send_midi_time_code_for_cycle(nframes_t nframes);
nframes_t adjust_apparent_position (nframes_t frames);

View File

@ -345,9 +345,10 @@ Session::mmc_record_enable (MIDI::MachineControl &mmc, size_t trk, bool enabled)
/** Send MTC Full Frame message (complete Timecode time) for the start of this cycle.
* This resets the MTC code, the next quarter frame message that is sent will be
* the first one with the beginning of this cycle as the new start point.
* @param t time to send.
*/
int
Session::send_full_time_code(nframes_t /*nframes*/)
Session::send_full_time_code (nframes64_t const t)
{
/* This function could easily send at a given frame offset, but would
* that be useful? Does ardour do sub-block accurate locating? [DR] */
@ -361,11 +362,11 @@ Session::send_full_time_code(nframes_t /*nframes*/)
return 0;
}
// Get timecode time for this transport frame
sample_to_timecode(_transport_frame, timecode, true /* use_offset */, false /* no subframes */);
// Get timecode time for the given time
sample_to_timecode (t, timecode, true /* use_offset */, false /* no subframes */);
transmitting_timecode_time = timecode;
outbound_mtc_timecode_frame = _transport_frame;
outbound_mtc_timecode_frame = t;
// I don't understand this bit yet.. [DR]
if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {

View File

@ -268,7 +268,7 @@ Session::process_with_events (nframes_t nframes)
* on locates (and allow slow slaves to position and prepare for rolling)
*/
if (_send_timecode_update) {
send_full_time_code(nframes);
send_full_time_code (_transport_frame);
}
if (!process_can_proceed()) {

View File

@ -562,7 +562,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
have_looped = false;
send_full_time_code (0);
send_full_time_code (_transport_frame);
if ((ptw & PostTransportLocate) && get_record_enabled()) {
/* capture start has been changed, so save pending state */