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

Constructor & Destructor Documentation

◆ WaveTrackFactory() [1/2]

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

Definition at line 708 of file WaveTrack.h.

710  : mSettings{ settings }
711  , mpFactory(pFactory)
712  {
713  }

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

2817 {
2818  project.AttachedObjects::Assign( key2, nullptr );
2819 }

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

2805 {
2806  return Get( const_cast< AudacityProject & >( project ) );
2807 }

References WaveTrack::Get().

Here is the call graph for this function:

◆ GetSampleBlockFactory()

const SampleBlockFactoryPtr& WaveTrackFactory::GetSampleBlockFactory ( ) const
inline

Definition at line 717 of file WaveTrack.h.

718  { 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 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 2809 of file WaveTrack.cpp.

2810 {
2811  auto result = TrackFactoryFactory( project );
2812  project.AttachedObjects::Assign( key2, result );
2813  return *result;
2814 }

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

Referenced by NewWaveTrack().

◆ mSettings

const ProjectSettings& WaveTrackFactory::mSettings
private

Definition at line 721 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:2799
Track::Duplicate
virtual Holder Duplicate() const
Definition: Track.cpp:113
WaveTrackFactory::mpFactory
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:722
key2
static const AudacityProject::AttachedObjects::RegisteredFactory key2
Definition: WaveTrack.cpp:2795
format
int format
Definition: ExportPCM.cpp:56
WaveTrackFactory::mSettings
const ProjectSettings & mSettings
Definition: WaveTrack.h:721
WaveTrackFactory
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:701
sampleFormat
sampleFormat
Definition: SampleFormat.h:29
QualitySettings::SampleFormatChoice
AUDACITY_DLL_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:113
ProjectSettings::GetRate
double GetRate() const
Definition: ProjectSettings.cpp:168
TrackFactoryFactory
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:2789
settings
static Settings & settings()
Definition: TrackInfo.cpp:86