1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Comments about CloseLock() functions

This commit is contained in:
Paul Licameli 2016-04-11 23:38:33 -04:00
parent cfaf3564a2
commit f7780adbf5
6 changed files with 16 additions and 6 deletions

View File

@ -122,7 +122,8 @@ class PROFILE_DLL_API BlockFile /* not final, abstract */ {
void SilenceLog() const { mSilentLog = TRUE; }
///when the project closes, it locks the blockfiles.
///Override this in case it needs special treatment
///Override this in case it needs special treatment.
// not balanced by unlocking calls.
virtual void CloseLock(){Lock();}
/// Prevents a read on other threads. The basic blockfile runs on only one thread, so does nothing.

View File

@ -149,9 +149,11 @@ class PROFILE_DLL_API Sequence final : public XMLTagHandler{
//
bool Lock();
bool CloseLock();//similar to Lock but should be called upon project close.
bool Unlock();
bool CloseLock();//similar to Lock but should be called upon project close.
// not balanced by unlocking calls.
//
// Manipulating Sample Format
//

View File

@ -343,10 +343,12 @@ public:
/// Lock all blockfiles
void Lock();
void CloseLock(); //similar to Lock but should be called when the project closes.
/// Unlock all blockfiles
void Unlock();
void CloseLock(); //similar to Lock but should be called when the project closes.
// not balanced by unlocking calls.
///Delete the wave cache - force redraw. Thread-safe
void DeleteWaveCache();

View File

@ -286,9 +286,11 @@ class AUDACITY_DLL_API WaveTrack final : public Track {
//
bool Lock();
bool CloseLock(); //similar to Lock but should be called when the project closes.
bool Unlock();
bool CloseLock(); //similar to Lock but should be called when the project closes.
// not balanced by unlocking calls.
/** @brief Convert correctly between an (absolute) time in seconds and a number of samples.
*
* This method will not give the correct results if used on a relative time (difference of two

View File

@ -129,7 +129,8 @@ void ODPCMAliasBlockFile::Lock()
PCMAliasBlockFile::Lock();
}
//when the file closes, it locks the blockfiles, but it calls this so we can check if it has been saved before.
//when the file closes, it locks the blockfiles, but only conditionally.
// It calls this so we can check if it has been saved before.
void ODPCMAliasBlockFile::CloseLock()
{
if(mHasBeenSaved)

View File

@ -127,7 +127,9 @@ class ODPCMAliasBlockFile final : public PCMAliasBlockFile
void SetFileName(wxFileName &name) override;
wxFileName GetFileName() const override;
//when the file closes, it locks the blockfiles, but it calls this so we can check if it has been saved before.
//when the file closes, it locks the blockfiles, but only conditionally.
// It calls this so we can check if it has been saved before.
// not balanced by unlocking calls.
void CloseLock() override;
/// Prevents a read on other threads.