Audacity 3.2.0
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< WaveTrackCreate ()
 Creates an unnamed empty WaveTrack with default sample format and default rate. More...
 
std::shared_ptr< WaveTrackCreate (sampleFormat format, double rate)
 Creates an unnamed empty WaveTrack with custom sample format and custom rate. More...
 
- 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 611 of file WaveTrack.h.

Constructor & Destructor Documentation

◆ WaveTrackFactory() [1/2]

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

Definition at line 620 of file WaveTrack.h.

623 : mRate{ rate }
624 , mpFactory(pFactory)
625 {
626 }
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:649
const ProjectRate & mRate
Definition: WaveTrack.h:648

◆ WaveTrackFactory() [2/2]

WaveTrackFactory::WaveTrackFactory ( const WaveTrackFactory )

Member Function Documentation

◆ Create() [1/2]

std::shared_ptr< WaveTrack > WaveTrackFactory::Create ( )

Creates an unnamed empty WaveTrack with default sample format and default rate.

Returns
Orphaned WaveTrack

Definition at line 118 of file WaveTrack.cpp.

119{
121}
double GetRate() const
Definition: ProjectRate.cpp:53
std::shared_ptr< WaveTrack > Create()
Creates an unnamed empty WaveTrack with default sample format and default rate.
Definition: WaveTrack.cpp:118
PROJECT_RATE_API sampleFormat SampleFormatChoice()

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

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

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

◆ Create() [2/2]

std::shared_ptr< WaveTrack > WaveTrackFactory::Create ( sampleFormat  format,
double  rate 
)

Creates an unnamed empty WaveTrack with custom sample format and custom rate.

Parameters
formatDesired sample format
rateDesired sample rate
Returns
Orphaned WaveTrack

Definition at line 123 of file WaveTrack.cpp.

124{
125 return std::make_shared<WaveTrack>(mpFactory, format, rate);
126}
int format
Definition: ExportPCM.cpp:56

References format, and mpFactory.

◆ Destroy()

void WaveTrackFactory::Destroy ( AudacityProject project)
static

Definition at line 2817 of file WaveTrack.cpp.

2818{
2819 project.AttachedObjects::Assign( key2, nullptr );
2820}
static const AudacityProject::AttachedObjects::RegisteredFactory key2
Definition: WaveTrack.cpp:2796

References key2.

Referenced by ProjectManager::OnCloseWindow().

Here is the caller graph for this function:

◆ Get() [1/2]

WaveTrackFactory & WaveTrackFactory::Get ( AudacityProject project)
static

Definition at line 2800 of file WaveTrack.cpp.

2801{
2802 return project.AttachedObjects::Get< WaveTrackFactory >( key2 );
2803}
Used to create or clone a WaveTrack, with appropriate context from the project that will own the trac...
Definition: WaveTrack.h:613

References key2.

Referenced by EffectUI::DoEffect(), anonymous_namespace{FileMenus.cpp}::DoImport(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), ProjectAudioManager::DoRecord(), AUPImportFileHandle::HandleWaveTrack(), ProjectFileManager::Import(), ProjectFileIO::LoadProject(), WaveTrack::New(), FileActions::Handler::OnImportLabels(), anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewStereoTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::Handler::OnNewWaveTrack(), EditActions::Handler::OnPaste(), and WaveTrack::PasteInto().

Here is the caller graph for this function:

◆ Get() [2/2]

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

Definition at line 2805 of file WaveTrack.cpp.

2806{
2807 return Get( const_cast< AudacityProject & >( project ) );
2808}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
static WaveTrackFactory & Get(AudacityProject &project)
Definition: WaveTrack.cpp:2800

References WaveTrack::Get().

Here is the call graph for this function:

◆ GetSampleBlockFactory()

const SampleBlockFactoryPtr & WaveTrackFactory::GetSampleBlockFactory ( ) const
inline

Definition at line 630 of file WaveTrack.h.

631 { return mpFactory; }

Referenced by ProjectFileIO::LoadProject(), and MixAndRender().

Here is the caller graph for this function:

◆ operator=()

WaveTrackFactory & WaveTrackFactory::operator= ( const WaveTrackFactory )

◆ Reset()

WaveTrackFactory & WaveTrackFactory::Reset ( AudacityProject project)
static

Definition at line 2810 of file WaveTrack.cpp.

2811{
2812 auto result = TrackFactoryFactory( project );
2813 project.AttachedObjects::Assign( key2, result );
2814 return *result;
2815}
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:2790

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

Referenced by Create().

◆ mRate

const ProjectRate& WaveTrackFactory::mRate
private

Definition at line 648 of file WaveTrack.h.

Referenced by Create().


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