Audacity  3.0.3
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
UndoManager Class Referencefinal

Maintain a non-persistent list of states of the project, to support undo and redo commands. More...

#include <UndoManager.h>

Inheritance diagram for UndoManager:
[legend]
Collaboration diagram for UndoManager:
[legend]

Public Types

using Consumer = std::function< void(const UndoStackElem &) >
 

Public Member Functions

 UndoManager (AudacityProject &project)
 
 ~UndoManager ()
 
 UndoManager (const UndoManager &)=delete
 
UndoManageroperator= (const UndoManager &)=delete
 
void PushState (const TrackList *l, const SelectedRegion &selectedRegion, const std::shared_ptr< Tags > &tags, const TranslatableString &longDescription, const TranslatableString &shortDescription, UndoPush flags=UndoPush::NONE)
 
void ModifyState (const TrackList *l, const SelectedRegion &selectedRegion, const std::shared_ptr< Tags > &tags)
 
void RenameState (int state, const TranslatableString &longDescription, const TranslatableString &shortDescription)
 
void AbandonRedo ()
 
void ClearStates ()
 
void RemoveStates (size_t begin, size_t end)
 
unsigned int GetNumStates ()
 
unsigned int GetCurrentState ()
 
void StopConsolidating ()
 
void GetShortDescription (unsigned int n, TranslatableString *desc)
 
wxLongLong_t GetLongDescription (unsigned int n, TranslatableString *desc, TranslatableString *size)
 
void SetLongDescription (unsigned int n, const TranslatableString &desc)
 
void SetStateTo (unsigned int n, const Consumer &consumer)
 
void Undo (const Consumer &consumer)
 
void Redo (const Consumer &consumer)
 
void VisitStates (const Consumer &consumer, bool newestFirst)
 Give read-only access to all states. More...
 
void VisitStates (const Consumer &consumer, size_t begin, size_t end)
 Visit a specified range of states. More...
 
bool UndoAvailable ()
 
bool RedoAvailable ()
 
bool UnsavedChanges () const
 
int GetSavedState () const
 
void StateSaved ()
 
wxLongLong_t GetClipboardSpaceUsage () const
 
void CalculateSpaceUsage ()
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static UndoManagerGet (AudacityProject &project)
 
static const UndoManagerGet (const AudacityProject &project)
 

Private Member Functions

size_t EstimateRemovedBlocks (size_t begin, size_t end)
 Just to find a denominator for a progress indicator. More...
 
void RemoveStateAt (int n)
 

Private Attributes

AudacityProjectmProject
 
int current
 
int saved
 
UndoStack stack
 
TranslatableString lastAction
 
bool mayConsolidate { false }
 
SpaceArray space
 
unsigned long long mClipboardSpaceUsage {}
 

Detailed Description

Maintain a non-persistent list of states of the project, to support undo and redo commands.

Works with HistoryDialog to provide the Undo functionality.

The history should be cleared before destruction

Definition at line 135 of file UndoManager.h.

Member Typedef Documentation

◆ Consumer

using UndoManager::Consumer = std::function< void( const UndoStackElem & ) >

Definition at line 180 of file UndoManager.h.

Constructor & Destructor Documentation

◆ UndoManager() [1/2]

UndoManager::UndoManager ( AudacityProject project)
explicit

Definition at line 67 of file UndoManager.cpp.

68  : mProject{ project }
69 {
70  current = -1;
71  saved = -1;
72 }

◆ ~UndoManager()

UndoManager::~UndoManager ( )

Definition at line 74 of file UndoManager.cpp.

75 {
76  wxASSERT( stack.empty() );
77 }

References stack.

◆ UndoManager() [2/2]

UndoManager::UndoManager ( const UndoManager )
delete

Member Function Documentation

◆ AbandonRedo()

void UndoManager::AbandonRedo ( )

Definition at line 374 of file UndoManager.cpp.

375 {
376  if (saved > current) {
377  saved = -1;
378  }
379  RemoveStates( current + 1, stack.size() );
380 }

References current, RemoveStates(), saved, and stack.

Referenced by PushState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateSpaceUsage()

void UndoManager::CalculateSpaceUsage ( )

Definition at line 94 of file UndoManager.cpp.

95 {
96  space.clear();
97  space.resize(stack.size(), 0);
98 
99  SampleBlockIDSet seen;
100 
101  // After copies and pastes, a block file may be used in more than
102  // one place in one undo history state, and it may be used in more than
103  // one undo history state. It might even be used in two states, but not
104  // in another state that is between them -- as when you have state A,
105  // then make a cut to get state B, but then paste it back into state C.
106 
107  // So be sure to count each block file once only, in the last undo item that
108  // contains it.
109 
110  // Why the last and not the first? Because the user of the History dialog
111  // may DELETE undo states, oldest first. To reclaim disk space you must
112  // DELETE all states containing the block file. So the block file's
113  // contribution to space usage should be counted only in that latest state.
114 
115  for (size_t nn = stack.size(); nn--;)
116  {
117  // Scan all tracks at current level
118  auto &tracks = *stack[nn]->state.tracks;
119  space[nn] = CalculateUsage(tracks, seen);
120  }
121 
122  // Count the usage of the clipboard separately, using another set. Do not
123  // multiple-count any block occurring multiple times within the clipboard.
124  seen.clear();
126  Clipboard::Get().GetTracks(), seen);
127 
128  //TIMER_STOP( space_calc );
129 }

References anonymous_namespace{UndoManager.cpp}::CalculateUsage(), Clipboard::Get(), mClipboardSpaceUsage, space, and stack.

Referenced by HistoryDialog::DoUpdate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearStates()

void UndoManager::ClearStates ( )

Definition at line 253 of file UndoManager.cpp.

254 {
255  RemoveStates(0, stack.size());
256  current = -1;
257  saved = -1;
258 }

References current, RemoveStates(), saved, and stack.

Referenced by ProjectManager::OnCloseWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EstimateRemovedBlocks()

size_t UndoManager::EstimateRemovedBlocks ( size_t  begin,
size_t  end 
)
private

Just to find a denominator for a progress indicator.

This estimate procedure should in fact be exact

Definition at line 176 of file UndoManager.cpp.

177 {
178  if (begin == end)
179  return 0;
180 
181  // Collect ids that survive
182  SampleBlockIDSet wontDelete;
183  auto f = [&](const auto &p){
184  InspectBlocks(*p->state.tracks, {}, &wontDelete);
185  };
186  auto first = stack.begin(), last = stack.end();
187  std::for_each( first, first + begin, f );
188  std::for_each( first + end, last, f );
189  if (saved >= 0)
190  std::for_each( first + saved, first + saved + 1, f );
191  InspectBlocks(TrackList::Get(mProject), {}, &wontDelete);
192 
193  // Collect ids that won't survive (and are not negative pseudo ids)
194  SampleBlockIDSet seen, mayDelete;
195  std::for_each( first + begin, first + end, [&](const auto &p){
196  auto &tracks = *p->state.tracks;
197  InspectBlocks(tracks, [&]( const SampleBlock &block ){
198  auto id = block.GetBlockID();
199  if ( id > 0 && !wontDelete.count( id ) )
200  mayDelete.insert( id );
201  },
202  &seen);
203  } );
204  return mayDelete.size();
205 }

References TrackList::Get(), SampleBlock::GetBlockID(), InspectBlocks(), mProject, saved, and stack.

Referenced by RemoveStates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

UndoManager & UndoManager::Get ( AudacityProject project)
static

◆ Get() [2/2]

const UndoManager & UndoManager::Get ( const AudacityProject project)
static

Definition at line 62 of file UndoManager.cpp.

63 {
64  return Get( const_cast< AudacityProject & >( project ) );
65 }

References Get().

Here is the call graph for this function:

◆ GetClipboardSpaceUsage()

wxLongLong_t UndoManager::GetClipboardSpaceUsage ( ) const
inline

Definition at line 202 of file UndoManager.h.

203  { return mClipboardSpaceUsage; }

Referenced by HistoryDialog::DoUpdate().

Here is the caller graph for this function:

◆ GetCurrentState()

unsigned int UndoManager::GetCurrentState ( )

Definition at line 265 of file UndoManager.cpp.

266 {
267  return current;
268 }

References current.

Referenced by HistoryDialog::DoUpdate(), and HistoryDialog::Populate().

Here is the caller graph for this function:

◆ GetLongDescription()

wxLongLong_t UndoManager::GetLongDescription ( unsigned int  n,
TranslatableString desc,
TranslatableString size 
)

Definition at line 131 of file UndoManager.cpp.

133 {
134  wxASSERT(n < stack.size());
135  wxASSERT(space.size() == stack.size());
136 
137  *desc = stack[n]->description;
138 
139  *size = Internat::FormatSize(space[n]);
140 
141  return space[n];
142 }

