Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
WaveClip::Transaction Struct Reference

Restores state when an update loop over mSequences fails midway. More...

Collaboration diagram for WaveClip::Transaction:
[legend]

Public Member Functions

 Transaction (WaveClip &clip)
 
 ~Transaction ()
 
void Commit ()
 

Public Attributes

WaveClipclip
 
std::vector< std::unique_ptr< Sequence > > sequences
 
const double mTrimLeft
 
const double mTrimRight
 
bool committed { false }
 

Detailed Description

Restores state when an update loop over mSequences fails midway.

Definition at line 930 of file WaveClip.h.

Constructor & Destructor Documentation

◆ Transaction()

WaveClip::Transaction::Transaction ( WaveClip clip)
explicit

Does not copy un-flushed append buffer data

Definition at line 2050 of file WaveClip.cpp.

2051 : clip{ clip }
2054{
2055 sequences.reserve(clip.mSequences.size());
2056 auto &factory = clip.GetFactory();
2057 for (auto &pSequence : clip.mSequences)
2058 sequences.push_back(
2060 std::make_unique<Sequence>(*pSequence, factory));
2061}
static RegisteredToolbarFactory factory
double mTrimRight
Definition: WaveClip.h:946
const SampleBlockFactoryPtr & GetFactory() const
Definition: WaveClip.cpp:713
double mTrimLeft
Definition: WaveClip.h:945
std::vector< std::unique_ptr< Sequence > > mSequences
Definition: WaveClip.h:964
const double mTrimLeft
Definition: WaveClip.h:937
std::vector< std::unique_ptr< Sequence > > sequences
Definition: WaveClip.h:936
const double mTrimRight
Definition: WaveClip.h:938

References clip, factory, WaveClip::GetFactory(), WaveClip::mSequences, and sequences.

Here is the call graph for this function:

◆ ~Transaction()

WaveClip::Transaction::~Transaction ( )

Definition at line 2063 of file WaveClip.cpp.

2064{
2065 if (!committed) {
2069 }
2070}

References WaveClip::mTrimLeft, and WaveClip::mTrimRight.

Member Function Documentation

◆ Commit()

void WaveClip::Transaction::Commit ( )
inline

Definition at line 933 of file WaveClip.h.

933{ committed = true; }

Referenced by WaveClip::Append(), WaveClip::Flush(), and WaveClip::SetSilence().

Here is the caller graph for this function:

Member Data Documentation

◆ clip

WaveClip& WaveClip::Transaction::clip

Definition at line 935 of file WaveClip.h.

Referenced by Transaction().

◆ committed

bool WaveClip::Transaction::committed { false }

Definition at line 939 of file WaveClip.h.

◆ mTrimLeft

const double WaveClip::Transaction::mTrimLeft

Definition at line 937 of file WaveClip.h.

◆ mTrimRight

const double WaveClip::Transaction::mTrimRight

Definition at line 938 of file WaveClip.h.

◆ sequences

std::vector<std::unique_ptr<Sequence> > WaveClip::Transaction::sequences

Definition at line 936 of file WaveClip.h.

Referenced by Transaction().


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