From 8f3c8ac01b48577a34606d3796306b9e037ce103 Mon Sep 17 00:00:00 2001 From: Steve Daulton Date: Fri, 12 Jun 2015 13:03:14 +0100 Subject: [PATCH] Fix - Generate should replace selection. Generate Silence needs to be inserted into the selection rather than overwriting mT0 to mT1. --- src/effects/Generator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/effects/Generator.cpp b/src/effects/Generator.cpp index 265bab35a..b4b741d99 100644 --- a/src/effects/Generator.cpp +++ b/src/effects/Generator.cpp @@ -14,6 +14,7 @@ **********************************************************************/ +#include "../Project.h" #include "../Prefs.h" #include "Generator.h" @@ -60,6 +61,7 @@ bool Generator::Process() if (GetDuration() > 0.0) { + AudacityProject *p = GetActiveProject(); // Create a temporary track std::auto_ptr tmp( mFactory->NewWaveTrack(track->GetSampleFormat(), @@ -75,7 +77,7 @@ bool Generator::Process() // Transfer the data from the temporary track to the actual one tmp->Flush(); SetTimeWarper(new StepTimeWarper(mT0+GetDuration(), GetDuration()-(mT1-mT0))); - bGoodResult = track->ClearAndPaste(mT0, mT1, &*tmp, true, + bGoodResult = track->ClearAndPaste(p->GetSel0(), p->GetSel1(), &*tmp, true, false, GetTimeWarper()); }