References desc, Internat::FormatSize(), space, and stack.

Referenced by HistoryDialog::DoUpdate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumStates()

unsigned int UndoManager::GetNumStates ( )

Definition at line 260 of file UndoManager.cpp.

261 {
262  return stack.size();
263 }

References stack.

Referenced by HistoryDialog::DoUpdate().

Here is the caller graph for this function:

◆ GetSavedState()

int UndoManager::GetSavedState ( ) const

Definition at line 477 of file UndoManager.cpp.

478 {
479  return saved;
480 }

References saved.

◆ GetShortDescription()

void UndoManager::GetShortDescription ( unsigned int  n,
TranslatableString desc 
)

Definition at line 144 of file UndoManager.cpp.

145 {
146  wxASSERT(n < stack.size());
147 
148  *desc = stack[n]->shortDescription;
149 }

References desc, and stack.

◆ ModifyState()

void UndoManager::ModifyState ( const TrackList l,
const SelectedRegion selectedRegion,
const std::shared_ptr< Tags > &  tags 
)

Definition at line 280 of file UndoManager.cpp.

283 {
284  if (current == wxNOT_FOUND) {
285  return;
286  }
287 
288 // SonifyBeginModifyState();
289  // Delete current -- not necessary, but let's reclaim space early
290  stack[current]->state.tracks.reset();
291 
292  // Duplicate
293  auto tracksCopy = TrackList::Create( nullptr );
294  for (auto t : *l) {
295  if ( t->GetId() == TrackId{} )
296  // Don't copy a pending added track
297  continue;
298  tracksCopy->Add(t->Duplicate());
299  }
300 
301  // Replace
302  stack[current]->state.tracks = std::move(tracksCopy);
303  stack[current]->state.tags = tags;
304 
305  stack[current]->state.selectedRegion = selectedRegion;
306 // SonifyEndModifyState();
307 
308  // wxWidgets will own the event object
309  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_MODIFIED } );
310 }

References TrackList::Create(), current, mProject, safenew, and stack.

Referenced by PushState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

UndoManager& UndoManager::operator= ( const UndoManager )
delete

◆ PushState()

void UndoManager::PushState ( const TrackList l,
const SelectedRegion selectedRegion,
const std::shared_ptr< Tags > &  tags,
const TranslatableString longDescription,
const TranslatableString shortDescription,
UndoPush  flags = UndoPush::NONE 
)

Definition at line 326 of file UndoManager.cpp.

332 {
333  if ( (flags & UndoPush::CONSOLIDATE) != UndoPush::NONE &&
334  // compare full translations not msgids!
335  lastAction.Translation() == longDescription.Translation() &&
336  mayConsolidate ) {
337  ModifyState(l, selectedRegion, tags);
338  // MB: If the "saved" state was modified by ModifyState, reset
339  // it so that UnsavedChanges returns true.
340  if (current == saved) {
341  saved = -1;
342  }
343  return;
344  }
345 
346  auto tracksCopy = TrackList::Create( nullptr );
347  for (auto t : *l) {
348  if ( t->GetId() == TrackId{} )
349  // Don't copy a pending added track
350  continue;
351  tracksCopy->Add(t->Duplicate());
352  }
353 
354  mayConsolidate = true;
355 
356  AbandonRedo();
357 
358  // Assume tags was duplicated before any changes.
359  // Just save a NEW shared_ptr to it.
360  stack.push_back(
361  std::make_unique<UndoStackElem>
362  (std::move(tracksCopy),
363  longDescription, shortDescription, selectedRegion, tags)
364  );
365 
366  current++;
367 
368  lastAction = longDescription;
369 
370  // wxWidgets will own the event object
371  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_PUSHED } );
372 }

References AbandonRedo(), CONSOLIDATE, TrackList::Create(), current, lastAction, mayConsolidate, ModifyState(), mProject, NONE, safenew, saved, stack, and TranslatableString::Translation().

Here is the call graph for this function:

◆ Redo()

void UndoManager::Redo ( const Consumer consumer)

Definition at line 412 of file UndoManager.cpp.

