Audacity  2.2.0
Track Class Referenceabstract

Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the WaveTrack, NoteTrack, LabelTrack and TimeTrack. More...

#include <Track.h>

Inheritance diagram for Track:
CommonTrackPanelCell XMLTagHandler TrackPanelCell AudioTrack LabelTrack TimeTrack PlayableTrack WaveTrack

Public Types

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

std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &, const AudacityProject *pProject) finaloverride
 
virtual std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &, const AudacityProject *pProject, int currentTool, bool bMultiTool)=0
 
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
 
virtual void SetMinimized (bool isMinimized)
 
TrackGetLink () const
 
 Track (const std::shared_ptr< DirManager > &projDirManager)
 
 Track (const Track &orig)
 
virtual ~Track ()
 
void Init (const Track &orig)
 
virtual Holder Duplicate () const =0
 
virtual void Merge (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)
 
virtual int GetChannel () const
 
virtual double GetOffset () const =0
 
void Offset (double t)
 
virtual void SetOffset (double o)
 
void SetChannel (int c)
 
virtual void SetPan (float)
 
virtual void SetPanFromChannelType ()
 
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 SyncLockAdjust (double oldT1, double newT1)
 
virtual void Silence (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual void InsertSilence (double WXUNUSED(t), double WXUNUSED(len))=0
 
virtual int GetKind () const
 
virtual void WriteXML (XMLWriter &xmlFile) const =0
 
virtual bool GetErrorOpening ()
 
virtual double GetStartTime () const =0
 
virtual double GetEndTime () const =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 bool HandleXMLTag (const wxChar *tag, const wxChar **attrs)=0
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const wxChar *tag)=0
 
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

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)
 

Public Attributes

wxSize vrulerSize
 

Protected Member Functions

std::shared_ptr< TrackFindTrack () override
 
virtual std::shared_ptr
< TrackControls
GetControls ()=0
 
virtual std::shared_ptr
< TrackVRulerControls
GetVRulerControls ()=0
 
- Protected Member Functions inherited from CommonTrackPanelCell
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 

Protected Attributes

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

TrackNodePointer GetNode () const
 
void SetOwner (const std::weak_ptr< TrackList > &list, TrackNodePointer node)
 

Friends

class TrackList
 
class TrackListIterator
 
class SyncLockedTracksIterator
 

Detailed Description

Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the WaveTrack, NoteTrack, LabelTrack and TimeTrack.

Member Typedef Documentation

using Track::Holder = std::unique_ptr<Track>

Member Enumeration Documentation

anonymous enum
Enumerator
LeftChannel 
RightChannel 
MonoChannel 
anonymous enum : unsigned
Enumerator
DefaultHeight 
Enumerator
None 
Wave 
Label 
Time 
All 

Constructor & Destructor Documentation

Track::Track ( const std::shared_ptr< DirManager > &  projDirManager)
Track::Track ( const Track orig)

References Init(), mIndex, mOffset, and mY.

Track::~Track ( )
virtual

Member Function Documentation

virtual void Track::Clear ( double   WXUNUSEDt0,
double   WXUNUSEDt1 
)
pure virtual
virtual Holder Track::Copy ( double   WXUNUSEDt0,
double   WXUNUSEDt1,
bool  forClipboard = true 
) const
pure virtual
virtual Holder Track::Cut ( double   WXUNUSEDt0,
double   WXUNUSEDt1 
)
pure virtual
virtual std::vector<UIHandlePtr> Track::DetailedHitTest ( const TrackPanelMouseState ,
const AudacityProject pProject,
int  currentTool,
bool  bMultiTool 
)
pure virtual

Implemented in LabelTrack, WaveTrack, and TimeTrack.

std::shared_ptr< Track > Track::FindTrack ( )
overrideprotectedvirtual

Implements CommonTrackPanelCell.

References Pointer().

int Track::GetActualHeight ( ) const
inline
virtual std::shared_ptr<TrackControls> Track::GetControls ( )
protectedpure virtual

