Audacity 3.2.0
WaveTrack.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 WaveTrack.h
6
7 Dominic Mazzoni
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WAVETRACK__
12#define __AUDACITY_WAVETRACK__
13
14#include "Prefs.h"
15#include "SampleCount.h"
16#include "SampleFormat.h"
17#include "SampleTrack.h"
18
19#include <vector>
20#include <functional>
21#include <wx/thread.h>
22#include <wx/longlong.h>
23
24namespace BasicUI{ class ProgressDialog; }
25
27using SampleBlockFactoryPtr = std::shared_ptr<SampleBlockFactory>;
28
29class TimeWarper;
30
31class Sequence;
32class WaveClip;
33
34// Array of pointers that assume ownership
35using WaveClipHolder = std::shared_ptr< WaveClip >;
36using WaveClipHolders = std::vector < WaveClipHolder >;
37using WaveClipConstHolders = std::vector < std::shared_ptr< const WaveClip > >;
38
39// Temporary arrays of mere pointers
40using WaveClipPointers = std::vector < WaveClip* >;
41using WaveClipConstPointers = std::vector < const WaveClip* >;
42
43//
44// Tolerance for merging wave tracks (in seconds)
45//
46#define WAVETRACK_MERGE_POINT_TOLERANCE 0.01
47
48class Envelope;
49
50class WAVE_TRACK_API WaveTrack final : public WritableSampleTrack
51{
52public:
55 struct Region
56 {
57 Region() : start(0), end(0) {}
58 Region(double start_, double end_) : start(start_), end(end_) {}
59
60 double start, end;
61
62 //used for sorting
63 bool operator < (const Region &b) const
64 {
65 return this->start < b.start;
66 }
67 };
68
69 using Regions = std::vector < Region >;
70
71 static wxString GetDefaultAudioTrackNamePreference();
72
73 //
74 // Constructor / Destructor / Duplicator
75 //
76
77 // Construct and also build all attachments
78 static WaveTrack *New( AudacityProject &project );
79
81 const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate);
84
85 // overwrite data excluding the sample sequence but including display
86 // settings
87 void Reinit(const WaveTrack &orig);
88private:
89 void Init(const WaveTrack &orig);
90
91 Track::Holder Clone() const override;
92
93 friend class WaveTrackFactory;
94
95 wxString MakeClipCopyName(const wxString& originalName) const;
96 wxString MakeNewClipName() const;
97 public:
98
99 using Holder = std::shared_ptr<WaveTrack>;
100
101 virtual ~WaveTrack();
102
103 double GetOffset() const override;
104 void SetOffset(double o) override;
105 ChannelType GetChannelIgnoringPan() const override;
106 ChannelType GetChannel() const override;
107 virtual void SetPanFromChannelType() override;
108
109 bool LinkConsistencyFix(bool doFix, bool completeList) override;
110
115 double GetStartTime() const override;
116
122 double GetEndTime() const override;
123
124 //
125 // Identifying the type of track
126 //
127
128 //
129 // WaveTrack parameters
130 //
131
132 double GetRate() const override;
133 void SetRate(double newRate);
134
135 // Multiplicative factor. Only converted to dB for display.
136 float GetGain() const;
137 void SetGain(float newGain);
138
139 // -1.0 (left) -> 1.0 (right)
140 float GetPan() const;
141 void SetPan(float newPan) override;
142
143 float GetChannelGain(int channel) const override;
144
145 int GetWaveColorIndex() const { return mWaveColorIndex; };
146 void SetWaveColorIndex(int colorIndex);
147
148 sampleCount GetPlaySamplesCount() const;
149 sampleCount GetSequenceSamplesCount() const;
150
151 sampleFormat GetSampleFormat() const override { return mFormat; }
152
153 void ConvertToSampleFormat(sampleFormat format,
154 const std::function<void(size_t)> & progressReport = {});
155
156 //
157 // High-level editing
158 //
159
160 Track::Holder Cut(double t0, double t1) override;
161
164
173 Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory = {},
174 bool keepLink = true) const;
175
176 // If forClipboard is true,
177 // and there is no clip at the end time of the selection, then the result
178 // will contain a "placeholder" clip whose only purpose is to make
179 // GetEndTime() correct. This clip is not re-copied when pasting.
180 Track::Holder Copy(double t0, double t1, bool forClipboard = true) const override;
181 Track::Holder CopyNonconst(double t0, double t1) /* not override */;
182
183 void Clear(double t0, double t1) override;
184 void Paste(double t0, const Track *src) override;
185 // May assume precondition: t0 <= t1
186 void ClearAndPaste(double t0, double t1,
187 const Track *src,
188 bool preserve = true,
189 bool merge = true,
190 const TimeWarper *effectWarper = NULL) /* not override */;
191
192 void Silence(double t0, double t1) override;
193 void InsertSilence(double t, double len) override;
194
195 void SplitAt(double t) /* not override */;
196 void Split(double t0, double t1) /* not override */;
197 // Track::Holder CutAndAddCutLine(double t0, double t1) /* not override */;
198 // May assume precondition: t0 <= t1
199 void ClearAndAddCutLine(double t0, double t1) /* not override */;
200
201 Track::Holder SplitCut(double t0, double t1) /* not override */;
202 // May assume precondition: t0 <= t1
203 void SplitDelete(double t0, double t1) /* not override */;
204 void Join(double t0, double t1) /* not override */;
205 // May assume precondition: t0 <= t1
206 void Disjoin(double t0, double t1) /* not override */;
207
208 // May assume precondition: t0 <= t1
209 void Trim(double t0, double t1) /* not override */;
210
211 // May assume precondition: t0 <= t1
212 void HandleClear(double t0, double t1, bool addCutLines, bool split);
213
214 void SyncLockAdjust(double oldT1, double newT1) override;
215
221 bool IsEmpty(double t0, double t1) const;
222
223 /*
224 * If there is an existing WaveClip in the WaveTrack then the data is
225 * appended to that clip. If there are no WaveClips in the track, then a NEW
226 * one is created.
227 *
228 */
230 size_t len, unsigned int stride = 1,
231 sampleFormat effectiveFormat = widestSampleFormat) override;
232
233 void Flush() override;
234
245
246 bool Get(samplePtr buffer, sampleFormat format,
247 sampleCount start, size_t len,
248 fillFormat fill = fillZero,
249 bool mayThrow = true,
250 // Report how many samples were copied from within clips, rather than
251 // filled according to fillFormat; but these were not necessarily one
252 // contiguous range.
253 sampleCount * pNumWithinClips = nullptr) const override;
254 void Set(constSamplePtr buffer, sampleFormat format,
255 sampleCount start, size_t len,
256 sampleFormat effectiveFormat = widestSampleFormat
262 );
263
264 sampleFormat WidestEffectiveFormat() const override;
265
266 bool HasTrivialEnvelope() const override;
267
268 void GetEnvelopeValues(double *buffer, size_t bufferLen,
269 double t0) const override;
270
271 // May assume precondition: t0 <= t1
272 std::pair<float, float> GetMinMax(
273 double t0, double t1, bool mayThrow = true) const;
274 // May assume precondition: t0 <= t1
275 float GetRMS(double t0, double t1, bool mayThrow = true) const;
276
277 //
278 // MM: We now have more than one sequence and envelope per track, so
279 // instead of GetSequence() and GetEnvelope() we have the following
280 // function which give the sequence and envelope which contains the given
281 // time.
282 //
283 Sequence* GetSequenceAtTime(double time);
284 Envelope* GetEnvelopeAtTime(double time);
285
286 WaveClip* GetClipAtTime(double time);
287
288 //
289 // Getting information about the track's internal block sizes
290 // and alignment for efficiency
291 //
292
293 sampleCount GetBlockStart(sampleCount t) const override;
294
295 // These return a nonnegative number of samples meant to size a memory buffer
296 size_t GetBestBlockSize(sampleCount t) const override;
297 size_t GetMaxBlockSize() const override;
298 size_t GetIdealBlockSize();
299
300 //
301 // XMLTagHandler callback methods for loading and saving
302 //
303
304 bool HandleXMLTag(const std::string_view& tag, const AttributesList& attrs) override;
305 void HandleXMLEndTag(const std::string_view& tag) override;
306 XMLTagHandler *HandleXMLChild(const std::string_view& tag) override;
307 void WriteXML(XMLWriter &xmlFile) const override;
308
309 // Returns true if an error occurred while reading from XML
310 bool GetErrorOpening() override;
311
312 //
313 // Lock and unlock the track: you must lock the track before
314 // doing a copy and paste between projects.
315 //
316
317 bool CloseLock(); //should be called when the project closes.
318 // not balanced by unlocking calls.
319
320 // Get access to the (visible) clips in the tracks, in unspecified order
321 // (not necessarily sequenced in time).
322 WaveClipHolders &GetClips() { return mClips; }
324 { return reinterpret_cast< const WaveClipConstHolders& >( mClips ); }
325
326 // Get mutative access to all clips (in some unspecified sequence),
327 // including those hidden in cutlines.
329 : public ValueIterator< WaveClip * >
330 {
331 public:
332 // Constructs an "end" iterator
334
335 // Construct a "begin" iterator
336 explicit AllClipsIterator( WaveTrack &track )
337 {
338 push( track.mClips );
339 }
340
342 {
343 if (mStack.empty())
344 return nullptr;
345 else
346 return mStack.back().first->get();
347 }
348
349 AllClipsIterator &operator ++ ();
350
351 // Define == well enough to serve for loop termination test
352 friend bool operator == (
353 const AllClipsIterator &a, const AllClipsIterator &b)
354 { return a.mStack.empty() == b.mStack.empty(); }
355
356 friend bool operator != (
357 const AllClipsIterator &a, const AllClipsIterator &b)
358 { return !( a == b ); }
359
360 private:
361
362 void push( WaveClipHolders &clips );
363
364 using Iterator = WaveClipHolders::iterator;
365 using Pair = std::pair< Iterator, Iterator >;
366 using Stack = std::vector< Pair >;
367
369 };
370
371 // Get const access to all clips (in some unspecified sequence),
372 // including those hidden in cutlines.
374 : public ValueIterator< const WaveClip * >
375 {
376 public:
377 // Constructs an "end" iterator
379
380 // Construct a "begin" iterator
381 explicit AllClipsConstIterator( const WaveTrack &track )
382 : mIter{ const_cast< WaveTrack& >( track ) }
383 {}
384
385 const WaveClip *operator * () const
386 { return *mIter; }
387
388 AllClipsConstIterator &operator ++ ()
389 { ++mIter; return *this; }
390
391 // Define == well enough to serve for loop termination test
392 friend bool operator == (
394 { return a.mIter == b.mIter; }
395
396 friend bool operator != (
398 { return !( a == b ); }
399
400 private:
402 };
403
405 {
406 return { AllClipsIterator{ *this }, AllClipsIterator{ } };
407 }
408
410 {
411 return { AllClipsConstIterator{ *this }, AllClipsConstIterator{ } };
412 }
413
414 // Create NEW clip and add it to this track. Returns a pointer
415 // to the newly created clip. Optionally initial offset and
416 // clip name may be provided
417 WaveClip* CreateClip(double offset = .0, const wxString& name = wxEmptyString);
418
424 WaveClip* NewestOrNewClip();
425
431 WaveClip* RightmostOrNewClip();
432
433 // Get the linear index of a given clip (-1 if the clip is not found)
434 int GetClipIndex(const WaveClip* clip) const;
435
436 // Get the nth clip in this WaveTrack (will return NULL if not found).
437 // Use this only in special cases (like getting the linked clip), because
438 // it is much slower than GetClipIterator().
439 WaveClip *GetClipByIndex(int index);
440 const WaveClip* GetClipByIndex(int index) const;
441
442 // Get number of clips in this WaveTrack
443 int GetNumClips() const;
444
445 // Add all wave clips to the given array 'clips' and sort the array by
446 // clip start time. The array is emptied prior to adding the clips.
447 WaveClipPointers SortedClipArray();
448 WaveClipConstPointers SortedClipArray() const;
449
451
454 bool CanOffsetClips(
455 const std::vector<WaveClip*> &clips,
456 double amount,
457 double *allowedAmount = nullptr
459 );
460
461 // Before moving a clip into a track (or inserting a clip), use this
462 // function to see if the times are valid (i.e. don't overlap with
463 // existing clips).
464 bool CanInsertClip(WaveClip* clip, double &slideBy, double &tolerance) const;
465
466 // Remove the clip from the track and return a SMART pointer to it.
467 // You assume responsibility for its memory!
468 std::shared_ptr<WaveClip> RemoveAndReturnClip(WaveClip* clip);
469
471 bool AddClip(const std::shared_ptr<WaveClip> &clip);
472
473 // Merge two clips, that is append data from clip2 to clip1,
474 // then remove clip2 from track.
475 // clipidx1 and clipidx2 are indices into the clip list.
476 void MergeClips(int clipidx1, int clipidx2);
477
478 // Expand cut line (that is, re-insert audio, then DELETE audio saved in cut line)
479 void ExpandCutLine(double cutLinePosition, double* cutlineStart = NULL, double* cutlineEnd = NULL);
480
481 // Remove cut line, without expanding the audio in it
482 bool RemoveCutLine(double cutLinePosition);
483
484 // This track has been merged into a stereo track. Copy shared parameters
485 // from the NEW partner.
486 void Merge(const Track &orig) override;
487
488 // Resample track (i.e. all clips in the track)
489 void Resample(int rate, BasicUI::ProgressDialog *progress = NULL);
490
491 const TypeInfo &GetTypeInfo() const override;
492 static const TypeInfo &ClassTypeInfo();
493
494 class IntervalData final : public Track::IntervalData {
495 public:
496 explicit IntervalData( const std::shared_ptr<WaveClip> &pClip )
497 : pClip{ pClip }
498 {}
499 std::shared_ptr<const WaveClip> GetClip() const { return pClip; }
500 std::shared_ptr<WaveClip> &GetClip() { return pClip; }
501 private:
502 std::shared_ptr<WaveClip> pClip;
503 };
504
505 Track::Holder PasteInto( AudacityProject & ) const override;
506
507 ConstIntervals GetIntervals() const override;
508 Intervals GetIntervals() override;
509
511 const WaveClip* FindClipByName(const wxString& name) const;
512 protected:
513 //
514 // Protected variables
515 //
516
518
520 int mRate;
522 std::atomic<float> mGain{ 1.0f };
524 std::atomic<float> mPan{ 0.0f };
526
527private:
528 void DoSetPan(float value);
529 void DoSetGain(float value);
530
531 void PasteWaveTrack(double t0, const WaveTrack* other);
532
534
535 wxCriticalSection mFlushCriticalSection;
536 wxCriticalSection mAppendCriticalSection;
538};
539
541
542#include <unordered_set>
543class SampleBlock;
544using SampleBlockID = long long;
545using SampleBlockIDSet = std::unordered_set<SampleBlockID>;
546class TrackList;
547using BlockVisitor = std::function< void(SampleBlock&) >;
548using BlockInspector = std::function< void(const SampleBlock&) >;
549
550// Function to visit all sample blocks from a list of tracks.
551// If a set is supplied, then only visit once each unique block ID not already
552// in that set, and accumulate those into the set as a side-effect.
553// The visitor function may be null.
554void VisitBlocks(TrackList &tracks, BlockVisitor visitor,
555 SampleBlockIDSet *pIDs = nullptr);
556
557// Non-mutating version of the above
558WAVE_TRACK_API void InspectBlocks(const TrackList &tracks,
559 BlockInspector inspector, SampleBlockIDSet *pIDs = nullptr);
560
561class ProjectRate;
562
563class WAVE_TRACK_API WaveTrackFactory final
564 : public ClientData::Base
565{
566 public:
567 static WaveTrackFactory &Get( AudacityProject &project );
568 static const WaveTrackFactory &Get( const AudacityProject &project );
569 static WaveTrackFactory &Reset( AudacityProject &project );
570 static void Destroy( AudacityProject &project );
571
573 const ProjectRate& rate,
574 const SampleBlockFactoryPtr &pFactory)
575 : mRate{ rate }
576 , mpFactory(pFactory)
577 {
578 }
579 WaveTrackFactory( const WaveTrackFactory & ) PROHIBITED;
581
583 { return mpFactory; }
584
589 std::shared_ptr<WaveTrack> Create();
590
597 std::shared_ptr<WaveTrack> Create(sampleFormat format, double rate);
598
599 private:
602};
603
604extern WAVE_TRACK_API BoolSetting
606;
607
608extern WAVE_TRACK_API StringSetting AudioTrackNameSetting;
609
610WAVE_TRACK_API bool GetEditClipsCanMove();
611
612// Generate a registry for serialized data
613#include "XMLMethodRegistry.h"
616
617#endif // __AUDACITY_WAVETRACK__
const TranslatableString name
Definition: Distortion.cpp:76
int format
Definition: ExportPCM.cpp:53
Vector operator*(const Vector &left, const Vector &right)
Definition: Matrix.cpp:153
long long SampleBlockID
Definition: ProjectFileIO.h:42
bool operator==(const EffectReverbSettings &a, const EffectReverbSettings &b)
Definition: Reverb.cpp:632
std::shared_ptr< SampleBlockFactory > SampleBlockFactoryPtr
Definition: SampleBlock.h:29
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
char * samplePtr
Definition: SampleFormat.h:55
const char * constSamplePtr
Definition: SampleFormat.h:56
fillFormat
Definition: SampleFormat.h:59
@ fillZero
Definition: SampleFormat.h:60
bool operator<(SnapPoint s1, SnapPoint s2)
Definition: Snap.cpp:24
std::shared_ptr< WaveClip > WaveClipHolder
Definition: WaveClip.h:41
std::vector< WaveClipHolder > WaveClipHolders
Definition: WaveClip.h:42
std::vector< std::shared_ptr< const WaveClip > > WaveClipConstHolders
Definition: WaveClip.h:43
std::function< void(SampleBlock &) > BlockVisitor
Definition: WaveTrack.h:547
void VisitBlocks(TrackList &tracks, BlockVisitor visitor, SampleBlockIDSet *pIDs=nullptr)
Definition: WaveTrack.cpp:2496
DECLARE_XML_METHOD_REGISTRY(WAVE_TRACK_API, WaveTrackIORegistry)
WAVE_TRACK_API bool GetEditClipsCanMove()
Definition: WaveTrack.cpp:2586
std::unordered_set< SampleBlockID > SampleBlockIDSet
Definition: WaveTrack.h:545
ENUMERATE_TRACK_TYPE(WaveTrack)
std::function< void(const SampleBlock &) > BlockInspector
Definition: WaveTrack.h:548
std::vector< WaveClip * > WaveClipPointers
Definition: WaveTrack.h:40
WAVE_TRACK_API StringSetting AudioTrackNameSetting
Definition: WaveTrack.cpp:2576
std::vector< const WaveClip * > WaveClipConstPointers
Definition: WaveTrack.h:41
WAVE_TRACK_API void InspectBlocks(const TrackList &tracks, BlockInspector inspector, SampleBlockIDSet *pIDs=nullptr)
Definition: WaveTrack.cpp:2517
WAVE_TRACK_API BoolSetting EditClipsCanMove
Definition: WaveTrack.cpp:2595
bool operator!=(const WaveTrackLocation &a, const WaveTrackLocation &b)
std::vector< Attribute > AttributesList
Definition: XMLTagHandler.h:40
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Abstraction of a progress dialog with well defined time-to-completion estimate.
Definition: BasicUI.h:156
This specialization of Setting for bool adds a Toggle method to negate the saved value.
Definition: Prefs.h:339
Piecewise linear or piecewise exponential function from double to double.
Definition: Envelope.h:72
void Init(const PlayableTrack &init)
Definition: Track.cpp:323
void Merge(const Track &init) override
Definition: Track.cpp:330
ProgressDialog Class.
Holds project sample rate.
Definition: ProjectRate.h:24
Interface to libsoxr.
Definition: Resample.h:27
abstract base class with methods to produce SampleBlock objects
Definition: SampleBlock.h:114
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
Definition: SampleBlock.h:45
virtual double GetRate() const =0
virtual float GetChannelGain(int channel) const =0
Takes gain and pan into account.
virtual bool Get(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const =0
Retrieve samples from a track in a specified format.
virtual void GetEnvelopeValues(double *buffer, size_t bufferLen, double t0) const =0
Fetch envelope values corresponding to uniformly separated sample times starting at the given time.
virtual size_t GetMaxBlockSize() const =0
This returns a nonnegative number of samples meant to size a memory buffer.
virtual bool HasTrivialEnvelope() const =0
virtual sampleCount GetBlockStart(sampleCount t) const =0
This returns a possibly large or negative value.
virtual sampleFormat WidestEffectiveFormat() const =0
virtual size_t GetBestBlockSize(sampleCount t) const =0
This returns a nonnegative number of samples meant to size a memory buffer.
virtual ChannelType GetChannelIgnoringPan() const =0
A WaveTrack contains WaveClip(s). A WaveClip contains a Sequence. A Sequence is primarily an interfac...
Definition: Sequence.h:61
Specialization of Setting for strings.
Definition: Prefs.h:363
Transforms one point in time to another point. For example, a time stretching effect might use one to...
Definition: TimeWarper.h:62
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:226
virtual void SetPan(float)
Definition: Track.h:486
virtual void SetOffset(double o)
Definition: Track.h:484
virtual void Paste(double WXUNUSED(t), const Track *WXUNUSED(src))=0
virtual Holder Cut(double WXUNUSED(t0), double WXUNUSED(t1))=0
virtual Holder PasteInto(AudacityProject &) const =0
Find or create the destination track for a paste, maybe in a different project.
virtual void Clear(double WXUNUSED(t0), double WXUNUSED(t1))=0
ChannelType
Definition: Track.h:282
virtual double GetStartTime() const =0
virtual Holder Clone() const =0
virtual void SyncLockAdjust(double oldT1, double newT1)
Definition: Track.cpp:286
virtual Holder Copy(double WXUNUSED(t0), double WXUNUSED(t1), bool forClipboard=true) const =0
virtual bool LinkConsistencyFix(bool doFix=true, bool completeList=true)
Check consistency of channel groups, and maybe fix it.
Definition: Track.cpp:425
std::shared_ptr< Track > Holder
Definition: Track.h:369
virtual void SetPanFromChannelType()
Definition: Track.h:487
virtual ConstIntervals GetIntervals() const
Report times on the track where important intervals begin and end, for UI to snap to.
Definition: Track.cpp:1264
virtual void WriteXML(XMLWriter &xmlFile) const =0
virtual void Silence(double WXUNUSED(t0), double WXUNUSED(t1))=0
virtual ChannelType GetChannel() const
Definition: Track.h:480
virtual double GetOffset() const =0
virtual double GetEndTime() const =0
std::vector< Interval > Intervals
Definition: Track.h:336
virtual void InsertSilence(double WXUNUSED(t), double WXUNUSED(len))=0
virtual bool GetErrorOpening()
Definition: Track.h:865
std::vector< ConstInterval > ConstIntervals
Definition: Track.h:338
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1339
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:101
AllClipsConstIterator(const WaveTrack &track)
Definition: WaveTrack.h:381
std::pair< Iterator, Iterator > Pair
Definition: WaveTrack.h:365
std::vector< Pair > Stack
Definition: WaveTrack.h:366
WaveClipHolders::iterator Iterator
Definition: WaveTrack.h:364
AllClipsIterator(WaveTrack &track)
Definition: WaveTrack.h:336
std::shared_ptr< WaveClip > pClip
Definition: WaveTrack.h:502
IntervalData(const std::shared_ptr< WaveClip > &pClip)
Definition: WaveTrack.h:496
std::shared_ptr< WaveClip > & GetClip()
Definition: WaveTrack.h:500
std::shared_ptr< const WaveClip > GetClip() const
Definition: WaveTrack.h:499
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:565
WaveTrackFactory(const WaveTrackFactory &) PROHIBITED
const SampleBlockFactoryPtr & GetSampleBlockFactory() const
Definition: WaveTrack.h:582
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:601
WaveTrackFactory(const ProjectRate &rate, const SampleBlockFactoryPtr &pFactory)
Definition: WaveTrack.h:572
const ProjectRate & mRate
Definition: WaveTrack.h:600
WaveTrackFactory & operator=(const WaveTrackFactory &) PROHIBITED
A Track that contains audio waveform data.
Definition: WaveTrack.h:51
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:533
std::vector< Region > Regions
Definition: WaveTrack.h:69
sampleFormat mFormat
Definition: WaveTrack.h:519
wxCriticalSection mFlushCriticalSection
Definition: WaveTrack.h:535
int GetWaveColorIndex() const
Definition: WaveTrack.h:145
sampleFormat GetSampleFormat() const override
Definition: WaveTrack.h:151
IteratorRange< AllClipsConstIterator > GetAllClips() const
Definition: WaveTrack.h:409
IteratorRange< AllClipsIterator > GetAllClips()
Definition: WaveTrack.h:404
const WaveClipConstHolders & GetClips() const
Definition: WaveTrack.h:323
WaveClipHolders & GetClips()
Definition: WaveTrack.h:322
int mWaveColorIndex
Definition: WaveTrack.h:525
double mLegacyProjectFileOffset
Definition: WaveTrack.h:537
int mRate
Definition: WaveTrack.h:520
wxCriticalSection mAppendCriticalSection
Definition: WaveTrack.h:536
WaveClipHolders mClips
Definition: WaveTrack.h:517
virtual void Flush()=0
Flush must be called after last Append.
virtual bool Append(constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1, sampleFormat effectiveFormat=widestSampleFormat)=0
Append the sample data to the track. You must call Flush() after the last Append.
static const TypeInfo & ClassTypeInfo()
Definition: SampleTrack.cpp:71
const TypeInfo & GetTypeInfo() const override
Definition: SampleTrack.cpp:76
This class is an interface which should be implemented by classes which wish to be able to load and s...
Definition: XMLTagHandler.h:42
virtual XMLTagHandler * HandleXMLChild(const std::string_view &tag)=0
virtual void HandleXMLEndTag(const std::string_view &WXUNUSED(tag))
Definition: XMLTagHandler.h:59
virtual bool HandleXMLTag(const std::string_view &tag, const AttributesList &attrs)=0
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Definition: XMLWriter.h:25
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159
std::vector< long > Split(const PluginRegistryVersion &regver)
A convenient default parameter for class template Site.
Definition: ClientData.h:28
A convenience for use with range-for.
Definition: MemoryX.h:277
Empty argument passed to some public constructors.
Definition: Track.h:233
Optional extra information about an interval, appropriate to a subtype of Track.
Definition: Track.h:173
A convenience for defining iterators that return rvalue types, so that they cooperate correctly with ...
Definition: MemoryX.h:263
Structure to hold region of a wavetrack and a comparison function for sortability.
Definition: WaveTrack.h:56
Region(double start_, double end_)
Definition: WaveTrack.h:58