Audacity  2.2.0
WaveTrack Class Referencefinal

A Track that contains audio waveform data. More...

#include <WaveTrack.h>

Inheritance diagram for WaveTrack:
PlayableTrack AudioTrack Track CommonTrackPanelCell XMLTagHandler TrackPanelCell

Classes

class  AllClipsIterator
 
class  Location
 Used only by WaveTrack, a special way to hold location that can accommodate merged regions. More...
 
struct  Locker
 
struct  WaveTrackLockDeleter
 

Public Types

enum  WaveTrackDisplay {
  Waveform = 0, MinDisplay = Waveform, obsoleteWaveformDBDisplay, Spectrum,
  obsolete1, obsolete2, obsolete3, obsolete4,
  MaxDisplay = Spectrum, NoDisplay
}
 
enum  SampleDisplay { LinarInterpolate = 0, StemPlot }
 
typedef WaveTrackLocation Location
 
using Holder = std::unique_ptr< WaveTrack >
 
using LockerBase = std::unique_ptr< const WaveTrack, WaveTrackLockDeleter >
 
- Public Types inherited from Track
enum  { LeftChannel = 0, RightChannel = 1, MonoChannel = 2 }
 
enum  TrackKindEnum {
  None, Wave, Label, Time,
  All
}
 
enum  : unsigned { DefaultHeight = 150 }
 
using Holder = std::unique_ptr< Track >
 

Public Member Functions

virtual ~WaveTrack ()
 
std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool) override
 
double GetOffset () const override
 
void SetOffset (double o) override
 
virtual int GetChannel () const override
 
virtual void SetPanFromChannelType () override
 
double GetStartTime () const
 Get the time at which the first clip in the track starts. More...
 
double GetEndTime () const
 Get the time at which the last clip in the track ends, plus recorded stuff. More...
 
int GetKind () const override
 
double GetRate () const
 
void SetRate (double newRate)
 
float GetGain () const
 
void SetGain (float newGain)
 
float GetPan () const
 
void SetPan (float newPan) override
 
float GetChannelGain (int channel) const
 
sampleFormat GetSampleFormat () const
 
void ConvertToSampleFormat (sampleFormat format)
 
const SpectrogramSettingsGetSpectrogramSettings () const
 
SpectrogramSettingsGetSpectrogramSettings ()
 
SpectrogramSettingsGetIndependentSpectrogramSettings ()
 
void SetSpectrogramSettings (std::unique_ptr< SpectrogramSettings > &&pSettings)
 
const WaveformSettingsGetWaveformSettings () const
 
WaveformSettingsGetWaveformSettings ()
 
WaveformSettingsGetIndependentWaveformSettings ()
 
void SetWaveformSettings (std::unique_ptr< WaveformSettings > &&pSettings)
 
Track::Holder Cut (double t0, double t1) override
 
Track::Holder Copy (double t0, double t1, bool forClipboard=true) const override
 
Track::Holder CopyNonconst (double t0, double t1)
 
void Clear (double t0, double t1) override
 
void Paste (double t0, const Track *src) override
 
void ClearAndPaste (double t0, double t1, const Track *src, bool preserve=true, bool merge=true, const TimeWarper *effectWarper=NULL)
 
void Silence (double t0, double t1) override
 
void InsertSilence (double t, double len) override
 
void SplitAt (double t)
 
void Split (double t0, double t1)
 
void ClearAndAddCutLine (double t0, double t1)
 
Track::Holder SplitCut (double t0, double t1)
 
void SplitDelete (double t0, double t1)
 
void Join (double t0, double t1)
 
void Disjoin (double t0, double t1)
 
void Trim (double t0, double t1)
 
void HandleClear (double t0, double t1, bool addCutLines, bool split)
 
void SyncLockAdjust (double oldT1, double newT1) override
 
bool IsEmpty (double t0, double t1) const
 Returns true if there are no WaveClips in the specified region. More...
 
void Append (samplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1, XMLWriter *blockFileLog=NULL)
 Append the sample data to the WaveTrack. You must call Flush() after the last Append. More...
 
void Flush ()
 Flush must be called after last Append. More...
 
void AppendAlias (const wxString &fName, sampleCount start, size_t len, int channel, bool useOD)
 
void AppendCoded (const wxString &fName, sampleCount start, size_t len, int channel, int decodeType)
 
unsigned int GetODFlags () const
 gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. More...
 
