Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13048
Modified Files: WaveTrack.cpp Log Message: Fixing P2:After split-new further splits (at a point) may shorten audio.\n also adding code that fixes a failed assert when doing split on a region twice Index: WaveTrack.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v retrieving revision 1.164 retrieving revision 1.165 diff -u -d -r1.164 -r1.165 --- WaveTrack.cpp 16 Aug 2009 14:44:20 -0000 1.164 +++ WaveTrack.cpp 22 Aug 2009 21:49:10 -0000 1.165 @@ -1946,7 +1946,10 @@ double val; t = LongSamplesToTime(TimeToLongSamples(t)); // put t on a sample val = c->GetEnvelope()->GetValue(t); - c->GetEnvelope()->Insert(t - c->GetOffset() - 1.0/c->GetRate(), val); // frame end points + //make two envelope points to preserve the value. + //handle the case where we split on the 1st sample (without this we hit an assert) + if(t != c->GetOffset()) + c->GetEnvelope()->Insert(t - c->GetOffset() - 1.0/c->GetRate(), val); // frame end points c->GetEnvelope()->Insert(t - c->GetOffset(), val); WaveClip* newClip = new WaveClip(*c, mDirManager); if (!c->Clear(t, c->GetEndTime())) @@ -1959,7 +1962,11 @@ delete newClip; return false; } - sampleCount here = llrint(floor(((t - c->GetStartTime() - mOffset) * mRate) + 0.5)); + + //mchinen 22.8.09 - This mOffset subtraction causes a bug for subsequent splits after a split new- + //We should be wary of this, but it appears GetStartTime and mOffset are identical + //if WaveTrack::SetOffset is called (as in AudacityProject::OnSplitNew()) + sampleCount here = llrint(floor(((t - c->GetStartTime()/* - mOffset*/) * mRate) + 0.5)); newClip->Offset((double)here/(double)mRate); mClips.Append(newClip); return true; ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs