Audacity 3.2.0
|
A Track that contains audio waveform data. More...
#include <WaveTrack.h>
Classes | |
struct | CreateToken |
struct | Region |
Structure to hold region of a wavetrack and a comparison function for sortability. More... | |
Public Types | |
using | Interval = WaveClip |
using | IntervalHolder = std::shared_ptr< Interval > |
using | IntervalHolders = std::vector< IntervalHolder > |
using | IntervalConstHolder = std::shared_ptr< const Interval > |
using | IntervalConstHolders = std::vector< IntervalConstHolder > |
using | Regions = std::vector< Region > |
using | Holder = std::shared_ptr< WaveTrack > |
Public Types inherited from Track | |
using | AttachedObjects = ::AttachedTrackObjects |
Alias for my base type. More... | |
using | Holder = std::shared_ptr< Track > |
Public Types inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy > | |
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 Types inherited from ChannelGroup | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
using | Attachments = ChannelGroupAttachments |
using | Interval = WideChannelGroupInterval |
Public Types inherited from Observer::Publisher< WaveTrackMessage > | |
using | message_type = WaveTrackMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const WaveTrackMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Public Member Functions | |
WaveTrack (CreateToken &&, const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate) | |
Don't call directly, but use Create. More... | |
const SampleBlockFactoryPtr & | GetSampleBlockFactory () const |
size_t | NChannels () const override |
A constant property. 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 | Init (const WaveTrack &orig) |
virtual | ~WaveTrack () |
void | MoveTo (double o) override |
void | ShiftBy (double t0, double delta) 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) |
!brief Sets the new rate for the track without resampling it More... | |
float | GetVolume () const |
void | SetVolume (float newVolume) |
float | GetPan () const |
void | SetPan (float newPan) |
float | GetChannelVolume (int channel) const override |
Takes volume and pan into account. More... | |
sampleCount | GetVisibleSampleCount () const |
sampleFormat | GetSampleFormat () const override |
void | ConvertToSampleFormat (sampleFormat format, const std::function< void(size_t)> &progressReport={}) |
Track::Holder | Cut (double t0, double t1) override |
Create tracks and modify this track. More... | |
Holder | EmptyCopy (size_t nChannels, const SampleBlockFactoryPtr &pFactory={}) const |
Holder | EmptyCopy (const SampleBlockFactoryPtr &pFactory={}) const |
void | MakeMono () |
Simply discard any right channel. More... | |
Holder | MonoToStereo () |
std::vector< Holder > | SplitChannels () |
void | SwapChannels () |
Track::Holder | 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 | Silence (double t0, double t1, ProgressReporter reportProgress) override |
void | InsertSilence (double t, double len) override |
void | Split (double t0, double t1) |
std::pair< IntervalHolder, IntervalHolder > | SplitAt (double t) |
void | ClearAndAddCutLine (double t0, double t1) |
Holder | 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 | ApplyPitchAndSpeed (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 (size_t iChannel, constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1, sampleFormat effectiveFormat=widestSampleFormat) override |
void | Flush () override |
void | RepairChannels () 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... | |
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 |
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 |
IntervalHolder | GetLeftmostClip () |
IntervalConstHolder | GetLeftmostClip () const |
IntervalHolder | GetRightmostClip () |
IntervalConstHolder | GetRightmostClip () const |
ClipConstHolders | GetClipInterfaces () const |
Get access to the (visible) clips in the tracks, in unspecified order. More... | |
IntervalHolder | CreateClip (double offset=.0, const wxString &name=wxEmptyString, const Interval *pToCopy=nullptr, bool copyCutlines=true) |
IntervalHolder | CopyClip (const Interval &toCopy, bool copyCutlines) |
Create new clip and add it to this track. More... | |
IntervalHolder | 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... | |
IntervalHolder | RightmostOrNewClip () |
Get access to the last (rightmost) clip, or create a clip, if there is not already one. More... | |
int | GetNumClips () const |
IntervalHolders | SortedIntervalArray () |
Return all WaveClips sorted by clip play start time. More... | |
IntervalConstHolders | SortedIntervalArray () const |
Return all WaveClips sorted by clip play start time. More... | |
bool | CanOffsetClips (const std::vector< Interval * > &movingClips, double amount, double *allowedAmount=nullptr) |
Decide whether the clips could be offset (and inserted) together without overlapping other clips. More... | |
bool | CanInsertClip (const Interval &clip, double &slideBy, double tolerance) const |
bool | MergeClips (int clipidx1, int clipidx2) |
void | Resample (int rate, BasicUI::ProgressDialog *progress=NULL) |
bool | SetFloats (const float *const *buffers, sampleCount start, size_t len, sampleFormat effectiveFormat=widestSampleFormat) |
Random-access assignment of a range of samples. More... | |
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 |
void | InsertInterval (const IntervalHolder &interval, bool newClip, bool allowEmpty=false) |
void | RemoveInterval (const IntervalHolder &interval) |
Track::Holder | PasteInto (AudacityProject &project, TrackList &list) const override |
bool | HasClipNamed (const wxString &name) const |
size_t | NIntervals () const override |
Report the number of intervals. More... | |
IntervalHolder | GetClip (size_t iInterval) |
IntervalConstHolder | GetClip (size_t iInterval) const |
used only during deserialization More... | |
void | SetLegacyFormat (sampleFormat format) |
int | GetClipIndex (const Interval &clip) const |
Get the linear index of a given clip (== number of clips if not found) More... | |
void | ZipClips (bool mustAlign=true) |
virtual void | Paste (double t, const Track &src)=0 |
Weak precondition allows overrides to replicate one channel into many. More... | |
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... | |
Public Member Functions inherited from WritableSampleTrack | |
WritableSampleTrack () | |
WritableSampleTrack (const WritableSampleTrack &other, ProtectedCreationArg &&) | |
~WritableSampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
virtual size_t | NChannels () const=0 |
Report the number of channels. More... | |
virtual double | GetRate () const=0 |
Public Member Functions inherited from SampleTrack | |
SampleTrack () | |
SampleTrack (const SampleTrack &other, ProtectedCreationArg &&) | |
~SampleTrack () override | |
const TypeInfo & | GetTypeInfo () const override |
virtual sampleFormat | GetSampleFormat () const =0 |
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 | 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 |
Public Member Functions inherited from PlayableTrack | |
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) |
Public Member Functions inherited from AudioTrack | |
AudioTrack () | |
AudioTrack (const Track &orig, ProtectedCreationArg &&a) | |
void | WriteXMLAttributes (XMLWriter &WXUNUSED(xmlFile)) const |
bool | HandleXMLAttribute (const std::string_view &, const XMLAttributeValueView &) |
Public Member Functions inherited from Track | |
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 > > |
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 |
LinkType | GetLinkType () const noexcept |
Track () | |
Track (const Track &orig, ProtectedCreationArg &&) | |
Track & | operator= (const Track &orig)=delete |
virtual | ~Track () |
void | Init (const Track &orig) |
virtual Holder | Duplicate (DuplicateOptions={}) const |
public nonvirtual duplication function that invokes Clone() More... | |
void | ReparentAllAttachments () |
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) |
virtual Holder | Cut (double t0, double t1)=0 |
Create tracks and modify this track. More... | |
virtual Holder | 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... | |
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 |
void | AdjustPositions () |
void | WriteCommonXMLAttributes (XMLWriter &xmlFile, bool includeNameAndSelected=true) const |
bool | HandleCommonXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
Public Member Functions inherited from XMLTagHandler | |
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) |
Public Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy > | |
~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... | |
Public Member Functions inherited from ChannelGroup | |
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 | ShiftBy (double t0, double delta)=0 |
Shift all intervals that starts after t0 by delta seconds. More... | |
virtual void | MoveTo (double o)=0 |
Change start time to given time point. 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... | |
std::shared_ptr< Channel > | NthChannel (size_t nChannel) |
std::shared_ptr< const Channel > | NthChannel (size_t nChannel) const |
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... | |
Public Member Functions inherited from PlayableSequence | |
~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... | |
Public Member Functions inherited from WideSampleSequence | |
virtual | ~WideSampleSequence () |
virtual size_t | NChannels () const =0 |
A constant property. More... | |
virtual float | GetChannelVolume (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 |
Public Member Functions inherited from AudioGraph::Channel | |
virtual | ~Channel () |
virtual ChannelType | GetChannelType () const =0 |
Classify this channel. More... | |
Public Member Functions inherited from RecordableSequence | |
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 (size_t iChannel, constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride, sampleFormat effectiveFormat)=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... | |
virtual void | RepairChannels ()=0 |
virtual void | InsertSilence (double t, double len)=0 |
Public Member Functions inherited from Observer::Publisher< WaveTrackMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static wxString | GetDefaultAudioTrackNamePreference () |
static double | ProjectNyquistFrequency (const AudacityProject &project) |
static WaveTrack * | New (AudacityProject &project) |
static Holder | Create (const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate) |
Factory builds all AttachedTrackObjects. More... | |
static const TypeInfo & | ClassTypeInfo () |
Static Public Member Functions inherited from WritableSampleTrack | |
static const TypeInfo & | ClassTypeInfo () |
Static Public Member Functions inherited from SampleTrack | |
static const TypeInfo & | ClassTypeInfo () |
Static Public Member Functions inherited from PlayableTrack | |
static const TypeInfo & | ClassTypeInfo () |
Static Public Member Functions inherited from AudioTrack | |
static const TypeInfo & | ClassTypeInfo () |
Static Public Member Functions inherited from Track | |
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 | CopyAttachments (Track &dst, const Track &src, bool deep) |
Copy (deep) or just share (!deep) AttachedTrackObjects. More... | |
Static Public Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy > | |
static size_t | numFactories () |
How many static factories have been registered with this specialization of Site. More... | |
Static Public Attributes | |
static const char * | WaveTrack_tag = "wavetrack" |
Static Public Attributes inherited from Observer::Publisher< WaveTrackMessage > | |
static constexpr bool | notifies_all |
Private Member Functions | |
std::ptrdiff_t | FindClip (const Interval &clip) |
void | RemoveClip (std::ptrdiff_t distance) |
Track::Holder | Clone (bool backup) const override |
wxString | MakeClipCopyName (const wxString &originalName) const |
wxString | MakeNewClipName () const |
void | CopyWholeClip (const Interval &clip, double t0, bool forClipboard) |
void | CopyPartOfClip (const Interval &clip, double t0, double t1, bool forClipboard) |
void | FinishCopy (double t0, double t1, bool forClipboard) |
IntervalConstHolders | SortedClipArray () const |
Return all WaveClips sorted by clip play start time. More... | |
IntervalConstHolder | GetClipAtTime (double time) const |
void | CreateRight () |
WaveClipHolder | DoCreateClip (double offset=.0, const wxString &name=wxEmptyString) const |
Create a new clip that can be inserted later into the track. More... | |
bool | InsertClip (WaveClipHolders &clips, WaveClipHolder clip, bool newClip, bool backup, bool allowEmpty) |
void | CopyClips (WaveClipHolders &clips, SampleBlockFactoryPtr pFactory, const WaveClipHolders &orig, bool backup) |
void | MergeChannelAttachments (WaveTrack &&other) |
void | EraseChannelAttachments (size_t index) |
Erase all attachments for a given index. More... | |
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 | ExpandOneCutLine (double cutLinePosition, double *cutlineStart, double *cutlineEnd) |
void | ApplyPitchAndSpeedOnIntervals (const std::vector< IntervalHolder > &intervals, const ProgressReporter &reportProgress) |
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 |
WaveClipHolders & | NarrowClips () |
const WaveClipHolders & | NarrowClips () const |
void | DoSetRate (double newRate) |
Holder | DuplicateWithOtherTempo (double newTempo) const |
bool | GetOne (const WaveClipHolders &clips, size_t iChannel, samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill, bool mayThrow, sampleCount *pNumWithinClips) const |
void | DoSetPan (float value) |
void | DoSetVolume (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 an unzipped leader track have a common rate. More... | |
bool | FormatConsistencyCheck () const |
void | ApplyPitchAndSpeedOne (double t0, double t1, const ProgressReporter &reportProgress) |
Static Private Member Functions | |
static void | JoinOne (WaveTrack &track, double t0, double t1) |
static void | WriteOneXML (const WaveChannel &channel, XMLWriter &xmlFile, size_t iChannel, size_t nChannels) |
Private Attributes | |
WaveChannel | mChannel |
std::optional< WaveChannel > | mRightChannel |
may be null More... | |
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 { 0 } |
friend | WaveChannel |
Friends | |
class | WaveTrackFactory |
Additional Inherited Members | |
Protected Member Functions inherited from PlayableTrack | |
bool | DoGetMute () const |
void | DoSetMute (bool value) |
bool | DoGetSolo () const |
void | DoSetSolo (bool value) |
Protected Member Functions inherited from Track | |
void | SetLinkType (LinkType linkType, bool completeList=true) |
Protected Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy > | |
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 > | |
void | ForCorresponding (Site &other, const Function &function, bool create=true) |
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... | |
template<typename Function > | |
void | EraseIf (const Function &function) |
Erase attached objects satisfying a predicate. 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 |
virtual std::shared_ptr< Interval > | DoGetInterval (size_t iInterval)=0 |
Retrieve an interval. More... | |
Protected Member Functions inherited from Observer::Publisher< WaveTrackMessage > | |
CallbackReturn | Publish (const WaveTrackMessage &message) |
Send a message to connected callbacks. More... | |
Protected Attributes inherited from Track | |
std::weak_ptr< TrackList > | mList |
TrackNodePointer | mNode {} |
Holds iterator to self, so that TrackList::Find can be constant-time. More... | |
A Track that contains audio waveform data.
Definition at line 200 of file WaveTrack.h.
using WaveTrack::Holder = std::shared_ptr<WaveTrack> |
Definition at line 247 of file WaveTrack.h.
using WaveTrack::Interval = WaveClip |
Definition at line 208 of file WaveTrack.h.
using WaveTrack::IntervalConstHolder = std::shared_ptr<const Interval> |
Definition at line 211 of file WaveTrack.h.
using WaveTrack::IntervalConstHolders = std::vector<IntervalConstHolder> |
Definition at line 212 of file WaveTrack.h.
using WaveTrack::IntervalHolder = std::shared_ptr<Interval> |
Definition at line 209 of file WaveTrack.h.
using WaveTrack::IntervalHolders = std::vector<IntervalHolder> |
Definition at line 210 of file WaveTrack.h.
using WaveTrack::Regions = std::vector < Region > |
Definition at line 230 of file WaveTrack.h.
WaveTrack::WaveTrack | ( | CreateToken && | , |
const SampleBlockFactoryPtr & | pFactory, | ||
sampleFormat | format, | ||
double | rate | ||
) |
Don't call directly, but use Create.
Definition at line 494 of file WaveTrack.cpp.
References DoSetRate(), anonymous_namespace{ExportPCM.cpp}::format, and BasicUI::Get().
|
virtual |
Definition at line 559 of file WaveTrack.cpp.
|
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.
iChannel < NChannels()
Implements RecordableSequence.
Definition at line 2248 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, NChannels(), and RightmostOrNewClip().
Referenced by WaveChannel::Append(), and WaveChannel::AppendBuffer().
void WaveTrack::ApplyPitchAndSpeed | ( | std::optional< TimeInterval > | interval, |
ProgressReporter | reportProgress | ||
) |
Definition at line 1945 of file WaveTrack.cpp.
References ApplyPitchAndSpeedOnIntervals(), forward, GetClipAtTime(), GetEndTime(), GetIntervalAtTime(), GetNextInterval(), GetNumClips(), GetStartTime(), min(), WideSampleSequence::SnapToSample(), and Split().
Referenced by Silence().
|
private |
|
private |
Definition at line 3207 of file WaveTrack.cpp.
References ReplaceInterval().
Referenced by ApplyPitchAndSpeed(), and Join().
bool WaveTrack::CanInsertClip | ( | const Interval & | clip, |
double & | slideBy, | ||
double | tolerance | ||
) | const |
Definition at line 3113 of file WaveTrack.cpp.
References Intervals(), and WideSampleSequence::SnapToSample().
bool WaveTrack::CanOffsetClips | ( | const std::vector< Interval * > & | movingClips, |
double | amount, | ||
double * | allowedAmount = nullptr |
||
) |
Decide whether the clips could be offset (and inserted) together without overlapping other clips.
(allowedAmount ? *allowedAmount : amount)
movingClips | 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 3054 of file WaveTrack.cpp.
References CanOffsetClips(), and Intervals().
Referenced by CanOffsetClips().
|
inline |
Definition at line 263 of file WaveTrack.h.
Referenced by TruncSilenceBase::Analyze(), CompareAudioCommand::Apply(), SetTrackVisualsCommand::ApplyInner(), DEFINE_ATTACHED_VIRTUAL_OVERRIDE(), WaveChannelSubView::DoDetailedHitTest(), TruncSilenceBase::DoRemoval(), ImportUtils::ForEachChannel(), GetChannelType(), WaveChannelUtilities::GetEnvelopeAtTime(), WaveChannelView::GetFirst(), GetIdealBlockSize(), GetSampleView(), LoudnessBase::LoadBufferBlock(), PerTrackEffect::ProcessPass(), SetFloats(), and LoudnessBase::StoreBufferBlock().
|
inline |
Definition at line 265 of file WaveTrack.h.
|
static |
Definition at line 689 of file WaveTrack.cpp.
References typeInfo().
|
overridevirtual |
Implements Track.
Definition at line 1161 of file WaveTrack.cpp.
References HandleClear().
Referenced by Cut(), TruncSilenceBase::DoRemoval(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), TrackSpectrumTransformer::PostProcess(), StereoToMono::ProcessOne(), SyncLockAdjust(), and Trim().
void WaveTrack::ClearAndAddCutLine | ( | double | t0, |
double | t1 | ||
) |
May assume precondition: t0 <= t1
Definition at line 1167 of file WaveTrack.cpp.
References HandleClear().
Referenced by anonymous_namespace{LabelMenus.cpp}::OnCutLabels().
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
src.NChannels() == 1 || src.NChannels() == NChannels()
Definition at line 1219 of file WaveTrack.cpp.
References ClearAndPasteAtSameTempo(), DuplicateWithOtherTempo(), GetProjectTempo(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by SBSMSBase::Finalize(), anonymous_namespace{EditMenus.cpp}::OnPaste(), and PerTrackEffect::ProcessPass().
|
private |
Definition at line 1238 of file WaveTrack.cpp.
References CopyClip(), GetEndTime(), GetProjectTempo(), min(), WideChannelGroupInterval::NChannels(), NChannels(), PasteWaveTrack(), WideSampleSequence::SnapToSample(), and TimeWarper::Warp().
Referenced by ClearAndPaste().
|
overrideprivatevirtual |
Subclass responsibility implements only a part of Duplicate(), copying the track data proper (not associated data such as for groups and views) including TrackId
backup | whether the duplication is for backup purposes while opening a project, instead of other editing operations |
this
Implements Track.
Definition at line 778 of file WaveTrack.cpp.
References EmptyCopy(), mLegacyFormat, mLegacyRate, and NChannels().
void WaveTrack::ConvertToSampleFormat | ( | sampleFormat | format, |
const std::function< void(size_t)> & | progressReport = {} |
||
) |
Definition at line 924 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, BasicUI::Get(), and Intervals().
|
overridevirtual |
Create new tracks and don't modify this track.
Implements Track.
Definition at line 1097 of file WaveTrack.cpp.
References EmptyCopy(), Intervals(), NChannels(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by Cut(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitCut(), and anonymous_namespace{EditMenus.cpp}::OnSplitNew().
auto WaveTrack::CopyClip | ( | const Interval & | toCopy, |
bool | copyCutlines | ||
) |
Create new clip and add it to this track.
Returns a pointer to the newly created clip, using this track's block factory but copying all else from the given clip, except possibly the cutlines.
Definition at line 2975 of file WaveTrack.cpp.
Referenced by ClearAndPasteAtSameTempo(), and HandleClear().
|
private |
Definition at line 516 of file WaveTrack.cpp.
References InsertClip().
|
private |
Definition at line 1131 of file WaveTrack.cpp.
References GetSampleBlockFactory(), and InsertInterval().
|
private |
Definition at line 1121 of file WaveTrack.cpp.
References GetSampleBlockFactory(), and InsertInterval().
|
static |
Factory builds all AttachedTrackObjects.
Definition at line 503 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format.
Referenced by TestWaveTrackMaker::Track().
auto WaveTrack::CreateClip | ( | double | offset = .0 , |
const wxString & | name = wxEmptyString , |
||
const Interval * | pToCopy = nullptr , |
||
bool | copyCutlines = true |
||
) |
Create new clip that uses this track's factory but do not add it to the track
Returns a pointer to the newly created clip. Optionally initial offset and clip name may be provided, and a clip from which to copy all sample data. The clip is not owned by the track. Use InsertInterval to make it so.
offset | desired sequence (not play) start time |
Definition at line 2961 of file WaveTrack.cpp.
References name.
Referenced by ProjectAudioManager::DoRecord(), FinishCopy(), AUPImportFileHandle::HandleWaveClip(), InsertSilence(), Join(), and PasteWaveTrackAtSameTempo().
|
private |
Definition at line 2982 of file WaveTrack.cpp.
References mRightChannel.
Referenced by ZipClips().
|
overridevirtual |
Create tracks and modify this track.
Implements Track.
Definition at line 955 of file WaveTrack.cpp.
References Clear(), Copy(), and THROW_INCONSISTENCY_EXCEPTION.
void WaveTrack::Disjoin | ( | double | t0, |
double | t1 | ||
) |
Definition at line 2061 of file WaveTrack.cpp.
References details::end(), floatSample, Intervals(), limitSampleBufferSize(), min(), NChannels(), SplitDelete(), WideSampleSequence::TimeToLongSamples(), and WAVETRACK_MERGE_POINT_TOLERANCE.
Referenced by anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels().
|
private |
Create a new clip that can be inserted later into the track.
Returns a pointer to the newly created clip. Optionally initial offset and clip name may be provided
result->NChannels() == track.NChannels()
Definition at line 2987 of file WaveTrack.cpp.
References GetProjectTempo(), anonymous_namespace{TimeTrack.cpp}::GetRate(), and name.
|
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.
Implements WideSampleSequence.
Definition at line 2636 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, GetOne(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, mClips, and NChannels().
Referenced by WaveChannel::DoGet().
|
overrideprivatevirtual |
Retrieve a channel For fixed iChannel, resulting address must be unchanging, if there has been no other mutation of this ChannelGroup
!(iChannel < NChannels()) || result
Implements ChannelGroup.
Definition at line 735 of file WaveTrack.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, mChannel, mRightChannel, and NChannels().
|
overrideprivatevirtual |
Retrieve an interval.
!(iInterval < NIntervals()) || result
Implements ChannelGroup.
Definition at line 721 of file WaveTrack.cpp.
References mClips, and NIntervals().
|
private |
Definition at line 865 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by HandleXMLTag(), and SetPan().
|
private |
Definition at line 836 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by Resample(), SetRate(), and WaveTrack().
|
private |
Definition at line 847 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by HandleXMLTag(), and SetVolume().
|
private |
Definition at line 589 of file WaveTrack.cpp.
References DoProjectTempoChange(), and anonymous_namespace{FloatVectorClip.cpp}::Duplicate().
Referenced by ClearAndPaste(), and PasteWaveTrack().
auto WaveTrack::EmptyCopy | ( | const SampleBlockFactoryPtr & | pFactory = {} | ) | const |
Make another channel group copying format, rate, etc. but containing no clips; with as many channels as in this
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.
Definition at line 1033 of file WaveTrack.cpp.
WaveTrack::Holder WaveTrack::EmptyCopy | ( | size_t | nChannels, |
const SampleBlockFactoryPtr & | pFactory = {} |
||
) | const |
Make another track copying format, rate, etc. but containing no clips; with the specified number of channels.
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.
Definition at line 1012 of file WaveTrack.cpp.
References Track::CopyAttachments(), BasicUI::Get(), GetRate(), GetSampleFormat(), and mpFactory.
Referenced by Clone(), Copy(), WaveTrackFactory::Create(), PasteInto(), StereoToMono::ProcessOne(), and SyncLockAdjust().
|
private |
Erase all attachments for a given index.
Definition at line 452 of file WaveTrack.cpp.
Referenced by MakeMono().
|
private |
|
overridevirtual |
Find associated ChannelGroup if any.
Implements PlayableSequence.
Definition at line 2334 of file WaveTrack.cpp.
|
private |
Definition at line 1533 of file WaveTrack.cpp.
References details::begin(), and Intervals().
Referenced by Join(), and ReplaceInterval().
|
private |
Definition at line 1144 of file WaveTrack.cpp.
References CreateClip(), GetEndTime(), GetRate(), and InsertInterval().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 2315 of file WaveTrack.cpp.
References GetRightmostClip(), and NIntervals().
Referenced by ImportUtils::FinalizeImport(), WaveTrackSink::Flush(), TrackSpectrumTransformer::PostProcess(), and SBSMSBase::Process().
|
private |
Whether all tracks in unzipped group and all clips have a common sample format
Definition at line 1920 of file WaveTrack.cpp.
References TrackList::Channels().
Referenced by LinkConsistencyFix().
size_t WaveTrack::GetBestBlockSize | ( | sampleCount | t | ) | const |
Definition at line 2260 of file WaveTrack.cpp.
References GetMaxBlockSize(), and Intervals().
Referenced by WaveChannel::GetBestBlockSize(), and anonymous_namespace{WaveTrackUtilities.cpp}::ReverseOneClip().
|
inline |
Definition at line 258 of file WaveTrack.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
Referenced by WaveTrackMenuTable::OnMergeStereo(), and WaveTrackMenuTable::SplitStereo().
|
inline |
Definition at line 260 of file WaveTrack.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
|
overridevirtual |
Classify this channel.
Implements AudioGraph::Channel.
Definition at line 546 of file WaveTrack.cpp.
References details::begin(), and Channels().
|
overridevirtual |
Takes volume and pan into account.
Implements WideSampleSequence.
Definition at line 888 of file WaveTrack.cpp.
References GetPan(), and GetVolume().
Referenced by WaveChannel::GetChannelVolume(), and StereoToMono::ProcessOne().
auto WaveTrack::GetClip | ( | size_t | iInterval | ) |
Definition at line 710 of file WaveTrack.cpp.
Referenced by GetClip(), HandleXMLChild(), MergeClips(), and PasteWaveTrackAtSameTempo().
auto WaveTrack::GetClip | ( | size_t | iInterval | ) | const |
used only during deserialization
Definition at line 715 of file WaveTrack.cpp.
References GetClip().
|
private |
Definition at line 2951 of file WaveTrack.cpp.
References WaveChannelUtilities::SortedClipArray().
Referenced by ApplyPitchAndSpeed().
int WaveTrack::GetClipIndex | ( | const Interval & | clip | ) | const |
Get the linear index of a given clip (== number of clips if not found)
Definition at line 3037 of file WaveTrack.cpp.
References details::begin(), details::end(), and Intervals().
ClipConstHolders WaveTrack::GetClipInterfaces | ( | ) | const |
Get access to the (visible) clips in the tracks, in unspecified order.
Definition at line 2592 of file WaveTrack.cpp.
References Intervals().
|
static |
Definition at line 373 of file WaveTrack.cpp.
References AudioTrackNameSetting, DefaultName, 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 2613 of file WaveTrack.cpp.
References ChannelGroup::GetEndTime().
Referenced by AUPImportFileHandle::AddSilence(), TruncSilenceBase::Analyze(), ApplyPitchAndSpeed(), ClearAndPasteAtSameTempo(), FinishCopy(), Effect::GetBounds(), WaveChannel::GetEndTime(), PasteWaveTrackAtSameTempo(), TrackSpectrumTransformer::PostProcess(), StereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), RateMenuTable::SetRate(), SyncLockAdjust(), and Trim().
|
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 2874 of file WaveTrack.cpp.
References limitSampleBufferSize(), min(), and anonymous_namespace{RegisterBuiltinEffects.cpp}::reverse.
Referenced by WaveChannel::GetEnvelopeValues().
|
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
Reimplemented from Track.
Definition at line 2548 of file WaveTrack.cpp.
References Intervals(), and XO().
size_t WaveTrack::GetIdealBlockSize | ( | ) |
Definition at line 2300 of file WaveTrack.cpp.
References details::begin(), Channels(), and NewestOrNewClip().
Referenced by WaveChannel::GetIdealBlockSize().
WaveTrack::IntervalHolder WaveTrack::GetIntervalAtTime | ( | double | t | ) |
Definition at line 201 of file WaveTrack.cpp.
References Intervals().
Referenced by ApplyPitchAndSpeed().
auto WaveTrack::GetLeftmostClip | ( | ) |
Definition at line 2560 of file WaveTrack.cpp.
References details::begin().
Referenced by GetLeftmostClip(), and PasteWaveTrackAtSameTempo().
auto WaveTrack::GetLeftmostClip | ( | ) | const |
Definition at line 2572 of file WaveTrack.cpp.
References GetLeftmostClip().
size_t WaveTrack::GetMaxBlockSize | ( | ) | const |
Definition at line 2279 of file WaveTrack.cpp.
References GetSampleFormat(), Intervals(), and mpFactory.
Referenced by TruncSilenceBase::Analyze(), CompareAudioCommand::Apply(), GetBestBlockSize(), WaveChannel::GetMaxBlockSize(), LegacyCompressorBase::InitPass1(), StereoToMono::ProcessOne(), PerTrackEffect::ProcessPass(), and anonymous_namespace{WaveTrackUtilities.cpp}::ReverseOneClip().
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 2339 of file WaveTrack.cpp.
References PlayableTrack::GetMute().
Referenced by ExportAudioDialog::DoExportSplitByTracks(), ExportUtils::FindExportWaveTracks(), GetInfoCommand::SendTracks(), and ExportAudioDialog::UpdateTrackExportSettings().
WaveTrack::IntervalHolder WaveTrack::GetNextInterval | ( | const Interval & | interval, |
PlaybackDirection | searchDirection | ||
) |
Definition at line 194 of file WaveTrack.cpp.
std::shared_ptr< const WaveTrack::Interval > WaveTrack::GetNextInterval | ( | const Interval & | interval, |
PlaybackDirection | searchDirection | ||
) | const |
Definition at line 173 of file WaveTrack.cpp.
References backward, forward, Intervals(), and ChannelGroupInterval::Start().
Referenced by ApplyPitchAndSpeed(), WaveTrackUtilities::ExpandClipTillNextOne(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit(), and TimeStretching::SetClipStretchRatio().
int WaveTrack::GetNumClips | ( | ) | const |
Definition at line 3049 of file WaveTrack.cpp.
References NarrowClips().
Referenced by ApplyPitchAndSpeed(), and PasteWaveTrackAtSameTempo().
|
private |
Definition at line 2651 of file WaveTrack.cpp.
References ClearSamples(), fillTwo, fillZero, floatSample, anonymous_namespace{ExportPCM.cpp}::format, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, min(), ReverseSamples(), SAMPLE_SIZE, and wxT().
Referenced by DoGet().
float WaveTrack::GetPan | ( | ) | const |
Definition at line 860 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by GetChannelVolume(), WaveTrackControls::PanSlider(), GetInfoCommand::SendTracks(), and SetPan().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 821 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by ProjectFileManager::AddImportedTracks(), TruncSilenceBase::Analyze(), EmptyCopy(), FinishCopy(), SpectrogramBounds::GetBounds(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetLeftAdjustLimit(), WaveChannel::GetRate(), anonymous_namespace{WaveClipAdjustBorderHandle.cpp}::GetRightAdjustLimit(), TranscriptionToolBar::GetSamples(), EqualizationBase::Init(), Join(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), WaveTrackMenuTable::OnMergeStereo(), RateMenuTable::OnRateOther(), PaulstretchBase::ProcessOne(), StereoToMono::ProcessOne(), SpectralDataManager::Worker::ProcessOvertones(), PerTrackEffect::ProcessPass(), SpectralDataManager::Worker::ProcessSnapping(), ProjectNyquistFrequency(), and SyncLockAdjust().
auto WaveTrack::GetRightmostClip | ( | ) |
Definition at line 2576 of file WaveTrack.cpp.
References details::begin().
Referenced by Flush(), GetRightmostClip(), and PasteWaveTrackAtSameTempo().
auto WaveTrack::GetRightmostClip | ( | ) | const |
Definition at line 2588 of file WaveTrack.cpp.
References GetRightmostClip().
|
inline |
Definition at line 253 of file WaveTrack.h.
Referenced by CopyPartOfClip(), and CopyWholeClip().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 918 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by EmptyCopy(), GetMaxBlockSize(), WaveChannel::GetSampleFormat(), and WaveTrackMenuTable::OnMergeStereo().
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.
result.size() == NChannels()
size_t
Definition at line 2742 of file WaveTrack.cpp.
References Channels().
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 2344 of file WaveTrack.cpp.
References PlayableTrack::GetSolo().
Referenced by ExportAudioDialog::DoExportSplitByTracks(), WaveformView::Draw(), ExportUtils::FindExportWaveTracks(), GetInfoCommand::SendTracks(), and ExportAudioDialog::UpdateTrackExportSettings().
|
overridevirtual |
Implement WideSampleSequence.
Implements WideSampleSequence.
Definition at line 2603 of file WaveTrack.cpp.
References ChannelGroup::GetStartTime().
Referenced by ApplyPitchAndSpeed(), Effect::GetBounds(), TranscriptionToolBar::GetSamples(), WaveChannel::GetStartTime(), MoveTo(), PasteWaveTrackAtSameTempo(), StereoToMono::ProcessOne(), GetInfoCommand::SendTracks(), and Trim().
|
overridevirtual |
Reimplemented from WritableSampleTrack.
Definition at line 684 of file WaveTrack.cpp.
References typeInfo().
sampleCount WaveTrack::GetVisibleSampleCount | ( | ) | const |
Definition at line 908 of file WaveTrack.cpp.
References Intervals().
float WaveTrack::GetVolume | ( | ) | const |
Definition at line 842 of file WaveTrack.cpp.
References BasicUI::Get().
Referenced by GetChannelVolume(), GetInfoCommand::SendTracks(), SetVolume(), and WaveTrackControls::VolumeSlider().
|
private |
Definition at line 1550 of file WaveTrack.cpp.
References CopyClip(), GetEditClipsCanMove(), InsertInterval(), Intervals(), RemoveInterval(), WideSampleSequence::SnapToSample(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by Clear(), ClearAndAddCutLine(), and SplitDelete().
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 2425 of file WaveTrack.cpp.
References WaveTrackMessage::Deserialized, XMLMethodRegistry< Host >::Get(), GetClip(), mLegacyFormat, mLegacyProjectFileOffset, mLegacyRate, mpFactory, NarrowClips(), NewestOrNewClip(), Observer::Publisher< WaveTrackMessage >::Publish(), Sequence::Sequence_tag, Sequence::WaveBlock_tag, and WaveClip::WaveClip_tag.
|
override |
Definition at line 2413 of file WaveTrack.cpp.
References NewestOrNewClip(), and WaveClip::WaveClip_tag.
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 2361 of file WaveTrack.cpp.
References DoSetPan(), DoSetVolume(), Track::HandleCommonXMLAttribute(), PlayableTrack::HandleXMLAttribute(), Sequence::IsValidSampleFormat(), Linked_attr, lrint, mLegacyProjectFileOffset, mLegacyRate, Offset_attr, Pan_attr, Rate_attr, SampleFormat_attr, SetLegacyFormat(), Track::SetLinkType(), anonymous_namespace{WaveTrack.cpp}::ToLinkType(), Volume_attr, and WaveTrack_tag.
bool WaveTrack::HasClipNamed | ( | const wxString & | name | ) | const |
Definition at line 728 of file WaveTrack.cpp.
References Intervals().
Referenced by ProjectAudioManager::DoRecord(), MakeClipCopyName(), and MakeNewClipName().
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 2858 of file WaveTrack.cpp.
Referenced by WaveChannel::HasTrivialEnvelope().
void WaveTrack::Init | ( | const WaveTrack & | orig | ) |
Overwrite data excluding the sample sequence but including display settings
Definition at line 553 of file WaveTrack.cpp.
References Track::Init(), and mpFactory.
Referenced by ProjectAudioManager::DoRecord().
|
private |
Sets project tempo on clip upon push. Use this instead of NarrowClips().push_back
backup | whether the duplication is for backup purposes while opening a project, instead of other editing operations |
Definition at line 1929 of file WaveTrack.cpp.
References GetProjectTempo(), WaveTrackMessage::Inserted, WaveTrackMessage::New, and Observer::Publisher< WaveTrackMessage >::Publish().
Referenced by CopyClips(), and InsertInterval().
void WaveTrack::InsertInterval | ( | const IntervalHolder & | interval, |
bool | newClip, | ||
bool | allowEmpty = false |
||
) |
Definition at line 3235 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::ClipsAreUnique(), InsertClip(), and mClips.
Referenced by CopyPartOfClip(), CopyWholeClip(), ProjectAudioManager::DoRecord(), FinishCopy(), HandleClear(), AUPImportFileHandle::HandleWaveClip(), InsertSilence(), Join(), ReplaceInterval(), and WaveTrackUtilities::Reverse().
|
overridevirtual |
Implements RecordableSequence.
Definition at line 2023 of file WaveTrack.cpp.
References CreateClip(), details::end(), InsertInterval(), Intervals(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by AUPImportFileHandle::AddSilence(), and SilenceBase::GenerateTrack().
|
inline |
Definition at line 671 of file WaveTrack.h.
Referenced by ProjectFileManager::AddImportedTracks(), WaveTrackUtilities::AllClipsIterator::AllClipsIterator(), SetClipCommand::Apply(), CanInsertClip(), CanOffsetClips(), ConvertToSampleFormat(), Copy(), WaveTrackUtilities::CountBlocks(), DEFINE_ATTACHED_VIRTUAL_OVERRIDE(), WaveTrackUtilities::DiscardTrimmed(), Disjoin(), WaveTrackUtilities::ExpandCutLine(), FindClip(), GetBestBlockSize(), GetClipIndex(), GetClipInterfaces(), WaveTrackUtilities::GetClipsIntersecting(), GetErrorOpening(), GetIntervalAtTime(), GetMaxBlockSize(), GetNextInterval(), WaveTrackUtilities::GetSequenceSamplesCount(), GetVisibleSampleCount(), HandleClear(), HasClipNamed(), WaveTrackUtilities::HasHiddenData(), TimeStretching::HasPitchOrSpeed(), InsertSilence(), IsEmpty(), Join(), MoveTo(), WaveTrackMenuTable::OnMergeStereo(), PasteWaveTrackAtSameTempo(), WaveTrackUtilities::RemoveCutLine(), RepairChannels(), ReplaceInterval(), Resample(), GetInfoCommand::SendClips(), SetRate(), ShiftBy(), Silence(), SortedClipArray(), SortedIntervalArray(), SyncLockAdjust(), Trim(), and WidestEffectiveFormat().
|
inline |
Definition at line 672 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 933 of file WaveTrack.cpp.
References Intervals().
Referenced by SyncLockAdjust().
void WaveTrack::Join | ( | double | t0, |
double | t1, | ||
const ProgressReporter & | reportProgress | ||
) |
Definition at line 2148 of file WaveTrack.cpp.
References ApplyPitchAndSpeedOnIntervals(), CreateClip(), details::end(), FindClip(), GetRate(), InsertInterval(), Intervals(), and RemoveClip().
Referenced by anonymous_namespace{LabelMenus.cpp}::OnJoinLabels().
|
staticprivate |
|
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 596 of file WaveTrack.cpp.
References ChannelGroup::Aligned, anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp}::AreAligned(), TrackList::Channels(), FormatConsistencyCheck(), BasicUI::Get(), Track::GetLinkType(), Track::GetName(), Track::IsLeader(), Track::LinkConsistencyFix(), mLegacyFormat, mLegacyRate, NarrowClips(), ChannelGroup::None, RateConsistencyCheck(), Track::SetLinkType(), SetRate(), SortedClipArray(), undefinedSample, and ZipClips().
|
private |
Definition at line 793 of file WaveTrack.cpp.
References HasClipNamed(), name, and XC.
void WaveTrack::MakeMono | ( | ) |
Simply discard any right channel.
Definition at line 1039 of file WaveTrack.cpp.
References EraseChannelAttachments(), mClips, and mRightChannel.
Referenced by StereoToMono::ProcessOne().
|
private |
Definition at line 805 of file WaveTrack.cpp.
References Track::GetName(), HasClipNamed(), name, and XC.
|
private |
Steal channel attachments from other, then destroy the track attachment slot
Definition at line 429 of file WaveTrack.cpp.
Referenced by ZipClips().
bool WaveTrack::MergeClips | ( | int | clipidx1, |
int | clipidx2 | ||
) |
Definition at line 3185 of file WaveTrack.cpp.
References GetClip(), and RemoveInterval().
auto WaveTrack::MonoToStereo | ( | ) |
!GetOwner()
Definition at line 1047 of file WaveTrack.cpp.
References anonymous_namespace{FloatVectorClip.cpp}::Duplicate(), and TrackList::Temporary().
|
overridevirtual |
Implements ChannelGroup.
Definition at line 564 of file WaveTrack.cpp.
References BasicUI::Get(), GetStartTime(), and Intervals().
|
private |
Definition at line 768 of file WaveTrack.cpp.
References mClips.
Referenced by GetNumClips(), HandleXMLChild(), LinkConsistencyFix(), NIntervals(), and RemoveClip().
|
private |
|
overridevirtual |
A constant property.
result > 0
Implements RecordableSequence.
Definition at line 530 of file WaveTrack.cpp.
References mRightChannel.
Referenced by Append(), AppendItem(), ProjectAudioManager::ChooseExistingRecordingTracks(), ClearAndPasteAtSameTempo(), Clone(), Copy(), EffectBase::CountWaveTracks(), Disjoin(), DoGet(), DoGetChannel(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), SBSMSBase::Finalize(), CompareAudioCommand::GetSelection(), anonymous_namespace{EditMenus.cpp}::OnPaste(), PasteWaveTrackAtSameTempo(), Reverse::Process(), NyquistBase::Process(), PerTrackEffect::ProcessPass(), anonymous_namespace{WaveTrackUtilities.cpp}::ReverseOneClip(), GetInfoCommand::SendTracks(), SwapChannels(), and ZipClips().
|
static |
Definition at line 486 of file WaveTrack.cpp.
References TrackList::Get(), WaveTrackFactory::Get(), project, and tracks.
auto 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 3002 of file WaveTrack.cpp.
References BasicUI::Get(), and name.
Referenced by GetIdealBlockSize(), HandleXMLChild(), and HandleXMLEndTag().
|
overridevirtual |
Report the number of intervals.
Implements ChannelGroup.
Definition at line 705 of file WaveTrack.cpp.
References NarrowClips().
Referenced by DoGetInterval(), and Flush().
|
virtual |
Weak precondition allows overrides to replicate one channel into many.
SameKindAs(src)
src.NChannels() == 1 || src.NChannels() == NChannels()
Implements Track.
|
overridevirtual |
Implements Track.
Definition at line 1986 of file WaveTrack.cpp.
References PasteWaveTrack().
Referenced by StereoToMono::ProcessOne(), and SyncLockAdjust().
|
overridevirtual |
Find or create the destination track for a paste, maybe in a different project
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 694 of file WaveTrack.cpp.
References TrackList::Add(), EmptyCopy(), WaveTrackFactory::Get(), and project.
|
private |
Definition at line 1709 of file WaveTrack.cpp.
References DuplicateWithOtherTempo(), GetProjectTempo(), PasteWaveTrackAtSameTempo(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by ClearAndPasteAtSameTempo(), and Paste().
|
private |
Definition at line 1720 of file WaveTrack.cpp.
References BadUserAction, CreateClip(), GetClip(), GetEditClipsCanMove(), GetEndTime(), GetLeftmostClip(), GetNumClips(), GetProjectTempo(), GetRightmostClip(), GetStartTime(), Intervals(), name, NChannels(), and XO().
Referenced by PasteWaveTrack().
|
static |
Definition at line 356 of file WaveTrack.cpp.
References ProjectRate::Get(), TrackList::Get(), GetRate(), project, and tracks.
Referenced by SelectFrequenciesCommand::Apply(), and SpectralSelectionBar::ModifySpectralSelection().
|
private |
Whether all clips of an unzipped leader track have a common rate.
Definition at line 1901 of file WaveTrack.cpp.
References TrackList::Channels().
Referenced by LinkConsistencyFix().
|
private |
Definition at line 1542 of file WaveTrack.cpp.
References NarrowClips().
Referenced by Join().
void WaveTrack::RemoveInterval | ( | const IntervalHolder & | interval | ) |
Definition at line 3246 of file WaveTrack.cpp.
References details::end(), and mClips.
Referenced by HandleClear(), MergeClips(), ReplaceInterval(), and WaveTrackUtilities::Reverse().
|
overridevirtual |
Called in exception handling after possibly unbalanced calls to Append in different channels. Allows the sequence to repair consistency.
Implements RecordableSequence.
Definition at line 2323 of file WaveTrack.cpp.
References Intervals().
|
private |
oldOne->NChannels() == newOne->NChannels()
Definition at line 3254 of file WaveTrack.cpp.
References FindClip(), InsertInterval(), Intervals(), RemoveInterval(), and ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::size().
Referenced by ApplyPitchAndSpeedOnIntervals().
void WaveTrack::Resample | ( | int | rate, |
BasicUI::ProgressDialog * | progress = NULL |
||
) |
Definition at line 3266 of file WaveTrack.cpp.
References DoSetRate(), and Intervals().
auto WaveTrack::RightmostOrNewClip | ( | ) |
Get access to the last (rightmost) clip, or create a clip, if there is not already one.
Definition at line 3017 of file WaveTrack.cpp.
References details::end(), and BasicUI::Get().
Referenced by AUPImportFileHandle::AddSamples(), Append(), and AUPImportFileHandle::HandleEnvelope().
bool WaveTrack::SetFloats | ( | const float *const * | buffers, |
sampleCount | start, | ||
size_t | len, | ||
sampleFormat | effectiveFormat = widestSampleFormat |
||
) |
Random-access assignment of a range of samples.
buffers | a span of pointers of size NChannels() |
effectiveFormat | Make the effective format of the data at least the minumum of this value and `format`. (Maybe wider, if merging with preexistent data.) If the data are later narrowed from stored format, but not narrower than the effective, then no dithering will occur. |
Definition at line 3273 of file WaveTrack.cpp.
References Channels().
Referenced by anonymous_namespace{WaveTrackUtilities.cpp}::ReverseOneClip().
void WaveTrack::SetLegacyFormat | ( | sampleFormat | format | ) |
Definition at line 2329 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, and mLegacyFormat.
Referenced by AUPImportFileHandle::HandleXMLEndTag(), and HandleXMLTag().
void WaveTrack::SetPan | ( | float | newPan | ) |
Definition at line 870 of file WaveTrack.cpp.
References DoSetPan(), GetPan(), and Track::Notify().
Referenced by MixerTrackCluster::HandleSliderPan(), WaveTrackMenuTable::OnMergeStereo(), and anonymous_namespace{TrackMenus.cpp}::SetTrackPan().
void WaveTrack::SetRate | ( | double | newRate | ) |
!brief Sets the new rate for the track without resampling it
Definition at line 826 of file WaveTrack.cpp.
References DoSetRate(), and Intervals().
Referenced by LinkConsistencyFix(), and RateMenuTable::SetRate().
void WaveTrack::SetVolume | ( | float | newVolume | ) |
Definition at line 852 of file WaveTrack.cpp.
References DoSetVolume(), GetVolume(), and Track::Notify().
Referenced by MixerTrackCluster::HandleSliderGain(), and anonymous_namespace{TrackMenus.cpp}::SetTrackGain().
|
overridevirtual |
Implements ChannelGroup.
Definition at line 574 of file WaveTrack.cpp.
References BasicUI::Get(), and Intervals().
|
overridevirtual |
Implements Track.
Definition at line 2000 of file WaveTrack.cpp.
References ApplyPitchAndSpeed(), details::end(), Intervals(), min(), THROW_INCONSISTENCY_EXCEPTION, and WideSampleSequence::TimeToLongSamples().
Referenced by anonymous_namespace{LabelMenus.cpp}::OnSilenceLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitCut(), and anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels().
|
private |
Return all WaveClips sorted by clip play start time.
Definition at line 3287 of file WaveTrack.cpp.
References Intervals().
Referenced by LinkConsistencyFix(), and ZipClips().
auto WaveTrack::SortedIntervalArray | ( | ) |
Return all WaveClips sorted by clip play start time.
Definition at line 3297 of file WaveTrack.cpp.
References staffpad::vo::copy().
Referenced by SetEnvelopeCommand::ApplyInner(), SBSMSBase::Finalize(), anonymous_namespace{ClipMenus.cpp}::FindNextClip(), anonymous_namespace{ClipMenus.cpp}::FindNextClipBoundary(), anonymous_namespace{ClipMenus.cpp}::FindPrevClip(), anonymous_namespace{ClipMenus.cpp}::FindPrevClipBoundary(), FindWaveTrackLocations(), anonymous_namespace{NyquistBase.cpp}::GetClipBoundaries(), WaveTrackUtilities::Reverse(), and GetInfoCommand::SendEnvelopes().
auto WaveTrack::SortedIntervalArray | ( | ) | const |
Return all WaveClips sorted by clip play start time.
Definition at line 3307 of file WaveTrack.cpp.
References staffpad::vo::copy(), and Intervals().
void WaveTrack::Split | ( | double | t0, |
double | t1 | ||
) |
Definition at line 3157 of file WaveTrack.cpp.
References SplitAt().
Referenced by ApplyPitchAndSpeed(), and anonymous_namespace{LabelMenus.cpp}::OnSplitLabels().
auto WaveTrack::SplitAt | ( | double | t | ) |
Definition at line 3165 of file WaveTrack.cpp.
Referenced by WaveTrackUtilities::Reverse(), and Split().
auto WaveTrack::SplitChannels | ( | ) |
Definition at line 1064 of file WaveTrack.cpp.
References TrackList::AssignUniqueId().
Referenced by WaveTrackMenuTable::SplitStereo().
auto WaveTrack::SplitCut | ( | double | t0, |
double | t1 | ||
) |
result->NChannels() == NChannels()
Definition at line 966 of file WaveTrack.cpp.
References THROW_INCONSISTENCY_EXCEPTION.
Referenced by anonymous_namespace{EditMenus.cpp}::OnSplitCut(), and anonymous_namespace{LabelMenus.cpp}::OnSplitCutLabels().
void WaveTrack::SplitDelete | ( | double | t0, |
double | t1 | ||
) |
Definition at line 1526 of file WaveTrack.cpp.
References HandleClear().
Referenced by Disjoin(), SBSMSBase::Finalize(), anonymous_namespace{EditMenus.cpp}::OnSplitDelete(), anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitNew(), and Trim().
void WaveTrack::SwapChannels | ( | ) |
NChannels() == 2
Definition at line 1084 of file WaveTrack.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::ForEach(), mClips, and NChannels().
Referenced by WaveTrackMenuTable::OnSwapChannels().
|
overridevirtual |
This can be used to adjust a sync-lock selected track when the selection is replaced by one of a different length.
Reimplemented from Track.
Definition at line 1671 of file WaveTrack.cpp.
References Clear(), EditClipsCanMove, EmptyCopy(), GetEndTime(), GetRate(), Intervals(), IsEmpty(), mpFactory, Paste(), and Setting< T >::Read().
void WaveTrack::Trim | ( | double | t0, |
double | t1 | ||
) |
Definition at line 980 of file WaveTrack.cpp.
References Clear(), GetEndTime(), GetStartTime(), Intervals(), and SplitDelete().
Referenced by anonymous_namespace{EditMenus.cpp}::OnTrim().
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 2845 of file WaveTrack.cpp.
References Intervals(), and narrowestSampleFormat.
Referenced by WaveChannel::WidestEffectiveFormat().
|
staticprivate |
Definition at line 2485 of file WaveTrack.cpp.
References ChannelGroup::Aligned, XMLMethodRegistry< Host >::CallWriters(), Channel_attr, XMLWriter::EndTag(), XMLMethodRegistry< Host >::Get(), WaveChannel::GetTrack(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, WaveChannel::Intervals(), AudioGraph::LeftChannel, Linked_attr, AudioGraph::MonoChannel, ChannelGroup::None, Pan_attr, Rate_attr, AudioGraph::RightChannel, SampleFormat_attr, XMLWriter::StartTag(), Volume_attr, WaveTrack_tag, and XMLWriter::WriteAttr().
|
overridevirtual |
Implements Track.
Definition at line 2475 of file WaveTrack.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
void WaveTrack::ZipClips | ( | bool | mustAlign = true | ) |
Convert channel-major storage to interval-major, replacing two tracks with one in the owning TrackList
GetOwner()
NChannels() == 1
mustAlign | if false, clips may be of different number or not aligned. Do not use the resulting track normally! |
Refuse if clips are not well aligned.
Definition at line 3317 of file WaveTrack.cpp.
References anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp}::AreAligned(), CreateRight(), Track::GetOwner(), mClips, MergeChannelAttachments(), NChannels(), ChannelGroup::None, Track::SetLinkType(), and SortedClipArray().
Referenced by LinkConsistencyFix(), PerTrackEffect::ProcessPass(), and ProjectFileManager::ReadProjectFile().
|
friend |
Definition at line 280 of file WaveTrack.h.
|
private |
Definition at line 833 of file WaveTrack.h.
|
private |
|
private |
Do not call mClips.push_back
directly. Use InsertClip
instead.
Definition at line 776 of file WaveTrack.h.
Referenced by DoGet(), DoGetInterval(), InsertInterval(), MakeMono(), NarrowClips(), RemoveInterval(), SwapChannels(), and ZipClips().
|
private |
Definition at line 832 of file WaveTrack.h.
|
private |
used only during deserialization
Definition at line 779 of file WaveTrack.h.
Referenced by Clone(), HandleXMLChild(), LinkConsistencyFix(), and SetLegacyFormat().
|
private |
Definition at line 834 of file WaveTrack.h.
Referenced by HandleXMLChild(), and HandleXMLTag().
|
mutableprivate |
used only during deserialization
Definition at line 778 of file WaveTrack.h.
Referenced by Clone(), HandleXMLChild(), HandleXMLTag(), and LinkConsistencyFix().
|
private |
Definition at line 830 of file WaveTrack.h.
Referenced by EmptyCopy(), GetMaxBlockSize(), HandleXMLChild(), Init(), and SyncLockAdjust().
|
private |
may be null
Definition at line 770 of file WaveTrack.h.
Referenced by CreateRight(), DoGetChannel(), MakeMono(), and NChannels().
|
private |
Definition at line 836 of file WaveTrack.h.
|
static |
Definition at line 206 of file WaveTrack.h.
Referenced by AUPImportFileHandle::HandleEnvelope(), AUPImportFileHandle::HandleImport(), AUPImportFileHandle::HandleSequence(), AUPImportFileHandle::HandleWaveClip(), AUPImportFileHandle::HandleXMLEndTag(), HandleXMLTag(), AUPImportFileHandle::HandleXMLTag(), and WriteOneXML().