413 {
414  wxASSERT(RedoAvailable());
415 
416  current++;
417 
418  /*
419  if (!RedoAvailable()) {
420  *sel0 = stack[current]->sel0;
421  *sel1 = stack[current]->sel1;
422  }
423  else {
424  current++;
425  *sel0 = stack[current]->sel0;
426  *sel1 = stack[current]->sel1;
427  current--;
428  }
429  */
430 
431  lastAction = {};
432  mayConsolidate = false;
433 
434  consumer( *stack[current] );
435 
436  // wxWidgets will own the event object
437  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_OR_REDO } );
438 }

References current, lastAction, mayConsolidate, mProject, RedoAvailable(), safenew, and stack.

Here is the call graph for this function:

◆ RedoAvailable()

bool UndoManager::RedoAvailable ( )

Definition at line 275 of file UndoManager.cpp.

276 {
277  return (current < (int)stack.size() - 1);
278 }

References current, and stack.

Referenced by Redo().

Here is the caller graph for this function:

◆ RemoveStateAt()

void UndoManager::RemoveStateAt ( int  n)
private

Definition at line 161 of file UndoManager.cpp.

162 {
163  // Remove the state from the array first, and destroy it at function exit.
164  // Because in case of callbacks from destruction of Sample blocks, there
165  // might be a yield to GUI and other events might inspect the undo stack
166  // (such as history window update). Don't expose an inconsistent stack
167  // state.
168  auto iter = stack.begin() + n;
169  auto state = std::move(*iter);
170  stack.erase(iter);
171 }

References stack.

Referenced by RemoveStates().

Here is the caller graph for this function:

◆ RemoveStates()

void UndoManager::RemoveStates ( size_t  begin,
size_t  end 
)
Parameters
begininclusive start of range
endexclusive end of range

Definition at line 207 of file UndoManager.cpp.

208 {
209  // Install a callback function that updates a progress indicator
210  unsigned long long nToDelete = EstimateRemovedBlocks(begin, end),
211  nDeleted = 0;
212  ProgressDialog dialog{ XO("Progress"), XO("Discarding undo/redo history"),
214  };
215  auto callback = [&](const SampleBlock &){
216  dialog.Update(++nDeleted, nToDelete);
217  };
218  auto &trackFactory = WaveTrackFactory::Get( mProject );
219  auto &pSampleBlockFactory = trackFactory.GetSampleBlockFactory();
220  auto prevCallback =
221  pSampleBlockFactory->SetBlockDeletionCallback(callback);
222  auto cleanup = finally([&]{ pSampleBlockFactory->SetBlockDeletionCallback( prevCallback ); });
223 
224  // Wrap the whole in a savepoint for better performance
226  auto pConnection = ConnectionPtr::Get(mProject).mpConnection.get();
227  if (pConnection)
228  pTrans.emplace(*pConnection, "DiscardingUndoStates");
229 
230  for (size_t ii = begin; ii < end; ++ii) {
231  RemoveStateAt(begin);
232 
233  if (current > begin)
234  --current;
235  if (saved > static_cast<int>(begin))
236  --saved;
237  }
238 
239  // Success, commit the savepoint
240  if (pTrans)
241  pTrans->Commit();
242 
243  if (begin != end)
244  // wxWidgets will own the event object
245  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_PURGE } );
246 
247  // Check sanity
248  wxASSERT_MSG(
249  nDeleted == 0 || // maybe bypassing all deletions
250  nDeleted == nToDelete, "Block count was misestimated");
251 }

References TransactionScope::Commit(), current, Optional< X >::emplace(), EstimateRemovedBlocks(), ConnectionPtr::Get(), WaveTrackFactory::Get(), ConnectionPtr::mpConnection, mProject, pdlgHideCancelButton, pdlgHideStopButton, RemoveStateAt(), safenew, saved, and XO.

Referenced by AbandonRedo(), ClearStates(), and HistoryDialog::OnDiscard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RenameState()

void UndoManager::RenameState ( int  state,
const TranslatableString longDescription,
const TranslatableString shortDescription 
)

Definition at line 312 of file UndoManager.cpp.

315 {
316  if (state >= 0 && state < stack.size() ) {
317  auto &theState = *stack[state];
318  theState.description = longDescription;
319  theState.shortDescription = shortDescription;
320 
321  // wxWidgets will own the event object
322  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_RENAMED } );
323  }
324 }

References mProject, safenew, and stack.

◆ SetLongDescription()

void UndoManager::SetLongDescription ( unsigned int  n,
const TranslatableString desc 
)

Definition at line 151 of file UndoManager.cpp.

