Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ProjectHistory Class Referencefinal

#include <ProjectHistory.h>

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

Classes

struct  AutoSave
 

Public Member Functions

 ProjectHistory (AudacityProject &project)
 
 ProjectHistory (const ProjectHistory &)=delete
 
ProjectHistoryoperator= (const ProjectHistory &)=delete
 
 ~ProjectHistory () override
 
void InitialState ()
 
void SetStateTo (unsigned int n, bool doAutosave=true)
 
bool UndoAvailable () const
 
bool RedoAvailable () const
 
void PushState (const TranslatableString &desc, const TranslatableString &shortDesc)
 
void PushState (const TranslatableString &desc, const TranslatableString &shortDesc, UndoPush flags)
 
void RollbackState ()
 
void ModifyState (bool bWantsAutoSave)
 
void PopState (const UndoState &state, bool doAutosave=true)
 
bool GetDirty () const
 
void SetDirty (bool value)
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static ProjectHistoryGet (AudacityProject &project)
 
static const ProjectHistoryGet (const AudacityProject &project)
 

Private Attributes

AudacityProjectmProject
 
bool mDirty { false }
 

Detailed Description

Definition at line 21 of file ProjectHistory.h.

Constructor & Destructor Documentation

◆ ProjectHistory() [1/2]

ProjectHistory::ProjectHistory ( AudacityProject project)
inlineexplicit

Definition at line 38 of file ProjectHistory.h.

39 : mProject{ project }
40 {}
const auto project
AudacityProject & mProject

◆ ProjectHistory() [2/2]

ProjectHistory::ProjectHistory ( const ProjectHistory )
delete

◆ ~ProjectHistory()

ProjectHistory::~ProjectHistory ( )
overridedefault

Member Function Documentation

◆ Get() [1/2]

ProjectHistory & ProjectHistory::Get ( AudacityProject project)
static

Definition at line 22 of file ProjectHistory.cpp.

23{
24 return project.AttachedObjects::Get< ProjectHistory >( sProjectHistoryKey );
25}
static AudacityProject::AttachedObjects::RegisteredFactory sProjectHistoryKey

References project, and sProjectHistoryKey.

