Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Effect::ModifiedAnalysisTrack Class Reference

#include <Effect.h>

Collaboration diagram for Effect::ModifiedAnalysisTrack:
[legend]

Public Member Functions

 ModifiedAnalysisTrack ()
 
 ModifiedAnalysisTrack (ModifiedAnalysisTrack &&that)
 
LabelTrackget () const
 
void Commit ()
 
 ~ModifiedAnalysisTrack ()
 

Private Member Functions

 ModifiedAnalysisTrack (Effect *pEffect, const LabelTrack *pOrigTrack, const wxString &name)
 
 ModifiedAnalysisTrack (const ModifiedAnalysisTrack &) PROHIBITED
 

Private Attributes

friend Effect
 
EffectmpEffect {}
 
LabelTrackmpTrack {}
 
std::shared_ptr< TrackmpOrigTrack {}
 

Detailed Description

Definition at line 351 of file Effect.h.

Constructor & Destructor Documentation

◆ ModifiedAnalysisTrack() [1/4]

Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack ( Effect pEffect,
const LabelTrack pOrigTrack,
const wxString &  name 
)
private

Definition at line 808 of file Effect.cpp.

810 : mpEffect(pEffect)
811{
812 // copy LabelTrack here, so it can be undone on cancel
813 auto newTrack = pOrigTrack->Copy(pOrigTrack->GetStartTime(), pOrigTrack->GetEndTime());
814
815 mpTrack = static_cast<LabelTrack*>(newTrack.get());
816
817 // Why doesn't LabelTrack::Copy complete the job? :
818 mpTrack->SetOffset(pOrigTrack->GetStartTime());
819 if (!name.empty())
821
822 // mpOrigTrack came from mTracks which we own but expose as const to subclasses
823 // So it's okay that we cast it back to const
825 pEffect->mTracks->Replace(const_cast<LabelTrack*>(pOrigTrack),
826 newTrack );
827}
const TranslatableString name
Definition: Distortion.cpp:82
std::shared_ptr< Track > mpOrigTrack
Definition: Effect.h:375
TrackList * mTracks
Definition: EffectBase.h:125
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
double GetStartTime() const override
Definition: LabelTrack.cpp:346
Track::Holder Copy(double t0, double t1, bool forClipboard=true) const override
Definition: LabelTrack.cpp:712
double GetEndTime() const override
Definition: LabelTrack.cpp:354
void SetOffset(double dOffset) override
Definition: LabelTrack.cpp:176
void SetName(const wxString &n)
Definition: Track.cpp:80
ListOfTracks::value_type Replace(Track *t, const ListOfTracks::value_type &with)
Definition: Track.cpp:709

References LabelTrack::Copy(), TranslatableString::empty(), LabelTrack::GetEndTime(), LabelTrack::GetStartTime(), mpOrigTrack, mpTrack, EffectBase::mTracks, name, TrackList::Replace(), Track::SetName(), and LabelTrack::SetOffset().

Here is the call graph for this function:

◆ ModifiedAnalysisTrack() [2/4]

Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack ( const ModifiedAnalysisTrack )
private

◆ ModifiedAnalysisTrack() [3/4]

Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack ( )

◆ ModifiedAnalysisTrack() [4/4]

Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack ( ModifiedAnalysisTrack &&  that)

Definition at line 829 of file Effect.cpp.

830{
831 mpEffect = that.mpEffect;
832 mpTrack = that.mpTrack;
833 mpOrigTrack = std::move(that.mpOrigTrack);
834 that.Commit();
835}

◆ ~ModifiedAnalysisTrack()

Effect::ModifiedAnalysisTrack::~ModifiedAnalysisTrack ( )

Definition at line 842 of file Effect.cpp.

843{
844 if (mpEffect) {
845 // not committed -- DELETE the label track
846 // mpOrigTrack came from mTracks which we own but expose as const to subclasses
847 // So it's okay that we cast it back to const
849 }
850}

Member Function Documentation

◆ Commit()

void Effect::ModifiedAnalysisTrack::Commit ( )

Definition at line 837 of file Effect.cpp.

838{
839 mpEffect = nullptr;
840}

◆ get()

LabelTrack * Effect::ModifiedAnalysisTrack::get ( ) const
inline

Definition at line 364 of file Effect.h.

364{ return mpTrack; }

Member Data Documentation

◆ Effect

friend Effect::ModifiedAnalysisTrack::Effect
private

Definition at line 352 of file Effect.h.

◆ mpEffect

Effect* Effect::ModifiedAnalysisTrack::mpEffect {}
private

Definition at line 373 of file Effect.h.

◆ mpOrigTrack

std::shared_ptr<Track> Effect::ModifiedAnalysisTrack::mpOrigTrack {}
private

Definition at line 375 of file Effect.h.

Referenced by ModifiedAnalysisTrack().

◆ mpTrack

LabelTrack* Effect::ModifiedAnalysisTrack::mpTrack {}
private

Definition at line 374 of file Effect.h.

Referenced by ModifiedAnalysisTrack().


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