153 {
154  n -= 1;
155 
156  wxASSERT(n < stack.size());
157 
158  stack[n]->description = desc;
159 }

References desc, and stack.

◆ SetStateTo()

void UndoManager::SetStateTo ( unsigned int  n,
const Consumer consumer 
)

Definition at line 382 of file UndoManager.cpp.

383 {
384  wxASSERT(n < stack.size());
385 
386  current = n;
387 
388  lastAction = {};
389  mayConsolidate = false;
390 
391  consumer( *stack[current] );
392 
393  // wxWidgets will own the event object
394  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_RESET } );
395 }

References current, lastAction, mayConsolidate, mProject, safenew, and stack.

◆ StateSaved()

void UndoManager::StateSaved ( )

Definition at line 472 of file UndoManager.cpp.

473 {
474  saved = current;
475 }

References current, and saved.

Referenced by ProjectFileManager::DoSave().

Here is the caller graph for this function:

◆ StopConsolidating()

void UndoManager::StopConsolidating ( )
inline

Definition at line 169 of file UndoManager.h.

169 { mayConsolidate = false; }

◆ Undo()

void UndoManager::Undo ( const Consumer consumer)

Definition at line 397 of file UndoManager.cpp.

398 {
399  wxASSERT(UndoAvailable());
400 
401  current--;
402 
403  lastAction = {};
404  mayConsolidate = false;
405 
406  consumer( *stack[current] );
407 
408  // wxWidgets will own the event object
409  mProject.QueueEvent( safenew wxCommandEvent{ EVT_UNDO_OR_REDO } );
410 }

References current, lastAction, mayConsolidate, mProject, safenew, stack, and UndoAvailable().

Here is the call graph for this function:

◆ UndoAvailable()

bool UndoManager::UndoAvailable ( )

Definition at line 270 of file UndoManager.cpp.

271 {
272  return (current > 0);
273 }

References current.

Referenced by Undo().

Here is the caller graph for this function:

◆ UnsavedChanges()

bool UndoManager::UnsavedChanges ( ) const

Definition at line 467 of file UndoManager.cpp.

468 {
469  return (saved != current);
470 }

References current, and saved.

Referenced by ProjectFileManager::CompactProjectOnClose().

Here is the caller graph for this function:

◆ VisitStates() [1/2]

void UndoManager::VisitStates ( const Consumer consumer,
bool  newestFirst 
)

Give read-only access to all states.

Definition at line 440 of file UndoManager.cpp.

441 {
442  auto fn = [&]( decltype(stack[0]) &ptr ){ consumer( *ptr ); };
443  if (newestFirst)
444  std::for_each(stack.rbegin(), stack.rend(), fn);
445  else
446  std::for_each(stack.begin(), stack.end(), fn);
447 }

References fn, and stack.

◆ VisitStates() [2/2]

void UndoManager::VisitStates ( const Consumer consumer,
size_t  begin,
size_t  end 
)

Visit a specified range of states.

end is exclusive; visit newer states first if end < begin

Definition at line 449 of file UndoManager.cpp.

451 {
452  auto size = stack.size();
453  if (begin < end) {
454  end = std::min(end, size);
455  for (auto ii = begin; ii < end; ++ii)
456  consumer(*stack[ii]);
457  }
458  else {
459  if (size == 0)
460  return;
461  begin = std::min(begin, size - 1);
462  for (auto ii = begin; ii > end; --ii)
463  consumer(*stack[ii]);
464  }
465 }

References min(), and stack.

Here is the call graph for this function:

Member Data Documentation

◆ current

int UndoManager::current
private

◆ lastAction

TranslatableString UndoManager::lastAction
private

Definition at line 220 of file UndoManager.h.

Referenced by PushState(), Redo(), SetStateTo(), and Undo().

◆ mayConsolidate

bool UndoManager::mayConsolidate { false }
private

Definition at line 221 of file UndoManager.h.

Referenced by PushState(), Redo(), SetStateTo(), and Undo().

◆ mClipboardSpaceUsage

unsigned long long UndoManager::mClipboardSpaceUsage {}
private

Definition at line 224 of file UndoManager.h.

Referenced by CalculateSpaceUsage().

◆ mProject

AudacityProject& UndoManager::mProject
private

◆ saved

int UndoManager::saved
private

◆ space

SpaceArray UndoManager::space
private

Definition at line 223 of file UndoManager.h.

Referenced by CalculateSpaceUsage(), and GetLongDescription().

◆ stack

