Audacity 3.2.0
Classes | Typedefs | Functions
WaveTrackLocation.h File Reference
#include <vector>
Include dependency graph for WaveTrackLocation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WaveTrackLocation
 

Typedefs

using WaveTrackLocations = std::vector< WaveTrackLocation >
 

Functions

bool operator== (const WaveTrackLocation &a, const WaveTrackLocation &b)
 
bool operator!= (const WaveTrackLocation &a, const WaveTrackLocation &b)
 
AUDACITY_DLL_API WaveTrackLocations FindWaveTrackLocations (const WaveTrack &track)
 

Typedef Documentation

◆ WaveTrackLocations

using WaveTrackLocations = std::vector<WaveTrackLocation>

Definition at line 51 of file WaveTrackLocation.h.

Function Documentation

◆ FindWaveTrackLocations()

AUDACITY_DLL_API WaveTrackLocations FindWaveTrackLocations ( const WaveTrack track)

Definition at line 17 of file WaveTrackLocation.cpp.

18{
19 WaveTrackLocations locations;
20
21 auto clips = track.SortedIntervalArray();
22
23 // Count number of display locations
24 int num = 0;
25 for (const auto clip : clips)
26 num += clip->NumCutLines();
27
28 if (num == 0)
29 return locations;
30
31 // Alloc necessary number of display locations
32 locations.reserve(num);
33
34 // Add all display locations to cache
35 int curpos = 0;
36
37 for (const auto clip: clips) {
38 for (const auto &cc : clip->GetCutLines()) {
39 auto cutlinePosition =
40 clip->GetSequenceStartTime() + cc->GetSequenceStartTime();
41 if (clip->WithinPlayRegion(cutlinePosition)) {
42 // Add cut line expander point
43 locations.emplace_back(cutlinePosition);
44 }
45 // If cutline is skipped, we still need to count it
46 // so that curpos matches num at the end
47 curpos++;
48 }
49 }
50
51 assert(curpos == num);
52
53 return locations;
54}
std::vector< WaveTrackLocation > WaveTrackLocations
IntervalHolders SortedIntervalArray()
Return all WaveClips sorted by clip play start time.
Definition: WaveTrack.cpp:3297

References WaveTrack::SortedIntervalArray().

Referenced by WaveChannelSubView::DrawBoldBoundaries(), and CutlineHandle::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const WaveTrackLocation a,
const WaveTrackLocation b 
)
inline

Definition at line 46 of file WaveTrackLocation.h.

47{
48 return !( a == b );
49}

◆ operator==()

bool operator== ( const WaveTrackLocation a,
const WaveTrackLocation b 
)
inline