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 ProjectSettings &settings, 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 ProjectSettingsmSettings
 
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 673 of file WaveTrack.h.

Constructor & Destructor Documentation

◆ WaveTrackFactory() [1/2]

WaveTrackFactory::WaveTrackFactory ( const ProjectSettings settings,
const SampleBlockFactoryPtr pFactory 
)
inline

Definition at line 682 of file WaveTrack.h.

684  : mSettings{ settings }
685  , mpFactory(pFactory)
686  {
687  }

References settings().

Here is the call graph for this function:

◆ WaveTrackFactory() [2/2]

WaveTrackFactory::WaveTrackFactory ( const WaveTrackFactory )

Member Function Documentation

◆ Destroy()

void WaveTrackFactory::Destroy ( AudacityProject project)
static

Definition at line 2803 of file WaveTrack.cpp.

2804 {
2805  project.AttachedObjects::Assign( key2, nullptr );
2806 }

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 79 of file WaveTrack.cpp.

80 {
81  return std::static_pointer_cast<WaveTrack>( orig.Duplicate() );
82 }

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 2791 of file WaveTrack.cpp.

2792 {
2793  return Get( const_cast< AudacityProject & >( project ) );
2794 }

References WaveTrack::Get().

Here is the call graph for this function:

◆ GetSampleBlockFactory()

const SampleBlockFactoryPtr& WaveTrackFactory::GetSampleBlockFactory ( ) const
inline

Definition at line 691 of file WaveTrack.h.

692  { 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 85 of file WaveTrack.cpp.

86 {
87  if (format == (sampleFormat)0)
89  if (rate == 0)
90  rate = mSettings.GetRate();
91  return std::make_shared<WaveTrack> ( mpFactory, format, rate );
92 }

References format, ProjectSettings::GetRate(), mpFactory, mSettings, and QualityPrefs::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 2796 of file WaveTrack.cpp.

2797 {
2798  auto result = TrackFactoryFactory( project );
2799  project.AttachedObjects::Assign( key2, result );
2800  return *result;
2801 }

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 696 of file WaveTrack.h.

Referenced by NewWaveTrack().

◆ mSettings

const ProjectSettings& WaveTrackFactory::mSettings
private

Definition at line 695 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:2786
Track::Duplicate
virtual Holder Duplicate() const
Definition: Track.cpp:113
WaveTrackFactory::mpFactory
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:696
key2
static const AudacityProject::AttachedObjects::RegisteredFactory key2
Definition: WaveTrack.cpp:2782
sampleFormat
sampleFormat
Definition: Types.h:717
format
int format
Definition: ExportPCM.cpp:54
WaveTrackFactory::mSettings
const ProjectSettings & mSettings
Definition: WaveTrack.h:695
WaveTrackFactory
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:675
QualityPrefs::SampleFormatChoice
static sampleFormat SampleFormatChoice()
Definition: QualityPrefs.cpp:246
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
ProjectSettings::GetRate
double GetRate() const
Definition: ProjectSettings.cpp:166
TrackFactoryFactory
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:2776
settings
static Settings & settings()
Definition: TrackInfo.cpp:87