fix up and re-enable MTC transmission
git-svn-id: svn://localhost/ardour2/branches/3.0@3158 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d9faaed2c1
commit
4808f7fe8b
@ -748,22 +748,17 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
|
|||||||
assert (next_quarter_frame_to_send >= 0);
|
assert (next_quarter_frame_to_send >= 0);
|
||||||
assert (next_quarter_frame_to_send <= 7);
|
assert (next_quarter_frame_to_send <= 7);
|
||||||
|
|
||||||
if (next_quarter_frame_to_send < 0)
|
|
||||||
{
|
|
||||||
printf("Negative????\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_mtc_port == 0 || !session_send_mtc || transmitting_smpte_time.negative
|
if (_mtc_port == 0 || !session_send_mtc || transmitting_smpte_time.negative
|
||||||
/*|| (next_quarter_frame_to_send < 0)*/ ) {
|
/*|| (next_quarter_frame_to_send < 0)*/ ) {
|
||||||
//printf("(MTC) Not sending MTC\n");
|
// cerr << "(MTC) Not sending MTC\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Duration of one quarter frame */
|
/* Duration of one quarter frame */
|
||||||
nframes_t quarter_frame_duration = ((long) _frames_per_smpte_frame) >> 2;
|
nframes_t quarter_frame_duration = ((long) _frames_per_smpte_frame) >> 2;
|
||||||
|
|
||||||
//cerr << "(MTC) TR: " << _transport_frame << " - SF: " << outbound_mtc_smpte_frame
|
// cerr << "(MTC) TR: " << _transport_frame << " - SF: " << outbound_mtc_smpte_frame
|
||||||
//<< " - NQ: " << next_quarter_frame_to_send << " - FD" << quarter_frame_duration << endl;
|
// << " - NQ: " << next_quarter_frame_to_send << " - FD" << quarter_frame_duration << endl;
|
||||||
|
|
||||||
// FIXME: this should always be true
|
// FIXME: this should always be true
|
||||||
//assert((outbound_mtc_smpte_frame + (next_quarter_frame_to_send * quarter_frame_duration))
|
//assert((outbound_mtc_smpte_frame + (next_quarter_frame_to_send * quarter_frame_duration))
|
||||||
@ -773,8 +768,8 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
|
|||||||
// Send quarter frames for this cycle
|
// Send quarter frames for this cycle
|
||||||
while (_transport_frame + nframes > (outbound_mtc_smpte_frame +
|
while (_transport_frame + nframes > (outbound_mtc_smpte_frame +
|
||||||
(next_quarter_frame_to_send * quarter_frame_duration))) {
|
(next_quarter_frame_to_send * quarter_frame_duration))) {
|
||||||
|
|
||||||
//cerr << "(MTC) Next frame to send: " << next_quarter_frame_to_send << endl;
|
// cerr << "(MTC) Next frame to send: " << next_quarter_frame_to_send << endl;
|
||||||
|
|
||||||
switch (next_quarter_frame_to_send) {
|
switch (next_quarter_frame_to_send) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -335,7 +335,9 @@ Session::process_with_events (nframes_t nframes)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_midi_time_code_for_cycle(nframes);
|
if (!_exporting) {
|
||||||
|
send_midi_time_code_for_cycle(nframes);
|
||||||
|
}
|
||||||
|
|
||||||
if (actively_recording()) {
|
if (actively_recording()) {
|
||||||
stop_limit = max_frames;
|
stop_limit = max_frames;
|
||||||
@ -754,8 +756,6 @@ Session::process_without_events (nframes_t nframes)
|
|||||||
if (!follow_slave (nframes, 0)) {
|
if (!follow_slave (nframes, 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_midi_time_code_for_cycle(nframes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_transport_speed == 0) {
|
if (_transport_speed == 0) {
|
||||||
@ -763,6 +763,10 @@ Session::process_without_events (nframes_t nframes)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_exporting) {
|
||||||
|
send_midi_time_code_for_cycle(nframes);
|
||||||
|
}
|
||||||
|
|
||||||
if (actively_recording()) {
|
if (actively_recording()) {
|
||||||
stop_limit = max_frames;
|
stop_limit = max_frames;
|
||||||
} else {
|
} else {
|
||||||
|
@ -352,7 +352,7 @@ Session::second_stage_init (bool new_session)
|
|||||||
|
|
||||||
BootMessage (_("Reset Remote Controls"));
|
BootMessage (_("Reset Remote Controls"));
|
||||||
|
|
||||||
//send_full_time_code ();
|
send_full_time_code (0);
|
||||||
_engine.transport_locate (0);
|
_engine.transport_locate (0);
|
||||||
deliver_mmc (MIDI::MachineControl::cmdMmcReset, 0);
|
deliver_mmc (MIDI::MachineControl::cmdMmcReset, 0);
|
||||||
deliver_mmc (MIDI::MachineControl::cmdLocate, 0);
|
deliver_mmc (MIDI::MachineControl::cmdLocate, 0);
|
||||||
|
@ -113,7 +113,7 @@ JACK_MidiPort::flush (void* jack_port_buffer)
|
|||||||
non_process_thread_fifo.get_read_vector (&vec);
|
non_process_thread_fifo.get_read_vector (&vec);
|
||||||
|
|
||||||
if (vec.len[0] + vec.len[1]) {
|
if (vec.len[0] + vec.len[1]) {
|
||||||
cerr << "Flush " << vec.len[0] + vec.len[1] << "events from non-process FIFO\n";
|
cerr << "Flush " << vec.len[0] + vec.len[1] << " events from non-process FIFO\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vec.len[0]) {
|
if (vec.len[0]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user