1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Bug 2408 - A region label gets split on inserting audio when Sync-lock is turned on

This commit is contained in:
James Crook
2020-05-31 12:58:59 +01:00
parent bc621158b8
commit 9d5befc196
2 changed files with 19 additions and 0 deletions

View File

@@ -846,6 +846,24 @@ bool LabelTrack::Repeat(double t0, double t1, int n)
return true; return true;
} }
void LabelTrack::SyncLockAdjust(double oldT1, double newT1)
{
if (newT1 > oldT1) {
// Insert space within the track
if (oldT1 > GetEndTime())
return;
//Clear(oldT1, newT1);
ShiftLabelsOnInsert(newT1 - oldT1, oldT1);
}
else if (newT1 < oldT1) {
// Remove from the track
Clear(newT1, oldT1);
}
}
void LabelTrack::Silence(double t0, double t1) void LabelTrack::Silence(double t0, double t1)
{ {
int len = mLabels.size(); int len = mLabels.size();

View File

@@ -123,6 +123,7 @@ public:
void Clear(double t0, double t1) override; void Clear(double t0, double t1) override;
void Paste(double t, const Track * src) override; void Paste(double t, const Track * src) override;
bool Repeat(double t0, double t1, int n); bool Repeat(double t0, double t1, int n);
void SyncLockAdjust(double oldT1, double newT1) override;
void Silence(double t0, double t1) override; void Silence(double t0, double t1) override;
void InsertSilence(double t, double len) override; void InsertSilence(double t, double len) override;