Audacity  3.2.0
Classes | Namespaces | Macros | Typedefs | Functions | Variables
WaveTrack.h File Reference
#include "Prefs.h"
#include "SampleCount.h"
#include "SampleFormat.h"
#include "SampleTrack.h"
#include <vector>
#include <functional>
#include <wx/thread.h>
#include <wx/longlong.h>
#include "WaveTrackLocation.h"
#include <unordered_set>
Include dependency graph for WaveTrack.h:

Go to the source code of this file.

Classes

struct  Region
 Structure to hold region of a wavetrack and a comparison function for sortability. More...
 
class  WaveTrack
 A Track that contains audio waveform data. More...
 
class  WaveTrack::AllClipsIterator
 
class  WaveTrack::AllClipsConstIterator
 
class  WaveTrack::IntervalData
 
class  WaveTrackFactory
 Used to create or clone a WaveTrack, with appropriate context from the project that will own the track. More...
 

Namespaces

 BasicUI
 

Macros

#define WAVETRACK_MERGE_POINT_TOLERANCE   0.01
 

Typedefs

using SampleBlockFactoryPtr = std::shared_ptr< SampleBlockFactory >
 
using WaveClipHolder = std::shared_ptr< WaveClip >
 
using WaveClipHolders = std::vector< WaveClipHolder >
 
using WaveClipConstHolders = std::vector< std::shared_ptr< const WaveClip > >
 
using WaveClipPointers = std::vector< WaveClip * >
 
using WaveClipConstPointers = std::vector< const WaveClip * >
 
using Regions = std::vector< Region >
 
using SampleBlockID = long long
 
using SampleBlockIDSet = std::unordered_set< SampleBlockID >
 
using BlockVisitor = std::function< void(SampleBlock &) >
 
using BlockInspector = std::function< void(const SampleBlock &) >
 

Functions

 ENUMERATE_TRACK_TYPE (WaveTrack)
 
void VisitBlocks (TrackList &tracks, BlockVisitor visitor, SampleBlockIDSet *pIDs=nullptr)
 
void InspectBlocks (const TrackList &tracks, BlockInspector inspector, SampleBlockIDSet *pIDs=nullptr)
 
AUDACITY_DLL_API bool GetEditClipsCanMove ()
 

Variables

AUDACITY_DLL_API StringSetting AudioTrackNameSetting
 

Macro Definition Documentation

◆ WAVETRACK_MERGE_POINT_TOLERANCE

#define WAVETRACK_MERGE_POINT_TOLERANCE   0.01

Definition at line 52 of file WaveTrack.h.

Typedef Documentation

◆ BlockInspector

using BlockInspector = std::function< void(const SampleBlock&) >

Definition at line 592 of file WaveTrack.h.

◆ BlockVisitor

using BlockVisitor = std::function< void(SampleBlock&) >

Definition at line 591 of file WaveTrack.h.

◆ Regions

using Regions = std::vector < Region >

Definition at line 70 of file WaveTrack.h.

◆ SampleBlockFactoryPtr

using SampleBlockFactoryPtr = std::shared_ptr<SampleBlockFactory>

Definition at line 31 of file WaveTrack.h.

◆ SampleBlockID

using SampleBlockID = long long

Definition at line 588 of file WaveTrack.h.

◆ SampleBlockIDSet

using SampleBlockIDSet = std::unordered_set<SampleBlockID>

Definition at line 589 of file WaveTrack.h.

◆ WaveClipConstHolders

using WaveClipConstHolders = std::vector < std::shared_ptr< const WaveClip > >

Definition at line 43 of file WaveTrack.h.

◆ WaveClipConstPointers

using WaveClipConstPointers = std::vector < const WaveClip* >

Definition at line 47 of file WaveTrack.h.

◆ WaveClipHolder

using WaveClipHolder = std::shared_ptr< WaveClip >

Definition at line 41 of file WaveTrack.h.

◆ WaveClipHolders

using WaveClipHolders = std::vector < WaveClipHolder >

Definition at line 42 of file WaveTrack.h.

◆ WaveClipPointers

using WaveClipPointers = std::vector < WaveClip* >

Definition at line 46 of file WaveTrack.h.

Function Documentation

◆ ENUMERATE_TRACK_TYPE()

ENUMERATE_TRACK_TYPE ( WaveTrack  )

◆ GetEditClipsCanMove()

AUDACITY_DLL_API bool GetEditClipsCanMove ( )

Definition at line 2849 of file WaveTrack.cpp.

2850 {
2851  bool mIsSyncLocked;
2852  gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
2853  if( mIsSyncLocked )
2854  return true;
2855  bool editClipsCanMove;
2856  gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipsCanMove, false);
2857  return editClipsCanMove;
2858 }

References gPrefs.

Referenced by WaveTrack::ExpandCutLine(), WaveTrack::HandleClear(), WaveTrack::PasteWaveTrack(), and Generator::Process().

Here is the caller graph for this function:

◆ InspectBlocks()

void InspectBlocks ( const TrackList tracks,
BlockInspector  inspector,
SampleBlockIDSet pIDs = nullptr 
)

Definition at line 2780 of file WaveTrack.cpp.

2782 {
2783  VisitBlocks(
2784  const_cast<TrackList &>(tracks), std::move( inspector ), pIDs );
2785 }

References VisitBlocks().

Referenced by anonymous_namespace{UndoManager.cpp}::CalculateUsage(), ProjectFileIO::CopyTo(), UndoManager::EstimateRemovedBlocks(), ProjectFileIO::GetCurrentUsage(), ProjectFileIO::SaveProject(), and ProjectFileIO::ShouldCompact().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VisitBlocks()

void VisitBlocks ( TrackList tracks,
BlockVisitor  visitor,
SampleBlockIDSet pIDs = nullptr 
)

Definition at line 2759 of file WaveTrack.cpp.

2761 {
2762  for (auto wt : tracks.Any< const WaveTrack >()) {
2763  // Scan all clips within current track
2764  for(const auto &clip : wt->GetAllClips()) {
2765  // Scan all sample blocks within current clip
2766  auto blocks = clip->GetSequenceBlockArray();
2767  for (const auto &block : *blocks) {
2768  auto &pBlock = block.sb;
2769  if ( pBlock ) {
2770  if ( pIDs && !pIDs->insert(pBlock->GetBlockID()).second )
2771  continue;
2772  if ( visitor )
2773  visitor( *pBlock );
2774  }
2775  }
2776  }
2777  }
2778 }

References TrackList::Any().

Referenced by InspectBlocks().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ AudioTrackNameSetting

AUDACITY_DLL_API StringSetting AudioTrackNameSetting
extern
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:75
VisitBlocks
void VisitBlocks(TrackList &tracks, BlockVisitor visitor, SampleBlockIDSet *pIDs)
Definition: WaveTrack.cpp:2759
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:71
TrackList
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:1288
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1379