Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
WaveTrackFactory Class Referencefinal

Used to create or clone a WaveTrack, with appropriate context from the project that will own the track. More...

#include <WaveTrack.h>

Inheritance diagram for WaveTrackFactory:
[legend]
Collaboration diagram for WaveTrackFactory:
[legend]

Public Member Functions

 WaveTrackFactory (const ProjectRate &rate, const SampleBlockFactoryPtr &pFactory)
 
 WaveTrackFactory (const WaveTrackFactory &) PROHIBITED
 
WaveTrackFactoryoperator= (const WaveTrackFactory &) PROHIBITED
 
const SampleBlockFactoryPtrGetSampleBlockFactory () const
 
std::shared_ptr< WaveTrackDuplicateWaveTrack (const WaveTrack &orig)
 
std::shared_ptr< WaveTrackNewWaveTrack (sampleFormat format=(sampleFormat) 0, double rate=0)
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static WaveTrackFactoryGet (AudacityProject &project)
 
static const WaveTrackFactoryGet (const AudacityProject &project)
 
static WaveTrackFactoryReset (AudacityProject &project)
 
static void Destroy (AudacityProject &project)
 

Private Attributes

const ProjectRatemRate
 
SampleBlockFactoryPtr mpFactory
 

Detailed Description

Used to create or clone a WaveTrack, with appropriate context from the project that will own the track.

Definition at line 711 of file WaveTrack.h.

Constructor & Destructor Documentation

◆ WaveTrackFactory() [1/2]

WaveTrackFactory::WaveTrackFactory ( const ProjectRate rate,
const SampleBlockFactoryPtr pFactory 
)
inline

Definition at line 720 of file WaveTrack.h.

722  : mRate{ rate }
723  , mpFactory(pFactory)
724  {
725  }

◆ WaveTrackFactory() [2/2]

WaveTrackFactory::WaveTrackFactory ( const WaveTrackFactory )

Member Function Documentation

◆ Destroy()

void WaveTrackFactory::Destroy ( AudacityProject project)
static

Definition at line 2907 of file WaveTrack.cpp.

2908 {
2909  project.AttachedObjects::Assign( key2, nullptr );
2910 }

References key2.

Referenced by ProjectManager::OnCloseWindow().

Here is the caller graph for this function:

◆ DuplicateWaveTrack()

WaveTrack::Holder WaveTrackFactory::DuplicateWaveTrack ( const WaveTrack orig)

Definition at line 112 of file WaveTrack.cpp.

113 {
114  return std::static_pointer_cast<WaveTrack>( orig.Duplicate() );
115 }

References Track::Duplicate().

Here is the call graph for this function:

◆ Get() [1/2]

WaveTrackFactory & WaveTrackFactory::Get ( AudacityProject project)
static

◆ Get() [2/2]

const WaveTrackFactory & WaveTrackFactory::Get ( const AudacityProject project)
static

Definition at line 2895 of file WaveTrack.cpp.

2896 {
2897  return Get( const_cast< AudacityProject & >( project ) );
2898 }

References WaveTrack::Get().

Here is the call graph for this function:

◆ GetSampleBlockFactory()

const SampleBlockFactoryPtr& WaveTrackFactory::GetSampleBlockFactory ( ) const
inline

Definition at line 729 of file WaveTrack.h.

730  { return mpFactory; }

Referenced by ProjectFileIO::LoadProject().

Here is the caller graph for this function:

◆ NewWaveTrack()

WaveTrack::Holder WaveTrackFactory::NewWaveTrack ( sampleFormat  format = (sampleFormat)0,
double  rate = 0 
)

Definition at line 118 of file WaveTrack.cpp.

119 {
120  if (format == (sampleFormat)0)
122  if (rate == 0)
123  rate = mRate.GetRate();
124  return std::make_shared<WaveTrack> ( mpFactory, format, rate );
125 }

References format, ProjectRate::GetRate(), mpFactory, mRate, and QualitySettings::SampleFormatChoice().

Referenced by Effect::DoEffect(), ProjectAudioManager::DoRecord(), ImportRaw(), MixAndRender(), and ImportFileHandle::NewWaveTrack().

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

◆ operator=()

WaveTrackFactory& WaveTrackFactory::operator= ( const WaveTrackFactory )

◆ Reset()

WaveTrackFactory & WaveTrackFactory::Reset ( AudacityProject project)
static

Definition at line 2900 of file WaveTrack.cpp.

2901 {
2902  auto result = TrackFactoryFactory( project );
2903  project.AttachedObjects::Assign( key2, result );
2904  return *result;
2905 }

References key2, and TrackFactoryFactory.

Referenced by ProjectManager::ResetProjectToEmpty().

Here is the caller graph for this function:

Member Data Documentation

◆ mpFactory

SampleBlockFactoryPtr WaveTrackFactory::mpFactory
private

Definition at line 734 of file WaveTrack.h.

Referenced by NewWaveTrack().

◆ mRate

const ProjectRate& WaveTrackFactory::mRate
private

Definition at line 733 of file WaveTrack.h.

Referenced by NewWaveTrack().


The documentation for this class was generated from the following files:
WaveTrackFactory::Get
static WaveTrackFactory & Get(AudacityProject &project)
Definition: WaveTrack.cpp:2890
WaveTrackFactory::mRate
const ProjectRate & mRate
Definition: WaveTrack.h:733
Track::Duplicate
virtual Holder Duplicate() const
Definition: Track.cpp:112
WaveTrackFactory::mpFactory
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:734
key2
static const AudacityProject::AttachedObjects::RegisteredFactory key2
Definition: WaveTrack.cpp:2886
format
int format
Definition: ExportPCM.cpp:56
ProjectRate::GetRate
double GetRate() const
Definition: ProjectRate.cpp:68
WaveTrackFactory
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:713
sampleFormat
sampleFormat
Definition: SampleFormat.h:29
QualitySettings::SampleFormatChoice
PROJECT_RATE_API sampleFormat SampleFormatChoice()
Definition: QualitySettings.cpp:38
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
TrackFactoryFactory
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:2880