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

Constructor & Destructor Documentation

◆ WaveTrackFactory() [1/2]

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

Definition at line 572 of file WaveTrack.h.

575 : mRate{ rate }
576 , mpFactory(pFactory)
577 {
578 }
SampleBlockFactoryPtr mpFactory
Definition: WaveTrack.h:601
const ProjectRate & mRate
Definition: WaveTrack.h:600

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

117{
119}
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:116
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 121 of file WaveTrack.cpp.

122{
123 return std::make_shared<WaveTrack>(mpFactory, format, rate);
124}
int format
Definition: ExportPCM.cpp:53

References format, and mpFactory.

◆ Destroy()

void WaveTrackFactory::Destroy ( AudacityProject project)
static

Definition at line 2553 of file WaveTrack.cpp.

2554{
2555 project.AttachedObjects::Assign( key2, nullptr );
2556}
static const AudacityProject::AttachedObjects::RegisteredFactory key2
Definition: WaveTrack.cpp:2532

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

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

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(), anonymous_namespace{FileMenus.cpp}::OnImportLabels(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewStereoTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewWaveTrack(), anonymous_namespace{EditMenus.cpp}::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 2541 of file WaveTrack.cpp.

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

References WaveTrack::Get().

Here is the call graph for this function:

◆ GetSampleBlockFactory()

const SampleBlockFactoryPtr & WaveTrackFactory::GetSampleBlockFactory ( ) const
inline

Definition at line 582 of file WaveTrack.h.

583 { 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 2546 of file WaveTrack.cpp.

2547{
2548 auto result = TrackFactoryFactory( project );
2549 project.AttachedObjects::Assign( key2, result );
2550 return *result;
2551}
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:2526

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

Referenced by Create().

◆ mRate

const ProjectRate& WaveTrackFactory::mRate
private

Definition at line 600 of file WaveTrack.h.

Referenced by Create().


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