1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-28 06:29:24 +02:00

Merge remote-tracking branch 'upstream/master' into darkaudacity

This commit is contained in:
James Crook 2016-08-17 22:27:43 +01:00
commit 13e8a81276

View File

@ -455,10 +455,7 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
while ((iter != mBlockFileHash.end()) && success)
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->IsLocked())
success = CopyToNewProjectDirectory( &*b );
else{
@ -466,10 +463,10 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
}
progress.Update(count, total);
++iter;
count++;
}
++iter;
}
// in case there are any nulls
trueTotal = count;
@ -487,18 +484,15 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
MoveToNewProjectDirectory(&*b);
if (count >= 0)
progress.Update(count, total);
++iter;
count--;
}
++iter;
}
this->projFull = oldFull;
this->projPath = oldPath;
@ -1319,10 +1313,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
// don't worry, we don't rely on this cast unless IsAlias is true
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.
db->LockRead();
}
}
++iter;
}
@ -1362,10 +1353,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
auto ab = static_cast< AliasBlockFile * > ( &*b );
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
@ -1373,7 +1361,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
ab->UnlockRead();
if (!b->IsDataAvailable() && (db->GetEncodedAudioFilename() == fName))
db->UnlockRead();
}
++iter;
}
@ -1390,10 +1378,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
auto ab = static_cast< AliasBlockFile * > ( &*b );
auto db = static_cast< ODDecodeBlockFile * > ( &*b );
@ -1409,6 +1394,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName)
db->ChangeAudioFile(wxFileNameWrapper{ renamedFileName });
db->UnlockRead();
}
}
++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.
BlockFilePtr b = iter->second.lock();
wxASSERT(b);
if (!b)
continue;
if (b) {
auto ab = static_cast< AliasBlockFile * > ( &*b );
if (action == 1)
// Silence error logging for this block in this session.
@ -1546,6 +1529,7 @@ _("Project check of \"%s\" folder \
ab->Recover();
nResult = FSCKstatus_CHANGED | FSCKstatus_SAVE_AUP;
}
}
++iter;
}
if ((action == 2) && bAutoRecoverMode)
@ -1592,11 +1576,8 @@ _("Project check of \"%s\" folder \
while (iter != missingAUFHash.end())
{
BlockFilePtr b = iter->second.lock();
wxASSERT(b);
if (!b)
continue;
if (b) {
if(action==0){
//regenerate from data
b->Recover();
@ -1605,6 +1586,7 @@ _("Project check of \"%s\" folder \
// Silence error logging for this block in this session.
b->SilenceLog();
}
}
++iter;
}
if ((action == 0) && bAutoRecoverMode)
@ -1656,11 +1638,8 @@ _("Project check of \"%s\" folder \
while (iter != missingAUHash.end())
{
BlockFilePtr b = iter->second.lock();
wxASSERT(b);
if (!b)
continue;
if (b) {
if (action == 2)
{
//regenerate with zeroes
@ -1669,6 +1648,7 @@ _("Project check of \"%s\" folder \
}
else if (action == 1)
b->SilenceLog();
}
++iter;
}
if ((action == 2) && bAutoRecoverMode)
@ -1768,10 +1748,7 @@ void DirManager::FindMissingAliasedFiles(
{
wxString key = iter->first; // file name and extension
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->IsAlias())
{
const wxFileName &aliasedFileName =
@ -1789,6 +1766,7 @@ void DirManager::FindMissingAliasedFiles(
missingAliasedFilePathHash[aliasedFileFullPath] = {};
}
}
}
++iter;
}
@ -1808,10 +1786,7 @@ void DirManager::FindMissingAUFs(
{
const wxString &key = iter->first;
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->IsAlias() && b->IsSummaryAvailable())
{
/* don't look in hash; that might find files the user moved
@ -1826,6 +1801,7 @@ void DirManager::FindMissingAUFs(
fileName.GetFullPath().c_str());
}
}
}
++iter;
}
}
@ -1838,10 +1814,7 @@ void DirManager::FindMissingAUs(
{
const wxString &key = iter->first;
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (!b->IsAlias())
{
wxFileNameWrapper fileName{ MakeBlockFilePath(key) };
@ -1854,6 +1827,7 @@ void DirManager::FindMissingAUs(
fileName.GetFullPath().c_str());
}
}
}
++iter;
}
}
@ -1942,12 +1916,10 @@ void DirManager::FillBlockfilesCache()
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->GetNeedFillCache())
numNeed++;
}
++iter;
}
@ -1962,19 +1934,17 @@ void DirManager::FillBlockfilesCache()
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->GetNeedFillCache() && (GetFreeMemory() > lowMem)) {
b->FillCache();
}
if (!progress.Update(current, numNeed))
break; // user cancelled progress dialog, stop caching
++iter;
current++;
}
++iter;
}
#endif // DEPRECATED_AUDIO_CACHE
}
@ -1987,12 +1957,10 @@ void DirManager::WriteCacheToDisk()
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->GetNeedWriteCacheToDisk())
numNeed++;
}
++iter;
}
@ -2007,17 +1975,15 @@ void DirManager::WriteCacheToDisk()
while (iter != mBlockFileHash.end())
{
BlockFilePtr b = iter->second.lock();
if (!b)
continue;
if (b) {
if (b->GetNeedWriteCacheToDisk())
{
b->WriteCacheToDisk();
progress.Update(current, numNeed);
}
++iter;
current++;
}
++iter;
}
}