Audacity  3.0.3
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 410 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 2141 of file Effect.cpp.

2143  : mpEffect(pEffect)
2144 {
2145  // copy LabelTrack here, so it can be undone on cancel
2146  auto newTrack = pOrigTrack->Copy(pOrigTrack->GetStartTime(), pOrigTrack->GetEndTime());
2147 
2148  mpTrack = static_cast<LabelTrack*>(newTrack.get());
2149 
2150  // Why doesn't LabelTrack::Copy complete the job? :
2151  mpTrack->SetOffset(pOrigTrack->GetStartTime());
2152  if (!name.empty())
2153  mpTrack->SetName(name);
2154 
2155  // mpOrigTrack came from mTracks which we own but expose as const to subclasses
2156  // So it's okay that we cast it back to const
2157  mpOrigTrack =
2158  pEffect->mTracks->Replace(const_cast<LabelTrack*>(pOrigTrack),
2159  newTrack );
2160 }

References LabelTrack::Copy(), TranslatableString::empty(), LabelTrack::GetEndTime(), LabelTrack::GetStartTime(), mpOrigTrack, mpTrack, Effect::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 2162 of file Effect.cpp.

2163 {
2164  mpEffect = that.mpEffect;
2165  mpTrack = that.mpTrack;
2166  mpOrigTrack = std::move(that.mpOrigTrack);
2167  that.Commit();
2168 }

◆ ~ModifiedAnalysisTrack()

Effect::ModifiedAnalysisTrack::~ModifiedAnalysisTrack ( )

Definition at line 2175 of file Effect.cpp.

2176 {
2177  if (mpEffect) {
2178  // not committed -- DELETE the label track
2179  // mpOrigTrack came from mTracks which we own but expose as const to subclasses
2180  // So it's okay that we cast it back to const
2182  }
2183 }

Member Function Documentation

◆ Commit()

void Effect::ModifiedAnalysisTrack::Commit ( )

Definition at line 2170 of file Effect.cpp.

2171 {
2172  mpEffect = nullptr;
2173 }

Referenced by EffectFindClipping::Process().

Here is the caller graph for this function:

◆ get()

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

Definition at line 423 of file Effect.h.

423 { return mpTrack; }

Referenced by EffectFindClipping::Process().

Here is the caller graph for this function:

Member Data Documentation

◆ Effect

friend Effect::ModifiedAnalysisTrack::Effect
private

Definition at line 411 of file Effect.h.

◆ mpEffect

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

Definition at line 432 of file Effect.h.

◆ mpOrigTrack

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

Definition at line 434 of file Effect.h.

Referenced by ModifiedAnalysisTrack().

◆ mpTrack

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

Definition at line 433 of file Effect.h.

Referenced by ModifiedAnalysisTrack().


The documentation for this class was generated from the following files:
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
Effect::ModifiedAnalysisTrack::mpEffect
Effect * mpEffect
Definition: Effect.h:432
LabelTrack::GetStartTime
double GetStartTime() const override
Definition: LabelTrack.cpp:316
Effect::mTracks
TrackList * mTracks
Definition: Effect.h:507
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
LabelTrack::GetEndTime
double GetEndTime() const override
Definition: LabelTrack.cpp:324
LabelTrack::SetOffset
void SetOffset(double dOffset) override
Definition: LabelTrack.cpp:146
name
const TranslatableString name
Definition: Distortion.cpp:98
Effect::ModifiedAnalysisTrack::mpTrack
LabelTrack * mpTrack
Definition: Effect.h:433
Track::SetName
void SetName(const wxString &n)
Definition: Track.cpp:82
TrackList::Replace
ListOfTracks::value_type Replace(Track *t, const ListOfTracks::value_type &with)
Definition: Track.cpp:718
LabelTrack::Copy
Track::Holder Copy(double t0, double t1, bool forClipboard=true) const override
Definition: LabelTrack.cpp:694
Effect::ModifiedAnalysisTrack::mpOrigTrack
std::shared_ptr< Track > mpOrigTrack
Definition: Effect.h:434