12#ifndef __AUDACITY_SAMPLE_TRACK_CACHE__
13#define __AUDACITY_SAMPLE_TRACK_CACHE__
33 const std::shared_ptr<const WideSampleSequence> &pSequence
37 SetSequence(pSequence);
41 const std::shared_ptr<const WideSampleSequence>&
GetSequence()
const {
45 const std::shared_ptr<const WideSampleSequence> &pSequence);
55 std::pair<const float *, const float *>
57 size_t nChannels,
sampleCount start,
size_t len,
bool mayThrow);
62 return GetFloatsWide(1, start, len, mayThrow).first;
74 void Free() { areas.reset(); start = 0; len = 0; }
79 areas .swap ( other.
areas );
85 return reinterpret_cast<float **
>(areas.get()); }
87 std::pair<const float*, const float *>
89 const auto buffers = GetBuffers();
90 const auto buffer0 = buffers[0],
93 (buffer0 ? buffer0 + offset :
nullptr),
94 (nChannels > 1 && buffer1 ? buffer1 + offset :
nullptr)
A short-lived object, during whose lifetime, the contents of the WaveTrack are assumed not to change.
SampleTrackCache(const std::shared_ptr< const WideSampleSequence > &pSequence)
const float * GetFloats(sampleCount start, size_t len, bool mayThrow)
fetch first channel only
const std::shared_ptr< const WideSampleSequence > & GetSequence() const
std::shared_ptr< const WideSampleSequence > mpSequence
Positions or offsets within audio files need a wide type.
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
std::pair< const float *, const float * > GetResults(size_t nChannels, size_t offset) const