From 6e5437587b89dc96b588aa0c33b0a0f547fd2b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonat=C3=A3=20Bolzan=20Loss?= Date: Fri, 16 Aug 2019 17:06:15 -0300 Subject: [PATCH] Bug 1904 - Audio offset not honored in Export/Export Multiple/Export Selection --- src/export/Export.cpp | 18 ++++++++++++++++-- src/prefs/ImportExportPrefs.cpp | 4 ++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/export/Export.cpp b/src/export/Export.cpp index ead3918e4..77e8b9c40 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -554,9 +554,23 @@ bool Exporter::ExamineTracks() return false; } - if (mT0 < earliestBegin) - mT0 = earliestBegin; + // The skipping of silent space could be cleverer and take + // into account clips. + // As implemented now, it can only skip initial silent space that + // has no clip before it, and terminal silent space that has no clip + // after it. + if (mT0 < earliestBegin){ + // Bug 1904 + // Previously we always skipped initial silent space. + // Now skipping it is an opt-in option. + bool skipSilenceAtBeginning; + gPrefs->Read(wxT("/AudioFiles/SkipSilenceAtBeginning"), + &skipSilenceAtBeginning, false); + if (skipSilenceAtBeginning) + mT0 = earliestBegin; + } + // We still skip silent space at the end if (mT1 > latestEnd) mT1 = latestEnd; diff --git a/src/prefs/ImportExportPrefs.cpp b/src/prefs/ImportExportPrefs.cpp index c87ee1d9b..28cd7b633 100644 --- a/src/prefs/ImportExportPrefs.cpp +++ b/src/prefs/ImportExportPrefs.cpp @@ -93,6 +93,10 @@ void ImportExportPrefs::PopulateOrExchange(ShuttleGui & S) S.TieCheckBox(_("S&how Metadata Tags editor before export"), wxT("/AudioFiles/ShowId3Dialog"), true); + /* i18n-hint 'silent space' is space on the tracks with no audio in it*/ + S.TieCheckBox(_("S&kip silent space at the beginning"), + wxT("/AudioFiles/SkipSilenceAtBeginning"), + false); } S.EndStatic(); #ifdef USE_MIDI