mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-18 00:37:59 +01:00
Convert sampleCount <-> floating or -> long long explicitly ...
... A non-narrowing conversion out to long long is a necessity, but the conversions to float and double are simply conveniences. Conversion from floating is explicit, to avoid unintended consequences with arithmetic operators, when later sampleCount ceases to be an alias for an integral type. Some conversions are not made explicit, where I expect to change the type of the variable later to have mere size_t width.
This commit is contained in:
@@ -105,7 +105,7 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
|
||||
//Get the length of the buffer (as double). len is
|
||||
//used simple to calculate a progress meter, so it is easier
|
||||
//to make it a double now than it is to do it later
|
||||
double len = (double)(end - start);
|
||||
auto len = (end - start).as_double();
|
||||
auto maxblock = track->GetMaxBlockSize();
|
||||
|
||||
//Initiate a processing buffer. This buffer will (most likely)
|
||||
@@ -165,9 +165,13 @@ bool EffectTwoPassSimpleMono::ProcessOne(WaveTrack * track,
|
||||
|
||||
//Update the Progress meter
|
||||
if (mSecondPassDisabled)
|
||||
ret = TotalProgress((mCurTrackNum + (s-start)/len) / GetNumWaveTracks());
|
||||
ret = TotalProgress(
|
||||
(mCurTrackNum + (s-start).as_double()/len) /
|
||||
GetNumWaveTracks());
|
||||
else
|
||||
ret = TotalProgress((mCurTrackNum + (s-start)/len + GetNumWaveTracks()*mPass)/ (GetNumWaveTracks()*2));
|
||||
ret = TotalProgress(
|
||||
(mCurTrackNum + (s-start).as_double()/len + GetNumWaveTracks()*mPass) /
|
||||
(GetNumWaveTracks()*2));
|
||||
if (ret) {
|
||||
delete[]buffer1;
|
||||
delete[]buffer2;
|
||||
|
||||
Reference in New Issue
Block a user