summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-13 21:22:39 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-13 21:22:39 +0000
commitb092902d8aa87adc461731235b405bc8bc46fa7c (patch)
treeaac1882b216cb47ac918be22e4af337e0222c196 /libs
parent8811175c992d8a2f23fe5dd9dbb3a3335e4f985c (diff)
MTC-continue-when-looping patch from carl (#1875). note - apparently not needed in 3.0
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5771 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/ardour/session_events.cc2
-rw-r--r--libs/ardour/session_midi.cc10
-rw-r--r--libs/ardour/session_process.cc8
-rw-r--r--libs/ardour/session_transport.cc2
6 files changed, 19 insertions, 7 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 90badcf9a4..dc9c4701b6 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1376,6 +1376,8 @@ class Session : public PBD::StatefulDestructible
nframes_t last_smpte_when;
SMPTE::Time last_smpte;
+ bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
+
int send_full_time_code ();
int send_midi_time_code ();
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index ef8d53b4bd..ef926b241f 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -284,6 +284,7 @@ Session::Session (AudioEngine &eng,
state_tree (0),
butler_mixdown_buffer (0),
butler_gain_buffer (0),
+ _send_smpte_update (false),
midi_thread (pthread_t (0)),
midi_requests (128), // the size of this should match the midi request pool size
diskstreams (new DiskstreamList),
@@ -355,6 +356,7 @@ Session::Session (AudioEngine &eng,
state_tree (0),
butler_mixdown_buffer (0),
butler_gain_buffer (0),
+ _send_smpte_update (false),
midi_thread (pthread_t (0)),
midi_requests (16),
diskstreams (new DiskstreamList),
diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc
index 20e7309c02..f52a458a15 100644
--- a/libs/ardour/session_events.cc
+++ b/libs/ardour/session_events.cc
@@ -336,6 +336,7 @@ Session::process_event (Event* ev)
// cerr << "soft locate to " << ev->target_frame << endl;
start_locate (ev->target_frame, false, true, false);
}
+ _send_smpte_update = true;
break;
case Event::LocateRoll:
@@ -346,6 +347,7 @@ Session::process_event (Event* ev)
// cerr << "soft locate to+roll " << ev->target_frame << endl;
start_locate (ev->target_frame, true, true, false);
}
+ _send_smpte_update = true;
break;
case Event::LocateRollLocate:
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index ffd30fb42c..1f0e08578f 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -762,6 +762,8 @@ Session::send_full_time_code ()
MIDI::byte msg[10];
SMPTE::Time smpte;
+ _send_smpte_update = false;
+
if (_mtc_port == 0 || !session_send_mtc) {
return 0;
}
@@ -829,14 +831,8 @@ Session::send_midi_time_code ()
return 0;
}
- nframes_t two_smpte_frames_duration;
- nframes_t quarter_frame_duration;
-
- /* Duration of two smpte frames */
- two_smpte_frames_duration = ((long) _frames_per_smpte_frame) << 1;
-
/* Duration of one quarter frame */
- quarter_frame_duration = ((long) _frames_per_smpte_frame) >> 2;
+ nframes_t const quarter_frame_duration = ((long) _frames_per_smpte_frame) >> 2;
while (_transport_frame >= (outbound_mtc_smpte_frame + (next_quarter_frame_to_send * quarter_frame_duration))) {
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index b607a43dbd..347356a7f4 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -282,6 +282,14 @@ Session::process_with_events (nframes_t nframes)
process_event (ev);
}
+ /* Events caused a transport change, send an MTC Full Frame (SMPTE) message.
+ * This is sent whether rolling or not, to give slaves an idea of ardour time
+ * on locates (and allow slow slaves to position and prepare for rolling)
+ */
+ if (_send_smpte_update) {
+ send_full_time_code ();
+ }
+
if (!process_can_proceed()) {
_silent = true;
return;
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 3d5e7a30ac..3e370b118c 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -773,6 +773,8 @@ Session::locate (nframes_t target_frame, bool with_roll, bool with_flush, bool w
}
loop_changing = false;
+
+ _send_smpte_update = true;
}
void