Referenced by ProjectFileManager::AddImportedTracks(), SetLabelCommand::Apply(), MacroCommands::ApplyMacro(), TrackSelectHandle::Cancel(), LabelGlyphHandle::Cancel(), StretchHandle::Cancel(), CutlineHandle::Cancel(), SampleHandle::Cancel(), EnvelopeHandle::Cancel(), TimeShiftHandle::Cancel(), LabelTrackView::Char(), TrackPanelResizeHandle::Click(), SubViewAdjustHandle::Click(), SelectHandle::Click(), VelocitySliderHandle::CommitChanges(), VolumeSliderHandle::CommitChanges(), PanSliderHandle::CommitChanges(), SubViewCloseHandle::CommitChanges(), MinimizeButtonHandle::CommitChanges(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::Create(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), anonymous_namespace{TrackMenus.cpp}::DoAlign(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), LabelTrackView::DoChar(), anonymous_namespace{ClipMenus.cpp}::DoClipLeftOrRight(), anonymous_namespace{ClipMenus.cpp}::DoCursorClipBoundary(), anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), LOFImportFileHandle::doDurationAndScrollOffset(), LabelTrackView::DoEditLabels(), AudacityApplicationLogic::DoEffect(), WaveformVRulerControls::DoHandleWheelRotation(), SpectrumVRulerControls::DoHandleWheelRotation(), ProjectFileManager::DoImport(), anonymous_namespace{ImportMIDI.cpp}::DoImportMIDI(), Scrubber::DoKeyboardScrub(), LabelTrackView::DoKeyDown(), SelectUtilities::DoListSelection(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), TrackUtilities::DoMoveTrack(), anonymous_namespace{NavigationMenus.cpp}::DoNextTrack(), anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), anonymous_namespace{EditMenus.cpp}::DoPasteText(), ProjectAudioManager::DoPlayStopSelect(), anonymous_namespace{NavigationMenus.cpp}::DoPrevTrack(), ClipPitchAndSpeedButtonHandle::DoRelease(), TrackUtilities::DoRemoveTrack(), TrackUtilities::DoRemoveTracks(), anonymous_namespace{ClipMenus.cpp}::DoSelectClip(), anonymous_namespace{ClipMenus.cpp}::DoSelectClipBoundary(), anonymous_namespace{SelectUtilities.cpp}::DoSelectTimeAndAudioTracks(), SelectUtilities::DoSelectTimeAndTracks(), TrackUtilities::DoTrackMute(), TrackUtilities::DoTrackSolo(), SpectrumVZoomHandle::DoZoom(), WaveformVZoomHandle::DoZoom(), anonymous_namespace{DropoutDetector.cpp}::DropoutSubscription::DropoutSubscription(), TagsEditorDialog::EditProjectMetadata(), AdjustClipBorder::Finish(), Get(), MixerTrackCluster::HandleSliderGain(), MixerTrackCluster::HandleSliderPan(), MixerTrackCluster::HandleSliderVelocity(), NoteTrackVRulerControls::HandleWheelRotation(), AUPImportFileHandle::Import(), LabelTrackView::KeyDown(), LOFImportFileHandle::lofOpenFiles(), RealtimeEffectPanel::MakeMasterEffectPane(), RealtimeEffectPanel::MakeTrackEffectPane(), ProjectSelectionManager::ModifySelection(), ProjectSelectionManager::ModifySpectralSelection(), CommandManager::ModifyUndoMenuItems(), anonymous_namespace{TrackMenus.cpp}::MuteTracks(), ProjectManager::New(), RealtimeEffectListWindow::OnAddEffectClicked(), ProjectAudioManager::OnAudioIOStopRecording(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::OnChangeButtonClicked(), NoteTrackMenuTable::OnChangeOctave(), ProjectManager::OnCloseWindow(), anonymous_namespace{ViewMenus.cpp}::OnCollapseAllTracks(), LabelTrackView::OnContextMenu(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), SelectActions::Handler::OnCursorSelEnd(), SelectActions::Handler::OnCursorSelStart(), SelectActions::Handler::OnCursorTrackEnd(), SelectActions::Handler::OnCursorTrackStart(), anonymous_namespace{EditMenus.cpp}::OnCut(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{EditMenus.cpp}::OnDelete(), anonymous_namespace{LabelMenus.cpp}::OnDeleteLabels(), HistoryDialog::OnDiscard(), anonymous_namespace{EditMenus.cpp}::OnDisjoin(), anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels(), anonymous_namespace{EditMenus.cpp}::OnDuplicate(), AudacityApp::OnExceptionInMainLoop(), anonymous_namespace{ViewMenus.cpp}::OnExpandAllTracks(), NavigationActions::Handler::OnFirstTrack(), FormatMenuTable::OnFormatChange(), anonymous_namespace{FileMenus.cpp}::OnImportLabels(), HistoryDialog::OnItemSelected(), anonymous_namespace{EditMenus.cpp}::OnJoin(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), NavigationActions::Handler::OnLastTrack(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), WaveTrackMenuTable::OnMergeStereo(), anonymous_namespace{LabelMenus.cpp}::OnNewLabelTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewStereoTrack(), anonymous_namespace{TimeTrackMenuItems.cpp}::OnNewTimeTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewWaveTrack(), anonymous_namespace{EditMenus.cpp}::OnPaste(), anonymous_namespace{LabelMenus.cpp}::OnPasteNewLabel(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnPitchShift(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), anonymous_namespace{EditMenus.cpp}::OnRedo(), WaveTrackAffordanceControls::OnRenderClipStretching(), anonymous_namespace{TrackMenus.cpp}::OnResample(), SelectActions::Handler::OnSelectCursorEnd(), SelectActions::Handler::OnSelectCursorStoredCursor(), SelectActions::Handler::OnSelectionRestore(), SelectActions::Handler::OnSelectNone(), SelectActions::Handler::OnSelectStartCursor(), SelectActions::Handler::OnSelectSyncLockSel(), SelectActions::Handler::OnSelectTrackStartToEnd(), SelectActions::Handler::OnSelToEnd(), SelectActions::Handler::OnSelToStart(), WaveTrackMenuTable::OnSetDisplay(), TrackMenuTable::OnSetName(), SelectUtilities::OnSetRegion(), TimeTrackMenuTable::OnSetTimeTrackRange(), anonymous_namespace{EditMenus.cpp}::OnSilence(), anonymous_namespace{LabelMenus.cpp}::OnSilenceLabels(), SelectActions::Handler::OnSkipEnd(), SelectActions::Handler::OnSkipStart(), anonymous_namespace{TrackMenus.cpp}::OnSortName(), anonymous_namespace{TrackMenus.cpp}::OnSortTime(), anonymous_namespace{SpectrumView.cpp}::SpectrogramSettingsHandler::OnSpectrogramSettings(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), anonymous_namespace{EditMenus.cpp}::OnSplit(), anonymous_namespace{EditMenus.cpp}::OnSplitCut(), anonymous_namespace{LabelMenus.cpp}::OnSplitCutLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitDelete(), anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitNew(), WaveTrackMenuTable::OnSplitStereo(), WaveTrackMenuTable::OnSplitStereoMono(), WaveTrackMenuTable::OnSwapChannels(), WaveTrackAffordanceControls::OnTextEditFinished(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), TimeTrackMenuTable::OnTimeTrackLin(), TimeTrackMenuTable::OnTimeTrackLog(), TimeTrackMenuTable::OnTimeTrackLogInt(), NavigationActions::Handler::OnToggle(), anonymous_namespace{SpectrumView.cpp}::Handler::OnToggleSpectralSelection(), anonymous_namespace{EditMenus.cpp}::OnTrim(), anonymous_namespace{EditMenus.cpp}::OnUndo(), WaveColorMenuTable::OnWaveColorChange(), WaveformVRulerMenuTable::OnWaveformScaleType(), SelectActions::Handler::OnZeroCrossing(), NoteTrackVRulerMenuTable::OnZoom(), anonymous_namespace{ViewMenus.cpp}::OnZoomFitV(), ProjectFileManager::OpenProjectFile(), TimeSignatureToolBar::Populate(), SpectralDataManager::ProcessTracks(), WaveClipUIUtilities::PushClipSpeedChangedUndoState(), RealtimeEffectListWindow::RealtimeEffectListWindow(), RedoAvailableFlag(), TrackPanelResizeHandle::Release(), LabelGlyphHandle::Release(), NoteTrackButtonHandle::Release(), NoteTrackVZoomHandle::Release(), StretchHandle::Release(), CutlineHandle::Release(), SampleHandle::Release(), SubViewAdjustHandle::Release(), SubViewRearrangeHandle::Release(), BrushHandle::Release(), EnvelopeHandle::Release(), SelectHandle::Release(), TimeShiftHandle::Release(), TrackSelectHandle::Release(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::RemoveFromList(), ProjectManager::ResetProjectToEmpty(), ProjectManager::SafeToOpenProjectInto(), NoteTrackAffordanceHandle::SelectAt(), WaveTrackAffordanceHandle::SelectAt(), anonymous_namespace{ClipOverflowButtonHandle.cpp}::SelectInterval(), WaveChannelView::SelectNextClip(), RateMenuTable::SetRate(), anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), anonymous_namespace{TrackMenus.cpp}::SetTrackPan(), WaveTrackAffordanceControls::StartEditClipName(), SelectHandle::StartSelection(), UndoAvailableFlag(), PitchAndSpeedDialog::UpdateHistory(), HighlitClipButtonHandle::UpdateTrackSelection(), AudacityMirProject::~AudacityMirProject(), and ProjectManager::ProjectChooser::~ProjectChooser().

◆ Get() [2/2]

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

Definition at line 27 of file ProjectHistory.cpp.

28{
29 return Get( const_cast< AudacityProject & >( project ) );
30}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ProjectHistory & Get(AudacityProject &project)

References Get(), and project.

Here is the call graph for this function:

◆ GetDirty()

bool ProjectHistory::GetDirty ( ) const
inline

Definition at line 62 of file ProjectHistory.h.

62{ return mDirty; }

◆ InitialState()

void ProjectHistory::InitialState ( )

Definition at line 38 of file ProjectHistory.cpp.

39{
40 auto &project = mProject;
41 auto &undoManager = UndoManager::Get( project );
42
43 undoManager.ClearStates();
44
45 undoManager.PushState(XO("Created new project"), {});
46
47 undoManager.StateSaved();
48}
XO("Cut/Copy/Paste")
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:71

References UndoManager::Get(), mProject, project, and XO().

Referenced by ProjectFileManager::OpenProjectFile().

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

◆ ModifyState()

void ProjectHistory::ModifyState ( bool  bWantsAutoSave)

Definition at line 92 of file ProjectHistory.cpp.

93{
94 auto &project = mProject;
95 if (bWantsAutoSave)
97
98 // remaining no-fail operations "commit" the changes of undo manager state
99 auto &undoManager = UndoManager::Get( project );
100 undoManager.ModifyState();
101}
static result_type Call(Arguments &&...arguments)
Null check of the installed function is done for you.

References GlobalHook< AutoSave, void(AudacityProject &) >::Call(), UndoManager::Get(), mProject, and project.

Referenced by MacroCommands::ApplyMacro(), TrackPanelResizeHandle::Click(), SubViewAdjustHandle::Click(), SelectHandle::Click(), SubViewCloseHandle::CommitChanges(), MinimizeButtonHandle::CommitChanges(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::Create(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), anonymous_namespace{ClipMenus.cpp}::DoCursorClipBoundary(), anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), LOFImportFileHandle::doDurationAndScrollOffset(), WaveformVRulerControls::DoHandleWheelRotation(), SpectrumVRulerControls::DoHandleWheelRotation(), Scrubber::DoKeyboardScrub(), SelectUtilities::DoListSelection(), ProjectAudioManager::DoPlayStopSelect(), anonymous_namespace{ClipMenus.cpp}::DoSelectClip(), anonymous_namespace{ClipMenus.cpp}::DoSelectClipBoundary(), anonymous_namespace{SelectUtilities.cpp}::DoSelectTimeAndAudioTracks(), SelectUtilities::DoSelectTimeAndTracks(), TrackUtilities::DoTrackMute(), TrackUtilities::DoTrackSolo(), SpectrumVZoomHandle::DoZoom(), WaveformVZoomHandle::DoZoom(), NoteTrackVRulerControls::HandleWheelRotation(), LOFImportFileHandle::lofOpenFiles(), RealtimeEffectPanel::MakeMasterEffectPane(), RealtimeEffectPanel::MakeTrackEffectPane(), anonymous_namespace{TrackMenus.cpp}::MuteTracks(), NoteTrackMenuTable::OnChangeOctave(), anonymous_namespace{ViewMenus.cpp}::OnCollapseAllTracks(), SelectActions::Handler::OnCursorSelEnd(), SelectActions::Handler::OnCursorSelStart(), SelectActions::Handler::OnCursorTrackEnd(), SelectActions::Handler::OnCursorTrackStart(), anonymous_namespace{ViewMenus.cpp}::OnExpandAllTracks(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), SelectActions::Handler::OnSelectCursorEnd(), SelectActions::Handler::OnSelectCursorStoredCursor(), SelectActions::Handler::OnSelectionRestore(), SelectActions::Handler::OnSelectNone(), SelectActions::Handler::OnSelectStartCursor(), SelectActions::Handler::OnSelectSyncLockSel(), SelectActions::Handler::OnSelectTrackStartToEnd(), SelectActions::Handler::OnSelToEnd(), SelectActions::Handler::OnSelToStart(), WaveTrackMenuTable::OnSetDisplay(), SelectUtilities::OnSetRegion(), SelectActions::Handler::OnSkipEnd(), SelectActions::Handler::OnSkipStart(), anonymous_namespace{SpectrumView.cpp}::SpectrogramSettingsHandler::OnSpectrogramSettings(), SpectrumVRulerMenuTable::OnSpectrumScaleType(), anonymous_namespace{SpectrumView.cpp}::Handler::OnToggleSpectralSelection(), WaveformVRulerMenuTable::OnWaveformScaleType(), SelectActions::Handler::OnZeroCrossing(), NoteTrackVRulerMenuTable::OnZoom(), anonymous_namespace{ViewMenus.cpp}::OnZoomFitV(), SpectralDataManager::ProcessTracks(), TrackPanelResizeHandle::Release(), NoteTrackButtonHandle::Release(), NoteTrackVZoomHandle::Release(), SubViewAdjustHandle::Release(), SubViewRearrangeHandle::Release(), BrushHandle::Release(), SelectHandle::Release(), NoteTrackAffordanceHandle::SelectAt(), WaveTrackAffordanceHandle::SelectAt(), anonymous_namespace{ClipOverflowButtonHandle.cpp}::SelectInterval(), WaveChannelView::SelectNextClip(), SelectHandle::StartSelection(), and HighlitClipButtonHandle::UpdateTrackSelection().

Here is the call graph for this function:

◆ operator=()

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

◆ PopState()

void ProjectHistory::PopState ( const UndoState state,
bool  doAutosave = true 
)

Definition at line 106 of file ProjectHistory.cpp.

107{
108 auto &project = mProject;
109 if (doAutosave)
111
112 // remaining no-fail operations "commit" the changes of undo manager state
113
114 // Restore extra state
115 for (auto &pExtension : state.extensions)
116 if (pExtension)
117 pExtension->RestoreUndoRedoState(project);
118}
Extensions extensions
Definition: UndoManager.h:114

References GlobalHook< AutoSave, void(AudacityProject &) >::Call(), UndoState::extensions, mProject, and project.

Referenced by anonymous_namespace{EditMenus.cpp}::OnRedo(), anonymous_namespace{EditMenus.cpp}::OnUndo(), and SetStateTo().

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

◆ PushState() [1/2]

void ProjectHistory::PushState ( const TranslatableString desc,
const TranslatableString shortDesc 
)

Definition at line 64 of file ProjectHistory.cpp.

66{
67 PushState(desc, shortDesc, UndoPush::NONE);
68}
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
const TranslatableString desc
Definition: ExportPCM.cpp:51

References anonymous_namespace{ExportPCM.cpp}::desc, NONE, and PushState().

Referenced by SetLabelCommand::Apply(), MacroCommands::ApplyMacro(), LabelTrackView::Char(), VelocitySliderHandle::CommitChanges(), VolumeSliderHandle::CommitChanges(), PanSliderHandle::CommitChanges(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), anonymous_namespace{TrackMenus.cpp}::DoAlign(), LabelTrackView::DoChar(), anonymous_namespace{ClipMenus.cpp}::DoClipLeftOrRight(), LabelTrackView::DoEditLabels(), AudacityApplicationLogic::DoEffect(), anonymous_namespace{ImportMIDI.cpp}::DoImportMIDI(), LabelTrackView::DoKeyDown(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), TrackUtilities::DoMoveTrack(), anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), anonymous_namespace{EditMenus.cpp}::DoPasteText(), ClipPitchAndSpeedButtonHandle::DoRelease(), TrackUtilities::DoRemoveTrack(), TrackUtilities::DoRemoveTracks(), TagsEditorDialog::EditProjectMetadata(), AdjustClipBorder::Finish(), MixerTrackCluster::HandleSliderGain(), MixerTrackCluster::HandleSliderPan(), MixerTrackCluster::HandleSliderVelocity(), LabelTrackView::KeyDown(), RealtimeEffectListWindow::OnAddEffectClicked(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::OnChangeButtonClicked(), LabelTrackView::OnContextMenu(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), anonymous_namespace{EditMenus.cpp}::OnCut(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{EditMenus.cpp}::OnDelete(), anonymous_namespace{LabelMenus.cpp}::OnDeleteLabels(), anonymous_namespace{EditMenus.cpp}::OnDisjoin(), anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels(), anonymous_namespace{EditMenus.cpp}::OnDuplicate(), FormatMenuTable::OnFormatChange(), anonymous_namespace{FileMenus.cpp}::OnImportLabels(), anonymous_namespace{EditMenus.cpp}::OnJoin(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), WaveTrackMenuTable::OnMergeStereo(), anonymous_namespace{LabelMenus.cpp}::OnNewLabelTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewStereoTrack(), anonymous_namespace{TimeTrackMenuItems.cpp}::OnNewTimeTrack(), anonymous_namespace{WaveTrackMenuItems.cpp}::OnNewWaveTrack(), anonymous_namespace{EditMenus.cpp}::OnPaste(), anonymous_namespace{LabelMenus.cpp}::OnPasteNewLabel(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::OnPitchShift(), WaveTrackAffordanceControls::OnRenderClipStretching(), anonymous_namespace{TrackMenus.cpp}::OnResample(), TrackMenuTable::OnSetName(), TimeTrackMenuTable::OnSetTimeTrackRange(), anonymous_namespace{EditMenus.cpp}::OnSilence(), anonymous_namespace{LabelMenus.cpp}::OnSilenceLabels(), anonymous_namespace{TrackMenus.cpp}::OnSortName(), anonymous_namespace{TrackMenus.cpp}::OnSortTime(), anonymous_namespace{EditMenus.cpp}::OnSplit(), anonymous_namespace{EditMenus.cpp}::OnSplitCut(), anonymous_namespace{LabelMenus.cpp}::OnSplitCutLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitDelete(), anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitLabels(), anonymous_namespace{EditMenus.cpp}::OnSplitNew(), WaveTrackMenuTable::OnSplitStereo(), WaveTrackMenuTable::OnSplitStereoMono(), WaveTrackMenuTable::OnSwapChannels(), WaveTrackAffordanceControls::OnTextEditFinished(), TimeTrackMenuTable::OnTimeTrackLin(), TimeTrackMenuTable::OnTimeTrackLog(), TimeTrackMenuTable::OnTimeTrackLogInt(), anonymous_namespace{EditMenus.cpp}::OnTrim(), WaveColorMenuTable::OnWaveColorChange(), TimeSignatureToolBar::Populate(), SpectralDataManager::ProcessTracks(), WaveClipUIUtilities::PushClipSpeedChangedUndoState(), PushState(), RealtimeEffectListWindow::RealtimeEffectListWindow(), LabelGlyphHandle::Release(), StretchHandle::Release(), CutlineHandle::Release(), SampleHandle::Release(), BrushHandle::Release(), EnvelopeHandle::Release(), TimeShiftHandle::Release(), TrackSelectHandle::Release(), anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectControl::RemoveFromList(), RateMenuTable::SetRate(), anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), anonymous_namespace{TrackMenus.cpp}::SetTrackPan(), WaveTrackAffordanceControls::StartEditClipName(), and PitchAndSpeedDialog::UpdateHistory().

Here is the call graph for this function:

◆ PushState() [2/2]

void ProjectHistory::PushState ( const TranslatableString desc,
const TranslatableString shortDesc,
UndoPush  flags 
)

Definition at line 70 of file ProjectHistory.cpp.

73{
74 auto &project = mProject;
77
78 // remaining no-fail operations "commit" the changes of undo manager state
79 auto &undoManager = UndoManager::Get( project );
80 undoManager.PushState(desc, shortDesc, flags);
81
82 mDirty = true;
83}

References GlobalHook< AutoSave, void(AudacityProject &) >::Call(), anonymous_namespace{ExportPCM.cpp}::desc, UndoManager::Get(), mDirty, mProject, NOAUTOSAVE, NONE, and project.

Here is the call graph for this function:

◆ RedoAvailable()

bool ProjectHistory::RedoAvailable ( ) const

Definition at line 57 of file ProjectHistory.cpp.

58{
59 auto &project = mProject;
60 auto &undoManager = UndoManager::Get( project );
61 return undoManager.RedoAvailable();
62}

References UndoManager::Get(), mProject, and project.

Referenced by RedoAvailableFlag().

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

◆ RollbackState()

void ProjectHistory::RollbackState ( )

Definition at line 85 of file ProjectHistory.cpp.

86{
87 auto &project = mProject;
88 auto &undoManager = UndoManager::Get( project );
89 SetStateTo( undoManager.GetCurrentState(), false );
90}
void SetStateTo(unsigned int n, bool doAutosave=true)

References UndoManager::Get(), mProject, project, and SetStateTo().

Referenced by TrackSelectHandle::Cancel(), LabelGlyphHandle::Cancel(), StretchHandle::Cancel(), CutlineHandle::Cancel(), SampleHandle::Cancel(), EnvelopeHandle::Cancel(), TimeShiftHandle::Cancel(), AudacityApp::OnExceptionInMainLoop(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), and ProjectManager::ProjectChooser::~ProjectChooser().

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

◆ SetDirty()

void ProjectHistory::SetDirty ( bool  value)
inline

Definition at line 63 of file ProjectHistory.h.

63{ mDirty = value; }

◆ SetStateTo()

void ProjectHistory::SetStateTo ( unsigned int  n,
bool  doAutosave = true 
)

Definition at line 120 of file ProjectHistory.cpp.

121{
122 auto &project = mProject;
123 auto &undoManager = UndoManager::Get( project );
124
125 undoManager.SetStateTo(n,
126 [this, doAutosave]( const UndoStackElem &elem ){
127 PopState(elem.state, doAutosave); } );
128}
void PopState(const UndoState &state, bool doAutosave=true)
Holds one item with description and time range for the UndoManager.
Definition: UndoManager.h:117
UndoState state
Definition: UndoManager.h:128

References UndoManager::Get(), mProject, PopState(), project, and UndoStackElem::state.

Referenced by ProjectManager::OnCloseWindow(), HistoryDialog::OnDiscard(), HistoryDialog::OnItemSelected(), and RollbackState().

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

◆ UndoAvailable()

bool ProjectHistory::UndoAvailable ( ) const

Definition at line 50 of file ProjectHistory.cpp.

51{
52 auto &project = mProject;
53 auto &undoManager = UndoManager::Get( project );
54 return undoManager.UndoAvailable();
55}

References UndoManager::Get(), mProject, and project.

Referenced by UndoAvailableFlag().

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

Member Data Documentation

◆ mDirty

bool ProjectHistory::mDirty { false }
private

Definition at line 68 of file ProjectHistory.h.

Referenced by PushState().

◆ mProject

AudacityProject& ProjectHistory::mProject
private

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