void ClearWaveCaches ()
 Invalidates all clips' wavecaches. Careful, This may not be threadsafe. More...
 
void AddInvalidRegion (sampleCount startSample, sampleCount endSample)
 Adds an invalid region to the wavecache so it redraws that portion only. More...
 
bool Get (samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true) const
 
void Set (samplePtr buffer, sampleFormat format, sampleCount start, size_t len)
 
void GetEnvelopeValues (double *buffer, size_t bufferLen, double t0) const
 
std::pair< float, float > GetMinMax (double t0, double t1, bool mayThrow=true) const
 
float GetRMS (double t0, double t1, bool mayThrow=true) const
 
WaveClipGetClipAtX (int xcoord)
 
SequenceGetSequenceAtX (int xcoord)
 
EnvelopeGetEnvelopeAtX (int xcoord)
 
WaveClipGetClipAtSample (sampleCount sample)
 
WaveClipGetClipAtTime (double time)
 
sampleCount GetBlockStart (sampleCount t) const
 
size_t GetBestBlockSize (sampleCount t) const
 
size_t GetMaxBlockSize () const
 
size_t GetIdealBlockSize ()
 
bool HandleXMLTag (const wxChar *tag, const wxChar **attrs) override
 
void HandleXMLEndTag (const wxChar *tag) override
 
XMLTagHandlerHandleXMLChild (const wxChar *tag) override
 
void WriteXML (XMLWriter &xmlFile) const override
 
bool GetErrorOpening () override
 
bool Lock () const
 
bool Unlock () const
 
bool CloseLock ()
 
sampleCount TimeToLongSamples (double t0) const
 Convert correctly between an (absolute) time in seconds and a number of samples. More...
 
double LongSamplesToTime (sampleCount pos) const
 Convert correctly between an number of samples and an (absolute) time in seconds. More...
 
WaveClipHoldersGetClips ()
 
const WaveClipConstHoldersGetClips () const
 
IteratorRange< AllClipsIteratorGetAllClips ()
 
WaveClipCreateClip ()
 
WaveClipNewestOrNewClip ()
 Get access to the most recently added clip, or create a clip, if there is not already one. THIS IS NOT NECESSARILY RIGHTMOST. More...
 
WaveClipRightmostOrNewClip ()
 Get access to the last (rightmost) clip, or create a clip, if there is not already one. More...
 
int GetClipIndex (const WaveClip *clip) const
 
WaveClipGetClipByIndex (int index)
 
const WaveClipGetClipByIndex (int index) const
 
int GetNumClips () const
 
WaveClipPointers SortedClipArray ()
 
WaveClipConstPointers SortedClipArray () const
 
bool CanOffsetClip (WaveClip *clip, double amount, double *allowedAmount=NULL)
 
bool CanInsertClip (WaveClip *clip)
 
std::shared_ptr< WaveClipRemoveAndReturnClip (WaveClip *clip)
 
void AddClip (std::shared_ptr< WaveClip > &&clip)
 
void MergeClips (int clipidx1, int clipidx2)
 
void UpdateLocationsCache () const
 
const std::vector< Location > & GetCachedLocations () const
 
void ExpandCutLine (double cutLinePosition, double *cutlineStart=NULL, double *cutlineEnd=NULL)
 
bool RemoveCutLine (double cutLinePosition)
 
void Merge (const Track &orig) override
 
void Resample (int rate, ProgressDialog *progress=NULL)
 
int GetAutoSaveIdent ()
 
void SetAutoSaveIdent (int id)
 
int GetLastScaleType () const
 
void SetLastScaleType () const
 
int GetLastdBRange () const
 
void SetLastdBRange () const
 
WaveTrackDisplay GetDisplay () const
 
void SetDisplay (WaveTrackDisplay display)
 
void GetDisplayBounds (float *min, float *max) const
 
void SetDisplayBounds (float min, float max) const
 
void GetSpectrumBounds (float *min, float *max) const
 
void SetSpectrumBounds (float min, float max) const
 
int ZeroLevelYCoordinate (wxRect rect) const
 
- Public Member Functions inherited from PlayableTrack
 PlayableTrack (const std::shared_ptr< DirManager > &projDirManager)
 
 PlayableTrack (const Track &orig)
 
bool GetMute () const
 
bool GetSolo () const
 
void SetMute (bool m)
 
void SetSolo (bool s)
 
void Init (const PlayableTrack &init)
 
