X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_midi.cc;h=6035a8a077e6976e7d44e7b09c69fbe84523e5cb;hb=932d6c79d01be93f491415ef1491bca17d92671f;hp=d8859e07c03ca0106201fd258acb946ebaad0b30;hpb=f450df300c9c057141a4caf79ff6dbfbf58492d9;p=ardour.git diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index d8859e07c0..6035a8a077 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -120,7 +120,7 @@ Session::set_mtc_port (string port_tag) if (port_tag.length() == 0) { if (_slave && ((ms = dynamic_cast (_slave)) != 0)) { - error << _("Ardour is slaved to MTC - port cannot be reset") << endmsg; + error << string_compose (_("%1 is slaved to MTC - port cannot be reset"), PROGRAM_NAME) << endmsg; return -1; } @@ -278,7 +278,7 @@ Session::set_midi_clock_port (string port_tag) if (port_tag.length() == 0) { if (_slave && ((ms = dynamic_cast (_slave)) != 0)) { - error << _("Ardour is slaved to MIDI Clock - port cannot be reset") << endmsg; + error << string_compose (_("%1 is slaved to MIDI Clock - port cannot be reset"), PROGRAM_NAME) << endmsg; return -1; } @@ -746,7 +746,7 @@ Session::send_full_time_code(nframes_t /*nframes*/) _send_timecode_update = false; - if (_mtc_port == 0 || !session_send_mtc) { + if (_mtc_port == 0 || !session_send_mtc || _slave) { return 0; } @@ -759,13 +759,12 @@ Session::send_full_time_code(nframes_t /*nframes*/) // I don't understand this bit yet.. [DR] if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) { // start MTC quarter frame transmission on an even frame - Timecode::increment( transmitting_timecode_time, config.get_subframes_per_frame() ); + Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame()); outbound_mtc_timecode_frame += (nframes_t) _frames_per_timecode_frame; } // Compensate for audio latency outbound_mtc_timecode_frame += _worst_output_latency; - next_quarter_frame_to_send = 0; // Sync slave to the same Timecode time as we are on @@ -781,8 +780,6 @@ Session::send_full_time_code(nframes_t /*nframes*/) msg[7] = timecode.seconds; msg[8] = timecode.frames; - cerr << "MTC: Sending full time code at " << outbound_mtc_timecode_frame << endl; - // Send message at offset 0, sent time is for the start of this cycle if (_mtc_port->midimsg (msg, sizeof (msg), 0)) { error << _("Session: could not send full MIDI time code") << endmsg; @@ -802,15 +799,14 @@ Session::send_full_time_code(nframes_t /*nframes*/) int Session::send_midi_time_code_for_cycle(nframes_t nframes) { - assert (next_quarter_frame_to_send >= 0); - assert (next_quarter_frame_to_send <= 7); - - if (_mtc_port == 0 || !session_send_mtc || transmitting_timecode_time.negative - /*|| (next_quarter_frame_to_send < 0)*/ ) { + if (_mtc_port == 0 || _slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) { // cerr << "(MTC) Not sending MTC\n"; return 0; } + assert (next_quarter_frame_to_send >= 0); + assert (next_quarter_frame_to_send <= 7); + /* Duration of one quarter frame */ nframes_t quarter_frame_duration = ((long) _frames_per_timecode_frame) >> 2;