Implemented in WaveTrack, LabelTrack, and TimeTrack.

Referenced by GetTrackControl().

wxString Track::GetDefaultName ( ) const
inline
const std::shared_ptr<DirManager>& Track::GetDirManager ( ) const
inline
virtual bool Track::GetErrorOpening ( )
inlinevirtual

Reimplemented in WaveTrack.

Referenced by AudacityProject::OpenFile().

int Track::GetIndex ( ) const
virtual int Track::GetKind ( ) const
inlinevirtual

Reimplemented in LabelTrack, WaveTrack, and TimeTrack.

Referenced by SelectHandle::AssignSelection(), LabelDefaultClickHandle::Click(), TrackListOfKindIterator::Condition(), AudacityProject::CountSelectedWaveTracks(), ExportMultiple::CountTracksAndLabels(), Effect::CountWaveTracks(), TimeShiftHandle::CreateListOfCapturedClips(), AudacityProject::DoAddLabel(), PlayIndicatorOverlayBase::Draw(), TrackPanel::DrawOutside(), TrackArtist::DrawTrack(), TrackArtist::DrawVRuler(), AudacityProject::EditByLabel(), AudacityProject::EditClipboardByLabel(), AudacityProject::EnqueueODTasks(), Exporter::ExamineTracks(), ExportMultiple::ExportMultipleByTrack(), LabelDialog::FindAllLabels(), AudacityProject::FindClipBoundaries(), AudacityProject::FindClips(), GetAllSeqBlocks(), TrackList::GetNumExportChannels(), AudacityProject::GetRegionsByLabel(), AudacityProject::GetTime(), AudacityProject::GetUpdateFlags(), AudacityProject::HandleMixAndRender(), EffectAutoDuck::Init(), EffectEqualization::Init(), WaveTrackMenuTable::InitMenu(), SyncLockedTracksIterator::IsGoodNextTrack(), IsSyncLockSelected(), ODTask::IsTaskAssociatedWithProject(), WaveTrack::Merge(), MixAndRender(), AudacityProject::NearestZeroCrossing(), SyncLockedTracksIterator::Next(), AudacityProject::OnClipMove(), AudacityProject::OnCopy(), AudacityProject::OnCut(), AudacityProject::OnDisjoin(), AudacityProject::OnEffect(), AudacityProject::OnExportLabels(), AudacityProject::OnJoin(), AudacityProject::OnMoveToLabel(), AudacityProject::OnPanTracks(), AudacityProject::OnPaste(), AudacityProject::OnResample(), AudacityProject::OnSplit(), AudacityProject::OnSplitCut(), AudacityProject::OnSplitDelete(), AudacityProject::OnSplitNew(), AudacityProject::OnTrackGain(), AudacityProject::OnTrackGainDec(), AudacityProject::OnTrackGainInc(), AudacityProject::OnTrackPan(), AudacityProject::OnTrackPanLeft(), AudacityProject::OnTrackPanRight(), AudacityProject::OnTrim(), AudacityProject::OpenFile(), TimeTrack::Paste(), LabelTrack::Paste(), WaveTrack::Paste(), LabelTrack::PasteOver(), SyncLockedTracksIterator::Prev(), Effect::ProcessPass(), AudacityProject::RedrawProject(), LabelDefaultClickHandle::SaveState(), SyncLockedTracksIterator::StartWith(), LabelDialog::TransferDataFromWindow(), TrackArtist::UpdateVRuler(), and AudacityProject::WriteXML().

Track * Track::GetLink ( ) const

References mLinked, mList, and mNode.