void WriteXMLAttributes (XMLWriter &xmlFile) const
 
bool HandleXMLAttribute (const wxChar *attr, const wxChar *value)
 
- Public Member Functions inherited from AudioTrack
 AudioTrack (const std::shared_ptr< DirManager > &projDirManager)
 
 AudioTrack (const Track &orig)
 
void WriteXMLAttributes (XMLWriter &xmlFile) const
 
bool HandleXMLAttribute (const wxChar *, const wxChar *)
 
- Public Member Functions inherited from Track
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &, const AudacityProject *pProject) finaloverride
 
std::shared_ptr< TrackPanelCellGetTrackControl ()
 
std::shared_ptr< TrackPanelCellGetVRulerControl ()
 
std::shared_ptr< TrackPanelCellGetResizer ()
 
virtual int GetMinimizedHeight () const
 
int GetActualHeight () const
 
int GetIndex () const
 
void SetIndex (int index)
 
int GetY () const
 
void SetY (int y)
 
int GetHeight () const
 
virtual void SetHeight (int h)
 
bool GetMinimized () const
 
void SetMinimized (bool isMinimized)
 
TrackGetLink () const
 
 Track (const std::shared_ptr< DirManager > &projDirManager)
 
 Track (const Track &orig)
 
virtual ~Track ()
 
void Init (const Track &orig)
 
wxString GetName () const
 
void SetName (const wxString &n)
 
wxString GetDefaultName () const
 
void SetDefaultName (const wxString &n)
 
bool GetSelected () const
 
bool GetLinked () const
 
virtual void SetSelected (bool s)
 
void SetLinked (bool l)
 
void Offset (double t)
 
void SetChannel (int c)
 
const std::shared_ptr
< DirManager > & 
GetDirManager () const
 
