Audacity  2.2.0
UndoManager Class Reference

Works with HistoryWindow to provide the Undo functionality. More...

#include <UndoManager.h>

Public Member Functions

 UndoManager ()
 
 ~UndoManager ()
 
void PushState (const TrackList *l, const SelectedRegion &selectedRegion, const std::shared_ptr< Tags > &tags, const wxString &longDescription, const wxString &shortDescription, UndoPush flags=UndoPush::AUTOSAVE)
 
void ModifyState (const TrackList *l, const SelectedRegion &selectedRegion, const std::shared_ptr< Tags > &tags)
 
void ClearStates ()
 
void RemoveStates (int num)
 
void RemoveStateAt (int n)
 
unsigned int GetNumStates ()
 
unsigned int GetCurrentState ()
 
void StopConsolidating ()
 
void GetShortDescription (unsigned int n, wxString *desc)
 
wxLongLong_t GetLongDescription (unsigned int n, wxString *desc, wxString *size)
 
void SetLongDescription (unsigned int n, const wxString &desc)
 
const UndoStateSetStateTo (unsigned int n, SelectedRegion *selectedRegion)
 
const UndoStateUndo (SelectedRegion *selectedRegion)
 
const UndoStateRedo (SelectedRegion *selectedRegion)
 
bool UndoAvailable ()
 
bool RedoAvailable ()
 
bool UnsavedChanges ()
 
void StateSaved ()
 
wxLongLong_t GetClipboardSpaceUsage () const
 
void CalculateSpaceUsage ()
 
void SetODChangesFlag ()
 to mark as unsaved changes without changing the state/tracks. More...
 
bool HasODChangesFlag ()
 
void ResetODChangesFlag ()
 

Private Attributes

int current
 
int saved
 
UndoStack stack
 
wxString lastAction
 
bool mayConsolidate { false }
 
SpaceArray space
 
unsigned long long mClipboardSpaceUsage {}
 
bool mODChanges
 
ODLock mODChangesMutex
 

Detailed Description

Works with HistoryWindow to provide the Undo functionality.

Constructor & Destructor Documentation

UndoManager::UndoManager ( )

References current, ResetODChangesFlag(), and saved.

UndoManager::~UndoManager ( )

References ClearStates().

Member Function Documentation

void UndoManager::CalculateSpaceUsage ( )
wxLongLong_t UndoManager::GetClipboardSpaceUsage ( ) const
inline

Referenced by HistoryWindow::DoUpdate().

unsigned int UndoManager::GetCurrentState ( )
wxLongLong_t UndoManager::GetLongDescription ( unsigned int  n,
wxString *  desc,
wxString *  size 
)

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

Referenced by HistoryWindow::DoUpdate().

unsigned int UndoManager::GetNumStates ( )

References stack.

Referenced by HistoryWindow::DoUpdate().

void UndoManager::GetShortDescription ( unsigned int  n,
wxString *  desc 
)

References stack.

Referenced by AudacityProject::ModifyUndoMenuItems().

bool UndoManager::HasODChangesFlag ( )

References mODChanges, and mODChangesMutex.

Referenced by UnsavedChanges().

void UndoManager::ModifyState ( const TrackList l,
const SelectedRegion selectedRegion,
const std::shared_ptr< Tags > &  tags 
)
void UndoManager::PushState ( const TrackList l,
const SelectedRegion selectedRegion,
const std::shared_ptr< Tags > &  tags,
const wxString &  longDescription,
const wxString &  shortDescription,
UndoPush  flags = UndoPush::AUTOSAVE 
)
const UndoState & UndoManager::Redo ( SelectedRegion selectedRegion)
bool UndoManager::RedoAvailable ( )

References current, and stack.

Referenced by AudacityProject::GetUpdateFlags(), and Redo().

void UndoManager::RemoveStateAt ( int  n)

References stack.

Referenced by PushState(), and RemoveStates().

void UndoManager::RemoveStates ( int  num)

References current, RemoveStateAt(), and saved.

Referenced by ClearStates(), and HistoryWindow::OnDiscard().

void UndoManager::ResetODChangesFlag ( )

References mODChanges, and mODChangesMutex.

Referenced by StateSaved(), and UndoManager().

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

References desc, and stack.

void UndoManager::SetODChangesFlag ( )

to mark as unsaved changes without changing the state/tracks.

References mODChanges, and mODChangesMutex.

const UndoState & UndoManager::SetStateTo ( unsigned int  n,
SelectedRegion selectedRegion 
)
void UndoManager::StateSaved ( )
void UndoManager::StopConsolidating ( )
inline
const UndoState & UndoManager::Undo ( SelectedRegion selectedRegion)
bool UndoManager::UndoAvailable ( )

References current.

Referenced by AudacityProject::GetUpdateFlags(), and Undo().

bool UndoManager::UnsavedChanges ( )

Member Data Documentation

wxString UndoManager::lastAction
private

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

bool UndoManager::mayConsolidate { false }
private

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

unsigned long long UndoManager::mClipboardSpaceUsage {}
private

Referenced by CalculateSpaceUsage().

bool UndoManager::mODChanges
private
ODLock UndoManager::mODChangesMutex
private
int UndoManager::saved
private
SpaceArray UndoManager::space
private

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