Referenced by _(), AudacityProject::ChannelsHaveSameClipBoundaries(), EnvelopeHandle::Click(), WaveformPrefs::Commit(), VisibleTrackIterator::Condition(), TimeShiftHandle::CreateListOfCapturedClips(), TimeShiftHandle::DoSlideHorizontal(), WaveTrackVZoomHandle::DoZoom(), TrackPanelResizeHandle::Drag(), TimeShiftHandle::Drag(), TrackPanel::DrawEverythingElse(), TrackArtist::DrawTrack(), TrackArtist::DrawTracks(), AudacityProject::FindClipBoundaries(), AudacityProject::FindClips(), TrackPanel::FindTrackRect(), TrackList::GetGroupHeight(), GetMinimizedHeight(), TrackList::GetPrev(), AudacityProject::HandleMixAndRender(), WaveTrackMenuTable::InitMenu(), TrackPanelAx::IsFocused(), MixAndRender(), AudacityProject::OnClipMove(), FormatMenuTable::OnFormatChange(), WaveTrackMenuTable::OnMergeStereo(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), WaveTrackMenuTable::OnSwapChannels(), WaveColorMenuTable::OnWaveColorChange(), WaveformVRulerMenuTable::OnWaveformScaleType(), AudacityProject::OpenFile(), POPUP_MENU_RADIO_ITEM(), SpectrumPrefs::Preview(), EffectTruncSilence::ProcessIndependently(), NyquistEffect::ProcessOne(), TrackPanel::RefreshTrack(), AudacityProject::RemoveTrack(), SpectrumPrefs::Rollback(), SelectionState::SelectTrackLength(), TrackPanel::SetFocusedTrack(), RateMenuTable::SetRate(), AudacityProject::SetTrackGain(), AudacityProject::SetTrackPan(), ControlToolBar::SetupCutPreviewTracks(), AudacityProject::SortTracks(), WaveTrackMenuTable::SplitStereo(), TrackList::SwapNodes(), and TrackPanel::UpdateTrackVRuler().

int Track::GetMinimizedHeight ( ) const
virtual
std::shared_ptr< TrackPanelCell > Track::GetResizer ( )

References mpResizer, and Pointer().

bool Track::GetSelected ( ) const
inline

Referenced by audacityAudioCallback(), AudacityProject::Clear(), LabelTextHandle::Click(), TimeShiftHandle::Click(), TrackInfo::CloseTitleDrawFunction(), SelectedTrackListOfKindIterator::Condition(), AudacityProject::CountSelectedTracks(), AudacityProject::CountSelectedWaveTracks(), Effect::CountWaveTracks(), TimeShiftHandle::CreateListOfCapturedClips(), EditCursorOverlay::Draw(), TrackArtist::DrawBackgroundWithSelection(), TrackArtist::DrawClipWaveform(), TrackArtist::DrawLabelTrack(), TrackPanel::DrawOutside(), AudacityProject::EditByLabel(), AudacityProject::EditClipboardByLabel(), Exporter::ExamineTracks(), ExportMultiple::ExportMultipleByTrack(), AudacityProject::FindClipBoundaries(), AudacityProject::FindClips(), TrackPanel::GetFirstSelectedTrack(), TrackList::GetNumExportChannels(), AudacityProject::GetRegionsByLabel(), TrackPanel::GetSelectedTrackCount(), AudacityProject::GetUpdateFlags(), AudacityProject::HandleAlign(), SelectionState::HandleListSelection(), AudacityProject::HandleMixAndRender(), AudacityProject::HandlePasteNothingSelected(), EffectAutoDuck::Init(), EffectScienFilter::Init(), EffectEqualization::Init(), IsSyncLockSelected(), TrackInfo::MinimizeSyncLockDrawFunction(), MixAndRender(), SelectHandle::MoveSnappingFreqSelection(), TrackInfo::MuteOrSoloDrawFunction(), AudacityProject::NearestZeroCrossing(), AudacityProject::OnClipMove(), AudacityProject::OnCopy(), AudacityProject::OnCursorTrackEnd(), AudacityProject::OnCursorTrackStart(), AudacityProject::OnCut(), AudacityProject::OnDisjoin(), AudacityProject::OnDuplicate(), AudacityProject::OnEffect(), AudacityProject::OnJoin(), AudacityProject::OnNextTrack(), MixerTrackCluster::OnPaint(), AudacityProject::OnPanTracks(), AudacityProject::OnPrevTrack(), AudacityProject::OnRemoveTracks(), AudacityProject::OnResample(), AudacityProject::OnSelectCursorEnd(), AudacityProject::OnSelectStartCursor(), AudacityProject::OnSilence(), AudacityProject::OnSplit(), AudacityProject::OnSplitCut(), AudacityProject::OnSplitDelete(), AudacityProject::OnSplitNew(), AudacityProject::OnToggle(), AudacityProject::OnTrim(), Effect::Preview(), Effect::ProcessPass(), SelectionState::SelectTrack(), and GetProjectInfoCommand::testSelected().