virtual Holder Cut (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual Holder Copy (double WXUNUSED(t0), double WXUNUSED(t1), bool forClipboard=true) const =0
 
virtual void Clear (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual void Paste (double WXUNUSED(t), const Track *WXUNUSED(src))=0
 
virtual void Silence (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual void InsertSilence (double WXUNUSED(t), double WXUNUSED(len))=0
 
bool IsSyncLockSelected () const
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
- Public Member Functions inherited from TrackPanelCell
virtual ~TrackPanelCell ()=0
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, wxPoint *pPosition)
 
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
bool ReadXMLTag (const char *tag, const char **attrs)
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 

Static Public Member Functions

static WaveTrackDisplay FindDefaultViewMode ()
 
static WaveTrackDisplay ConvertLegacyDisplayValue (int oldValue)
 
static WaveTrackDisplay ValidateWaveTrackDisplay (WaveTrackDisplay display)
 
- Static Public Member Functions inherited from Track
template<typename Subclass = Track>
static std::shared_ptr< Subclass > Pointer (Track *t)
 
template<typename Subclass = const Track>
static std::shared_ptr< Subclass > Pointer (const Track *t)
 

Protected Member Functions

std::shared_ptr< TrackControlsGetControls () override
 
std::shared_ptr
< TrackVRulerControls
GetVRulerControls () override
 
- Protected Member Functions inherited from Track
std::shared_ptr< TrackFindTrack () override
 
- Protected Member Functions inherited from CommonTrackPanelCell
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 

Protected Attributes

WaveClipHolders mClips
 
sampleFormat mFormat
 
int mRate
 
float mGain
 
float mPan
 
float mDisplayMin
 
float mDisplayMax
 
float mSpectrumMin
 
float mSpectrumMax
 
WaveTrackDisplay mDisplay
 
int mLastScaleType
 
int mLastdBRange
 
std::vector< LocationmDisplayLocationsCache
 
- Protected Attributes inherited from PlayableTrack
bool mMute { false }
 
bool mSolo { false }
 
- Protected Attributes inherited from Track
std::weak_ptr< TrackListmList
 
TrackNodePointer mNode {}
 
int mIndex
 
int mY
 
int mHeight
 
wxString mName
 
wxString mDefaultName
 
bool mSelected
 
bool mLinked
 
bool mMinimized
 
int mChannel
 
double mOffset
 
std::shared_ptr< DirManagermDirManager
 
std::shared_ptr< TrackControlsmpControls
 
std::shared_ptr
< TrackVRulerControls
mpVRulerContols
 
std::shared_ptr
< TrackPanelResizerCell
mpResizer
 
std::weak_ptr< SelectHandlemSelectHandle
 
std::weak_ptr< TimeShiftHandlemTimeShiftHandle
 

Private Member Functions

 WaveTrack (const std::shared_ptr< DirManager > &projDirManager, sampleFormat format=(sampleFormat) 0, double rate=0)
 
 WaveTrack (const WaveTrack &orig)
 
void Init (const WaveTrack &orig)
 
Track::Holder Duplicate () const override
 

Private Attributes

wxCriticalSection mFlushCriticalSection
 
wxCriticalSection mAppendCriticalSection
 
double mLegacyProjectFileOffset
 
int mAutoSaveIdent
 
std::unique_ptr
< SpectrogramSettings
mpSpectrumSettings
 
std::unique_ptr< WaveformSettingsmpWaveformSettings
 
std::weak_ptr< CutlineHandlemCutlineHandle
 
std::weak_ptr< SampleHandlemSampleHandle
 
std::weak_ptr< EnvelopeHandlemEnvelopeHandle
 

Friends

class TrackFactory
 

Additional Inherited Members

- Public Attributes inherited from Track
wxSize vrulerSize
 

Detailed Description

A Track that contains audio waveform data.

Member Typedef Documentation

using WaveTrack::Holder = std::unique_ptr<WaveTrack>
using WaveTrack::LockerBase = std::unique_ptr< const WaveTrack, WaveTrackLockDeleter >

Member Enumeration Documentation

Enumerator
LinarInterpolate 
StemPlot 
Enumerator
Waveform 
MinDisplay 
obsoleteWaveformDBDisplay 
Spectrum 
obsolete1 
obsolete2 
obsolete3 
obsolete4 
MaxDisplay 
NoDisplay 

Constructor & Destructor Documentation

WaveTrack::WaveTrack ( const WaveTrack orig)
private
WaveTrack::~WaveTrack ( )
virtual

Member Function Documentation

void WaveTrack::AddClip ( std::shared_ptr< WaveClip > &&  clip)
void WaveTrack::AddInvalidRegion ( sampleCount  startSample,
sampleCount  endSample 
)

Adds an invalid region to the wavecache so it redraws that portion only.

References WaveClip::AddInvalidRegion().

void WaveTrack::Append ( samplePtr  buffer,
sampleFormat  format,
size_t  len,
unsigned int  stride = 1,
XMLWriter blockFileLog = NULL 
)

Append the sample data to the WaveTrack. You must call Flush() after the last Append.

If there is an existing WaveClip in the WaveTrack then the data is appended to that clip. If there are no WaveClips in the track, then a NEW one is created.

References WaveClip::Append(), and RightmostOrNewClip().

Referenced by BlockGenerator::GenerateTrack(), NyquistEffect::PutCallback(), and EffectNoiseReduction::Worker::ReduceNoise().

void WaveTrack::AppendAlias ( const wxString &  fName,
sampleCount  start,
size_t  len,
int  channel,
bool  useOD 
)
void WaveTrack::AppendCoded ( const wxString &  fName,
sampleCount  start,
size_t  len,
int  channel,
int  decodeType 
)

for use with On-Demand decoding of compressed files. decodeType should be an enum from ODDecodeTask that specifies what Type of encoded file this is, such as eODFLAC

References WaveClip::AppendCoded(), and RightmostOrNewClip().

bool WaveTrack::CanInsertClip ( WaveClip clip)
bool WaveTrack::CanOffsetClip ( WaveClip clip,
double  amount,
double *  allowedAmount = NULL 
)
void WaveTrack::ClearAndAddCutLine ( double  t0,
double  t1 
)

References HandleClear().

Referenced by AudacityProject::OnCutLabels().

void WaveTrack::ClearWaveCaches ( )

Invalidates all clips' wavecaches. Careful, This may not be threadsafe.

Deletes all clips' wavecaches. Careful, This may not be threadsafe.

References WaveClip::ClearWaveCache().

bool WaveTrack::CloseLock ( )

References WaveClip::CloseLock(), and mClips.

WaveTrack::WaveTrackDisplay WaveTrack::ConvertLegacyDisplayValue ( int  oldValue)
static
void WaveTrack::ConvertToSampleFormat ( sampleFormat  format)

References format, mClips, and mFormat.

Referenced by FormatMenuTable::OnFormatChange().

Track::Holder WaveTrack::Copy ( double  t0,
double  t1,
bool  forClipboard = true 
) const
override
Track::Holder WaveTrack::CopyNonconst ( double  t0,
double  t1 
)
WaveClip * WaveTrack::CreateClip ( )
Track::Holder WaveTrack::Cut ( double  t0,
double  t1 
)
override

References Clear(), Copy(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by Paste(), and SyncLockAdjust().

Track::Holder WaveTrack::Duplicate ( ) const
overrideprivatevirtual

Implements Track.

References safenew.

Referenced by TrackFactory::DuplicateWaveTrack().

void WaveTrack::ExpandCutLine ( double  cutLinePosition,
double *  cutlineStart = NULL,
double *  cutlineEnd = NULL 
)
void WaveTrack::Flush ( )

Flush must be called after last Append.

References WaveClip::Flush(), and RightmostOrNewClip().

Referenced by NyquistEffect::ProcessOne(), and AudioIO::StopStream().

bool WaveTrack::Get ( samplePtr  buffer,
sampleFormat  format,
sampleCount  start,
size_t  len,
fillFormat  fill = fillZero,
bool  mayThrow = true 
) const

MM: Now that each wave track can contain multiple clips, we don't have a continous space of samples anymore, but we simulate it, because there are alot 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.

References ClearSamples(), fillTwo, fillZero, WaveClip::GetEndSample(), WaveClip::GetNumSamples(), WaveClip::GetSamples(), WaveClip::GetStartSample(), mClips, and min().

Referenced by EffectNormalize::AnalyseDC(), EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), EffectAutoDuck::ApplyDuckFade(), EffectTruncSilence::DoRemoval(), WaveTrackCache::Get(), FreqWindow::GetAudio(), NyquistEffect::GetCallback(), SampleHandle::HitTest(), AudacityProject::NearestZeroCrossing(), VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), EffectAutoDuck::Process(), EffectRepair::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectStereoToMono::ProcessOne(), EffectPaulstretch::ProcessOne(), EffectFindClipping::ProcessOne(), EffectNormalize::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectEqualization::ProcessOne(), EffectNoiseReduction::Worker::ProcessOne(), EffectReverse::ProcessOneClip(), Effect::ProcessTrack(), SelectHandle::StartSnappingFreqSelection(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), VoiceKey::TestSignChanges(), and MixerTrackCluster::UpdateMeter().

IteratorRange< AllClipsIterator > WaveTrack::GetAllClips ( )
inline

Referenced by GetAllSeqBlocks().

int WaveTrack::GetAutoSaveIdent ( )

References mAutoSaveIdent.

sampleCount WaveTrack::GetBlockStart ( sampleCount  t) const
const std::vector<Location>& WaveTrack::GetCachedLocations ( ) const
inline
float WaveTrack::GetChannelGain ( int  channel) const
WaveClip * WaveTrack::GetClipAtSample ( sampleCount  sample)
WaveClip * WaveTrack::GetClipAtTime ( double  time)
WaveClip * WaveTrack::GetClipAtX ( int  xcoord)
WaveClip * WaveTrack::GetClipByIndex ( int  index)
const WaveClip * WaveTrack::GetClipByIndex ( int  index) const

References GetClipByIndex().

int WaveTrack::GetClipIndex ( const WaveClip clip) const

References mClips.

Referenced by ClearAndPaste(), and UpdateLocationsCache().

const WaveClipConstHolders& WaveTrack::GetClips ( ) const
inline
std::shared_ptr< TrackControls > WaveTrack::GetControls ( )
overrideprotectedvirtual

Implements Track.

References Track::Pointer().

void WaveTrack::GetDisplayBounds ( float *  min,
float *  max 
) const
Envelope * WaveTrack::GetEnvelopeAtX ( int  xcoord)
void WaveTrack::GetEnvelopeValues ( double *  buffer,
size_t  bufferLen,
double  t0 
) const
bool WaveTrack::GetErrorOpening ( )
overridevirtual

Reimplemented from Track.

References Sequence::GetErrorOpening(), WaveClip::GetSequence(), and mClips.

float WaveTrack::GetGain ( ) const
size_t WaveTrack::GetIdealBlockSize ( )
int WaveTrack::GetLastdBRange ( ) const
inline
int WaveTrack::GetLastScaleType ( ) const
inline
std::pair< float, float > WaveTrack::GetMinMax ( double  t0,
double  t1,
bool  mayThrow = true 
) const
int WaveTrack::GetNumClips ( ) const

References mClips.

Referenced by AudacityProject::GetTime(), and Paste().

unsigned int WaveTrack::GetODFlags ( ) const

gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.

References Sequence::GetODFlags(), WaveClip::GetSequence(), and mClips.

Referenced by EffectNormalize::AnalyseTrack().

double WaveTrack::GetOffset ( ) const
overridevirtual

Implements Track.

References GetStartTime().

Referenced by TranscriptionToolBar::GetSamples(), and SetOffset().

float WaveTrack::GetPan ( ) const
float WaveTrack::GetRMS ( double  t0,
double  t1,
bool  mayThrow = true 
) const
Sequence * WaveTrack::GetSequenceAtX ( int  xcoord)
SpectrogramSettings & WaveTrack::GetSpectrogramSettings ( )
std::shared_ptr< TrackVRulerControls > WaveTrack::GetVRulerControls ( )
overrideprotectedvirtual

Implements Track.

References Track::Pointer().

WaveformSettings & WaveTrack::GetWaveformSettings ( )
XMLTagHandler * WaveTrack::HandleXMLChild ( const wxChar *  tag)
overridevirtual
void WaveTrack::HandleXMLEndTag ( const wxChar *  tag)
override
bool WaveTrack::IsEmpty ( double  t0,
double  t1 
) const

Returns true if there are no WaveClips in the specified region.

Returns
true if no clips in the track overlap the specified time range, false otherwise.

References mClips.

Referenced by Paste(), Generator::Process(), and SyncLockAdjust().

bool WaveTrack::Lock ( ) const

References WaveClip::Lock(), and mClips.

double WaveTrack::LongSamplesToTime ( sampleCount  pos) const
void WaveTrack::MergeClips ( int  clipidx1,
int  clipidx2 
)
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.

Returns
a pointer to the most recently added WaveClip

References CreateClip(), mClips, Track::mOffset, and WaveClip::SetOffset().

Referenced by GetIdealBlockSize(), HandleXMLChild(), RecordingRecoveryHandler::HandleXMLEndTag(), HandleXMLEndTag(), and RecordingRecoveryHandler::HandleXMLTag().

std::shared_ptr< WaveClip > WaveTrack::RemoveAndReturnClip ( WaveClip clip)

References mClips.

Referenced by EffectReverse::ProcessOneWave().

bool WaveTrack::RemoveCutLine ( double  cutLinePosition)
void WaveTrack::Resample ( int  rate,
ProgressDialog progress = NULL 
)

References mClips, mRate, and WaveClip::Resample().

WaveClip * WaveTrack::RightmostOrNewClip ( )

Get access to the last (rightmost) clip, or create a clip, if there is not already one.

Returns
a pointer to a WaveClip at the end of the track

References CreateClip(), WaveClip::GetOffset(), mClips, Track::mOffset, and WaveClip::SetOffset().

Referenced by Append(), AppendAlias(), AppendCoded(), and Flush().

void WaveTrack::SetAutoSaveIdent ( int  id)

References mAutoSaveIdent.

Referenced by AudacityProject::WriteXML().

void WaveTrack::SetDisplay ( WaveTrackDisplay  display)
inline
void WaveTrack::SetDisplayBounds ( float  min,
float  max 
) const
void WaveTrack::SetGain ( float  newGain)
void WaveTrack::SetLastdBRange ( ) const
void WaveTrack::SetLastScaleType ( ) const
void WaveTrack::SetOffset ( double  o)
overridevirtual

Reimplemented from Track.

References GetOffset(), mClips, and Track::mOffset.

Referenced by AudioIO::StopStream().

void WaveTrack::SetPanFromChannelType ( )
overridevirtual
void WaveTrack::SetRate ( double  newRate)

References mClips, and mRate.

Referenced by RateMenuTable::SetRate().

void WaveTrack::SetSpectrogramSettings ( std::unique_ptr< SpectrogramSettings > &&  pSettings)
void WaveTrack::SetSpectrumBounds ( float  min,
float  max 
) const
void WaveTrack::SetWaveformSettings ( std::unique_ptr< WaveformSettings > &&  pSettings)

References mpWaveformSettings.

Referenced by WaveformPrefs::Commit(), and Merge().

WaveClipConstPointers WaveTrack::SortedClipArray ( ) const

References mClips.

void WaveTrack::Split ( double  t0,
double  t1 
)
void WaveTrack::SplitAt ( double  t)
Track::Holder WaveTrack::SplitCut ( double  t0,
double  t1 
)
void WaveTrack::SplitDelete ( double  t0,
double  t1 
)
void WaveTrack::SyncLockAdjust ( double  oldT1,
double  newT1 
)
overridevirtual
AUDACITY_DLL_API sampleCount WaveTrack::TimeToLongSamples ( double  t0) const

Convert correctly between an (absolute) time in seconds and a number of samples.

This method will not give the correct results if used on a relative time (difference of two times). Each absolute time must be converted and the numbers of samples differenced: sampleCount start = track->TimeToLongSamples(t0); sampleCount end = track->TimeToLongSamples(t1); sampleCount len = (sampleCount)(end - start); NOT the likes of: sampleCount len = track->TimeToLongSamples(t1 - t0); See also WaveTrack::TimeToLongSamples().

Parameters
t0The time (floating point seconds) to convert
Returns
The number of samples from the start of the track which lie before the given time.

References mRate.

Referenced by EffectNormalize::AnalyseDC(), EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), EffectAutoDuck::ApplyDuckFade(), EffectTruncSilence::CalcPreviewInputLength(), ClearAndPaste(), Disjoin(), EffectTruncSilence::DoRemoval(), TrackArtist::DrawClipWaveform(), EffectTruncSilence::FindSilences(), BlockGenerator::GenerateTrack(), FreqWindow::GetAudio(), Effect::GetSamples(), Mixer::MixVariableRates(), AudacityProject::NearestZeroCrossing(), Paste(), EffectReverse::Process(), EffectStereoToMono::Process(), EffectRepeat::Process(), EffectFindClipping::Process(), EffectAutoDuck::Process(), EffectChangeSpeed::Process(), EffectNoiseReduction::Worker::Process(), EffectPaulstretch::ProcessOne(), EffectNormalize::ProcessOne(), NyquistEffect::ProcessOne(), EffectReverse::ProcessOneWave(), Effect::ProcessPass(), SplitAt(), and SelectHandle::StartSnappingFreqSelection().

