summaryrefslogtreecommitdiff
path: root/libs/ardour/session_export.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-25 22:33:37 +0200
committerRobin Gareus <robin@gareus.org>2016-10-25 22:33:37 +0200
commit0e658529011d859e508e3ef62d29fa2fe56535eb (patch)
tree9c58936a8a8fe8441afffd58131be8401c59aed2 /libs/ardour/session_export.cc
parent24846f478bf6a44f3f0e117d12e08864f579ed23 (diff)
Desperate hack to align master-bus on export.
Another 90% solution which hopefully gives us another year :( see comments Session::start_audio_export() for explanation.
Diffstat (limited to 'libs/ardour/session_export.cc')
-rw-r--r--libs/ardour/session_export.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index 23172838d0..7276d631dd 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -104,7 +104,7 @@ Session::pre_export ()
/** Called for each range that is being exported */
int
-Session::start_audio_export (framepos_t position, bool realtime, bool region_export)
+Session::start_audio_export (framepos_t position, bool realtime, bool region_export, bool comensate_master_latency)
{
if (!_exporting) {
pre_export ();
@@ -130,14 +130,24 @@ Session::start_audio_export (framepos_t position, bool realtime, bool region_exp
/* "worst_track_latency" is the correct value for stem-exports
* see to Route::add_export_point(),
*
- * for master-bus export, we'd need to add the master's latency.
- * or actually longest-total-session-latency.
+ * For master-bus export, we also need to add the master's latency.
+ * (or actually longest-total-session-latency - worst-track-latency)
+ * to align the export to 00:00:00:00.
*
- * We can't use worst_playback_latency because that includes
- * includes external latencies and would overcompensate.
+ * We must not use worst_playback_latency because that
+ * includes external (hardware) latencies and would overcompensate
+ * during file-export.
+ *
+ * (this is all still very [w]hacky. Individual Bus and Track outputs
+ * are not aligned but one can select them in the PortExportChannelSelector)
*/
_export_latency = worst_track_latency ();
+ boost::shared_ptr<Route> master = master_out ();
+ if (master && comensate_master_latency) {
+ _export_latency += master->signal_latency ();
+ }
+
if (region_export) {
_export_latency = 0;
}