#include "pbd/pthread_utils.h"
#include "ardour/configuration.h"
+#include "ardour/debug.h"
#include "ardour/audioengine.h"
#include "ardour/session.h"
#include "ardour/audio_track.h"
void
Session::spp_start (Parser &, nframes_t /*timestamp*/)
{
- if (Config->get_mmc_control() && (Config->get_slave_source() != MTC)) {
+ if (Config->get_mmc_control() && (!config.get_external_sync() || config.get_sync_source() != JACK)) {
request_transport_speed (1.0);
}
}
request_stop ();
}
}
-/*
-void
-Session::midi_clock_start (Parser& ignored, nframes_t timestamp)
-{
- if (Config->get_slave_source() == MIDIClock) {
- request_transport_speed (1.0);
- }
-}
-
-void
-Session::midi_clock_continue (Parser& parser, nframes_t timestamp)
-{
- midi_clock_start (parser, 0);
-}
-
-void
-Session::midi_clock_stop (Parser& ignored, nframes_t timestamp)
-{
- if (Config->get_slave_source() == MIDIClock) {
- request_stop ();
- }
-}
-*/
void
Session::mmc_deferred_play (MIDI::MachineControl &/*mmc*/)
{
- if (Config->get_mmc_control() && (Config->get_slave_source() != MTC)) {
+ if (Config->get_mmc_control() && (!config.get_external_sync() || (config.get_sync_source() != JACK))) {
request_transport_speed (1.0);
}
}
/* Duration of one quarter frame */
nframes_t quarter_frame_duration = ((long) _frames_per_timecode_frame) >> 2;
- // cerr << "(MTC) TR: " << _transport_frame << " - SF: " << outbound_mtc_timecode_frame
- // << " - NQ: " << next_quarter_frame_to_send << " - FD" << quarter_frame_duration << endl;
+ DEBUG_TRACE (DEBUG::MTC, string_compose ("TF %1 SF %2 NQ %3 FD %\4n", _transport_frame, outbound_mtc_timecode_frame,
+ next_quarter_frame_to_send, quarter_frame_duration));
// FIXME: this should always be true
//assert((outbound_mtc_timecode_frame + (next_quarter_frame_to_send * quarter_frame_duration))
while (_transport_frame + nframes > (outbound_mtc_timecode_frame +
(next_quarter_frame_to_send * quarter_frame_duration))) {
- // cerr << "(MTC) Next frame to send: " << next_quarter_frame_to_send << endl;
+ DEBUG_TRACE (DEBUG::MTC, string_compose ("next frame to send: %1\n", next_quarter_frame_to_send));
switch (next_quarter_frame_to_send) {
case 0:
return -1;
}
- /*cerr << "(MTC) Timecode: " << transmitting_timecode_time.hours
- << ":" << transmitting_timecode_time.minutes
- << ":" << transmitting_timecode_time.seconds
- << ":" << transmitting_timecode_time.frames
- << ", qfm = " << next_quarter_frame_to_send
- << ", stamp = " << out_stamp
- << ", delta = " << _transport_frame + out_stamp - last_time << endl;*/
+ DEBUG_STR_SET(foo,"sending ");
+ DEBUG_STR(foo) << transmitting_timecode_time;
+ DEBUG_TRACE (DEBUG::MTC, string_compose ("%1 qfm = %2, stamp = %3\n", DEBUG_STR(foo).str(), next_quarter_frame_to_send,
+ out_stamp));
// Increment quarter frame counter
next_quarter_frame_to_send++;