Audacity 3.2.0
WaveformCache.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 WaveformCache.h
6
7 Paul Licameli split from WaveClip.h
8
9*******************************************************************/
10
11#ifndef __AUDACITY_WAVEFORM_CACHE__
12#define __AUDACITY_WAVEFORM_CACHE__
13
14#include "WaveClip.h"
15
16class WaveCache;
18
20{
21 explicit WaveClipWaveformCache(size_t nChannels);
22 ~WaveClipWaveformCache() override;
23
24 // Cache of values for drawing the waveform
25 std::vector<std::unique_ptr<WaveCache>> mWaveCaches;
26 int mDirty { 0 };
27
28 static WaveClipWaveformCache &Get( const WaveClip &clip );
29
30 void MarkChanged() override; // NOFAIL-GUARANTEE
31 void Invalidate() override; // NOFAIL-GUARANTEE
32
34 void Clear();
35
37 bool GetWaveDisplay(const WaveChannelInterval &clip,
38 WaveDisplay &display, double t0, double pixelsPerSecond);
39};
40
41#endif
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:113
bool GetWaveDisplay(const WaveChannelInterval &clip, WaveDisplay &display, double t0, double pixelsPerSecond)
~WaveClipWaveformCache() override
static WaveClipWaveformCache & Get(const WaveClip &clip)
void Clear()
Delete the wave cache - force redraw. Thread-safe.
void Invalidate() override
void MarkChanged() override
std::vector< std::unique_ptr< WaveCache > > mWaveCaches
Definition: WaveformCache.h:25
WaveClipWaveformCache(size_t nChannels)