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 2140 of file Effect.cpp.

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

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 2161 of file Effect.cpp.

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

◆ ~ModifiedAnalysisTrack()

Effect::ModifiedAnalysisTrack::~ModifiedAnalysisTrack ( )

Definition at line 2174 of file Effect.cpp.

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

Member Function Documentation

◆ Commit()

void Effect::ModifiedAnalysisTrack::Commit ( )

Definition at line 2169 of file Effect.cpp.

2170 {
2171  mpEffect = nullptr;
2172 }

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:83
TrackList::Replace
ListOfTracks::value_type Replace(Track *t, const ListOfTracks::value_type &with)
Definition: Track.cpp:758
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