std::shared_ptr< TrackPanelCell > Track::GetTrackControl ( )

References GetControls(), and mpControls.

Referenced by TrackPanel::OnTrackMenu().

std::shared_ptr< TrackPanelCell > Track::GetVRulerControl ( )
virtual std::shared_ptr<TrackVRulerControls> Track::GetVRulerControls ( )
protectedpure virtual

Implemented in WaveTrack, LabelTrack, and TimeTrack.

Referenced by GetVRulerControl().

virtual void Track::InsertSilence ( double   WXUNUSEDt,
double   WXUNUSEDlen 
)
pure virtual
void Track::Merge ( const Track orig)
virtual

Reimplemented in WaveTrack, and PlayableTrack.

References mSelected.

Referenced by PlayableTrack::Merge().

void Track::Offset ( double  t)
inline
virtual void Track::Paste ( double   WXUNUSEDt,
const Track WXUNUSEDsrc 
)
pure virtual
template<typename Subclass = const Track>
static std::shared_ptr<Subclass> Track::Pointer ( const Track t)
inlinestatic

References mList, and mNode.

void Track::SetDefaultName ( const wxString &  n)
inline
void Track::SetIndex ( int  index)

References mIndex.

Referenced by TrackList::RecalcPositions().

virtual void Track::SetOffset ( double  o)
inlinevirtual
void Track::SetOwner ( const std::weak_ptr< TrackList > &  list,
TrackNodePointer  node 
)
private
virtual void Track::SetPan ( float  )
inlinevirtual

Reimplemented in WaveTrack.

virtual void Track::SetPanFromChannelType ( )
inlinevirtual

Reimplemented in WaveTrack.

void Track::SetY ( int  y)

References mY.

Referenced by TrackList::RecalcPositions().

virtual void Track::Silence ( double   WXUNUSEDt0,
double   WXUNUSEDt1 
)
pure virtual
void Track::SyncLockAdjust ( double  oldT1,
double  newT1 
)
virtual
virtual void Track::WriteXML ( XMLWriter xmlFile) const
pure virtual

Implemented in WaveTrack, LabelTrack, and TimeTrack.

Referenced by AudacityProject::WriteXML().

Friends And Related Function Documentation

friend class SyncLockedTracksIterator
friend
friend class TrackList
friend
friend class TrackListIterator
friend

Member Data Documentation

wxString Track::mDefaultName
protected

Referenced by Init().

int Track::mIndex
protected

Referenced by GetIndex(), SetIndex(), and Track().

bool Track::mLinked
protected

Referenced by GetLink(), Init(), SetLinked(), and Track().

wxString Track::mName
protected
TrackNodePointer Track::mNode {}
protected
std::shared_ptr<TrackControls> Track::mpControls
protected

Referenced by GetTrackControl().

std::shared_ptr<TrackPanelResizerCell> Track::mpResizer
protected

Referenced by GetResizer().

std::shared_ptr<TrackVRulerControls> Track::mpVRulerContols
protected

Referenced by GetVRulerControl().

bool Track::mSelected
protected

Referenced by Init(), Merge(), SetSelected(), and Track().

std::weak_ptr<SelectHandle> Track::mSelectHandle
protected
std::weak_ptr<TimeShiftHandle> Track::mTimeShiftHandle
protected
int Track::mY
protected

Referenced by GetY(), SetY(), and Track().

wxSize Track::vrulerSize
mutable

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