![]() |
Audacity 3.2.0
|
A short-lived object, during whose lifetime, the contents of the WaveTrack are assumed not to change. More...
#include <SampleTrackCache.h>
Classes | |
struct | Buffer |
Public Member Functions | |
SampleTrackCache () | |
SampleTrackCache (const std::shared_ptr< const SampleTrack > &pTrack) | |
~SampleTrackCache () | |
const std::shared_ptr< const SampleTrack > & | GetTrack () const |
void | SetTrack (const std::shared_ptr< const SampleTrack > &pTrack) |
const float * | GetFloats (sampleCount start, size_t len, bool mayThrow) |
Retrieve samples as floats from the track or from the memory cache. More... | |
Private Member Functions | |
void | Free () |
Private Attributes | |
std::shared_ptr< const SampleTrack > | mPTrack |
size_t | mBufferSize |
Buffer | mBuffers [2] |
GrowableSampleBuffer | mOverlapBuffer |
int | mNValidBuffers |
A short-lived object, during whose lifetime, the contents of the WaveTrack are assumed not to change.
It can replace repeated calls to WaveTrack::Get() (each of which opens and closes at least one block).
Definition at line 24 of file SampleTrackCache.h.
|
inline |
Definition at line 26 of file SampleTrackCache.h.
|
inlineexplicit |
Definition at line 33 of file SampleTrackCache.h.
SampleTrackCache::~SampleTrackCache | ( | ) |
Definition at line 14 of file SampleTrackCache.cpp.
|
private |
Definition at line 217 of file SampleTrackCache.cpp.
References GrowableSampleBuffer::Free(), SampleTrackCache::Buffer::Free(), mBuffers, mNValidBuffers, and mOverlapBuffer.
Referenced by SetTrack().
const float * SampleTrackCache::GetFloats | ( | sampleCount | start, |
size_t | len, | ||
bool | mayThrow | ||
) |
Retrieve samples as floats from the track or from the memory cache.
Uses fillZero always
Definition at line 37 of file SampleTrackCache.cpp.
References SampleTrackCache::Buffer::data, SampleTrackCache::Buffer::end(), PackedArray::end(), fillZero, floatSample, format, SampleTrackCache::Buffer::len, mBuffers, mBufferSize, min(), mNValidBuffers, mOverlapBuffer, mPTrack, GrowableSampleBuffer::ptr(), GrowableSampleBuffer::Resize(), SAMPLE_SIZE, size, SampleTrackCache::Buffer::start, and SampleTrackCache::Buffer::swap().
Referenced by SpecCache::CalculateOneSpectrum().
|
inline |
Definition at line 42 of file SampleTrackCache.h.
Referenced by anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), WaveClipSpectrumCache::GetSpectrogram(), and SpecCache::Populate().
void SampleTrackCache::SetTrack | ( | const std::shared_ptr< const SampleTrack > & | pTrack | ) |
Definition at line 18 of file SampleTrackCache.cpp.
References SampleTrackCache::Buffer::data, Free(), mBuffers, mBufferSize, mNValidBuffers, and mPTrack.
|
private |
Definition at line 73 of file SampleTrackCache.h.
Referenced by Free(), GetFloats(), and SetTrack().
|
private |
Definition at line 72 of file SampleTrackCache.h.
Referenced by GetFloats(), and SetTrack().
|
private |
Definition at line 75 of file SampleTrackCache.h.
Referenced by Free(), GetFloats(), and SetTrack().
|
private |
Definition at line 74 of file SampleTrackCache.h.
Referenced by Free(), and GetFloats().
|
private |
Definition at line 71 of file SampleTrackCache.h.
Referenced by GetFloats(), and SetTrack().