mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-28 14:39:28 +02:00
Merge remote-tracking branch 'upstream/master' into darkaudacity
This commit is contained in:
commit
13e8a81276
@ -455,10 +455,7 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
|||||||
while ((iter != mBlockFileHash.end()) && success)
|
while ((iter != mBlockFileHash.end()) && success)
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->IsLocked())
|
if (b->IsLocked())
|
||||||
success = CopyToNewProjectDirectory( &*b );
|
success = CopyToNewProjectDirectory( &*b );
|
||||||
else{
|
else{
|
||||||
@ -466,10 +463,10 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
progress.Update(count, total);
|
progress.Update(count, total);
|
||||||
|
|
||||||
++iter;
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
|
||||||
// in case there are any nulls
|
// in case there are any nulls
|
||||||
trueTotal = count;
|
trueTotal = count;
|
||||||
@ -487,18 +484,15 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
MoveToNewProjectDirectory(&*b);
|
MoveToNewProjectDirectory(&*b);
|
||||||
|
|
||||||
if (count >= 0)
|
if (count >= 0)
|
||||||
progress.Update(count, total);
|
progress.Update(count, total);
|
||||||
|
|
||||||
++iter;
|
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
|
||||||
this->projFull = oldFull;
|
this->projFull = oldFull;
|
||||||
this->projPath = oldPath;
|
this->projPath = oldPath;
|
||||||
@ -1319,10 +1313,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// don't worry, we don't rely on this cast unless IsAlias is true
|
// don't worry, we don't rely on this cast unless IsAlias is true
|
||||||
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
||||||
|
|
||||||
@ -1343,7 +1334,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
//ODBlocks access the aliased file on another thread, so we need to pause them before this continues.
|
//ODBlocks access the aliased file on another thread, so we need to pause them before this continues.
|
||||||
db->LockRead();
|
db->LockRead();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,10 +1353,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
||||||
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
|
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
|
||||||
|
|
||||||
@ -1373,7 +1361,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
ab->UnlockRead();
|
ab->UnlockRead();
|
||||||
if (!b->IsDataAvailable() && (db->GetEncodedAudioFilename() == fName))
|
if (!b->IsDataAvailable() && (db->GetEncodedAudioFilename() == fName))
|
||||||
db->UnlockRead();
|
db->UnlockRead();
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1390,10 +1378,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
||||||
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
|
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
|
||||||
|
|
||||||
@ -1409,6 +1394,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
|
|||||||
db->ChangeAudioFile(wxFileNameWrapper{ renamedFileName });
|
db->ChangeAudioFile(wxFileNameWrapper{ renamedFileName });
|
||||||
db->UnlockRead();
|
db->UnlockRead();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1525,11 +1511,8 @@ _("Project check of \"%s\" folder \
|
|||||||
{
|
{
|
||||||
// This type cast is safe. We checked that it's an alias block file earlier.
|
// This type cast is safe. We checked that it's an alias block file earlier.
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
|
||||||
wxASSERT(b);
|
wxASSERT(b);
|
||||||
if (!b)
|
if (b) {
|
||||||
continue;
|
|
||||||
|
|
||||||
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
auto ab = static_cast< AliasBlockFile * > ( &*b );
|
||||||
if (action == 1)
|
if (action == 1)
|
||||||
// Silence error logging for this block in this session.
|
// Silence error logging for this block in this session.
|
||||||
@ -1546,6 +1529,7 @@ _("Project check of \"%s\" folder \
|
|||||||
ab->Recover();
|
ab->Recover();
|
||||||
nResult = FSCKstatus_CHANGED | FSCKstatus_SAVE_AUP;
|
nResult = FSCKstatus_CHANGED | FSCKstatus_SAVE_AUP;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
if ((action == 2) && bAutoRecoverMode)
|
if ((action == 2) && bAutoRecoverMode)
|
||||||
@ -1592,11 +1576,8 @@ _("Project check of \"%s\" folder \
|
|||||||
while (iter != missingAUFHash.end())
|
while (iter != missingAUFHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
|
||||||
wxASSERT(b);
|
wxASSERT(b);
|
||||||
if (!b)
|
if (b) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if(action==0){
|
if(action==0){
|
||||||
//regenerate from data
|
//regenerate from data
|
||||||
b->Recover();
|
b->Recover();
|
||||||
@ -1605,6 +1586,7 @@ _("Project check of \"%s\" folder \
|
|||||||
// Silence error logging for this block in this session.
|
// Silence error logging for this block in this session.
|
||||||
b->SilenceLog();
|
b->SilenceLog();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
if ((action == 0) && bAutoRecoverMode)
|
if ((action == 0) && bAutoRecoverMode)
|
||||||
@ -1656,11 +1638,8 @@ _("Project check of \"%s\" folder \
|
|||||||
while (iter != missingAUHash.end())
|
while (iter != missingAUHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
|
||||||
wxASSERT(b);
|
wxASSERT(b);
|
||||||
if (!b)
|
if (b) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if (action == 2)
|
if (action == 2)
|
||||||
{
|
{
|
||||||
//regenerate with zeroes
|
//regenerate with zeroes
|
||||||
@ -1669,6 +1648,7 @@ _("Project check of \"%s\" folder \
|
|||||||
}
|
}
|
||||||
else if (action == 1)
|
else if (action == 1)
|
||||||
b->SilenceLog();
|
b->SilenceLog();
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
if ((action == 2) && bAutoRecoverMode)
|
if ((action == 2) && bAutoRecoverMode)
|
||||||
@ -1768,10 +1748,7 @@ void DirManager::FindMissingAliasedFiles(
|
|||||||
{
|
{
|
||||||
wxString key = iter->first; // file name and extension
|
wxString key = iter->first; // file name and extension
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->IsAlias())
|
if (b->IsAlias())
|
||||||
{
|
{
|
||||||
const wxFileName &aliasedFileName =
|
const wxFileName &aliasedFileName =
|
||||||
@ -1789,6 +1766,7 @@ void DirManager::FindMissingAliasedFiles(
|
|||||||
missingAliasedFilePathHash[aliasedFileFullPath] = {};
|
missingAliasedFilePathHash[aliasedFileFullPath] = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1808,10 +1786,7 @@ void DirManager::FindMissingAUFs(
|
|||||||
{
|
{
|
||||||
const wxString &key = iter->first;
|
const wxString &key = iter->first;
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->IsAlias() && b->IsSummaryAvailable())
|
if (b->IsAlias() && b->IsSummaryAvailable())
|
||||||
{
|
{
|
||||||
/* don't look in hash; that might find files the user moved
|
/* don't look in hash; that might find files the user moved
|
||||||
@ -1826,6 +1801,7 @@ void DirManager::FindMissingAUFs(
|
|||||||
fileName.GetFullPath().c_str());
|
fileName.GetFullPath().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1838,10 +1814,7 @@ void DirManager::FindMissingAUs(
|
|||||||
{
|
{
|
||||||
const wxString &key = iter->first;
|
const wxString &key = iter->first;
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!b->IsAlias())
|
if (!b->IsAlias())
|
||||||
{
|
{
|
||||||
wxFileNameWrapper fileName{ MakeBlockFilePath(key) };
|
wxFileNameWrapper fileName{ MakeBlockFilePath(key) };
|
||||||
@ -1854,6 +1827,7 @@ void DirManager::FindMissingAUs(
|
|||||||
fileName.GetFullPath().c_str());
|
fileName.GetFullPath().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1942,12 +1916,10 @@ void DirManager::FillBlockfilesCache()
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->GetNeedFillCache())
|
if (b->GetNeedFillCache())
|
||||||
numNeed++;
|
numNeed++;
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1962,19 +1934,17 @@ void DirManager::FillBlockfilesCache()
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->GetNeedFillCache() && (GetFreeMemory() > lowMem)) {
|
if (b->GetNeedFillCache() && (GetFreeMemory() > lowMem)) {
|
||||||
b->FillCache();
|
b->FillCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!progress.Update(current, numNeed))
|
if (!progress.Update(current, numNeed))
|
||||||
break; // user cancelled progress dialog, stop caching
|
break; // user cancelled progress dialog, stop caching
|
||||||
++iter;
|
|
||||||
current++;
|
current++;
|
||||||
}
|
}
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
#endif // DEPRECATED_AUDIO_CACHE
|
#endif // DEPRECATED_AUDIO_CACHE
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1987,12 +1957,10 @@ void DirManager::WriteCacheToDisk()
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->GetNeedWriteCacheToDisk())
|
if (b->GetNeedWriteCacheToDisk())
|
||||||
numNeed++;
|
numNeed++;
|
||||||
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2007,17 +1975,15 @@ void DirManager::WriteCacheToDisk()
|
|||||||
while (iter != mBlockFileHash.end())
|
while (iter != mBlockFileHash.end())
|
||||||
{
|
{
|
||||||
BlockFilePtr b = iter->second.lock();
|
BlockFilePtr b = iter->second.lock();
|
||||||
|
if (b) {
|
||||||
if (!b)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (b->GetNeedWriteCacheToDisk())
|
if (b->GetNeedWriteCacheToDisk())
|
||||||
{
|
{
|
||||||
b->WriteCacheToDisk();
|
b->WriteCacheToDisk();
|
||||||
progress.Update(current, numNeed);
|
progress.Update(current, numNeed);
|
||||||
}
|
}
|
||||||
++iter;
|
|
||||||
current++;
|
current++;
|
||||||
}
|
}
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user