mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 00:59:43 +02:00
Some comments to avoid further confusions using WaveTrack::Get().
This commit is contained in:
parent
7ae5c65580
commit
7aa2667c33
@ -1858,7 +1858,7 @@ float WaveTrack::GetRMS(double t0, double t1, bool mayThrow) const
|
||||
|
||||
bool WaveTrack::Get(samplePtr buffer, sampleFormat format,
|
||||
sampleCount start, size_t len, fillFormat fill,
|
||||
bool mayThrow, sampleCount * pNumCopied) const
|
||||
bool mayThrow, sampleCount * pNumWithinClips) const
|
||||
{
|
||||
// Simple optimization: When this buffer is completely contained within one clip,
|
||||
// don't clear anything (because we won't have to). Otherwise, just clear
|
||||
@ -1893,6 +1893,7 @@ bool WaveTrack::Get(samplePtr buffer, sampleFormat format,
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate the clips. They are not necessarily sorted by time.
|
||||
for (const auto &clip: mClips)
|
||||
{
|
||||
auto clipStart = clip->GetStartSample();
|
||||
@ -1932,8 +1933,8 @@ bool WaveTrack::Get(samplePtr buffer, sampleFormat format,
|
||||
samplesCopied += samplesToCopy;
|
||||
}
|
||||
}
|
||||
if( pNumCopied )
|
||||
*pNumCopied = samplesCopied;
|
||||
if( pNumWithinClips )
|
||||
*pNumWithinClips = samplesCopied;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -239,8 +239,13 @@ private:
|
||||
/// guaranteed that the same samples are affected.
|
||||
///
|
||||
bool Get(samplePtr buffer, sampleFormat format,
|
||||
sampleCount start, size_t len,
|
||||
fillFormat fill = fillZero, bool mayThrow = true, sampleCount * pNumCopied = nullptr) const;
|
||||
sampleCount start, size_t len,
|
||||
fillFormat fill = fillZero,
|
||||
bool mayThrow = true,
|
||||
// Report how many samples were copied from within clips, rather than
|
||||
// filled according to fillFormat; but these were not necessarily one
|
||||
// contiguous range.
|
||||
sampleCount * pNumWithinClips = nullptr) const;
|
||||
void Set(samplePtr buffer, sampleFormat format,
|
||||
sampleCount start, size_t len);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user