1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-02 04:24:51 +02:00

Rewrite comments about exception safety guarantees with Doxygen...

... Defining a new macro, which generates a special paragraph with links to a
new page describing the principles.
This commit is contained in:
Paul Licameli
2020-08-22 15:33:03 -04:00
parent 0e10a27172
commit 372393f49e
12 changed files with 253 additions and 116 deletions

View File

@@ -94,12 +94,12 @@ auto ProjectAudioManager::StatusWidthFunction(
return {};
}
/*! @excsafety{Strong} -- For state of mCutPreviewTracks */
int ProjectAudioManager::PlayPlayRegion(const SelectedRegion &selectedRegion,
const AudioIOStartStreamOptions &options,
PlayMode mode,
bool backwards, /* = false */
bool playWhiteSpace /* = false */)
// STRONG-GUARANTEE (for state of mCutPreviewTracks)
{
auto &projectAudioManager = *this;
bool canStop = projectAudioManager.CanStopAudioStream();
@@ -458,8 +458,8 @@ WaveTrackArray ProjectAudioManager::ChooseExistingRecordingTracks(
return {};
}
/*! @excsafety{Strong} -- For state of current project's tracks */
void ProjectAudioManager::OnRecord(bool altAppearance)
// STRONG-GUARANTEE (for state of current project's tracks)
{
bool bPreferNewTrack;
gPrefs->Read("/GUI/PreferNewTrackRecord", &bPreferNewTrack, false);
@@ -803,10 +803,10 @@ void ProjectAudioManager::OnPause()
}
}
/*! @excsafety{Strong} -- For state of mCutPreviewTracks*/
void ProjectAudioManager::SetupCutPreviewTracks(double WXUNUSED(playStart), double cutStart,
double cutEnd, double WXUNUSED(playEnd))
// STRONG-GUARANTEE (for state of mCutPreviewTracks)
{
ClearCutPreviewTracks();
AudacityProject *p = &mProject;
@@ -822,7 +822,7 @@ void ProjectAudioManager::SetupCutPreviewTracks(double WXUNUSED(playStart), doub
newTrack->Clear(cutStart, cutEnd);
cutPreviewTracks->Add( newTrack );
}
// use NOTHROW-GUARANTEE:
// use No-throw-guarantee:
mCutPreviewTracks = cutPreviewTracks;
}
}
@@ -879,7 +879,7 @@ void ProjectAudioManager::OnAudioIOStopRecording()
}
else {
// Add to history
// We want this to have NOFAIL-GUARANTEE if we get here from exception
// We want this to have No-fail-guarantee if we get here from exception
// handling of recording, and that means we rely on the last autosave
// successully committed to the database, not risking a failure
history.PushState(XO("Recorded Audio"), XO("Record"),