Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19258
Modified Files: LabelTrack.cpp LabelTrack.h Log Message: Fix to Reverse finishes fixing of "P2 - Labels should move with all the timeline changing effects." Labels are now reversed if the selection includes all the label (aditional conditions are tested to make sure the references to the other tracks in the group are kept). Index: LabelTrack.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- LabelTrack.cpp 2 Jun 2009 06:35:51 -0000 1.106 +++ LabelTrack.cpp 4 Jul 2009 00:18:14 -0000 1.107 @@ -191,6 +191,17 @@ } } +void LabelTrack::ChangeLabelsOnReverse(double b, double e) +{ + for (size_t i=0; i<mLabels.GetCount(); i++) { + if (mLabels[i]->t >= b && mLabels[i]->t1 <= e) {//deletion region encloses label + double aux = b + (e - mLabels[i]->t1); + mLabels[i]->t1 = e - (mLabels[i]->t - b); + mLabels[i]->t = aux; + } + } +} + double LabelTrack::AdjustTimeStampForSpeedChange(double t, double b, double e, double change) { //t is the time stamp we'll be changing Index: LabelTrack.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.h,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- LabelTrack.h 25 May 2009 11:13:01 -0000 1.47 +++ LabelTrack.h 4 Jul 2009 00:18:14 -0000 1.48 @@ -170,6 +170,7 @@ void ShiftLabelsOnClear(double b, double e); void ShiftLabelsOnInsert(double length, double pt); void ShiftLabelsOnChangeSpeed(double b, double e, double change); + void ChangeLabelsOnReverse(double b, double e); double AdjustTimeStampForSpeedChange(double t, double b, double e, double change); public: ------------------------------------------------------------------------------ _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs