Potential change to void WaveTrack::SplitAt(double t)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Potential change to void WaveTrack::SplitAt(double t)

David Bailes-3
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|

Re: Potential change to void WaveTrack::SplitAt(double t)

Paul Licameli
There is a commit from ra dated 23 Jan 2010, before which, there is nothing in our Git repository.

If you need to research older history, clone this repository:  https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL


On Thu, May 4, 2017 at 12:02 PM, David Bailes <[hidden email]> wrote:
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|

Re: Potential change to void WaveTrack::SplitAt(double t)

Paul Licameli
Your proposed change makes sense to me.  The simplification is welcome.

PRL


On Thu, May 4, 2017 at 12:52 PM, Paul Licameli <[hidden email]> wrote:
There is a commit from ra dated 23 Jan 2010, before which, there is nothing in our Git repository.

If you need to research older history, clone this repository:  https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL


On Thu, May 4, 2017 at 12:02 PM, David Bailes <[hidden email]> wrote:
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|

Re: Potential change to void WaveTrack::SplitAt(double t)

David Bailes-3
On Thu, May 4, 2017 at 6:11 PM, Paul Licameli <[hidden email]> wrote:
Your proposed change makes sense to me.  The simplification is welcome.

thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all cases.

David.
 

PRL


On Thu, May 4, 2017 at 12:52 PM, Paul Licameli <[hidden email]> wrote:
There is a commit from ra dated 23 Jan 2010, before which, there is nothing in our Git repository.

If you need to research older history, clone this repository:  https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL


On Thu, May 4, 2017 at 12:02 PM, David Bailes <[hidden email]> wrote:
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|

Re: Potential change to void WaveTrack::SplitAt(double t)

Paul Licameli
So the change is necessary but insufficient?

Be warned that I also intend to change SplitAt soon, because I am fixing miscellaneous bugs in envelopes.  Whichever of us commits second, may have a conflict there, but it should not be a difficult one.

PRL



On Thu, May 4, 2017 at 1:34 PM, David Bailes <[hidden email]> wrote:
On Thu, May 4, 2017 at 6:11 PM, Paul Licameli <[hidden email]> wrote:
Your proposed change makes sense to me.  The simplification is welcome.

thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all cases.

David.
 

PRL


On Thu, May 4, 2017 at 12:52 PM, Paul Licameli <[hidden email]> wrote:
There is a commit from ra dated 23 Jan 2010, before which, there is nothing in our Git repository.

If you need to research older history, clone this repository:  https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL


On Thu, May 4, 2017 at 12:02 PM, David Bailes <[hidden email]> wrote:
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Reply | Threaded
Open this post in threaded view
|

Re: Potential change to void WaveTrack::SplitAt(double t)

David Bailes-3
On Thu, May 4, 2017 at 6:47 PM, Paul Licameli <[hidden email]> wrote:
So the change is necessary but insufficient?

At the moment, I'm not sure if it's necessary. 

Be warned that I also intend to change SplitAt soon, because I am fixing miscellaneous bugs in envelopes.  Whichever of us commits second, may have a conflict there, but it should not be a difficult one.

thanks for letting me know, but as you say, shouldn't be difficult,
David
 

PRL



On Thu, May 4, 2017 at 1:34 PM, David Bailes <[hidden email]> wrote:
On Thu, May 4, 2017 at 6:11 PM, Paul Licameli <[hidden email]> wrote:
Your proposed change makes sense to me.  The simplification is welcome.

thanks for have a look at the code..
The bad news is I no longer think it's going to solve my problems in all cases.

David.
 

PRL


On Thu, May 4, 2017 at 12:52 PM, Paul Licameli <[hidden email]> wrote:
There is a commit from ra dated 23 Jan 2010, before which, there is nothing in our Git repository.

If you need to research older history, clone this repository:  https://github.com/JamesCrook/audacity-from-svn-5GB.git

PRL


On Thu, May 4, 2017 at 12:02 PM, David Bailes <[hidden email]> wrote:
In trying to sort of the problems with rounding errors in the start and end times of clips which are affecting the clip boundaries commands, I would like to make a small change in WaveTrack::SplitAt(double t):

change the two lines:
sampleCount here = llrint(floor(((t - c->GetStartTime()) * mRate) + 0.5));
newClip->Offset(here.as_double()/(double)mRate);

to:
newClip->SetOffset(c->GetEndTime());

Can anyone see a problem with this change? Using Git, the first of the two lines was last changed by RA, which I presume is Richard Ash.

thanks,
David.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/audacity-devel