void WaveTrack::Trim ( double  t0,
double  t1 
)
bool WaveTrack::Unlock ( ) const
WaveTrack::WaveTrackDisplay WaveTrack::ValidateWaveTrackDisplay ( WaveTrackDisplay  display)
static
void WaveTrack::WriteXML ( XMLWriter xmlFile) const
overridevirtual
int WaveTrack::ZeroLevelYCoordinate ( wxRect  rect) const

References mDisplayMax, and mDisplayMin.

Referenced by TrackArtist::DrawClipWaveform().

Friends And Related Function Documentation

friend class TrackFactory
friend

Member Data Documentation

wxCriticalSection WaveTrack::mAppendCriticalSection
private
int WaveTrack::mAutoSaveIdent
private
std::weak_ptr<CutlineHandle> WaveTrack::mCutlineHandle
private
WaveTrackDisplay WaveTrack::mDisplay
protected

Referenced by Init(), Merge(), and WaveTrack().

std::vector<Location> WaveTrack::mDisplayLocationsCache
mutableprotected

Referenced by Init(), and UpdateLocationsCache().

float WaveTrack::mDisplayMax
mutableprotected
float WaveTrack::mDisplayMin
mutableprotected
std::weak_ptr<EnvelopeHandle> WaveTrack::mEnvelopeHandle
private
wxCriticalSection WaveTrack::mFlushCriticalSection
private
sampleFormat WaveTrack::mFormat
protected
float WaveTrack::mGain
protected
int WaveTrack::mLastdBRange
mutableprotected

Referenced by SetLastdBRange(), and WaveTrack().

int WaveTrack::mLastScaleType
mutableprotected

Referenced by SetLastScaleType(), and WaveTrack().

double WaveTrack::mLegacyProjectFileOffset
private
float WaveTrack::mPan
protected
std::unique_ptr<SpectrogramSettings> WaveTrack::mpSpectrumSettings
private
std::unique_ptr<WaveformSettings> WaveTrack::mpWaveformSettings
private
std::weak_ptr<SampleHandle> WaveTrack::mSampleHandle
private
float WaveTrack::mSpectrumMax
mutableprotected
float WaveTrack::mSpectrumMin
mutableprotected

The documentation for this class was generated from the following files: