![]() |
Audacity 3.2.0
|
A Track that contains audio waveform data. More...
#include <WaveTrack.h>
Classes | |
class | AllClipsConstIterator |
class | AllClipsIterator |
class | IntervalData |
struct | Region |
Structure to hold region of a wavetrack and a comparison function for sortability. More... | |
Public Types | |
using | Regions = std::vector< Region > |
typedef WaveTrackLocation | Location |
using | Holder = std::shared_ptr< WaveTrack > |
![]() | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
enum | ChannelType { LeftChannel = 0 , RightChannel = 1 , MonoChannel = 2 } |
using | ChannelGroupAttachments = ClientData::Site< ChannelGroupData, ClientData::Cloneable<>, ClientData::DeepCopying > |
Hosting of objects attached by higher level code. More... | |
using | AttachedObjects = ::AttachedTrackObjects |
Alias for my base type. More... | |
using | IntervalData = TrackIntervalData |
using | Interval = TrackInterval |
using | Intervals = std::vector< Interval > |
using | ConstInterval = ConstTrackInterval |
using | ConstIntervals = std::vector< ConstInterval > |
using | Holder = std::shared_ptr< Track > |
template<typename R = void> | |
using | Continuation = std::function< R() > |
Type of arguments passed as optional second parameter to TypeSwitch() cases. More... | |
using | Fallthrough = Continuation<> |
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases. More... | |
![]() | |
using | DataType = ClientData |
using | DataPointer = Pointer< ClientData > |
using | DataFactory = std::function< DataPointer(Host &) > |
Type of function from which RegisteredFactory is constructed; it builds attachments. More... | |
Public Member Functions | |
WaveTrack (const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate) | |
WaveTrack (const WaveTrack &orig) | |
void | Reinit (const WaveTrack &orig) |
virtual | ~WaveTrack () |
double | GetOffset () const override |
void | SetOffset (double o) override |
ChannelType | GetChannelIgnoringPan () const override |
ChannelType | GetChannel () const override |
virtual void | SetPanFromChannelType () override |
bool | LinkConsistencyFix (bool doFix, bool completeList) override |
Check consistency of channel groups, and maybe fix it. More... | |
double | GetStartTime () const override |
Get the time at which the first clip in the track starts. More... | |
double | GetEndTime () const override |
Get the time at which the last clip in the track ends, plus recorded stuff. More... | |
double | GetRate () const override |
void | SetRate (double newRate) |
float | GetGain () const |
void | SetGain (float newGain) |
float | GetPan () const |
void | SetPan (float newPan) override |
float | GetChannelGain (int channel) const override |
Takes gain and pan into account. More... | |
float | GetOldChannelGain (int channel) const override |
void | SetOldChannelGain (int channel, float gain) override |
int | GetWaveColorIndex () const |
void | SetWaveColorIndex (int colorIndex) |
sampleCount | GetPlaySamplesCount () const |
sampleCount | GetSequenceSamplesCount () const |
sampleFormat | GetSampleFormat () const override |
void | ConvertToSampleFormat (sampleFormat format, const std::function< void(size_t)> &progressReport={}) |
const SpectrogramSettings & | GetSpectrogramSettings () const |
SpectrogramSettings & | GetSpectrogramSettings () |
SpectrogramSettings & | GetIndependentSpectrogramSettings () |
void | SetSpectrogramSettings (std::unique_ptr< SpectrogramSettings > &&pSettings) |
const WaveformSettings & | GetWaveformSettings () const |
WaveformSettings & | GetWaveformSettings () |
void | SetWaveformSettings (std::unique_ptr< WaveformSettings > &&pSettings) |
void | UseSpectralPrefs (bool bUse=true) |
Track::Holder | Cut (double t0, double t1) override |
Holder | EmptyCopy (const SampleBlockFactoryPtr &pFactory={}) const |
Track::Holder | Copy (double t0, double t1, bool forClipboard=true) const override |
Track::Holder | CopyNonconst (double t0, double t1) |
void | Clear (double t0, double t1) override |
void | Paste (double t0, const Track *src) override |
void | ClearAndPaste (double t0, double t1, const Track *src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=NULL) |
void | Silence (double t0, double t1) override |
void | InsertSilence (double t, double len) override |
void | SplitAt (double t) |
void | Split (double t0, double t1) |
void | ClearAndAddCutLine (double t0, double t1) |
Track::Holder | SplitCut (double t0, double t1) |
void | SplitDelete (double t0, double t1) |
void | Join (double t0, double t1) |
void | Disjoin (double t0, double t1) |
void | Trim (double t0, double t1) |
void | HandleClear (double t0, double t1, bool addCutLines, bool split) |
void | SyncLockAdjust (double oldT1, double newT1) override |
bool | IsEmpty (double t0, double t1) const |
Returns true if there are no WaveClips in the specified region. More... | |
bool | Append (constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1) override |
void | Flush () override |
bool | Get (samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override |
void | Set (constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len) |
void | GetEnvelopeValues (double *buffer, size_t bufferLen, double t0) const override |
Fetch envelope values corresponding to uniformly separated sample times starting at the given time. More... | |
std::pair< float, float > | GetMinMax (double t0, double t1, bool mayThrow=true) const |
float | GetRMS (double t0, double t1, bool mayThrow=true) const |
Sequence * | GetSequenceAtTime (double time) |
Envelope * | GetEnvelopeAtTime (double time) |
WaveClip * | GetClipAtSample (sampleCount sample) |
WaveClip * | GetClipAtTime (double time) |
sampleCount | GetBlockStart (sampleCount t) const override |
This returns a possibly large or negative value. More... | |
size_t | GetBestBlockSize (sampleCount t) const override |
This returns a nonnegative number of samples meant to size a memory buffer. More... | |
size_t | GetMaxBlockSize () const override |
This returns a nonnegative number of samples meant to size a memory buffer. More... | |
size_t | GetIdealBlockSize () |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
void | HandleXMLEndTag (const std::string_view &tag) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
void | WriteXML (XMLWriter &xmlFile) const override |
bool | GetErrorOpening () override |
bool | CloseLock () |
WaveClipHolders & | GetClips () |
const WaveClipConstHolders & | GetClips () const |
IteratorRange< AllClipsIterator > | GetAllClips () |
IteratorRange< AllClipsConstIterator > | GetAllClips () const |
WaveClip * | CreateClip (double offset=.0, const wxString &name=wxEmptyString) |
WaveClip * | NewestOrNewClip () |
Get access to the most recently added clip, or create a clip, if there is not already one. THIS IS NOT NECESSARILY RIGHTMOST. More... | |
WaveClip * | RightmostOrNewClip () |
Get access to the last (rightmost) clip, or create a clip, if there is not already one. More... | |
int | GetClipIndex (const WaveClip *clip) const |
WaveClip * | GetClipByIndex (int index) |
const WaveClip * | GetClipByIndex (int index) const |
int | GetNumClips () const |
WaveClipPointers | SortedClipArray () |
WaveClipConstPointers | SortedClipArray () const |
bool | CanOffsetClips (const std::vector< WaveClip * > &clips, double amount, double *allowedAmount=nullptr) |
Decide whether the clips could be offset (and inserted) together without overlapping other clips. More... | |
bool | CanInsertClip (WaveClip *clip, double &slideBy, double &tolerance) const |
std::shared_ptr< WaveClip > | RemoveAndReturnClip (WaveClip *clip) |
bool | AddClip (const std::shared_ptr< WaveClip > &clip) |
Append a clip to the track; which must have the same block factory as this track; return success. More... | |
void | MergeClips (int clipidx1, int clipidx2) |
void | UpdateLocationsCache () const |
const std::vector< Location > & | GetCachedLocations () const |
void | ExpandCutLine (double cutLinePosition, double *cutlineStart=NULL, double *cutlineEnd=NULL) |
bool | RemoveCutLine (double cutLinePosition) |
void | Merge (const Track &orig) override |
void | Resample (int rate, BasicUI::ProgressDialog *progress=NULL) |
const TypeInfo & | GetTypeInfo () const override |
int | GetLastScaleType () const |
void | SetLastScaleType () const |
int | GetLastdBRange () const |
void | SetLastdBRange () const |
void | GetDisplayBounds (float *min, float *max) const |
void | SetDisplayBounds (float min, float max) const |
void | GetSpectrumBounds (float *min, float *max) const |
void | SetSpectrumBounds (float min, float max) const |
int | ZeroLevelYCoordinate (wxRect rect) const |
Track::Holder | PasteInto (AudacityProject &) const override |
Find or create the destination track for a paste, maybe in a different project. More... | |
ConstIntervals | GetIntervals () const override |
Report times on the track where important intervals begin and end, for UI to snap to. More... | |
Intervals | GetIntervals () override |
const WaveClip * | FindClipByName (const wxString &name) const |
Returns nullptr if clip with such name was not found. More... | |
![]() | |
~WritableSampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
virtual void | SetOldChannelGain (int channel, float gain)=0 |
virtual bool | Append (constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1)=0 |
Append the sample data to the track. You must call Flush() after the last Append. More... | |
virtual void | Flush ()=0 |
Flush must be called after last Append. More... | |
![]() | |
~SampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
virtual sampleFormat | GetSampleFormat () const =0 |
virtual ChannelType | GetChannelIgnoringPan () const =0 |
virtual float | GetOldChannelGain (int channel) const =0 |
virtual double | GetRate () const =0 |
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. More... | |
virtual float | GetChannelGain (int channel) const =0 |
Takes gain and pan into account. More... | |
virtual size_t | GetBestBlockSize (sampleCount t) const =0 |
This returns a nonnegative number of samples meant to size a memory buffer. More... | |
virtual size_t | GetMaxBlockSize () const =0 |
This returns a nonnegative number of samples meant to size a memory buffer. More... | |
virtual sampleCount | GetBlockStart (sampleCount t) const =0 |
This returns a possibly large or negative value. More... | |
bool | GetFloats (float *buffer, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
Retrieve samples from a track in floating-point format, regardless of the storage format. More... | |
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. More... | |
sampleCount | TimeToLongSamples (double t0) const |
Convert correctly between an (absolute) time in seconds and a number of samples. More... | |
double | LongSamplesToTime (sampleCount pos) const |
Convert correctly between a number of samples and an (absolute) time in seconds. More... | |
![]() | |
PlayableTrack () | |
PlayableTrack (const PlayableTrack &orig) | |
bool | GetMute () const |
bool | GetSolo () const |
bool | GetNotMute () const |
bool | GetNotSolo () const |
void | SetMute (bool m) |
void | SetSolo (bool s) |
void | Init (const PlayableTrack &init) |
void | Merge (const Track &init) override |
void | WriteXMLAttributes (XMLWriter &xmlFile) const |
bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &value) |
![]() | |
AudioTrack () | |
AudioTrack (const Track &orig) | |
void | WriteXMLAttributes (XMLWriter &WXUNUSED(xmlFile)) const |
bool | HandleXMLAttribute (const std::string_view &, const XMLAttributeValueView &) |
![]() | |
TrackId | GetId () const |
template<typename Subclass = Track> | |
std::shared_ptr< Subclass > | SharedPointer () |
template<typename Subclass = const Track> | |
auto | SharedPointer () const -> std::enable_if_t< std::is_const_v< Subclass >, std::shared_ptr< Subclass > > |
std::shared_ptr< Track > | SubstitutePendingChangedTrack () |
std::shared_ptr< const Track > | SubstitutePendingChangedTrack () const |
std::shared_ptr< const Track > | SubstituteOriginalTrack () const |
virtual const TypeInfo & | GetTypeInfo () const =0 |
virtual const TypeNames & | GetTypeNames () const |
virtual bool | SupportsBasicEditing () const |
Whether this track type implements cut-copy-paste; by default, true. More... | |
virtual Holder | PasteInto (AudacityProject &) const =0 |
Find or create the destination track for a paste, maybe in a different project. More... | |
virtual ConstIntervals | GetIntervals () const |
Report times on the track where important intervals begin and end, for UI to snap to. More... | |
virtual Intervals | GetIntervals () |
int | GetIndex () const |
void | SetIndex (int index) |
virtual bool | LinkConsistencyFix (bool doFix=true, bool completeList=true) |
Check consistency of channel groups, and maybe fix it. More... | |
bool | LinkConsistencyCheck (bool completeList) |
Do the non-mutating part of consistency fix only and return status. More... | |
bool | HasOwner () const |
std::shared_ptr< TrackList > | GetOwner () const |
LinkType | GetLinkType () const noexcept |
bool | IsAlignedWithLeader () const |
Returns true if the leader track has link type LinkType::Aligned. More... | |
ChannelGroupData & | GetGroupData () |
const ChannelGroupData & | GetGroupData () const |
Track () | |
Track (const Track &orig) | |
virtual | ~Track () |
void | Init (const Track &orig) |
virtual Holder | Duplicate () const |
virtual void | Merge (const Track &orig) |
wxString | GetName () const |
void | SetName (const wxString &n) |
bool | GetSelected () const |
virtual void | SetSelected (bool s) |
void | EnsureVisible (bool modifyState=false) |
virtual ChannelType | GetChannel () const |
virtual double | GetOffset () const =0 |
void | Offset (double t) |
virtual void | SetOffset (double o) |
virtual void | SetPan (float) |
virtual void | SetPanFromChannelType () |
virtual Holder | Cut (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual Holder | Copy (double WXUNUSED(t0), double WXUNUSED(t1), bool forClipboard=true) const =0 |
virtual void | Clear (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual void | Paste (double WXUNUSED(t), const Track *WXUNUSED(src))=0 |
virtual void | SyncLockAdjust (double oldT1, double newT1) |
virtual void | Silence (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual void | InsertSilence (double WXUNUSED(t), double WXUNUSED(len))=0 |
bool | SameKindAs (const Track &track) const |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) |
Use this function rather than testing track type explicitly and making down-casts. More... | |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) const |
Use this function rather than testing track type explicitly and making down-casts. More... | |
virtual void | WriteXML (XMLWriter &xmlFile) const =0 |
virtual bool | GetErrorOpening () |
virtual double | GetStartTime () const =0 |
virtual double | GetEndTime () const =0 |
void | Notify (int code=-1) |
bool | Any () const |
bool | IsSelected () const |
bool | IsLeader () const |
bool | IsSelectedLeader () const |
void | AdjustPositions () |
void | WriteCommonXMLAttributes (XMLWriter &xmlFile, bool includeNameAndSelected=true) const |
bool | HandleCommonXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
![]() | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
![]() | |
~Site () | |
Site () | |
Site (const Site &other) | |
Site & | operator= (const Site &other) |
Site (Site &&other) | |
Site & | operator= (Site &&other) |
size_t | size () const |
How many attachment pointers are in the Site. More... | |
template<typename Subclass = ClientData> | |
Subclass & | Get (const RegisteredFactory &key) |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = const ClientData> | |
auto | Get (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass & > |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = ClientData> | |
Subclass * | Find (const RegisteredFactory &key) |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename Subclass = const ClientData> | |
auto | Find (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass * > |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename ReplacementPointer > | |
void | Assign (const RegisteredFactory &key, ReplacementPointer &&replacement) |
Reassign Site's pointer to ClientData. More... | |
Static Public Member Functions | |
static wxString | GetDefaultAudioTrackNamePreference () |
static WaveTrack * | New (AudacityProject &project) |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
template<typename Subclass = Track> | |
static std::shared_ptr< Subclass > | SharedPointer (Track *pTrack) |
template<typename Subclass = const Track> | |
static std::shared_ptr< Subclass > | SharedPointer (const Track *pTrack) |
static const TypeInfo & | ClassTypeInfo () |
static void | FinishCopy (const Track *n, Track *dest) |
template<typename TrackType > | |
static void | checkTrackType () |
template<typename R , typename TrackType , typename... Functions> | |
static R | CallExecutor (R *, std::tuple<> *, TrackType &, const Functions &...) |
template<typename R , typename TrackType , typename... Functions, typename Executor , typename... Executors> | |
static R | CallExecutor (R *, std::tuple< Executor, Executors... > *, TrackType &track, const Functions &...functions) |
template<typename ... Executors> | |
static constexpr unsigned | UsedCases (std::tuple< Executors... > *) |
template<typename Tag , bool IsConst, typename R , typename ... TrackTypes, typename ... Functions> | |
static R | DoTypeSwitch (std::conditional_t< IsConst, const Track, Track > &track, std::tuple< TrackTypes... > *, const Functions &...functions) |
![]() | |
static size_t | slots () |
How many static factories have been registered with this specialization of Site. More... | |
Protected Attributes | |
WaveClipHolders | mClips |
sampleFormat | mFormat |
int | mRate |
std::atomic< float > | mGain { 1.0f } |
Atomic because it may be read by worker threads in playback. More... | |
std::atomic< float > | mPan { 0.0f } |
Atomic because it may be read by worker threads in playback. More... | |
int | mWaveColorIndex |
float | mOldGain [2] |
A memo used by PortAudio thread, doesn't need atomics: More... | |
float | mDisplayMin |
float | mDisplayMax |
float | mSpectrumMin |
float | mSpectrumMax |
int | mLastScaleType |
int | mLastdBRange |
std::vector< Location > | mDisplayLocationsCache |
![]() | |
std::atomic< bool > | mMute { false } |
Atomic because it may be read by worker threads in playback. More... | |
std::atomic< bool > | mSolo { false } |
Atomic because it may be read by worker threads in playback. More... | |
![]() | |
std::weak_ptr< TrackList > | mList |
TrackNodePointer | mNode {} |
Holds iterator to self, so that TrackList::Find can be constant-time. More... | |
int | mIndex |
0-based position of this track in its TrackList More... | |
wxString | mName |
ChannelType | mChannel |
double | mOffset |
Private Member Functions | |
void | Init (const WaveTrack &orig) |
Track::Holder | Clone () const override |
wxString | MakeClipCopyName (const wxString &originalName) const |
wxString | MakeNewClipName () const |
void | DoSetPan (float value) |
void | DoSetGain (float value) |
void | PasteWaveTrack (double t0, const WaveTrack *other) |
Private Attributes | |
SampleBlockFactoryPtr | mpFactory |
wxCriticalSection | mFlushCriticalSection |
wxCriticalSection | mAppendCriticalSection |
double | mLegacyProjectFileOffset |
std::unique_ptr< SpectrogramSettings > | mpSpectrumSettings |
std::unique_ptr< WaveformSettings > | mpWaveformSettings |
Friends | |
class | WaveTrackFactory |
Additional Inherited Members | |
![]() | |
std::pair< int, int > | vrulerSize |
![]() | |
bool | DoGetMute () const |
void | DoSetMute (bool value) |
bool | DoGetSolo () const |
void | DoSetSolo (bool value) |
![]() | |
void | SetLinkType (LinkType linkType, bool completeList=true) |
void | SetChannel (ChannelType c) noexcept |
![]() | |
template<typename Function > | |
void | ForEach (const Function &function) |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
void | ForEach (const Function &function) const |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
ClientData * | FindIf (const Function &function) |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
template<typename Function > | |
const ClientData * | FindIf (const Function &function) const |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
void | BuildAll () |
For each RegisteredFactory, if the corresponding attachment is absent in this , build and store it. More... | |
A Track that contains audio waveform data.
Definition at line 56 of file WaveTrack.h.
using WaveTrack::Holder = std::shared_ptr<WaveTrack> |
Definition at line 105 of file WaveTrack.h.
typedef WaveTrackLocation WaveTrack::Location |
Definition at line 104 of file WaveTrack.h.
using WaveTrack::Regions = std::vector < Region > |
Definition at line 75 of file WaveTrack.h.
WaveTrack::WaveTrack | ( | const SampleBlockFactoryPtr & | pFactory, |
sampleFormat | format, | ||
double | rate | ||
) |
Definition at line 137 of file WaveTrack.cpp.
References format, mDisplayMax, mDisplayMin, mFormat, mLastdBRange, mLastScaleType, mLegacyProjectFileOffset, mOldGain, mRate, mSpectrumMax, mSpectrumMin, and mWaveColorIndex.
WaveTrack::WaveTrack | ( | const WaveTrack & | orig | ) |
Definition at line 156 of file WaveTrack.cpp.
References Init(), mClips, mLastdBRange, mLastScaleType, mLegacyProjectFileOffset, and mpFactory.
|
virtual |
Definition at line 237 of file WaveTrack.cpp.
bool WaveTrack::AddClip | ( | const std::shared_ptr< WaveClip > & | clip | ) |
Append a clip to the track; which must have the same block factory as this track; return success.
Definition at line 1220 of file WaveTrack.cpp.
References mClips.
Referenced by ClearAndPaste(), and EffectReverse::ProcessOneWave().
|
overridevirtual |
Implements WritableSampleTrack.
Definition at line 1766 of file WaveTrack.cpp.
References WaveClip::Append(), format, and RightmostOrNewClip().
Referenced by BlockGenerator::GenerateTrack(), EffectTwoPassSimpleMono::ProcessOne(), and NyquistEffect::PutCallback().
bool WaveTrack::CanInsertClip | ( | WaveClip * | clip, |
double & | slideBy, | ||
double & | tolerance | ||
) | const |
Definition at line 2482 of file WaveTrack.cpp.
References WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), and mClips.
bool WaveTrack::CanOffsetClips | ( | const std::vector< WaveClip * > & | clips, |
double | amount, | ||
double * | allowedAmount = nullptr |
||
) |
Decide whether the clips could be offset (and inserted) together without overlapping other clips.
(allowedAmount ? *allowedAmount : amount)
clips | not necessarily in this track | |
amount | signed | |
[out] | allowedAmount | if null, test exact amount only; else, largest (in magnitude) possible offset with same sign |
Definition at line 2424 of file WaveTrack.cpp.
References CanOffsetClips(), and mClips.
Referenced by CanOffsetClips().
|
static |
Definition at line 329 of file WaveTrack.cpp.
References typeInfo().
|
override |
Definition at line 788 of file WaveTrack.cpp.
References HandleClear().
Referenced by Cut(), EffectTruncSilence::DoRemoval(), LabelEditActions::Handler::OnCutLabels(), Generator::Process(), EffectEqualization::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectPaulstretch::ProcessOne(), SyncLockAdjust(), and Trim().
void WaveTrack::ClearAndAddCutLine | ( | double | t0, |
double | t1 | ||
) |
Definition at line 794 of file WaveTrack.cpp.
References HandleClear().
Referenced by EditActions::Handler::OnCut(), and LabelEditActions::Handler::OnCutLabels().
void WaveTrack::ClearAndPaste | ( | double | t0, |
double | t1, | ||
const Track * | src, | ||
bool | preserve = true , |
||
bool | merge = true , |
||
const TimeWarper * | effectWarper = NULL |
||
) |
Definition at line 915 of file WaveTrack.cpp.
References AddClip(), GetClipIndex(), GetClips(), Track::GetEndTime(), WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), GetRate(), WaveClip::GetSequenceStartTime(), WaveClip::GetTrimLeft(), WaveClip::GetTrimRight(), HandleClear(), SampleTrack::LongSamplesToTime(), mClips, MergeClips(), min(), mpFactory, WaveClip::Offset(), Paste(), WaveClip::Paste(), WaveClip::SetSequenceStartTime(), WaveClip::SetTrimLeft(), WaveClip::SetTrimRight(), SortedClipArray(), SampleTrack::TimeToLongSamples(), and TimeWarper::Warp().
Referenced by TrackSpectrumTransformer::DoFinish(), EffectSBSMS::Finalize(), EditActions::Handler::OnPaste(), Generator::Process(), NyquistEffect::ProcessOne(), EffectNoiseRemoval::ProcessOne(), EffectChangeSpeed::ProcessOne(), and PerTrackEffect::ProcessTrack().
|
overrideprivatevirtual |
Implements Track.
Definition at line 452 of file WaveTrack.cpp.
bool WaveTrack::CloseLock | ( | ) |
Definition at line 1987 of file WaveTrack.cpp.
References mClips.
void WaveTrack::ConvertToSampleFormat | ( | sampleFormat | format, |
const std::function< void(size_t)> & | progressReport = {} |
||
) |
Definition at line 598 of file WaveTrack.cpp.
References format, mClips, and mFormat.
Referenced by EffectEqualization::ProcessOne().
|
override |
Definition at line 716 of file WaveTrack.cpp.
References EmptyCopy(), GetEndTime(), GetRate(), GetSampleFormat(), mClips, min(), mpFactory, WaveClip::Offset(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by CopyNonconst(), Cut(), EditActions::Handler::OnSplitCut(), LabelEditActions::Handler::OnSplitCutLabels(), and SplitCut().
Track::Holder WaveTrack::CopyNonconst | ( | double | t0, |
double | t1 | ||
) |
Definition at line 782 of file WaveTrack.cpp.
References Copy().
Referenced by LabelEditActions::Handler::OnCopyLabels(), and LabelEditActions::Handler::OnCutLabels().
WaveClip * WaveTrack::CreateClip | ( | double | offset = .0 , |
const wxString & | name = wxEmptyString |
||
) |
Definition at line 2358 of file WaveTrack.cpp.
References GetWaveColorIndex(), mClips, mFormat, mpFactory, mRate, and name.
Referenced by AUPImportFileHandle::HandleWaveClip(), HandleXMLChild(), Join(), NewestOrNewClip(), and RightmostOrNewClip().
|
override |
Definition at line 629 of file WaveTrack.cpp.
References Clear(), Copy(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by PasteWaveTrack(), and SyncLockAdjust().
void WaveTrack::Disjoin | ( | double | t0, |
double | t1 | ||
) |
Definition at line 1637 of file WaveTrack.cpp.
References PackedArray::end(), WaveTrack::Region::end, floatSample, limitSampleBufferSize(), mClips, min(), SplitDelete(), WaveTrack::Region::start, SampleTrack::TimeToLongSamples(), and WAVETRACK_MERGE_POINT_TOLERANCE.
Referenced by LabelEditActions::Handler::OnDisjoinLabels().
|
private |
Definition at line 503 of file WaveTrack.cpp.
References mGain.
Referenced by HandleXMLTag(), Init(), Merge(), and SetGain().
|
private |
Definition at line 521 of file WaveTrack.cpp.
References mPan.
Referenced by HandleXMLTag(), Init(), Merge(), and SetPan().
WaveTrack::Holder WaveTrack::EmptyCopy | ( | const SampleBlockFactoryPtr & | pFactory = {} | ) | const |
Definition at line 707 of file WaveTrack.cpp.
References mFormat, mpFactory, and mRate.
Referenced by Copy(), TrackSpectrumTransformer::DoStart(), PasteInto(), Generator::Process(), EffectSBSMS::Process(), NyquistEffect::ProcessOne(), EffectEqualization::ProcessOne(), EffectNoiseRemoval::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectPaulstretch::ProcessOne(), and PerTrackEffect::ProcessTrack().
void WaveTrack::ExpandCutLine | ( | double | cutLinePosition, |
double * | cutlineStart = NULL , |
||
double * | cutlineEnd = NULL |
||
) |
Definition at line 2618 of file WaveTrack.cpp.
References BadUserAction, PackedArray::end(), GetEditClipsCanMove(), mClips, and XO.
const WaveClip * WaveTrack::FindClipByName | ( | const wxString & | name | ) | const |
Returns nullptr if clip with such name was not found.
Definition at line 442 of file WaveTrack.cpp.
Referenced by MakeClipCopyName(), and MakeNewClipName().
|
overridevirtual |
Implements WritableSampleTrack.
Definition at line 1836 of file WaveTrack.cpp.
References WaveClip::Flush(), and RightmostOrNewClip().
Referenced by EffectTwoPassSimpleMono::ProcessOne(), and AudioIO::StopStream().
|
overridevirtual |
MM: Now that each wave track can contain multiple clips, we don't have a continuous space of samples anymore, but we simulate it, because there are a lot of places (e.g. effects) using this interface. This interface makes much sense for modifying samples, but note that it is not time-accurate, because the "offset" is a double value and therefore can lie inbetween samples. But as long as you use the same value for "start" in both calls to "Set" and "Get" it is guaranteed that the same samples are affected.
Implements SampleTrack.
Definition at line 2112 of file WaveTrack.cpp.
References ClearSamples(), fillTwo, fillZero, floatSample, format, mClips, min(), and SAMPLE_SIZE.
Referenced by WaveTrackFactory::Get(), and EffectNoiseRemoval::ProcessOne().
|
inline |
Definition at line 404 of file WaveTrack.h.
|
inline |
Definition at line 409 of file WaveTrack.h.
|
overridevirtual |
This returns a nonnegative number of samples meant to size a memory buffer.
Implements SampleTrack.
Definition at line 1788 of file WaveTrack.cpp.
References GetMaxBlockSize(), and mClips.
Referenced by EffectNormalize::AnalyseTrackData(), CompareAudioCommand::Apply(), BlockGenerator::GenerateTrack(), NyquistEffect::GetCallback(), TrackSpectrumTransformer::Process(), EffectNoiseRemoval::ProcessOne(), EffectLoudness::ProcessOne(), EffectNormalize::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectReverse::ProcessOneClip(), resampleCB(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().
|
overridevirtual |
This returns a possibly large or negative value.
Implements SampleTrack.
Definition at line 1772 of file WaveTrack.cpp.
References mClips.
|
inline |
Definition at line 482 of file WaveTrack.h.
Referenced by WaveTrackSubView::DrawBoldBoundaries(), anonymous_namespace{CutlineHandle.cpp}::FindMergeLine(), and anonymous_namespace{CutlineHandle.cpp}::IsOverCutline().
|
overridevirtual |
Reimplemented from Track.
Definition at line 262 of file WaveTrack.cpp.
References GetPan(), Track::LeftChannel, Track::mChannel, Track::MonoChannel, and Track::RightChannel.
|
overridevirtual |
Takes gain and pan into account.
Implements SampleTrack.
Definition at line 539 of file WaveTrack.cpp.
References GetGain(), and GetPan().
Referenced by AudioIoCallback::AddToOutputChannel(), and MixerTrackCluster::UpdateMeter().
|
overridevirtual |
May be called from a worker thread
Implements SampleTrack.
Definition at line 258 of file WaveTrack.cpp.
References Track::mChannel.
Referenced by AudioIoCallback::FillOutputBuffers(), and AudioIoCallback::TrackHasBeenFadedOut().
WaveClip * WaveTrack::GetClipAtSample | ( | sampleCount | sample | ) |
Definition at line 2303 of file WaveTrack.cpp.
References WaveClip::GetPlayStartSample(), and mClips.
WaveClip * WaveTrack::GetClipAtTime | ( | double | time | ) |
Definition at line 2319 of file WaveTrack.cpp.
References SortedClipArray().
Referenced by SelectHandle::Click(), GetEnvelopeAtTime(), and GetSequenceAtTime().
WaveClip * WaveTrack::GetClipByIndex | ( | int | index | ) |
Definition at line 2406 of file WaveTrack.cpp.
References mClips.
Referenced by GetClipByIndex(), MergeClips(), and PasteWaveTrack().
const WaveClip * WaveTrack::GetClipByIndex | ( | int | index | ) | const |
Definition at line 2414 of file WaveTrack.cpp.
References GetClipByIndex().
int WaveTrack::GetClipIndex | ( | const WaveClip * | clip | ) | const |
Definition at line 2399 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), and mClips.
Referenced by ClearAndPaste(), and UpdateLocationsCache().
|
inline |
Definition at line 322 of file WaveTrack.h.
Referenced by ProjectFileManager::AddImportedTracks(), WaveClipTrimHandle::AdjustBetweenBorders::AdjustBetweenBorders(), ClearAndPaste(), SpectrumView::DoDraw(), WaveformView::DoDraw(), EffectEqualization::ProcessOne(), EffectReverse::ProcessOneWave(), and anonymous_namespace{ClipMenus.cpp}::TwoChannelsHaveSameBoundaries().
|
inline |
Definition at line 323 of file WaveTrack.h.
|
static |
Definition at line 100 of file WaveTrack.cpp.
References AudioTrackNameSetting, DefaultName, TranslatableString::empty(), name, and Setting< T >::ReadWithDefault().
Referenced by TracksPrefs::Commit(), EffectBase::DoEffect(), ProjectAudioManager::DoRecord(), anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewStereoTrack(), and anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewWaveTrack().
void WaveTrack::GetDisplayBounds | ( | float * | min, |
float * | max | ||
) | const |
Definition at line 344 of file WaveTrack.cpp.
References mDisplayMax, mDisplayMin, and min().
Referenced by EnvelopeHandle::Click(), WaveformVRulerControls::DoHandleWheelRotation(), WaveformVRulerControls::DoUpdateVRuler(), WaveformVZoomHandle::DoZoom(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), and GetInfoCommand::SendTracks().
|
overridevirtual |
Get the time at which the last clip in the track ends, plus recorded stuff.
Implements Track.
Definition at line 2015 of file WaveTrack.cpp.
References mClips.
Referenced by AUPImportFileHandle::AddSilence(), EffectTruncSilence::Analyze(), Copy(), Effect::GetBounds(), PasteWaveTrack(), EffectChangeSpeed::Process(), EffectSBSMS::Process(), NyquistEffect::ProcessOne(), EffectStereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), SyncLockAdjust(), and Trim().
Envelope * WaveTrack::GetEnvelopeAtTime | ( | double | time | ) |
Definition at line 2340 of file WaveTrack.cpp.
References GetClipAtTime(), and WaveClip::GetEnvelope().
|
overridevirtual |
Fetch envelope values corresponding to uniformly separated sample times starting at the given time.
Implements SampleTrack.
Definition at line 2237 of file WaveTrack.cpp.
References limitSampleBufferSize(), mClips, min(), and mRate.
|
overridevirtual |
Reimplemented from Track.
Definition at line 1978 of file WaveTrack.cpp.
References mClips.
float WaveTrack::GetGain | ( | ) | const |
Definition at line 498 of file WaveTrack.cpp.
References mGain.
Referenced by WaveTrackControls::GainSlider(), GetChannelGain(), Init(), Merge(), GetInfoCommand::SendTracks(), and SetGain().
size_t WaveTrack::GetIdealBlockSize | ( | ) |
Definition at line 1826 of file WaveTrack.cpp.
References Sequence::GetIdealBlockSize(), WaveClip::GetSequence(), and NewestOrNewClip().
Referenced by NyquistEffect::GetCallback().
SpectrogramSettings & WaveTrack::GetIndependentSpectrogramSettings | ( | ) |
Definition at line 815 of file WaveTrack.cpp.
References SpectrogramSettings::defaults(), and mpSpectrumSettings.
Referenced by SpectrumVRulerControls::DoHandleWheelRotation(), and UseSpectralPrefs().
|
overridevirtual |
Report times on the track where important intervals begin and end, for UI to snap to.
Some intervals may be empty, and no ordering of the intervals is assumed.
Reimplemented from Track.
Definition at line 432 of file WaveTrack.cpp.
References mClips.
|
overridevirtual |
This overload exposes the extra data of the intervals as non-const This overload exposes the extra data of the intervals as non-const
Reimplemented from Track.
Definition at line 437 of file WaveTrack.cpp.
|
inline |
Definition at line 503 of file WaveTrack.h.
Referenced by WaveformVRulerControls::DoUpdateVRuler().
|
inline |
Definition at line 500 of file WaveTrack.h.
Referenced by WaveformVRulerControls::DoUpdateVRuler().
|
overridevirtual |
This returns a nonnegative number of samples meant to size a memory buffer.
Implements SampleTrack.
Definition at line 1806 of file WaveTrack.cpp.
References GetMaxBlockSize(), mClips, mFormat, and mpFactory.
Referenced by EffectNormalize::AnalyseTrackData(), EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), BlockGenerator::GenerateTrack(), GetBestBlockSize(), GetMaxBlockSize(), EffectCompressor::InitPass1(), TrackSpectrumTransformer::Process(), EffectSBSMS::Process(), EffectEqualization::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectNoiseRemoval::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectNormalize::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectReverse::ProcessOneClip(), PerTrackEffect::ProcessPass(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().
std::pair< float, float > WaveTrack::GetMinMax | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Definition at line 2040 of file WaveTrack.cpp.
References mClips, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectNormalize::AnalyseTrack(), and NyquistEffect::ProcessOne().
int WaveTrack::GetNumClips | ( | ) | const |
Definition at line 2419 of file WaveTrack.cpp.
References mClips.
Referenced by PasteWaveTrack().
|
overridevirtual |
Implements Track.
Definition at line 241 of file WaveTrack.cpp.
References GetStartTime().
Referenced by TranscriptionToolBar::GetSamples(), EditActions::Handler::OnSplitNew(), and SetOffset().
|
overridevirtual |
Implements SampleTrack.
Definition at line 557 of file WaveTrack.cpp.
References mOldGain.
Referenced by AudioIoCallback::AddToOutputChannel(), and AudioIoCallback::TrackHasBeenFadedOut().
float WaveTrack::GetPan | ( | ) | const |
Definition at line 516 of file WaveTrack.cpp.
References mPan.
Referenced by GetChannel(), GetChannelGain(), Init(), Merge(), WaveTrackControls::PanSlider(), GetInfoCommand::SendTracks(), and SetPan().
sampleCount WaveTrack::GetPlaySamplesCount | ( | ) | const |
Definition at line 577 of file WaveTrack.cpp.
References mClips.
|
overridevirtual |
Implements SampleTrack.
Definition at line 481 of file WaveTrack.cpp.
References mRate.
Referenced by ProjectFileManager::AddImportedTracks(), SelectHandle::AdjustFreqSelection(), EffectTruncSilence::Analyze(), VoiceKey::CalibrateNoise(), ClearAndPaste(), Copy(), SpectrumVRulerControls::DoHandleWheelRotation(), SpectrumVZoomHandle::DoZoom(), WaveformVZoomHandle::DoZoom(), anonymous_namespace{CutlineHandle.cpp}::FindMergeLine(), TranscriptionToolBar::GetSamples(), GetSpectrumBounds(), SelectHandle::MoveSnappingFreqSelection(), VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), anonymous_namespace{SelectHandle.cpp}::PositionToFrequency(), Generator::Process(), EffectSBSMS::Process(), NyquistEffect::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectPaulstretch::ProcessOne(), SpectralDataManager::Worker::ProcessOvertones(), PerTrackEffect::ProcessPass(), SpectralDataManager::Worker::ProcessSnapping(), PerTrackEffect::ProcessTrack(), anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest(), SelectHandle::SnapCenterOnce(), ProjectSelectionManager::SSBL_GetRate(), SelectHandle::StartSnappingFreqSelection(), anonymous_namespace{WaveTrackControls.cpp}::Status1DrawFunction(), and SyncLockAdjust().
float WaveTrack::GetRMS | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Definition at line 2079 of file WaveTrack.cpp.
References sampleCount::as_double(), mClips, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectLoudness::GetTrackRMS(), and NyquistEffect::ProcessOne().
|
inlineoverridevirtual |
Implements SampleTrack.
Definition at line 160 of file WaveTrack.h.
Referenced by Copy(), and SyncLockAdjust().
Sequence * WaveTrack::GetSequenceAtTime | ( | double | time | ) |
Definition at line 2349 of file WaveTrack.cpp.
References GetClipAtTime(), and WaveClip::GetSequence().
sampleCount WaveTrack::GetSequenceSamplesCount | ( | ) | const |
Definition at line 587 of file WaveTrack.cpp.
References mClips.
SpectrogramSettings & WaveTrack::GetSpectrogramSettings | ( | ) |
Definition at line 807 of file WaveTrack.cpp.
References SpectrogramSettings::defaults(), and mpSpectrumSettings.
const SpectrogramSettings & WaveTrack::GetSpectrogramSettings | ( | ) | const |
Definition at line 799 of file WaveTrack.cpp.
References SpectrogramSettings::defaults(), and mpSpectrumSettings.
Referenced by SpectrumVRulerControls::DoUpdateVRuler(), SpectrumVZoomHandle::DoZoom(), for(), anonymous_namespace{BrushHandle.cpp}::FrequencyToPosition(), anonymous_namespace{SelectHandle.cpp}::FrequencyToPosition(), GetSpectrumBounds(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), anonymous_namespace{SelectHandle.cpp}::PositionToFrequency(), NyquistEffect::ProcessOne(), SelectHandle::SnapCenterOnce(), SpectrumPrefs::SpectrumPrefs(), and SelectHandle::StartSnappingFreqSelection().
void WaveTrack::GetSpectrumBounds | ( | float * | min, |
float * | max | ||
) | const |
Definition at line 356 of file WaveTrack.cpp.
References GetRate(), GetSpectrogramSettings(), min(), mSpectrumMax, mSpectrumMin, settings(), SpectrogramSettings::stLinear, and SpectrogramSettings::stPeriod.
Referenced by SpectrumVRulerControls::DoHandleWheelRotation(), SpectrumVRulerControls::DoUpdateVRuler(), SpectrumVZoomHandle::DoZoom(), anonymous_namespace{BrushHandle.cpp}::FrequencyToPosition(), anonymous_namespace{SelectHandle.cpp}::FrequencyToPosition(), anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), anonymous_namespace{SelectHandle.cpp}::PositionToFrequency(), and SpectrumPrefs::SpectrumPrefs().
|
overridevirtual |
Get the time at which the first clip in the track starts.
Implements Track.
Definition at line 1995 of file WaveTrack.cpp.
References mClips.
Referenced by Effect::GetBounds(), GetOffset(), PasteWaveTrack(), EffectChangeSpeed::Process(), EffectSBSMS::Process(), EffectStereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), and Trim().
|
overridevirtual |
Implements Track.
Definition at line 324 of file WaveTrack.cpp.
References typeInfo().
|
inline |
Definition at line 154 of file WaveTrack.h.
Referenced by CreateClip(), and InsertSilence().
WaveformSettings & WaveTrack::GetWaveformSettings | ( | ) |
Definition at line 853 of file WaveTrack.cpp.
References WaveformSettings::defaults(), and mpWaveformSettings.
const WaveformSettings & WaveTrack::GetWaveformSettings | ( | ) | const |
Definition at line 847 of file WaveTrack.cpp.
References GetWaveformSettings().
Referenced by EnvelopeHandle::Click(), WaveformView::DoDraw(), WaveformVRulerControls::DoHandleWheelRotation(), WaveformVRulerControls::DoUpdateVRuler(), WaveformVZoomHandle::DoZoom(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), for(), GetWaveformSettings(), WaveformVRulerMenuTable::OnWaveformScaleType(), SetLastdBRange(), SetLastScaleType(), and WaveformPrefs::WaveformPrefs().
void WaveTrack::HandleClear | ( | double | t0, |
double | t1, | ||
bool | addCutLines, | ||
bool | split | ||
) |
Definition at line 1233 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), GetEditClipsCanMove(), mClips, mpFactory, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by Clear(), ClearAndAddCutLine(), ClearAndPaste(), and SplitDelete().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 1914 of file WaveTrack.cpp.
References CreateClip(), XMLMethodRegistry< Host >::Get(), WaveClip::GetEnvelope(), WaveClip::GetSequence(), mLegacyProjectFileOffset, NewestOrNewClip(), and WaveClip::SetSequenceStartTime().
|
override |
Definition at line 1907 of file WaveTrack.cpp.
References WaveClip::HandleXMLEndTag(), and NewestOrNewClip().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 1849 of file WaveTrack.cpp.
References DoSetGain(), DoSetPan(), Track::HandleCommonXMLAttribute(), PlayableTrack::HandleXMLAttribute(), anonymous_namespace{WaveTrack.cpp}::IsValidChannel(), Sequence::IsValidSampleFormat(), lrint, Track::mChannel, mFormat, mLegacyProjectFileOffset, mRate, mWaveColorIndex, Track::SetLinkType(), and anonymous_namespace{WaveTrack.cpp}::ToLinkType().
|
private |
Definition at line 181 of file WaveTrack.cpp.
References DoSetGain(), DoSetPan(), GetGain(), GetPan(), PlayableTrack::Init(), mDisplayLocationsCache, mDisplayMax, mDisplayMin, mFormat, mOldGain, mpFactory, mRate, mSpectrumMax, mSpectrumMin, and mWaveColorIndex.
Referenced by Reinit(), and WaveTrack().
|
override |
Definition at line 1597 of file WaveTrack.cpp.
References PackedArray::end(), GetWaveColorIndex(), mClips, mFormat, mpFactory, mRate, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by AUPImportFileHandle::AddSilence(), EffectSilence::GenerateTrack(), and FFmpegImportFileHandle::Import().
bool WaveTrack::IsEmpty | ( | double | t0, |
double | t1 | ||
) | const |
Returns true if there are no WaveClips in the specified region.
Definition at line 607 of file WaveTrack.cpp.
References mClips.
Referenced by PasteWaveTrack(), Generator::Process(), and SyncLockAdjust().
void WaveTrack::Join | ( | double | t0, |
double | t1 | ||
) |
Definition at line 1708 of file WaveTrack.cpp.
References CreateClip(), PackedArray::end(), anonymous_namespace{WaveTrack.cpp}::FindClip(), Track::GetName(), mClips, and mRate.
Referenced by LabelEditActions::Handler::OnJoinLabels(), and EffectEqualization::ProcessOne().
|
overridevirtual |
Check consistency of channel groups, and maybe fix it.
doFix | whether to make any changes to correct inconsistencies |
completeList | whether to assume that the TrackList containing this is completely loaded; if false, skip some of the checks |
Reimplemented from Track.
Definition at line 282 of file WaveTrack.cpp.
References Track::Aligned, anonymous_namespace{WaveTrack.cpp}::AreAligned(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), Track::GetLinkType(), Track::GetName(), Track::GetOwner(), Track::Group, Track::LinkConsistencyFix(), Track::MonoChannel, Track::None, Track::SetChannel(), Track::SetLinkType(), and SortedClipArray().
|
private |
Definition at line 457 of file WaveTrack.cpp.
References FindClipByName(), name, and XC.
Referenced by PasteWaveTrack().
|
private |
Definition at line 469 of file WaveTrack.cpp.
References FindClipByName(), Track::GetName(), name, and XC.
Referenced by NewestOrNewClip(), PasteWaveTrack(), and RightmostOrNewClip().
|
overridevirtual |
Reimplemented from Track.
Definition at line 221 of file WaveTrack.cpp.
References DoSetGain(), DoSetPan(), GetGain(), GetPan(), mDisplayMax, mDisplayMin, PlayableTrack::Merge(), mpSpectrumSettings, mpWaveformSettings, SetSpectrogramSettings(), SetWaveformSettings(), and Track::TypeSwitch().
Referenced by WaveTrackMenuTable::OnMergeStereo().
void WaveTrack::MergeClips | ( | int | clipidx1, |
int | clipidx2 | ||
) |
Definition at line 2681 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), GetClipByIndex(), WaveClip::GetPlayEndTime(), mClips, and WaveClip::Paste().
Referenced by ClearAndPaste().
|
static |
Definition at line 128 of file WaveTrack.cpp.
References TrackList::Get(), and WaveTrackFactory::Get().
WaveClip * WaveTrack::NewestOrNewClip | ( | ) |
Get access to the most recently added clip, or create a clip, if there is not already one. THIS IS NOT NECESSARILY RIGHTMOST.
Definition at line 2368 of file WaveTrack.cpp.
References CreateClip(), MakeNewClipName(), mClips, and Track::mOffset.
Referenced by GetIdealBlockSize(), HandleXMLChild(), and HandleXMLEndTag().
|
override |
Definition at line 1563 of file WaveTrack.cpp.
References PasteWaveTrack().
Referenced by ClearAndPaste(), PasteWaveTrack(), EffectEqualization::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectPaulstretch::ProcessOne(), and SyncLockAdjust().
|
overridevirtual |
Find or create the destination track for a paste, maybe in a different project.
use_count()
can tell whether it is new Implements Track.
Definition at line 423 of file WaveTrack.cpp.
References EmptyCopy(), and WaveTrackFactory::Get().
|
private |
Definition at line 1403 of file WaveTrack.cpp.
References BadUserAction, Cut(), GetClipByIndex(), GetEditClipsCanMove(), GetEndTime(), GetNumClips(), Track::GetOwner(), WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), GetStartTime(), IsEmpty(), MakeClipCopyName(), MakeNewClipName(), mClips, mpFactory, mRate, Paste(), WaveClip::Paste(), SampleTrack::TimeToLongSamples(), and XO.
Referenced by Paste().
void WaveTrack::Reinit | ( | const WaveTrack & | orig | ) |
Definition at line 200 of file WaveTrack.cpp.
References Init(), mpSpectrumSettings, mpWaveformSettings, and settings().
Referenced by ProjectAudioManager::DoRecord().
Definition at line 1207 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), and mClips.
Referenced by EffectReverse::ProcessOneWave().
bool WaveTrack::RemoveCutLine | ( | double | cutLinePosition | ) |
Definition at line 2671 of file WaveTrack.cpp.
References mClips.
void WaveTrack::Resample | ( | int | rate, |
BasicUI::ProgressDialog * | progress = NULL |
||
) |
WaveClip * WaveTrack::RightmostOrNewClip | ( | ) |
Get access to the last (rightmost) clip, or create a clip, if there is not already one.
Definition at line 2378 of file WaveTrack.cpp.
References CreateClip(), PackedArray::end(), WaveClip::GetPlayStartTime(), MakeNewClipName(), mClips, and Track::mOffset.
Referenced by AUPImportFileHandle::AddSamples(), Append(), Flush(), and AUPImportFileHandle::HandleEnvelope().
void WaveTrack::Set | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len | ||
) |
Definition at line 2195 of file WaveTrack.cpp.
References format, mClips, min(), and SAMPLE_SIZE.
Referenced by EffectAutoDuck::ApplyDuckFade(), EffectTruncSilence::DoRemoval(), EffectClickRemoval::ProcessOne(), EffectRepair::ProcessOne(), EffectNormalize::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectReverse::ProcessOneClip(), and PerTrackEffect::ProcessTrack().
void WaveTrack::SetDisplayBounds | ( | float | min, |
float | max | ||
) | const |
Definition at line 350 of file WaveTrack.cpp.
References mDisplayMax, mDisplayMin, and min().
Referenced by WaveformVRulerControls::DoUpdateVRuler().
void WaveTrack::SetGain | ( | float | newGain | ) |
Definition at line 508 of file WaveTrack.cpp.
References DoSetGain(), GetGain(), and Track::Notify().
Referenced by MixerTrackCluster::HandleSliderGain().
void WaveTrack::SetLastdBRange | ( | ) | const |
Definition at line 339 of file WaveTrack.cpp.
References WaveformSettings::dBRange, GetWaveformSettings(), and mLastdBRange.
Referenced by WaveformVRulerControls::DoUpdateVRuler().
void WaveTrack::SetLastScaleType | ( | ) | const |
Definition at line 334 of file WaveTrack.cpp.
References GetWaveformSettings(), mLastScaleType, and WaveformSettings::scaleType.
Referenced by WaveformVRulerControls::DoUpdateVRuler().
|
overridevirtual |
Reimplemented from Track.
Definition at line 247 of file WaveTrack.cpp.
References GetOffset(), mClips, and Track::mOffset.
|
overridevirtual |
Implements WritableSampleTrack.
Definition at line 562 of file WaveTrack.cpp.
References mOldGain.
Referenced by AudioIoCallback::AddToOutputChannel().
|
overridevirtual |
Reimplemented from Track.
Definition at line 526 of file WaveTrack.cpp.
References DoSetPan(), GetPan(), and Track::Notify().
Referenced by MixerTrackCluster::HandleSliderPan(), WaveTrackMenuTable::OnMergeStereo(), and SetPanFromChannelType().
|
overridevirtual |
Reimplemented from Track.
Definition at line 274 of file WaveTrack.cpp.
References Track::LeftChannel, Track::mChannel, Track::RightChannel, and SetPan().
void WaveTrack::SetRate | ( | double | newRate | ) |
Definition at line 486 of file WaveTrack.cpp.
void WaveTrack::SetSpectrogramSettings | ( | std::unique_ptr< SpectrogramSettings > && | pSettings | ) |
Definition at line 823 of file WaveTrack.cpp.
References mpSpectrumSettings.
Referenced by Merge().
void WaveTrack::SetSpectrumBounds | ( | float | min, |
float | max | ||
) | const |
Definition at line 400 of file WaveTrack.cpp.
References min(), mSpectrumMax, and mSpectrumMin.
void WaveTrack::SetWaveColorIndex | ( | int | colorIndex | ) |
Definition at line 570 of file WaveTrack.cpp.
References mClips, and mWaveColorIndex.
Referenced by SetTrackVisualsCommand::ApplyInner().
void WaveTrack::SetWaveformSettings | ( | std::unique_ptr< WaveformSettings > && | pSettings | ) |
Definition at line 861 of file WaveTrack.cpp.
References mpWaveformSettings.
Referenced by Merge().
|
override |
Definition at line 1572 of file WaveTrack.cpp.
References PackedArray::end(), mClips, min(), THROW_INCONSISTENCY_EXCEPTION, and SampleTrack::TimeToLongSamples().
Referenced by LabelEditActions::Handler::OnSilenceLabels(), EditActions::Handler::OnSplitCut(), LabelEditActions::Handler::OnSplitCutLabels(), and LabelEditActions::Handler::OnSplitDeleteLabels().
WaveClipPointers WaveTrack::SortedClipArray | ( | ) |
Definition at line 2723 of file WaveTrack.cpp.
References mClips.
Referenced by SetClipCommand::ApplyInner(), SetEnvelopeCommand::ApplyInner(), ClearAndPaste(), EffectSBSMS::Finalize(), anonymous_namespace{ClipMenus.cpp}::FindNextClip(), anonymous_namespace{ClipMenus.cpp}::FindNextClipBoundary(), anonymous_namespace{ClipMenus.cpp}::FindPrevClip(), anonymous_namespace{ClipMenus.cpp}::FindPrevClipBoundary(), GetClipAtTime(), LinkConsistencyFix(), NyquistEffect::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectReverse::ProcessOneWave(), GetInfoCommand::SendClips(), GetInfoCommand::SendEnvelopes(), and UpdateLocationsCache().
WaveClipConstPointers WaveTrack::SortedClipArray | ( | ) | const |
Definition at line 2728 of file WaveTrack.cpp.
References mClips.
void WaveTrack::Split | ( | double | t0, |
double | t1 | ||
) |
Definition at line 2517 of file WaveTrack.cpp.
References SplitAt().
Referenced by LabelEditActions::Handler::OnSplitLabels().
void WaveTrack::SplitAt | ( | double | t | ) |
Definition at line 2525 of file WaveTrack.cpp.
References SampleTrack::LongSamplesToTime(), mClips, mpFactory, and SampleTrack::TimeToLongSamples().
Referenced by EffectReverse::ProcessOneWave(), and Split().
Track::Holder WaveTrack::SplitCut | ( | double | t0, |
double | t1 | ||
) |
Definition at line 642 of file WaveTrack.cpp.
References Copy(), SplitDelete(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EditActions::Handler::OnSplitCut(), LabelEditActions::Handler::OnSplitCutLabels(), and EditActions::Handler::OnSplitNew().
void WaveTrack::SplitDelete | ( | double | t0, |
double | t1 | ||
) |
Definition at line 1165 of file WaveTrack.cpp.
References HandleClear().
Referenced by Disjoin(), EffectSBSMS::Finalize(), EditActions::Handler::OnSplitDelete(), LabelEditActions::Handler::OnSplitDeleteLabels(), EffectChangeSpeed::ProcessOne(), SplitCut(), and Trim().
|
overridevirtual |
Reimplemented from Track.
Definition at line 1366 of file WaveTrack.cpp.
References Clear(), Cut(), EditClipsCanMove, GetEndTime(), GetRate(), GetSampleFormat(), IsEmpty(), mpFactory, Paste(), and Setting< T >::Read().
void WaveTrack::Trim | ( | double | t0, |
double | t1 | ||
) |
Definition at line 675 of file WaveTrack.cpp.
References Clear(), GetEndTime(), GetStartTime(), mClips, and SplitDelete().
Referenced by EditActions::Handler::OnTrim().
void WaveTrack::UpdateLocationsCache | ( | ) | const |
Definition at line 2544 of file WaveTrack.cpp.
References GetClipIndex(), WaveClip::GetPlayEndTime(), WaveClip::GetSequenceStartTime(), WaveTrackLocation::locationCutLine, WaveTrackLocation::locationMergePoint, mDisplayLocationsCache, WaveClip::NumCutLines(), SortedClipArray(), and WAVETRACK_MERGE_POINT_TOLERANCE.
void WaveTrack::UseSpectralPrefs | ( | bool | bUse = true | ) |
Definition at line 830 of file WaveTrack.cpp.
References GetIndependentSpectrogramSettings(), and mpSpectrumSettings.
|
overridevirtual |
Implements Track.
Definition at line 1954 of file WaveTrack.cpp.
References XMLMethodRegistry< Host >::CallWriters(), XMLMethodRegistry< Host >::Get(), Track::WriteCommonXMLAttributes(), and PlayableTrack::WriteXMLAttributes().
int WaveTrack::ZeroLevelYCoordinate | ( | wxRect | rect | ) | const |
Definition at line 406 of file WaveTrack.cpp.
References mDisplayMax, and mDisplayMin.
Referenced by WaveformVRulerControls::DoHandleWheelRotation(), and anonymous_namespace{WaveformView.cpp}::DrawClipWaveform().
|
friend |
Definition at line 98 of file WaveTrack.h.
|
private |
Definition at line 574 of file WaveTrack.h.
|
protected |
Definition at line 539 of file WaveTrack.h.
Referenced by AddClip(), WaveTrack::AllClipsIterator::AllClipsIterator(), CanInsertClip(), CanOffsetClips(), ClearAndPaste(), CloseLock(), ConvertToSampleFormat(), Copy(), CreateClip(), Disjoin(), ExpandCutLine(), FindClipByName(), Get(), GetBestBlockSize(), GetBlockStart(), GetClipAtSample(), GetClipByIndex(), GetClipIndex(), GetEndTime(), GetEnvelopeValues(), GetErrorOpening(), GetIntervals(), GetMaxBlockSize(), GetMinMax(), GetNumClips(), GetPlaySamplesCount(), GetRMS(), GetSequenceSamplesCount(), GetStartTime(), HandleClear(), InsertSilence(), IsEmpty(), Join(), MergeClips(), NewestOrNewClip(), PasteWaveTrack(), RemoveAndReturnClip(), RemoveCutLine(), Resample(), RightmostOrNewClip(), Set(), SetOffset(), SetRate(), SetWaveColorIndex(), Silence(), SortedClipArray(), SplitAt(), Trim(), and WaveTrack().
|
mutableprotected |
Definition at line 563 of file WaveTrack.h.
Referenced by Init(), and UpdateLocationsCache().
|
mutableprotected |
Definition at line 557 of file WaveTrack.h.
Referenced by GetDisplayBounds(), Init(), Merge(), SetDisplayBounds(), WaveTrack(), and ZeroLevelYCoordinate().
|
mutableprotected |
Definition at line 556 of file WaveTrack.h.
Referenced by GetDisplayBounds(), Init(), Merge(), SetDisplayBounds(), WaveTrack(), and ZeroLevelYCoordinate().
|
private |
Definition at line 573 of file WaveTrack.h.
|
protected |
Definition at line 541 of file WaveTrack.h.
Referenced by ConvertToSampleFormat(), CreateClip(), EmptyCopy(), GetMaxBlockSize(), HandleXMLTag(), Init(), InsertSilence(), and WaveTrack().
|
protected |
Atomic because it may be read by worker threads in playback.
Definition at line 544 of file WaveTrack.h.
Referenced by DoSetGain(), and GetGain().
|
mutableprotected |
Definition at line 562 of file WaveTrack.h.
Referenced by SetLastdBRange(), and WaveTrack().
|
mutableprotected |
Definition at line 561 of file WaveTrack.h.
Referenced by SetLastScaleType(), and WaveTrack().
|
private |
Definition at line 575 of file WaveTrack.h.
Referenced by HandleXMLChild(), HandleXMLTag(), and WaveTrack().
|
protected |
A memo used by PortAudio thread, doesn't need atomics:
Definition at line 549 of file WaveTrack.h.
Referenced by GetOldChannelGain(), Init(), SetOldChannelGain(), and WaveTrack().
|
protected |
Atomic because it may be read by worker threads in playback.
Definition at line 546 of file WaveTrack.h.
Referenced by DoSetPan(), and GetPan().
|
private |
Definition at line 571 of file WaveTrack.h.
Referenced by ClearAndPaste(), Copy(), CreateClip(), EmptyCopy(), GetMaxBlockSize(), HandleClear(), Init(), InsertSilence(), PasteWaveTrack(), SplitAt(), SyncLockAdjust(), and WaveTrack().
|
private |
Definition at line 577 of file WaveTrack.h.
Referenced by GetIndependentSpectrogramSettings(), GetSpectrogramSettings(), Merge(), Reinit(), SetSpectrogramSettings(), and UseSpectralPrefs().
|
private |
Definition at line 578 of file WaveTrack.h.
Referenced by GetWaveformSettings(), Merge(), Reinit(), and SetWaveformSettings().
|
protected |
Definition at line 542 of file WaveTrack.h.
Referenced by CreateClip(), EmptyCopy(), GetEnvelopeValues(), GetRate(), HandleXMLTag(), Init(), InsertSilence(), Join(), PasteWaveTrack(), Resample(), SetRate(), and WaveTrack().
|
mutableprotected |
Definition at line 559 of file WaveTrack.h.
Referenced by GetSpectrumBounds(), Init(), SetSpectrumBounds(), and WaveTrack().
|
mutableprotected |
Definition at line 558 of file WaveTrack.h.
Referenced by GetSpectrumBounds(), Init(), SetSpectrumBounds(), and WaveTrack().
|
protected |
Definition at line 547 of file WaveTrack.h.
Referenced by HandleXMLTag(), Init(), SetWaveColorIndex(), and WaveTrack().