mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Fix problem generating over beginning of clips with "editClipsCanMove" mode
off; make WaveTrack::IsEmpty() use the clip boundary routines; hopefully make warping more correct.
This commit is contained in:
parent
830db47f50
commit
fad5cd7f96
@ -254,8 +254,7 @@ bool WaveTrack::IsEmpty(double t0, double t1)
|
||||
{
|
||||
WaveClip *clip = it->GetData();
|
||||
|
||||
if (clip->GetStartTime() < t1-(1.0/mRate) &&
|
||||
clip->GetEndTime()-(1.0/mRate) > t0) {
|
||||
if (!clip->BeforeClip(t1) && !clip->AfterClip(t0)) {
|
||||
//printf("Overlapping clip: %.6f...%.6f\n",
|
||||
// clip->GetStartTime(),
|
||||
// clip->GetEndTime());
|
||||
|
@ -43,10 +43,12 @@ bool Generator::Process()
|
||||
bool editClipCanMove;
|
||||
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove, true);
|
||||
|
||||
//if we can't move clips, check if generation is done on an empty place with enough
|
||||
//duration before actually generate anything.
|
||||
if (!editClipCanMove && track->IsEmpty(mT0, mT0+1.0/track->GetRate()) &&
|
||||
!track->IsEmpty(mT0, mT0+mDuration-1.0/track->GetRate())) {
|
||||
//if we can't move clips, and we're generating into an empty space,
|
||||
//make sure there's room.
|
||||
if (!editClipCanMove &&
|
||||
track->IsEmpty(mT0, mT1+1.0/track->GetRate()) &&
|
||||
!track->IsEmpty(mT0, mT0+mDuration-(mT1-mT0)-1.0/track->GetRate()))
|
||||
{
|
||||
wxMessageBox(
|
||||
_("There is not enough room available to generate the audio"),
|
||||
_("Error"), wxICON_STOP);
|
||||
@ -67,7 +69,7 @@ bool Generator::Process()
|
||||
else {
|
||||
// Transfer the data from the temporary track to the actual one
|
||||
tmp->Flush();
|
||||
SetTimeWarper(new StepTimeWarper(mT1, mDuration-mT1));
|
||||
SetTimeWarper(new StepTimeWarper(mT0+mDuration, mDuration-(mT1-mT0)));
|
||||
bGoodResult = track->ClearAndPaste(mT0, mT1, tmp, true,
|
||||
false, GetTimeWarper());
|
||||
delete tmp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user