![]() |
Audacity 3.2.0
|
A Track that contains audio waveform data. More...
#include <WaveTrack.h>
Classes | |
class | AllClipsConstIterator |
class | AllClipsIterator |
class | Interval |
struct | Region |
Structure to hold region of a wavetrack and a comparison function for sortability. More... | |
Public Types | |
using | Regions = std::vector< Region > |
using | Holder = std::shared_ptr< WaveTrack > |
using | ProgressReport = std::function< bool(double)> |
using | IntervalHolder = std::shared_ptr< Interval > |
using | IntervalConstHolder = std::shared_ptr< const Interval > |
![]() | |
using | AttachedObjects = ::AttachedTrackObjects |
Alias for my base type. More... | |
using | Holder = std::shared_ptr< Track > |
![]() | |
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... | |
![]() | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
using | Attachments = ClientData::Site< ChannelGroupData, ClientData::Cloneable<>, ClientData::DeepCopying > |
using | Interval = WideChannelGroupInterval |
![]() | |
using | Interval = ChannelInterval |
Public Member Functions | |
WaveTrack (const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate) | |
WaveTrack (const WaveTrack &orig, ProtectedCreationArg &&) | |
Copied only in WaveTrack::Clone() ! More... | |
size_t | GetWidth () const |
The width of every WaveClip in this track; for now always 1. More... | |
size_t | NChannels () const override |
May report more than one only when this is a leader track. More... | |
auto | GetChannel (size_t iChannel) |
auto | GetChannel (size_t iChannel) const |
auto | Channels () |
auto | Channels () const |
AudioGraph::ChannelType | GetChannelType () const override |
Classify this channel. More... | |
void | Reinit (const WaveTrack &orig) |
virtual | ~WaveTrack () |
void | MoveTo (double o) override |
bool | LinkConsistencyFix (bool doFix) override |
Check consistency of channel groups, and maybe fix it. More... | |
double | GetStartTime () const override |
Implement WideSampleSequence. More... | |
double | GetEndTime () const override |
Implement WideSampleSequence. More... | |
double | GetRate () const override |
void | SetRate (double newRate) |
float | GetGain () const |
void | SetGain (float newGain) |
float | GetPan () const |
void | SetPan (float newPan) |
float | GetChannelGain (int channel) const override |
Takes gain and pan into account. More... | |
int | GetWaveColorIndex () const |
void | SetWaveColorIndex (int colorIndex) |
sampleCount | GetVisibleSampleCount () const |
sampleCount | GetSequenceSamplesCount () const |
size_t | CountBlocks () const |
sampleFormat | GetSampleFormat () const override |
void | ConvertToSampleFormat (sampleFormat format, const std::function< void(size_t)> &progressReport={}) |
TrackListHolder | Cut (double t0, double t1) override |
Create tracks and modify this track. More... | |
Holder | EmptyCopy (const SampleBlockFactoryPtr &pFactory={}, bool keepLink=true) const |
TrackListHolder | WideEmptyCopy (const SampleBlockFactoryPtr &pFactory={}, bool keepLink=true) const |
TrackListHolder | MonoToStereo () |
TrackListHolder | Copy (double t0, double t1, bool forClipboard=true) const override |
Create new tracks and don't modify this track. More... | |
void | Clear (double t0, double t1) override |
void | Paste (double t0, const Track &src) override |
void | ClearAndPaste (double t0, double t1, const WaveTrack &src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=nullptr, bool clearByTrimming=false) |
void | ClearAndPaste (double t0, double t1, const TrackList &src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=nullptr) |
void | Silence (double t0, double t1, ProgressReporter reportProgress) override |
void | InsertSilence (double t, double len) override |
void | Split (double t0, double t1) |
void | ClearAndAddCutLine (double t0, double t1) |
TrackListHolder | SplitCut (double t0, double t1) |
void | SplitDelete (double t0, double t1) |
void | Join (double t0, double t1, const ProgressReporter &reportProgress) |
void | Disjoin (double t0, double t1) |
void | Trim (double t0, double t1) |
void | ApplyStretchRatio (std::optional< TimeInterval > interval, ProgressReporter reportProgress) |
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, sampleFormat effectiveFormat=widestSampleFormat, size_t iChannel=0) override |
void | Flush () override |
bool | IsLeader () const override |
bool | DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override |
This fails if any clip overlapping the range has non-unit stretch ratio! More... | |
std::pair< size_t, size_t > | GetFloatsCenteredAroundTime (double t, size_t iChannel, float *buffer, size_t numSideSamples, bool mayThrow) const |
Gets as many samples as it can, but no more than 2 * numSideSamples + 1 , centered around t . Reads nothing if GetClipAtTime(t) == nullptr . Useful to access samples across clip boundaries, as it spreads the read to adjacent clips, i.e., not separated by silence from clip at t . More... | |
bool | GetFloatAtTime (double t, size_t iChannel, float &value, bool mayThrow) const |
void | SetFloatsCenteredAroundTime (double t, size_t iChannel, const float *buffer, size_t numSideSamples, sampleFormat effectiveFormat) |
Similar to GetFloatsCenteredAroundTime, but for writing. Sets as many samples as it can according to the same rules as GetFloatsCenteredAroundTime. Leaves the other samples untouched. More... | |
void | SetFloatAtTime (double t, size_t iChannel, float value, sampleFormat effectiveFormat) |
Sets sample nearest to t to value . Silently fails if GetClipAtTime(t) == nullptr . More... | |
void | SetFloatsWithinTimeRange (double t0, double t1, size_t iChannel, const std::function< float(double sampleTime)> &producer, sampleFormat effectiveFormat) |
Provides a means of setting clip values as a function of time. Included are closest sample to t0 up to closest sample to t1, exclusively. If the given interval is empty, i.e., t0 >= t1 , no action is taken. More... | |
ChannelGroupSampleView | GetSampleView (double t0, double t1, bool mayThrow=true) const |
Request samples within [t0, t1), not knowing in advance how many this will be. More... | |
sampleFormat | WidestEffectiveFormat () const override |
bool | HasTrivialEnvelope () const override |
void | GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const override |
Envelope * | GetEnvelopeAtTime (double time) |
const WaveClip * | GetClipAtTime (double time) const |
WaveClip * | GetClipAtTime (double time) |
WaveClipConstHolders | GetClipsIntersecting (double t0, double t1) const |
const WaveClip * | GetNextClip (const WaveClip &clip, PlaybackDirection searchDirection) const |
Returns clips next to clip in the given direction, or nullptr if there is none. More... | |
WaveClip * | GetNextClip (const WaveClip &clip, PlaybackDirection searchDirection) |
Returns clips next to clip in the given direction, or nullptr if there is none. More... | |
const WaveClip * | GetAdjacentClip (const WaveClip &clip, PlaybackDirection searchDirection) const |
Similar to GetNextClip, but returns nullptr if the neighbour clip is not adjacent. More... | |
WaveClip * | GetAdjacentClip (const WaveClip &clip, PlaybackDirection searchDirection) |
Similar to GetNextClip, but returns nullptr if the neighbour clip is not adjacent. More... | |
size_t | GetBestBlockSize (sampleCount t) const |
size_t | GetMaxBlockSize () const |
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 |
std::optional< TranslatableString > | GetErrorOpening () const override |
bool | CloseLock () noexcept |
Should be called upon project close. Not balanced by unlocking calls. More... | |
WaveClipHolders & | GetClips () |
const WaveClipConstHolders & | GetClips () const |
const WaveClip * | GetLeftmostClip () const |
const WaveClip * | GetRightmostClip () const |
ClipConstHolders | GetClipInterfaces () const |
Get access to the (visible) clips in the tracks, in unspecified order. More... | |
IteratorRange< AllClipsIterator > | GetAllClips () |
IteratorRange< AllClipsConstIterator > | GetAllClips () const |
void | CreateWideClip (double offset=.0, const wxString &name=wxEmptyString) |
WaveClip * | CreateClip (double offset=.0, const wxString &name=wxEmptyString) |
Create new clip and add it to this track. More... | |
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) |
Get the nth clip in this WaveTrack (will return nullptr if not found). More... | |
const WaveClip * | GetClipByIndex (int index) const |
Get the nth clip in this WaveTrack (will return nullptr if not found). More... | |
int | GetNumClips () const |
int | GetNumClips (double t0, double t1) const |
WaveClipPointers | SortedClipArray () |
WaveClipConstPointers | SortedClipArray () const |
bool | HasHiddenData () const |
Whether any clips have hidden audio. More... | |
void | DiscardTrimmed () |
Remove hidden audio from all clips. More... | |
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 (const WaveClip &clip, double &slideBy, double tolerance) const |
std::shared_ptr< WaveClip > | RemoveAndReturnClip (WaveClip *clip) |
bool | AddClip (const std::shared_ptr< WaveClip > &clip) |
bool | MergeClips (int clipidx1, int clipidx2) |
void | ExpandCutLine (double cutLinePosition, double *cutlineStart=nullptr, double *cutlineEnd=nullptr) |
bool | RemoveCutLine (double cutLinePosition) |
Remove cut line, without expanding the audio in it. More... | |
void | Resample (int rate, BasicUI::ProgressDialog *progress=NULL) |
bool | Reverse (sampleCount start, sampleCount len, const ProgressReport &report={}) |
const TypeInfo & | GetTypeInfo () const override |
IntervalConstHolder | GetNextInterval (const Interval &interval, PlaybackDirection searchDirection) const |
IntervalHolder | GetNextInterval (const Interval &interval, PlaybackDirection searchDirection) |
IntervalHolder | GetIntervalAtTime (double t) |
auto | Intervals () |
auto | Intervals () const |
Track::Holder | PasteInto (AudacityProject &project, TrackList &list) const override |
const WaveClip * | FindClipByName (const wxString &name) const |
Returns nullptr if clip with such name was not found. More... | |
size_t | NIntervals () const override |
used only during deserialization More... | |
void | SetLegacyFormat (sampleFormat format) |
void | CopyClipEnvelopes () |
bool | GetFloats (float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
"narrow" overload fetches first channel only More... | |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
virtual void | Paste (double t, const Track &src)=0 |
Weak precondition allows overrides to replicate one channel into many. More... | |
void | Paste (double t, const TrackList &src) |
PlayableSequence implementation | |
const ChannelGroup * | FindChannelGroup () const override |
Find associated ChannelGroup if any. More... | |
bool | GetMute () const override |
May vary asynchronously. More... | |
bool | GetSolo () const override |
May vary asynchronously. More... | |
![]() | |
WritableSampleTrack () | |
WritableSampleTrack (const WritableSampleTrack &other, ProtectedCreationArg &&) | |
~WritableSampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
bool | IsLeader () const override |
virtual size_t | NChannels () const=0 |
Report the number of channels. More... | |
virtual double | GetRate () const=0 |
![]() | |
SampleTrack () | |
SampleTrack (const SampleTrack &other, ProtectedCreationArg &&) | |
~SampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
virtual sampleFormat | GetSampleFormat () const =0 |
bool | GetFloats (float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
"narrow" overload fetches first channel only More... | |
double | GetStartTime () const |
Get the minimum of Start() values of intervals, or 0 when none. More... | |
double | GetEndTime () const |
Get the maximum of End() values of intervals, or 0 when none. More... | |
bool | IsLeader () const override |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
![]() | |
PlayableTrack () | |
PlayableTrack (const PlayableTrack &orig, ProtectedCreationArg &&) | |
bool | GetMute () const |
bool | GetSolo () const |
bool | GetNotMute () const |
bool | GetNotSolo () const |
void | SetMute (bool m) |
void | SetSolo (bool s) |
void | WriteXMLAttributes (XMLWriter &xmlFile) const |
bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &value) |
![]() | |
AudioTrack () | |
AudioTrack (const Track &orig, ProtectedCreationArg &&a) | |
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 &project, TrackList &list) const =0 |
virtual bool | LinkConsistencyFix (bool doFix=true) |
Check consistency of channel groups, and maybe fix it. More... | |
bool | LinkConsistencyCheck () |
Do the non-mutating part of consistency fix only and return status. More... | |
bool | HasOwner () const |
std::shared_ptr< TrackList > | GetOwner () const |
TrackList * | GetHolder () const |
LinkType | GetLinkType () const noexcept |
ChannelGroupData & | GetGroupData () |
const ChannelGroupData & | GetGroupData () const |
May make group data on demand, but consider that logically const. More... | |
Track () | |
Track (const Track &orig, ProtectedCreationArg &&) | |
Track & | operator= (const Track &orig)=delete |
virtual | ~Track () |
void | Init (const Track &orig) |
virtual TrackListHolder | Duplicate () const |
public nonvirtual duplication function that invokes Clone() More... | |
const wxString & | GetName () const |
Name is always the same for all channels of a group. More... | |
void | SetName (const wxString &n) |
bool | GetSelected () const |
Selectedness is always the same for all channels of a group. More... | |
virtual void | SetSelected (bool s) |
void | OnProjectTempoChange (double newTempo) |
method to set project tempo on track More... | |
virtual TrackListHolder | Cut (double t0, double t1)=0 |
Create tracks and modify this track. More... | |
virtual TrackListHolder | Copy (double t0, double t1, bool forClipboard=true) const =0 |
Create new tracks and don't modify this track. More... | |
virtual void | Clear (double t0, double t1)=0 |
virtual void | Paste (double t, const Track &src)=0 |
Weak precondition allows overrides to replicate one channel into many. More... | |
void | Paste (double t, const TrackList &src) |
virtual void | SyncLockAdjust (double oldT1, double newT1) |
virtual void | Silence (double t0, double t1, ProgressReporter reportProgress={})=0 |
virtual void | InsertSilence (double t, double len)=0 |
bool | SameKindAs (const Track &track) const |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) const |
virtual void | WriteXML (XMLWriter &xmlFile) const =0 |
virtual std::optional< TranslatableString > | GetErrorOpening () const |
void | Notify (bool allChannels, int code=-1) |
bool | Any () const |
bool | IsSelected () const |
bool | IsLeader () const override |
bool | IsSelectedLeader () const |
void | AdjustPositions () |
void | WriteCommonXMLAttributes (XMLWriter &xmlFile, bool includeNameAndSelected=true) const |
bool | HandleCommonXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
const std::optional< double > & | GetProjectTempo () const |
![]() | |
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... | |
![]() | |
virtual | ~ChannelGroup () |
double | GetStartTime () const |
Get the minimum of Start() values of intervals, or 0 when none. More... | |
double | GetEndTime () const |
Get the maximum of End() values of intervals, or 0 when none. More... | |
void | ShiftBy (double t) |
Change start time by given duration. More... | |
virtual void | MoveTo (double o)=0 |
Change start time to given time point. More... | |
virtual bool | IsLeader () const =0 |
ChannelGroupData & | GetGroupData () |
Make attachment site on demand as needed. More... | |
const ChannelGroupData & | GetGroupData () const |
ChannelGroupData * | FindGroupData () |
Do not make attachment site on demand if absent. More... | |
const ChannelGroupData * | FindGroupData () const |
Do not make attachment site on demand if absent. More... | |
void | Init (const ChannelGroup &other) |
Copy, including cloning of attached objects. More... | |
void | DestroyGroupData () |
Leave all attachments null. More... | |
std::unique_ptr< ChannelGroupData > | DetachGroupData () |
Move attachments out. More... | |
void | AssignGroupData (std::unique_ptr< ChannelGroupData > pGroupData) |
Replace any previous attachments. More... | |
template<typename ChannelType = Channel> | |
std::shared_ptr< ChannelType > | GetChannel (size_t iChannel) |
Retrieve a channel, cast to the given type. More... | |
template<typename ChannelType = const Channel> | |
auto | GetChannel (size_t iChannel) const -> std::enable_if_t< std::is_const_v< ChannelType >, std::shared_ptr< ChannelType > > |
template<typename ChannelType = Channel> | |
IteratorRange< ChannelIterator< ChannelType > > | Channels () |
Get range of channels with mutative access. More... | |
template<typename ChannelType = const Channel> | |
auto | Channels () const -> std::enable_if_t< std::is_const_v< ChannelType >, IteratorRange< ChannelIterator< ChannelType > > > |
Get range of channels with read-only access. More... | |
template<typename IntervalType = Interval> | |
std::shared_ptr< IntervalType > | GetInterval (size_t iInterval) |
Retrieve an interval, cast to the given type. More... | |
template<typename IntervalType = const Interval> | |
auto | GetInterval (size_t iInterval) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > > |
template<typename IntervalType = Interval> | |
IteratorRange< IntervalIterator< IntervalType > > | Intervals () |
Get range of intervals with mutative access. More... | |
template<typename IntervalType = const Interval> | |
auto | Intervals () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< IntervalIterator< IntervalType > > > |
Get range of intervals with read-only access. More... | |
![]() | |
~PlayableSequence () override | |
virtual const ChannelGroup * | FindChannelGroup () const =0 |
Find associated ChannelGroup if any. More... | |
virtual bool | GetSolo () const =0 |
May vary asynchronously. More... | |
virtual bool | GetMute () const =0 |
May vary asynchronously. More... | |
![]() | |
virtual | ~WideSampleSequence () |
virtual size_t | NChannels () const =0 |
A constant property. More... | |
virtual float | GetChannelGain (int channel) const =0 |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
virtual bool | DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backward, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const =0 |
virtual double | GetStartTime () const =0 |
virtual double | GetEndTime () const =0 |
virtual double | GetRate () const =0 |
sampleCount | TimeToLongSamples (double t0) const |
double | LongSamplesToTime (sampleCount pos) const |
double | SnapToSample (double t) const |
virtual sampleFormat | WidestEffectiveFormat () const =0 |
virtual bool | HasTrivialEnvelope () const =0 |
virtual void | GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const =0 |
![]() | |
virtual | ~Channel () |
virtual ChannelType | GetChannelType () const =0 |
Classify this channel. More... | |
![]() | |
virtual | ~RecordableSequence () |
virtual sampleFormat | GetSampleFormat () const =0 |
virtual double | GetRate () const =0 |
virtual size_t | NChannels () const =0 |
A constant property. More... | |
virtual bool | Append (constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride, sampleFormat effectiveFormat, size_t iChannel=0)=0 |
Append the sample data to the track. You must call Flush() after the last Append. More... | |
bool | Append (constSamplePtr buffer, sampleFormat format, size_t len, size_t iChannel=0) |
virtual bool | IsLeader () const =0 |
virtual void | Flush ()=0 |
Flush of related leader must be called after last Append. More... | |
virtual void | InsertSilence (double t, double len)=0 |
![]() | |
~WaveChannel () override | |
WaveTrack & | GetTrack () |
const WaveTrack & | GetTrack () const |
auto | GetInterval (size_t iInterval) |
auto | GetInterval (size_t iInterval) const |
auto | Intervals () |
auto | Intervals () const |
bool | GetFloats (float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
"narrow" overload fetches from the unique channel More... | |
ChannelSampleView | GetSampleView (double t0, double t1, bool mayThrow) const |
Request channel samples within [t0, t1), not knowing in advance how many this will be. More... | |
bool | Set (constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len, sampleFormat effectiveFormat=widestSampleFormat) |
Random-access assignment of a range of samples. More... | |
bool | AppendBuffer (constSamplePtr buffer, sampleFormat format, size_t len, unsigned stride, sampleFormat effectiveFormat) |
bool | Append (constSamplePtr buffer, sampleFormat format, size_t len) |
std::pair< float, float > | GetMinMax (double t0, double t1, bool mayThrow=true) const |
float | GetRMS (double t0, double t1, bool mayThrow=true) const |
Get root-mean-square. More... | |
size_t | GetBestBlockSize (sampleCount t) const |
A hint for sizing of well aligned fetches. More... | |
size_t | GetIdealBlockSize () |
A hint for sizing of well aligned fetches. More... | |
size_t | GetMaxBlockSize () const |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
![]() | |
virtual | ~Channel () |
ChannelGroup & | GetChannelGroup () |
Channel object's lifetime is assumed to be nested in its Track's. More... | |
const ChannelGroup & | GetChannelGroup () const |
Channel object's lifetime is assumed to be nested in its Track's. More... | |
size_t | GetChannelIndex () const |
size_t | ReallyGetChannelIndex () const |
size_t | NIntervals () const |
Report the number of intervals. More... | |
template<typename IntervalType = Interval> | |
std::shared_ptr< IntervalType > | GetInterval (size_t iInterval) |
Retrieve an interval, cast to the given type. More... | |
template<typename IntervalType = const Interval> | |
auto | GetInterval (size_t iInterval) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > > |
template<typename IntervalType = Interval> | |
IteratorRange< IntervalIterator< IntervalType > > | Intervals () |
Get range of intervals with mutative access. More... | |
template<typename IntervalType = const Interval> | |
auto | Intervals () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< IntervalIterator< IntervalType > > > |
Get range of intervals with read-only access. More... | |
Static Public Member Functions | |
static wxString | GetDefaultAudioTrackNamePreference () |
static double | ProjectNyquistFrequency (const AudacityProject &project) |
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 size_t | numFactories () |
How many static factories have been registered with this specialization of Site. More... | |
Private Member Functions | |
void | Init (const WaveTrack &orig) |
TrackListHolder | Clone () const override |
wxString | MakeClipCopyName (const wxString &originalName) const |
wxString | MakeNewClipName () const |
void | FlushOne () |
void | HandleClear (double t0, double t1, bool addCutLines, bool split, bool clearByTrimming=false) |
void | ClearAndPasteAtSameTempo (double t0, double t1, const WaveTrack &src, bool preserve, bool merge, const TimeWarper *effectWarper, bool clearByTrimming) |
void | SplitAt (double t) |
void | ExpandOneCutLine (double cutLinePosition, double *cutlineStart, double *cutlineEnd) |
bool | MergeOneClipPair (int clipidx1, int clipidx2) |
void | ApplyStretchRatioOnIntervals (const std::vector< IntervalHolder > &intervals, const ProgressReporter &reportProgress) |
void | InsertInterval (const IntervalHolder &interval) |
void | RemoveInterval (const IntervalHolder &interval) |
void | ReplaceInterval (const IntervalHolder &oldOne, const IntervalHolder &newOne) |
std::shared_ptr< WideChannelGroupInterval > | DoGetInterval (size_t iInterval) override |
Retrieve an interval. More... | |
std::shared_ptr<::Channel > | DoGetChannel (size_t iChannel) override |
Retrieve a channel. More... | |
ChannelGroup & | DoGetChannelGroup () const override |
Subclass must override. More... | |
ChannelGroup & | ReallyDoGetChannelGroup () const override |
This is temporary! It defaults to call the above. More... | |
void | DoSetRate (double newRate) |
void | SetClipRates (double newRate) |
void | DoOnProjectTempoChange (const std::optional< double > &oldTempo, double newTempo) override |
TrackListHolder | DuplicateWithOtherTempo (double newTempo, WaveTrack *&leader) const |
bool | GetOne (samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill, bool mayThrow, sampleCount *pNumWithinClips) const |
size_t | GetFloatsFromTime (double t, size_t iChannel, float *buffer, size_t numSamples, bool mayThrow, PlaybackDirection direction) const |
Helper for GetFloatsCenteredAroundTime. If direction == PlaybackDirection::Backward , fetches samples to the left of t , excluding t , without reversing. More... | |
void | SetFloatsFromTime (double t, size_t iChannel, const float *buffer, size_t numSamples, sampleFormat effectiveFormat, PlaybackDirection direction) |
Similar to GetFloatsFromTime, but for writing. Sets as many samples as it can according to the same rules as GetFloatsFromTime. Leaves the other samples untouched. More... | |
void | DoSetPan (float value) |
void | DoSetGain (float value) |
void | PasteWaveTrack (double t0, const WaveTrack &other, bool merge) |
void | PasteWaveTrackAtSameTempo (double t0, const WaveTrack &other, bool merge) |
bool | RateConsistencyCheck () const |
Whether all clips of a leader track have a common rate. More... | |
bool | FormatConsistencyCheck () const |
Whether all tracks in group and all clips have a common sample format. More... | |
bool | InsertClip (WaveClipHolder clip) |
void | ApplyStretchRatioOne (double t0, double t1, const ProgressReporter &reportProgress) |
Static Private Member Functions | |
static void | ClearAndPasteOne (WaveTrack &track, double t0, double t1, double startTime, double endTime, const WaveTrack &src, bool preserve, bool merge, const TimeWarper *effectWarper, bool clearByTrimming) |
static void | JoinOne (WaveTrack &track, double t0, double t1) |
static Holder | CopyOne (const WaveTrack &track, double t0, double t1, bool forClipboard) |
static void | WriteOneXML (const WaveTrack &track, XMLWriter &xmlFile, size_t iChannel, size_t nChannels) |
static bool | ReverseOne (WaveTrack &track, sampleCount start, sampleCount len, const ProgressReport &report={}) |
static bool | ReverseOneClip (WaveTrack &track, sampleCount start, sampleCount len, sampleCount originalStart, sampleCount originalEnd, const ProgressReport &report={}) |
static void | PasteOne (WaveTrack &track, double t0, const WaveTrack &other, double startTime, double insertDuration, bool merge=true) |
Private Attributes | |
WaveClipHolders | mClips |
int | mLegacyRate { 0 } |
used only during deserialization More... | |
sampleFormat | mLegacyFormat { undefinedSample } |
used only during deserialization More... | |
SampleBlockFactoryPtr | mpFactory |
wxCriticalSection | mFlushCriticalSection |
wxCriticalSection | mAppendCriticalSection |
double | mLegacyProjectFileOffset |
friend | WaveChannel |
Friends | |
class | WaveTrackFactory |
Additional Inherited Members | |
![]() | |
bool | DoGetMute () const |
void | DoSetMute (bool value) |
bool | DoGetSolo () const |
void | DoSetSolo (bool value) |
![]() | |
void | SetLinkType (LinkType linkType, bool completeList=true) |
virtual void | DoOnProjectTempoChange (const std::optional< double > &oldTempo, double newTempo)=0 |
![]() | |
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... | |
virtual std::shared_ptr< Channel > | DoGetChannel (size_t iChannel)=0 |
Retrieve a channel. More... | |
virtual std::shared_ptr< Interval > | DoGetInterval (size_t iInterval)=0 |
Retrieve an interval. More... | |
virtual ChannelGroup & | DoGetChannelGroup () const =0 |
Subclass must override. More... | |
virtual ChannelGroup & | ReallyDoGetChannelGroup () const |
This is temporary! It defaults to call the above. 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... | |
A Track that contains audio waveform data.
Definition at line 218 of file WaveTrack.h.
using WaveTrack::Holder = std::shared_ptr<WaveTrack> |
Definition at line 298 of file WaveTrack.h.
using WaveTrack::IntervalConstHolder = std::shared_ptr<const Interval> |
Definition at line 1012 of file WaveTrack.h.
using WaveTrack::IntervalHolder = std::shared_ptr<Interval> |
Definition at line 1011 of file WaveTrack.h.
using WaveTrack::ProgressReport = std::function<bool(double)> |
Argument is in (0, 1)
Definition at line 915 of file WaveTrack.h.
using WaveTrack::Regions = std::vector < Region > |
Definition at line 243 of file WaveTrack.h.
WaveTrack::WaveTrack | ( | const SampleBlockFactoryPtr & | pFactory, |
sampleFormat | format, | ||
double | rate | ||
) |
Definition at line 776 of file WaveTrack.cpp.
References DoSetRate(), anonymous_namespace{ExportPCM.cpp}::format, BasicUI::Get(), and mLegacyProjectFileOffset.
WaveTrack::WaveTrack | ( | const WaveTrack & | orig, |
ProtectedCreationArg && | a | ||
) |
Copied only in WaveTrack::Clone() !
Definition at line 786 of file WaveTrack.cpp.
References InsertClip(), mClips, mLegacyProjectFileOffset, and mpFactory.
|
virtual |
Definition at line 840 of file WaveTrack.cpp.
bool WaveTrack::AddClip | ( | const std::shared_ptr< WaveClip > & | clip | ) |
Append a clip to the track; to succeed, must have the same block factory as this track, and this->GetWidth() == clip->GetWidth()
; return success
clip != nullptr
this->GetWidth() == clip->GetWidth()
Definition at line 1892 of file WaveTrack.cpp.
References GetWidth(), and InsertClip().
Referenced by ClearAndPasteOne(), and ReverseOne().
|
overridevirtual |
If there is an existing WaveClip in the WaveTrack, then the data are appended to that clip. If there are no WaveClips in the track, then a new one is created.
Implements RecordableSequence.
Definition at line 2665 of file WaveTrack.cpp.
References TrackList::Channels(), anonymous_namespace{ExportPCM.cpp}::format, Track::GetOwner(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
Referenced by WaveChannel::Append(), and WaveChannel::AppendBuffer().
void WaveTrack::ApplyStretchRatio | ( | std::optional< TimeInterval > | interval, |
ProgressReporter | reportProgress | ||
) |
Definition at line 2351 of file WaveTrack.cpp.
References ApplyStretchRatioOnIntervals(), forward, GetClipAtTime(), GetEndTime(), GetIntervalAtTime(), GetNextInterval(), GetNumClips(), GetStartTime(), IsLeader(), min(), WideSampleSequence::SnapToSample(), Split(), and WaveClip::SplitsPlayRegion().
Referenced by Silence().
|
private |
|
private |
Definition at line 4099 of file WaveTrack.cpp.
References ReplaceInterval().
Referenced by ApplyStretchRatio(), and Join().
bool WaveTrack::CanInsertClip | ( | const WaveClip & | clip, |
double & | slideBy, | ||
double | tolerance | ||
) | const |
Definition at line 3910 of file WaveTrack.cpp.
References WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), mClips, and WideSampleSequence::SnapToSample().
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 3852 of file WaveTrack.cpp.
References CanOffsetClips(), and mClips.
Referenced by CanOffsetClips().
|
inline |
Definition at line 272 of file WaveTrack.h.
Referenced by EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), EffectTruncSilence::DoRemoval(), GetSampleView(), EffectLoudness::LoadBufferBlock(), PerTrackEffect::ProcessPass(), SetRate(), and EffectLoudness::StoreBufferBlock().
|
inline |
Definition at line 274 of file WaveTrack.h.
|
static |
Definition at line 956 of file WaveTrack.cpp.
References typeInfo().
|
overridevirtual |
Implements Track.
Definition at line 1436 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by Cut(), EffectTruncSilence::DoRemoval(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), TrackSpectrumTransformer::PostProcess(), EffectStereoToMono::ProcessOne(), SyncLockAdjust(), and Trim().
void WaveTrack::ClearAndAddCutLine | ( | double | t0, |
double | t1 | ||
) |
May assume precondition: t0 <= t1
IsLeader()
Definition at line 1444 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by anonymous_namespace{LabelMenus.cpp}::OnCutLabels().
|
inline |
Overload that takes a TrackList and passes its first wave track
**src.Any<const WaveTrack>().begin()
satisfies preconditions of the other overload for src
Definition at line 434 of file WaveTrack.h.
References TrackList::Any().
void WaveTrack::ClearAndPaste | ( | double | t0, |
double | t1, | ||
const WaveTrack & | src, | ||
bool | preserve = true , |
||
bool | merge = true , |
||
const TimeWarper * | effectWarper = nullptr , |
||
bool | clearByTrimming = false |
||
) |
May assume precondition: t0 <= t1 If the source has one channel and this has more, then replicate source
IsLeader()
src.IsLeader()
src.NChannels() == 1 || src.NChannels() == NChannels()
Definition at line 1498 of file WaveTrack.cpp.
References ClearAndPasteAtSameTempo(), staffpad::vo::copy(), DuplicateWithOtherTempo(), Track::GetProjectTempo(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectSBSMS::Finalize(), anonymous_namespace{EditMenus.cpp}::OnPaste(), and EffectNoiseRemoval::ProcessOne().
|
private |
Definition at line 1518 of file WaveTrack.cpp.
References TrackList::Channels(), ClearAndPasteOne(), GetEndTime(), Track::GetProjectTempo(), GetStartTime(), IsLeader(), min(), NChannels(), PasteWaveTrack(), and WideSampleSequence::SnapToSample().
Referenced by ClearAndPaste().
|
staticprivate |
Definition at line 1555 of file WaveTrack.cpp.
References AddClip(), GetClipIndex(), GetClips(), WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), GetRate(), WaveClip::GetSequenceStartTime(), WaveClip::GetStretchRatio(), WaveClip::GetTrimLeft(), WaveClip::GetTrimRight(), GetWidth(), WaveClip::GetWidth(), HandleClear(), WaveClip::HasEqualStretchRatio(), mClips, MergeOneClipPair(), mpFactory, WaveClip::Paste(), PasteOne(), WaveClip::SetSequenceStartTime(), WaveClip::SetTrimLeft(), WaveClip::SetTrimRight(), WaveClip::ShiftBy(), WideSampleSequence::SnapToSample(), SortedClipArray(), WideSampleSequence::TimeToLongSamples(), and TimeWarper::Warp().
Referenced by ClearAndPasteAtSameTempo().
|
overrideprivatevirtual |
Subclass responsibility implements only a part of Duplicate(), copying the track data proper (not associated data such as for groups and views)
unstretchInterval | If set, this time interval's stretching must be applied. |
!unstretchInterval.has_value() || unstretchInterval->first < unstretchInterval->second
IsLeader()
NChannels() == result->NChannels()
Implements Track.
Definition at line 1043 of file WaveTrack.cpp.
References TrackList::Channels(), Track::GetOwner(), IsLeader(), and TrackList::Temporary().
|
noexcept |
Should be called upon project close. Not balanced by unlocking calls.
IsLeader()
Definition at line 2982 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
void WaveTrack::ConvertToSampleFormat | ( | sampleFormat | format, |
const std::function< void(size_t)> & | progressReport = {} |
||
) |
IsLeader()
Definition at line 1226 of file WaveTrack.cpp.
References TrackList::Channels(), anonymous_namespace{ExportPCM.cpp}::format, BasicUI::Get(), and IsLeader().
|
overridevirtual |
Create new tracks and don't modify this track.
IsLeader
result->NChannels() == NChannels()
Implements Track.
Definition at line 1365 of file WaveTrack.cpp.
References TrackList::Channels(), CopyOne(), TrackList::Create(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by Cut(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitCut(), anonymous_namespace{EditMenus.cpp}::OnSplitNew(), and SplitCut().
void WaveTrack::CopyClipEnvelopes | ( | ) |
Definition at line 2746 of file WaveTrack.cpp.
References PackedArray::begin(), TrackList::Channels(), and PackedArray::end().
|
staticprivate |
Definition at line 1376 of file WaveTrack.cpp.
References GetEndTime(), GetRate(), GetSampleFormat(), InsertClip(), mClips, Track::SharedPointer(), and WaveClip::ShiftBy().
Referenced by Copy().
size_t WaveTrack::CountBlocks | ( | ) | const |
IsLeader()
Definition at line 1209 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
WaveClip * WaveTrack::CreateClip | ( | double | offset = .0 , |
const wxString & | name = wxEmptyString |
||
) |
Create new clip and add it to this track.
Returns a pointer to the newly created clip. Optionally initial offset and clip name may be provided
result->GetWidth() == GetWidth()
Definition at line 3760 of file WaveTrack.cpp.
References Track::GetProjectTempo(), GetRate(), GetSampleFormat(), GetWaveColorIndex(), GetWidth(), mClips, mpFactory, and name.
Referenced by AUPImportFileHandle::HandleWaveClip(), JoinOne(), NewestOrNewClip(), and RightmostOrNewClip().
void WaveTrack::CreateWideClip | ( | double | offset = .0 , |
const wxString & | name = wxEmptyString |
||
) |
Definition at line 3753 of file WaveTrack.cpp.
References TrackList::Channels(), IsLeader(), and name.
|
overridevirtual |
Create tracks and modify this track.
IsLeader()
result->NChannels() == NChannels()
Implements Track.
Definition at line 1260 of file WaveTrack.cpp.
References Clear(), Copy(), IsLeader(), and THROW_INCONSISTENCY_EXCEPTION.
void WaveTrack::DiscardTrimmed | ( | ) |
Remove hidden audio from all clips.
IsLeader()
Definition at line 4392 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
void WaveTrack::Disjoin | ( | double | t0, |
double | t1 | ||
) |
IsLeader()
Definition at line 2477 of file WaveTrack.cpp.
References PackedArray::end(), floatSample, Intervals(), IsLeader(), limitSampleBufferSize(), min(), NChannels(), SplitDelete(), WideSampleSequence::TimeToLongSamples(), and WAVETRACK_MERGE_POINT_TOLERANCE.
Referenced by anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels().
|
overridevirtual |
This fails if any clip overlapping the range has non-unit stretch ratio!
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.
an un-owned track should have reported one channel only
Implements WideSampleSequence.
Definition at line 3134 of file WaveTrack.cpp.
References TrackList::Channels(), anonymous_namespace{ExportPCM.cpp}::format, Track::GetOwner(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, IsLeader(), and NChannels().
|
overrideprivatevirtual |
Retrieve a channel.
!(iChannel < NChannels()) || result
Implements ChannelGroup.
Definition at line 1014 of file WaveTrack.cpp.
References TrackList::Channels(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and NChannels().
|
overrideprivatevirtual |
Subclass must override.
ii
less than result.NChannels()
, this == result.GetChannel(ii).get()
Implements Channel.
Definition at line 1028 of file WaveTrack.cpp.
|
overrideprivatevirtual |
Retrieve an interval.
!(iInterval < NIntervals()) || result
Implements ChannelGroup.
Definition at line 988 of file WaveTrack.cpp.
References mClips, and NIntervals().
|
overrideprivatevirtual |
IsLeader()
Implements Track.
Definition at line 857 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
|
private |
Definition at line 1117 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by HandleXMLTag(), and SetGain().
|
private |
Definition at line 1135 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by HandleXMLTag(), and SetPan().
|
private |
Definition at line 1100 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by Resample(), SetRate(), and WaveTrack().
|
private |
IsLeader()
[out] | leader |
pre IsLeader()
Definition at line 867 of file WaveTrack.cpp.
References Track::Any(), PackedArray::begin(), Track::Duplicate(), and Track::OnProjectTempoChange().
Referenced by ClearAndPaste(), and PasteWaveTrack().
WaveTrack::Holder WaveTrack::EmptyCopy | ( | const SampleBlockFactoryPtr & | pFactory = {} , |
bool | keepLink = true |
||
) | const |
Make another track copying format, rate, color, etc. but containing no clips; and always with a unique channel
It is important to pass the correct factory (that for the project which will own the copy) in the unusual case that a track is copied from another project or the clipboard. For copies within one project, the default will do.
keepLink | if false, make the new track mono. But always preserve any other track group data. |
Definition at line 1323 of file WaveTrack.cpp.
References BasicUI::Get(), GetRate(), GetSampleFormat(), mpFactory, and ChannelGroup::None.
Referenced by WaveTrackFactory::Create(), PasteInto(), EffectNoiseRemoval::ProcessOne(), and EffectStereoToMono::ProcessOne().
void WaveTrack::ExpandCutLine | ( | double | cutLinePosition, |
double * | cutlineStart = nullptr , |
||
double * | cutlineEnd = nullptr |
||
) |
Expand cut line (that is, re-insert audio, then delete audio saved in cut line)
Definition at line 3984 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
|
private |
Definition at line 3996 of file WaveTrack.cpp.
References BadUserAction, PackedArray::end(), GetEditClipsCanMove(), mClips, and XO().
|
overridevirtual |
Find associated ChannelGroup if any.
Implements PlayableSequence.
Definition at line 2783 of file WaveTrack.cpp.
const WaveClip * WaveTrack::FindClipByName | ( | const wxString & | name | ) | const |
Returns nullptr if clip with such name was not found.
Definition at line 1004 of file WaveTrack.cpp.
Referenced by MakeClipCopyName(), and MakeNewClipName().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 2734 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by WaveTrackSink::Flush(), TrackSpectrumTransformer::PostProcess(), and EffectSBSMS::Process().
|
private |
Definition at line 2772 of file WaveTrack.cpp.
References WaveClip::Flush(), and RightmostOrNewClip().
|
private |
Whether all tracks in group and all clips have a common sample format.
IsLeader()
Definition at line 2327 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by LinkConsistencyFix().
WaveClip * WaveTrack::GetAdjacentClip | ( | const WaveClip & | clip, |
PlaybackDirection | searchDirection | ||
) |
Similar to GetNextClip, but returns nullptr
if the neighbour clip is not adjacent.
Definition at line 3675 of file WaveTrack.cpp.
const WaveClip * WaveTrack::GetAdjacentClip | ( | const WaveClip & | clip, |
PlaybackDirection | searchDirection | ||
) | const |
Similar to GetNextClip, but returns nullptr
if the neighbour clip is not adjacent.
Definition at line 3656 of file WaveTrack.cpp.
References forward, GetNextClip(), WaveClip::GetPlayEndTime(), and WaveClip::GetPlayStartTime().
Referenced by GetFloatsFromTime(), and SetFloatsFromTime().
|
inline |
Definition at line 789 of file WaveTrack.h.
|
inline |
Definition at line 794 of file WaveTrack.h.
size_t WaveTrack::GetBestBlockSize | ( | sampleCount | t | ) | const |
Definition at line 2679 of file WaveTrack.cpp.
References GetMaxBlockSize(), and mClips.
Referenced by WaveChannel::GetBestBlockSize(), EffectNoiseRemoval::ProcessOne(), ReverseOneClip(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().
|
inline |
Definition at line 267 of file WaveTrack.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
Referenced by WaveTrackMenuTable::SplitStereo().
|
inline |
Definition at line 269 of file WaveTrack.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
|
overridevirtual |
Takes gain and pan into account.
Implements WideSampleSequence.
Definition at line 1153 of file WaveTrack.cpp.
References GetGain(), and GetPan().
Referenced by EffectStereoToMono::ProcessOne().
|
overridevirtual |
Classify this channel.
Implements AudioGraph::Channel.
Definition at line 811 of file WaveTrack.cpp.
References IsLeader(), AudioGraph::LeftChannel, AudioGraph::MonoChannel, TrackList::NChannels(), and AudioGraph::RightChannel.
WaveClip * WaveTrack::GetClipAtTime | ( | double | time | ) |
Definition at line 3683 of file WaveTrack.cpp.
const WaveClip * WaveTrack::GetClipAtTime | ( | double | time | ) | const |
Definition at line 3718 of file WaveTrack.cpp.
References SortedClipArray().
Referenced by anonymous_namespace{SampleHandle.cpp}::adjustTime(), ApplyStretchRatio(), SelectHandle::Click(), GetFloatAtTime(), GetFloatsFromTime(), PasteOne(), anonymous_namespace{WaveTrack.cpp}::RoundToNearestClipSample(), SetFloatsFromTime(), and SetFloatsWithinTimeRange().
WaveClip * WaveTrack::GetClipByIndex | ( | int | index | ) |
Get the nth clip in this WaveTrack (will return nullptr if not found).
Use this only in special cases (like getting the linked clip), because it is much slower than GetClipIterator().
Definition at line 3818 of file WaveTrack.cpp.
References mClips.
Referenced by GetClipByIndex(), MergeOneClipPair(), and PasteOne().
const WaveClip * WaveTrack::GetClipByIndex | ( | int | index | ) | const |
Get the nth clip in this WaveTrack (will return nullptr if not found).
Use this only in special cases (like getting the linked clip), because it is much slower than GetClipIterator().
Definition at line 3826 of file WaveTrack.cpp.
References GetClipByIndex().
int WaveTrack::GetClipIndex | ( | const WaveClip * | clip | ) | const |
Definition at line 3811 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), and mClips.
Referenced by ClearAndPasteOne().
ClipConstHolders WaveTrack::GetClipInterfaces | ( | ) | const |
Get access to the (visible) clips in the tracks, in unspecified order.
IsLeader()
Definition at line 3014 of file WaveTrack.cpp.
References TrackList::Channels(), Track::GetOwner(), IsLeader(), mClips, and NChannels().
|
inline |
Get access to the (visible) clips in the tracks, in unspecified order (not necessarily sequenced in time).
Definition at line 694 of file WaveTrack.h.
Referenced by ClearAndPasteOne(), WaveTrackUtilities::HasStretch(), EffectAutoDuck::Process(), and ReverseOne().
|
inline |
Get access to the (visible) clips in the tracks, in unspecified order (not necessarily sequenced in time).
Definition at line 698 of file WaveTrack.h.
WaveClipConstHolders WaveTrack::GetClipsIntersecting | ( | double | t0, |
double | t1 | ||
) | const |
Definition at line 3701 of file WaveTrack.cpp.
References mClips.
Referenced by anonymous_namespace{EditMenus.cpp}::JoinClipsAvailableFlag(), and SelectActions::Handler::OnZeroCrossing().
|
static |
Definition at line 708 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}::OnNewStereoTrack(), and anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewWaveTrack().
|
overridevirtual |
Implement WideSampleSequence.
Implements WideSampleSequence.
Definition at line 3050 of file WaveTrack.cpp.
References ChannelGroup::GetEndTime().
Referenced by AUPImportFileHandle::AddSilence(), EffectTruncSilence::Analyze(), ApplyStretchRatio(), ClearAndPasteAtSameTempo(), CopyOne(), Effect::GetBounds(), PasteWaveTrackAtSameTempo(), TrackSpectrumTransformer::PostProcess(), EffectStereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), RateMenuTable::SetRate(), SyncLockAdjust(), and Trim().
Envelope * WaveTrack::GetEnvelopeAtTime | ( | double | time | ) |
Definition at line 3740 of file WaveTrack.cpp.
References TrackList::Channels(), WaveClip::GetEnvelope(), and Track::GetOwner().
|
overridevirtual |
Fetch envelope values corresponding to uniformly separated sample times starting at the given time
backwards | if true, fetch values in reverse order, from t0 to t0 - bufferLen / rate |
Implements WideSampleSequence.
Definition at line 3580 of file WaveTrack.cpp.
References TrackList::Channels(), Track::GetOwner(), GetRate(), limitSampleBufferSize(), and min().
|
overridevirtual |
Returns nonempty if an error was encountered while trying to open the track from XML
May assume consistency of stereo channel grouping and examine other channels
IsLeader()
Reimplemented from Track.
Definition at line 2970 of file WaveTrack.cpp.
References TrackList::Channels(), IsLeader(), and XO().
bool WaveTrack::GetFloatAtTime | ( | double | t, |
size_t | iChannel, | ||
float & | value, | ||
bool | mayThrow | ||
) | const |
GetClipAtTime(t) != nullptr
, false otherwise. Definition at line 3267 of file WaveTrack.cpp.
References GetClipAtTime(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
|
inline |
"narrow" overload fetches first channel only
Definition at line 46 of file SampleTrack.h.
Referenced by VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), ReverseOneClip(), SelectHandle::StartSnappingFreqSelection(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().
bool WideSampleSequence::GetFloats | ( | size_t | iChannel, |
size_t | nBuffers, | ||
float *const | buffers[], | ||
sampleCount | start, | ||
size_t | len, | ||
bool | backwards = false , |
||
fillFormat | fill = FillFormat::fillZero , |
||
bool | mayThrow = true , |
||
sampleCount * | pNumWithinClips = nullptr |
||
) | const |
Retrieve samples from a sequence in floating-point format, regardless of the storage format
iChannel | index of first channel to fetch | |
nBuffers | counts buffers | |
buffers | receive the samples | |
start | starting sample, relative to absolute time zero | |
len | how many samples to get. buffers are assumed sufficiently large | |
fill | how to assign values for sample positions between clips | |
mayThrow | if false, fill buffer with zeros when there is failure to retrieve samples; else throw | |
[out] | pNumWithinClips | Report how many samples were copied from within clips, rather than filled according to fillFormat; but these were not necessarily one contiguous range. |
iChannel + nBuffers <= NChannels()
mayThrow
is false and not all samples could be retrieved Definition at line 43 of file WideSampleSequence.cpp.
std::pair< size_t, size_t > WaveTrack::GetFloatsCenteredAroundTime | ( | double | t, |
size_t | iChannel, | ||
float * | buffer, | ||
size_t | numSideSamples, | ||
bool | mayThrow | ||
) | const |
Gets as many samples as it can, but no more than 2 * numSideSamples + 1
, centered around t
. Reads nothing if GetClipAtTime(t) == nullptr
. Useful to access samples across clip boundaries, as it spreads the read to adjacent clips, i.e., not separated by silence from clip at t
.
Definition at line 3175 of file WaveTrack.cpp.
References backward, forward, GetFloatsFromTime(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
|
private |
Helper for GetFloatsCenteredAroundTime. If direction == PlaybackDirection::Backward
, fetches samples to the left of t
, excluding t
, without reversing.
Definition at line 3243 of file WaveTrack.cpp.
References floatSample, forward, GetAdjacentClip(), GetClipAtTime(), anonymous_namespace{WaveTrack.cpp}::GetSampleAccessArgs(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and anonymous_namespace{WaveTrack.cpp}::RoundToNearestClipSample().
Referenced by GetFloatsCenteredAroundTime().
float WaveTrack::GetGain | ( | ) | const |
Definition at line 1112 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by WaveTrackControls::GainSlider(), GetChannelGain(), GetInfoCommand::SendTracks(), SetGain(), and WriteOneXML().
size_t WaveTrack::GetIdealBlockSize | ( | ) |
Definition at line 2721 of file WaveTrack.cpp.
References Sequence::GetIdealBlockSize(), WaveClip::GetSequence(), and NewestOrNewClip().
Referenced by WaveChannel::GetIdealBlockSize().
WaveTrack::IntervalHolder WaveTrack::GetIntervalAtTime | ( | double | t | ) |
Definition at line 528 of file WaveTrack.cpp.
References Intervals().
Referenced by ApplyStretchRatio().
const WaveClip * WaveTrack::GetLeftmostClip | ( | ) | const |
Definition at line 2992 of file WaveTrack.cpp.
References mClips.
Referenced by PasteOne().
size_t WaveTrack::GetMaxBlockSize | ( | ) | const |
Definition at line 2699 of file WaveTrack.cpp.
References GetMaxBlockSize(), GetSampleFormat(), mClips, and mpFactory.
Referenced by EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), GetBestBlockSize(), WaveChannel::GetMaxBlockSize(), GetMaxBlockSize(), EffectCompressor::InitPass1(), EffectNoiseRemoval::ProcessOne(), EffectStereoToMono::ProcessOne(), PerTrackEffect::ProcessPass(), ReverseOneClip(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 2788 of file WaveTrack.cpp.
References PlayableTrack::GetMute().
Referenced by ExportAudioDialog::DoExportSplitByTracks(), ExportUtils::FindExportWaveTracks(), anonymous_namespace{ExportAudioDialog.cpp}::GetNumExportChannels(), GetInfoCommand::SendTracks(), and ExportAudioDialog::UpdateTrackExportSettings().
WaveClip * WaveTrack::GetNextClip | ( | const WaveClip & | clip, |
PlaybackDirection | searchDirection | ||
) |
Returns clips next to clip
in the given direction, or nullptr
if there is none.
Definition at line 3712 of file WaveTrack.cpp.
const WaveClip * WaveTrack::GetNextClip | ( | const WaveClip & | clip, |
PlaybackDirection | searchDirection | ||
) | const |
Returns clips next to clip
in the given direction, or nullptr
if there is none.
Definition at line 3688 of file WaveTrack.cpp.
References forward, and SortedClipArray().
Referenced by GetAdjacentClip(), and SetFloatsWithinTimeRange().
WaveTrack::IntervalHolder WaveTrack::GetNextInterval | ( | const Interval & | interval, |
PlaybackDirection | searchDirection | ||
) |
Definition at line 521 of file WaveTrack.cpp.
std::shared_ptr< const WaveTrack::Interval > WaveTrack::GetNextInterval | ( | const Interval & | interval, |
PlaybackDirection | searchDirection | ||
) | const |
Definition at line 499 of file WaveTrack.cpp.
References backward, forward, Intervals(), and ChannelGroupInterval::Start().
Referenced by ApplyStretchRatio(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit(), and ChangeClipSpeedDialog::SetClipSpeedFromDialog().
int WaveTrack::GetNumClips | ( | ) | const |
Definition at line 3831 of file WaveTrack.cpp.
References mClips.
Referenced by ApplyStretchRatio(), and PasteOne().
int WaveTrack::GetNumClips | ( | double | t0, |
double | t1 | ||
) | const |
Definition at line 3836 of file WaveTrack.cpp.
References SortedClipArray().
|
private |
Definition at line 3359 of file WaveTrack.cpp.
References ClearSamples(), fillTwo, fillZero, floatSample, anonymous_namespace{ExportPCM.cpp}::format, mClips, min(), ReverseSamples(), SAMPLE_SIZE, and wxT().
float WaveTrack::GetPan | ( | ) | const |
Definition at line 1130 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by GetChannelGain(), WaveTrackControls::PanSlider(), GetInfoCommand::SendTracks(), SetPan(), and WriteOneXML().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 1085 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by ProjectFileManager::AddImportedTracks(), SelectHandle::AdjustFreqSelection(), EffectTruncSilence::Analyze(), VoiceKey::CalibrateNoise(), ClearAndPasteOne(), CopyOne(), CreateClip(), SpectrumVRulerControls::DoHandleWheelRotation(), SpectrumVZoomHandle::DoZoom(), WaveformVZoomHandle::DoZoom(), EmptyCopy(), SpectrogramBounds::GetBounds(), GetEnvelopeValues(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit(), TranscriptionToolBar::GetSamples(), InsertSilence(), JoinOne(), SelectHandle::MoveSnappingFreqSelection(), VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), PasteOne(), anonymous_namespace{BrushHandle.cpp}::PositionToFrequency(), anonymous_namespace{SelectHandle.cpp}::PositionToFrequency(), EffectPaulstretch::ProcessOne(), EffectStereoToMono::ProcessOne(), SpectralDataManager::Worker::ProcessOvertones(), PerTrackEffect::ProcessPass(), SpectralDataManager::Worker::ProcessSnapping(), ProjectNyquistFrequency(), SelectHandle::SnapCenterOnce(), SelectHandle::StartSnappingFreqSelection(), anonymous_namespace{WaveTrackControls.cpp}::Status1DrawFunction(), SyncLockAdjust(), and WriteOneXML().
const WaveClip * WaveTrack::GetRightmostClip | ( | ) | const |
Definition at line 3003 of file WaveTrack.cpp.
References mClips.
Referenced by ProjectAudioManager::DoRecord(), and PasteOne().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 1220 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by CopyOne(), CreateClip(), EmptyCopy(), GetMaxBlockSize(), InsertSilence(), SyncLockAdjust(), and WriteOneXML().
ChannelGroupSampleView WaveTrack::GetSampleView | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Request samples within [t0, t1), not knowing in advance how many this will be.
The stretching of intersecting intervals influences the number of samples fitting into [t0, t1), i.e., half as many for twice as large a stretch ratio, due to a larger spacing of the raw samples.
IsLeader()
result.size() == NChannels()
size_t
Definition at line 3451 of file WaveTrack.cpp.
References Channels(), and IsLeader().
sampleCount WaveTrack::GetSequenceSamplesCount | ( | ) | const |
IsLeader()
Definition at line 1197 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 2793 of file WaveTrack.cpp.
References PlayableTrack::GetSolo().
Referenced by ExportAudioDialog::DoExportSplitByTracks(), ExportUtils::FindExportWaveTracks(), anonymous_namespace{ExportAudioDialog.cpp}::GetNumExportChannels(), GetInfoCommand::SendTracks(), and ExportAudioDialog::UpdateTrackExportSettings().
|
overridevirtual |
Implement WideSampleSequence.
Implements WideSampleSequence.
Definition at line 3045 of file WaveTrack.cpp.
References ChannelGroup::GetStartTime().
Referenced by ApplyStretchRatio(), ClearAndPasteAtSameTempo(), Effect::GetBounds(), TranscriptionToolBar::GetSamples(), MoveTo(), PasteWaveTrackAtSameTempo(), EffectStereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), and Trim().
|
overridevirtual |
Reimplemented from WritableSampleTrack.
Definition at line 951 of file WaveTrack.cpp.
References typeInfo().
sampleCount WaveTrack::GetVisibleSampleCount | ( | ) | const |
Definition at line 1187 of file WaveTrack.cpp.
References mClips.
int WaveTrack::GetWaveColorIndex | ( | ) | const |
Definition at line 1171 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by CreateClip(), HandleXMLChild(), InsertSilence(), and WriteOneXML().
size_t WaveTrack::GetWidth | ( | ) | const |
The width of every WaveClip in this track; for now always 1.
Definition at line 795 of file WaveTrack.cpp.
Referenced by AddClip(), ClearAndPasteOne(), and CreateClip().
|
private |
Definition at line 1909 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), GetEditClipsCanMove(), InsertClip(), mClips, mpFactory, WideSampleSequence::SnapToSample(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by ClearAndPasteOne().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 2865 of file WaveTrack.cpp.
References XMLMethodRegistry< Host >::Get(), WaveClip::GetEnvelope(), WaveClip::GetSequence(), GetWaveColorIndex(), mClips, mLegacyFormat, mLegacyProjectFileOffset, mLegacyRate, mpFactory, NewestOrNewClip(), and WaveClip::SetSequenceStartTime().
|
override |
Definition at line 2853 of file WaveTrack.cpp.
References WaveClip::HandleXMLEndTag(), and NewestOrNewClip().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 2798 of file WaveTrack.cpp.
References DoSetGain(), DoSetPan(), BasicUI::Get(), Track::HandleCommonXMLAttribute(), PlayableTrack::HandleXMLAttribute(), Sequence::IsValidSampleFormat(), lrint, mLegacyProjectFileOffset, mLegacyRate, SetLegacyFormat(), Track::SetLinkType(), and anonymous_namespace{WaveTrack.cpp}::ToLinkType().
bool WaveTrack::HasHiddenData | ( | ) | const |
Whether any clips have hidden audio.
IsLeader()
Definition at line 4382 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 3569 of file WaveTrack.cpp.
References TrackList::Channels(), and Track::GetOwner().
|
private |
Definition at line 823 of file WaveTrack.cpp.
References Track::Init(), and mpFactory.
|
private |
Adds clip to the track. Clip should be not empty or to be a placeholder. Sets project tempo on clip upon push. Use this instead of mClips.push_back
.
Definition at line 2338 of file WaveTrack.cpp.
References Track::GetProjectTempo(), and mClips.
Referenced by AddClip(), CopyOne(), HandleClear(), PasteOne(), SplitAt(), and WaveTrack().
|
private |
IsLeader()
Definition at line 4118 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by ReplaceInterval().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 2434 of file WaveTrack.cpp.
References TrackList::Channels(), PackedArray::end(), GetRate(), GetSampleFormat(), GetWaveColorIndex(), IsLeader(), mpFactory, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by AUPImportFileHandle::AddSilence().
|
inline |
Definition at line 1026 of file WaveTrack.h.
Referenced by ProjectFileManager::AddImportedTracks(), SetClipCommand::Apply(), Disjoin(), GetIntervalAtTime(), GetNextInterval(), and Join().
|
inline |
Definition at line 1027 of file WaveTrack.h.
bool WaveTrack::IsEmpty | ( | double | t0, |
double | t1 | ||
) | const |
Returns true if there are no WaveClips in the specified region.
Definition at line 1238 of file WaveTrack.cpp.
References mClips.
Referenced by PasteOne(), and SyncLockAdjust().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 2778 of file WaveTrack.cpp.
References Track::IsLeader().
Referenced by AUPImportFileHandle::AddSilence(), EffectTruncSilence::Analyze(), ApplyStretchRatio(), Clear(), ClearAndAddCutLine(), ClearAndPasteAtSameTempo(), Clone(), CloseLock(), ConvertToSampleFormat(), CountBlocks(), CreateWideClip(), Cut(), DEFINE_ATTACHED_VIRTUAL_OVERRIDE(), DiscardTrimmed(), Disjoin(), SpectrumView::DoDraw(), WaveformView::DoDraw(), DoGet(), DoOnProjectTempoChange(), EffectTruncSilence::DoRemoval(), ExpandCutLine(), EffectSBSMS::Finalize(), Flush(), FormatConsistencyCheck(), Effect::GetBounds(), GetChannelType(), GetClipInterfaces(), GetErrorOpening(), GetSampleView(), GetSequenceSamplesCount(), HasHiddenData(), InsertInterval(), InsertSilence(), Join(), LinkConsistencyFix(), MoveTo(), NChannels(), Paste(), PasteInto(), PasteWaveTrackAtSameTempo(), TrackSpectrumTransformer::PostProcess(), RateConsistencyCheck(), Reinit(), RemoveCutLine(), RemoveInterval(), ReplaceInterval(), SetWaveColorIndex(), Silence(), Split(), SplitCut(), SplitDelete(), SyncLockAdjust(), Trim(), and WideEmptyCopy().
void WaveTrack::Join | ( | double | t0, |
double | t1, | ||
const ProgressReporter & | reportProgress | ||
) |
IsLeader()
Definition at line 2565 of file WaveTrack.cpp.
References ApplyStretchRatioOnIntervals(), TrackList::Channels(), Intervals(), IsLeader(), and JoinOne().
Referenced by anonymous_namespace{LabelMenus.cpp}::OnJoinLabels().
|
staticprivate |
Definition at line 2589 of file WaveTrack.cpp.
References CreateClip(), PackedArray::end(), anonymous_namespace{WaveTrack.cpp}::FindClip(), Track::GetName(), WaveClip::GetPlayStartTime(), GetRate(), and mClips.
Referenced by Join().
|
overridevirtual |
Check consistency of channel groups, and maybe fix it.
doFix | whether to make any changes to correct inconsistencies |
!doFix || IsLeader()
Reimplemented from Track.
Definition at line 875 of file WaveTrack.cpp.
References ChannelGroup::Aligned, anonymous_namespace{WaveTrack.cpp}::AreAligned(), TrackList::Channels(), FormatConsistencyCheck(), BasicUI::Get(), Track::GetLinkType(), Track::GetName(), IsLeader(), Track::LinkConsistencyFix(), mClips, mLegacyFormat, mLegacyRate, ChannelGroup::None, RateConsistencyCheck(), Track::SetLinkType(), SetRate(), SortedClipArray(), and undefinedSample.
|
private |
Definition at line 1061 of file WaveTrack.cpp.
References FindClipByName(), name, and XC.
Referenced by PasteOne().
|
private |
Definition at line 1073 of file WaveTrack.cpp.
References FindClipByName(), Track::GetName(), name, and XC.
Referenced by NewestOrNewClip(), PasteOne(), and RightmostOrNewClip().
bool WaveTrack::MergeClips | ( | int | clipidx1, |
int | clipidx2 | ||
) |
Definition at line 4065 of file WaveTrack.cpp.
References TrackList::Channels().
|
private |
Definition at line 4074 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), GetClipByIndex(), WaveClip::GetPlayEndTime(), WaveClip::HasEqualStretchRatio(), mClips, and WaveClip::Paste().
Referenced by ClearAndPasteOne().
TrackListHolder WaveTrack::MonoToStereo | ( | ) |
Definition at line 1355 of file WaveTrack.cpp.
References Track::Duplicate(), and Track::GetOwner().
|
overridevirtual |
Implements ChannelGroup.
Definition at line 845 of file WaveTrack.cpp.
References TrackList::Channels(), BasicUI::Get(), GetStartTime(), and IsLeader().
|
overridevirtual |
May report more than one only when this is a leader track.
Implements RecordableSequence.
Definition at line 800 of file WaveTrack.cpp.
References Track::GetOwner(), IsLeader(), and TrackList::NChannels().
Referenced by WaveTrack::Interval::Append(), ProjectAudioManager::ChooseExistingRecordingTracks(), ClearAndPasteAtSameTempo(), WaveTrack::Interval::ClearLeft(), WaveTrack::Interval::ClearRight(), EffectBase::CountWaveTracks(), DEFINE_ATTACHED_VIRTUAL_OVERRIDE(), Disjoin(), DoGet(), WaveTrack::Interval::DoGetChannel(), DoGetChannel(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), EffectSBSMS::Finalize(), WaveTrack::Interval::ForEachClip(), GetClipInterfaces(), WaveTrack::Interval::GetStretchRenderedCopy(), PasteWaveTrackAtSameTempo(), NyquistEffect::Process(), EffectReverse::Process(), Reinit(), WaveTrack::Interval::SetTrimLeft(), WaveTrack::Interval::SetTrimRight(), WaveTrack::Interval::StretchLeftTo(), WaveTrack::Interval::StretchRatioEquals(), WaveTrack::Interval::StretchRightTo(), WaveTrack::Interval::TrimLeftTo(), and WaveTrack::Interval::TrimRightTo().
|
static |
Definition at line 767 of file WaveTrack.cpp.
References TrackList::Get(), WaveTrackFactory::Get(), project, and tracks.
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 3780 of file WaveTrack.cpp.
References CreateClip(), BasicUI::Get(), MakeNewClipName(), and mClips.
Referenced by GetIdealBlockSize(), HandleXMLChild(), and HandleXMLEndTag().
|
overridevirtual |
used only during deserialization
Implements ChannelGroup.
Definition at line 982 of file WaveTrack.cpp.
References mClips.
Referenced by DoGetInterval().
|
virtual |
Weak precondition allows overrides to replicate one channel into many.
IsLeader()
SameKindAs(src)
src.NChannels() == 1 || src.NChannels() == NChannels()
Implements Track.
void Track::Paste | ( | double | t, |
const TrackList & | src | ||
) |
Non-virtual overload that passes the first track of a given list
IsLeader()
SameKindAs(**src.begin()).NChannels()
NChannels == (**src.begin()).NChannels()
Definition at line 364 of file Track.cpp.
|
overridevirtual |
Implements Track.
Definition at line 2393 of file WaveTrack.cpp.
References IsLeader(), and PasteWaveTrack().
Referenced by EffectStereoToMono::ProcessOne().
|
overridevirtual |
Find or create the destination track for a paste, maybe in a different project
IsLeader()
list | to which any newly created tracks are added; but left unchanged if an existing track is found in the project instead |
Implements Track.
Definition at line 961 of file WaveTrack.cpp.
References TrackList::Add(), TrackList::Channels(), EmptyCopy(), WaveTrackFactory::Get(), IsLeader(), and project.
|
staticprivate |
Definition at line 2131 of file WaveTrack.cpp.
References BadUserAction, GetClipAtTime(), GetClipByIndex(), GetEditClipsCanMove(), GetLeftmostClip(), GetNumClips(), Track::GetOwner(), WaveClip::GetPlayEndTime(), WaveClip::GetPlayStartTime(), GetRate(), GetRightmostClip(), InsertClip(), IsEmpty(), WideSampleSequence::LongSamplesToTime(), MakeClipCopyName(), MakeNewClipName(), mClips, mpFactory, WaveClip::Paste(), WideSampleSequence::SnapToSample(), SplitAt(), and XO().
Referenced by ClearAndPasteOne(), PasteWaveTrackAtSameTempo(), and SyncLockAdjust().
|
private |
Definition at line 2100 of file WaveTrack.cpp.
References staffpad::vo::copy(), DuplicateWithOtherTempo(), Track::GetProjectTempo(), PasteWaveTrackAtSameTempo(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by ClearAndPasteAtSameTempo(), and Paste().
|
private |
Definition at line 2112 of file WaveTrack.cpp.
References TrackList::Channels(), GetEndTime(), Track::GetProjectTempo(), GetStartTime(), IsLeader(), NChannels(), and PasteOne().
Referenced by PasteWaveTrack().
|
static |
Definition at line 696 of file WaveTrack.cpp.
References ProjectRate::Get(), TrackList::Get(), GetRate(), project, and tracks.
Referenced by SelectFrequenciesCommand::Apply().
|
private |
Whether all clips of a leader track have a common rate.
IsLeader()
Definition at line 2306 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by LinkConsistencyFix().
|
overrideprivatevirtual |
This is temporary! It defaults to call the above.
Reimplemented from Channel.
Definition at line 1034 of file WaveTrack.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), and Track::GetHolder().
void WaveTrack::Reinit | ( | const WaveTrack & | orig | ) |
Overwrite data excluding the sample sequence but including display settings
IsLeader()
orig.IsLeader()
NChannels() == orig.NChannels()
Definition at line 829 of file WaveTrack.cpp.
References TrackList::Channels(), IsLeader(), and NChannels().
Referenced by ProjectAudioManager::DoRecord().
Definition at line 1879 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::FindClip(), and mClips.
Referenced by ReverseOne().
bool WaveTrack::RemoveCutLine | ( | double | cutLinePosition | ) |
Remove cut line, without expanding the audio in it.
Definition at line 4049 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
|
private |
IsLeader()
Definition at line 4130 of file WaveTrack.cpp.
References TrackList::Channels(), and IsLeader().
Referenced by ReplaceInterval().
|
private |
IsLeader()
oldOne->NChannels() == newOne->NChannels()