UndoStack UndoManager::stack
private

The documentation for this class was generated from the following files:
Optional::emplace
X & emplace(Args &&... args)
Definition: MemoryX.h:193
WaveTrackFactory::Get
static WaveTrackFactory & Get(AudacityProject &project)
Definition: WaveTrack.cpp:2901
SampleBlock::GetBlockID
virtual SampleBlockID GetBlockID() const =0
SampleBlockIDSet
std::unordered_set< SampleBlockID > SampleBlockIDSet
Definition: WaveTrack.h:690
Optional
Like a smart pointer, allows for object to not exist (nullptr)
Definition: MemoryX.h:144
fn
static const auto fn
Definition: WaveformView.cpp:1113
UndoManager::saved
int saved
Definition: UndoManager.h:217
UndoManager::mProject
AudacityProject & mProject
Definition: UndoManager.h:214
UndoManager::RemoveStateAt
void RemoveStateAt(int n)
Definition: UndoManager.cpp:161
UndoManager::lastAction
TranslatableString lastAction
Definition: UndoManager.h:220
UndoManager::mayConsolidate
bool mayConsolidate
Definition: UndoManager.h:221
pdlgHideStopButton
@ pdlgHideStopButton
Definition: ProgressDialog.h:38
UndoManager::RedoAvailable
bool RedoAvailable()
Definition: UndoManager.cpp:275
UndoPush::NONE
@ NONE
XO
#define XO(s)
Definition: Internat.h:31
UndoManager::UndoAvailable
bool UndoAvailable()
Definition: UndoManager.cpp:270
InspectBlocks
void InspectBlocks(const TrackList &tracks, BlockInspector inspector, SampleBlockIDSet *pIDs)
Definition: WaveTrack.cpp:2882
desc
const TranslatableString desc
Definition: ExportPCM.cpp:58
UndoManager::AbandonRedo
void AbandonRedo()
Definition: UndoManager.cpp:374
ProgressDialog
ProgressDialog Class.
Definition: ProgressDialog.h:51
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: UndoManager.cpp:52
anonymous_namespace{UndoManager.cpp}::CalculateUsage
SpaceArray::value_type CalculateUsage(const TrackList &tracks, SampleBlockIDSet &seen)
Definition: UndoManager.cpp:81
UndoManager::EstimateRemovedBlocks
size_t EstimateRemovedBlocks(size_t begin, size_t end)
Just to find a denominator for a progress indicator.
Definition: UndoManager.cpp:176
Internat::FormatSize
static TranslatableString FormatSize(wxLongLong size)
Convert a number to a string while formatting it in bytes, KB, MB, GB.
Definition: Internat.cpp:203
UndoManager::stack
UndoStack stack
Definition: UndoManager.h:218
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
Clipboard::Get
static Clipboard & Get()
Definition: Clipboard.cpp:29
UndoManager::current
int current
Definition: UndoManager.h:216
TrackId
An in-session identifier of track objects across undo states. It does not persist between sessions.
Definition: Track.h:165
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
ConnectionPtr::Get
static ConnectionPtr & Get(AudacityProject &project)
Definition: DBConnection.cpp:693
UndoManager::Get
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:57
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
SampleBlock
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
Definition: SampleBlock.h:45
UndoManager::mClipboardSpaceUsage
unsigned long long mClipboardSpaceUsage
Definition: UndoManager.h:224
UndoPush::CONSOLIDATE
@ CONSOLIDATE
TrackList::Create
static std::shared_ptr< TrackList > Create(AudacityProject *pOwner)
Definition: Track.cpp:523
ConnectionPtr::mpConnection
Connection mpConnection
Definition: DBConnection.h:169
UndoManager::ModifyState
void ModifyState(const TrackList *l, const SelectedRegion &selectedRegion, const std::shared_ptr< Tags > &tags)
Definition: UndoManager.cpp:280
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
TransactionScope::Commit
bool Commit()
Definition: DBConnection.cpp:658
safenew
#define safenew
Definition: MemoryX.h:10
UndoManager
Maintain a non-persistent list of states of the project, to support undo and redo commands.
Definition: UndoManager.h:137
UndoManager::RemoveStates
void RemoveStates(size_t begin, size_t end)
Definition: UndoManager.cpp:207
pdlgHideCancelButton
@ pdlgHideCancelButton
Definition: ProgressDialog.h:39
UndoManager::space
SpaceArray space
Definition: UndoManager.h:223