13#ifndef __AUDACITY_WAVE_TRACK_UTILITIES__
14#define __AUDACITY_WAVE_TRACK_UTILITIES__
18#include <unordered_set>
36 std::function<void(
const std::shared_ptr<SampleBlock> &)>;
38 std::function<void(std::shared_ptr<const SampleBlock>)>;
74 using Stack = std::vector<std::pair<IntervalHolders, size_t>>;
101 { ++mIter;
return *
this; }
110 {
return !(a == b); }
165 double* cutlineStart =
nullptr,
double* cutlineEnd =
nullptr);
std::unordered_set< SampleBlockID > SampleBlockIDSet
auto operator*(PffftAlignedCount x, Integral y) -> std::enable_if_t< std::is_unsigned_v< Integral > &&sizeof(Integral)<=sizeof(size_t), PffftAlignedCount >
std::function< void(double)> ProgressReporter
bool operator==(const WaveTrackLocation &a, const WaveTrackLocation &b)
bool operator!=(const WaveTrackLocation &a, const WaveTrackLocation &b)
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
This allows multiple clips to be a part of one WaveTrack.
A Track that contains audio waveform data.
std::vector< IntervalConstHolder > IntervalConstHolders
AllClipsConstIterator(const WaveTrack &track)
std::vector< std::pair< IntervalHolders, size_t > > Stack
Positions or offsets within audio files need a wide type.
WAVE_TRACK_API void InspectBlocks(const TrackList &tracks, BlockInspector inspector, SampleBlockIDSet *pIDs=nullptr)
WAVE_TRACK_API size_t CountBlocks(const WaveTrack &track)
WAVE_TRACK_API sampleCount GetSequenceSamplesCount(const WaveTrack &track)
std::function< void(std::shared_ptr< const SampleBlock >)> BlockInspector
WAVE_TRACK_API bool Reverse(WaveTrack &track, sampleCount start, sampleCount len, const ProgressReport &report={})
WAVE_TRACK_API void ExpandCutLine(WaveTrack &track, double cutLinePosition, double *cutlineStart=nullptr, double *cutlineEnd=nullptr)
WAVE_TRACK_API void CloseLock(WaveTrack &track) noexcept
Should be called upon project close. Not balanced by unlocking calls.
std::vector< IntervalHolder > IntervalHolders
std::shared_ptr< WaveTrack::Interval > IntervalHolder
std::unordered_set< SampleBlockID > SampleBlockIDSet
IteratorRange< AllClipsIterator > GetAllClips(WaveTrack &track)
WAVE_TRACK_API bool RemoveCutLine(WaveTrack &track, double cutLinePosition)
Remove cut line, without expanding the audio in it.
std::function< bool(double)> ProgressReport
WAVE_TRACK_API void ExpandClipTillNextOne(const WaveTrack &track, WaveTrack::Interval &interval)
std::shared_ptr< const WaveTrack::Interval > IntervalConstHolder
WAVE_TRACK_API bool HasHiddenData(const WaveTrack &track)
Whether any clips have hidden audio.
WAVE_TRACK_API void DiscardTrimmed(WaveTrack &track)
Remove hidden audio from all clips.
std::function< void(const std::shared_ptr< SampleBlock > &)> BlockVisitor
WAVE_TRACK_API void VisitBlocks(TrackList &tracks, BlockVisitor visitor, SampleBlockIDSet *pIDs=nullptr)
WAVE_TRACK_API WaveTrack::IntervalConstHolders GetClipsIntersecting(const WaveTrack &track, double t0, double t1)
A convenience for use with range-for.
A convenience for defining iterators that return rvalue types, so that they cooperate correctly with ...
IntervalConstHolder value_type