Some naming consistency...
Prefer "MissingAliasFiles" not other permutations of the words
This commit is contained in:
parent
2d8c287384
commit
0ab29d21e9
|
@ -881,7 +881,7 @@ void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||
}
|
||||
|
||||
// Check if a warning for missing aliased files should be displayed
|
||||
if (ShouldShowMissingAliasedFileWarning()) {
|
||||
if (ShouldShowMissingAliasFilesWarning()) {
|
||||
// find which project owns the blockfile
|
||||
// note: there may be more than 1, but just go with the first one.
|
||||
//size_t numProjects = gAudacityProjects.size();
|
||||
|
@ -914,16 +914,16 @@ locations of the missing files."), missingFileName);
|
|||
if (offendingProject->GetMissingAliasFileDialog()) {
|
||||
offendingProject->GetMissingAliasFileDialog()->Raise();
|
||||
} else {
|
||||
ShowAliasMissingDialog(offendingProject.get(), _("Files Missing"),
|
||||
ShowMissingAliasFilesDialog(offendingProject.get(), _("Files Missing"),
|
||||
errorMessage, wxT(""), true);
|
||||
}
|
||||
}
|
||||
// Only show this warning once per event (playback/menu item/etc).
|
||||
SetMissingAliasedFileWarningShouldShow(false);
|
||||
SetMissingAliasFilesWarningShouldShow(false);
|
||||
}
|
||||
}
|
||||
|
||||
void AudacityApp::MarkAliasedFilesMissingWarning(const AliasBlockFile *b)
|
||||
void AudacityApp::MarkMissingAliasFilesWarning(const AliasBlockFile *b)
|
||||
{
|
||||
ODLocker locker { &m_LastMissingBlockFileLock };
|
||||
if (b) {
|
||||
|
@ -945,24 +945,24 @@ void AudacityApp::MarkAliasedFilesMissingWarning(const AliasBlockFile *b)
|
|||
m_LastMissingBlockFilePath = wxString{};
|
||||
}
|
||||
|
||||
void AudacityApp::SetMissingAliasedFileWarningShouldShow(bool b)
|
||||
void AudacityApp::SetMissingAliasFilesWarningShouldShow(bool b)
|
||||
{
|
||||
// Note that this is can be called by both the main thread and other threads.
|
||||
// I don't believe we need a mutex because we are checking zero vs non-zero,
|
||||
// and the setting from other threads will always be non-zero (true), and the
|
||||
// setting from the main thread is always false.
|
||||
m_aliasMissingWarningShouldShow = b;
|
||||
m_missingAliasFilesWarningShouldShow = b;
|
||||
// reset the warnings as they were probably marked by a previous run
|
||||
if (m_aliasMissingWarningShouldShow) {
|
||||
MarkAliasedFilesMissingWarning( nullptr );
|
||||
if (m_missingAliasFilesWarningShouldShow) {
|
||||
MarkMissingAliasFilesWarning( nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
bool AudacityApp::ShouldShowMissingAliasedFileWarning()
|
||||
bool AudacityApp::ShouldShowMissingAliasFilesWarning()
|
||||
{
|
||||
ODLocker locker { &m_LastMissingBlockFileLock };
|
||||
auto ptr = m_LastMissingBlockFileProject.lock();
|
||||
return ptr && m_aliasMissingWarningShouldShow;
|
||||
return ptr && m_missingAliasFilesWarningShouldShow;
|
||||
}
|
||||
|
||||
AudacityLogger *AudacityApp::GetLogger()
|
||||
|
@ -1284,7 +1284,7 @@ bool AudacityApp::OnInit()
|
|||
|
||||
mLocale = NULL;
|
||||
|
||||
m_aliasMissingWarningShouldShow = true;
|
||||
m_missingAliasFilesWarningShouldShow = true;
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
// Disable window animation
|
||||
|
|
|
@ -106,18 +106,18 @@ class AudacityApp final : public wxApp {
|
|||
/** \brief Mark playback as having missing aliased blockfiles
|
||||
*
|
||||
* Playback will continue, but the missing files will be silenced
|
||||
* ShouldShowMissingAliasedFileWarning can be called to determine
|
||||
* ShouldShowMissingAliasFilesWarning can be called to determine
|
||||
* if the user should be notified
|
||||
*/
|
||||
void MarkAliasedFilesMissingWarning(const AliasBlockFile *b);
|
||||
void MarkMissingAliasFilesWarning(const AliasBlockFile *b);
|
||||
|
||||
/** \brief Changes the behavior of missing aliased blockfiles warnings
|
||||
*/
|
||||
void SetMissingAliasedFileWarningShouldShow(bool b);
|
||||
void SetMissingAliasFilesWarningShouldShow(bool b);
|
||||
|
||||
/** \brief Returns true if the user should be notified of missing alias warnings
|
||||
*/
|
||||
bool ShouldShowMissingAliasedFileWarning();
|
||||
bool ShouldShowMissingAliasFilesWarning();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// In response to Apple Events
|
||||
|
@ -185,7 +185,7 @@ class AudacityApp final : public wxApp {
|
|||
|
||||
wxTimer mTimer;
|
||||
|
||||
bool m_aliasMissingWarningShouldShow;
|
||||
bool m_missingAliasFilesWarningShouldShow;
|
||||
std::weak_ptr< AudacityProject > m_LastMissingBlockFileProject;
|
||||
wxString m_LastMissingBlockFilePath;
|
||||
|
||||
|
|
|
@ -2058,7 +2058,7 @@ int AudioIO::StartStream(const TransportTracks &tracks,
|
|||
}
|
||||
|
||||
// Enable warning popups for unfound aliased blockfiles.
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
|
||||
commit = true;
|
||||
return mStreamToken;
|
||||
|
|
|
@ -537,8 +537,8 @@ size_t BlockFile::CommonReadData(
|
|||
|
||||
if (pAliasFile) {
|
||||
// Set a marker to display an error message for the silence
|
||||
if (!wxGetApp().ShouldShowMissingAliasedFileWarning())
|
||||
wxGetApp().MarkAliasedFilesMissingWarning(pAliasFile);
|
||||
if (!wxGetApp().ShouldShowMissingAliasFilesWarning())
|
||||
wxGetApp().MarkMissingAliasFilesWarning(pAliasFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1702,12 +1702,12 @@ int DirManager::ProjectFSCK(const bool bForceError, const bool bAutoRecoverMode)
|
|||
//
|
||||
// MISSING ALIASED AUDIO FILES
|
||||
//
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(false);
|
||||
BlockHash missingAliasedFileAUFHash; // (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash missingAliasedFilePathHash; // full paths of missing aliased files
|
||||
this->FindMissingAliasedFiles(missingAliasedFileAUFHash, missingAliasedFilePathHash);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(false);
|
||||
BlockHash missingAliasFilesAUFHash; // (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash missingAliasFilesPathHash; // full paths of missing aliased files
|
||||
this->FindMissingAliasFiles(missingAliasFilesAUFHash, missingAliasFilesPathHash);
|
||||
|
||||
if ((nResult != FSCKstatus_CLOSE_REQ) && !missingAliasedFileAUFHash.empty())
|
||||
if ((nResult != FSCKstatus_CLOSE_REQ) && !missingAliasFilesAUFHash.empty())
|
||||
{
|
||||
// In auto-recover mode, we always create silent blocks, and do not ask user.
|
||||
// This makes sure the project is complete next time we open it.
|
||||
|
@ -1729,7 +1729,7 @@ _("Project check of \"%s\" folder \
|
|||
\nproject in its current state, unless you \"Close \
|
||||
\nproject immediately\" on further error alerts.");
|
||||
wxString msg;
|
||||
msg.Printf(msgA, this->projName, (long long) missingAliasedFilePathHash.size());
|
||||
msg.Printf(msgA, this->projName, (long long) missingAliasFilesPathHash.size());
|
||||
const wxChar *buttons[] =
|
||||
{_("Close project immediately with no changes"),
|
||||
_("Treat missing audio as silence (this session only)"),
|
||||
|
@ -1744,8 +1744,8 @@ _("Project check of \"%s\" folder \
|
|||
else
|
||||
{
|
||||
// LL: A progress dialog should probably be used here
|
||||
BlockHash::iterator iter = missingAliasedFileAUFHash.begin();
|
||||
while (iter != missingAliasedFileAUFHash.end())
|
||||
BlockHash::iterator iter = missingAliasFilesAUFHash.begin();
|
||||
while (iter != missingAliasFilesAUFHash.end())
|
||||
{
|
||||
// This type cast is safe. We checked that it's an alias block file earlier.
|
||||
BlockFilePtr b = iter->second.lock();
|
||||
|
@ -1990,7 +1990,7 @@ other projects. \
|
|||
|
||||
// Summarize and flush the log.
|
||||
if (bForceError ||
|
||||
!missingAliasedFileAUFHash.empty() ||
|
||||
!missingAliasFilesAUFHash.empty() ||
|
||||
!missingAUFHash.empty() ||
|
||||
!missingAUHash.empty() ||
|
||||
!orphanFilePathArray.empty())
|
||||
|
@ -2006,13 +2006,13 @@ other projects. \
|
|||
wxOK | wxICON_EXCLAMATION);
|
||||
}
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
return nResult;
|
||||
}
|
||||
|
||||
void DirManager::FindMissingAliasedFiles(
|
||||
BlockHash& missingAliasedFileAUFHash, // output: (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash& missingAliasedFilePathHash) // output: full paths of missing aliased files
|
||||
void DirManager::FindMissingAliasFiles(
|
||||
BlockHash& missingAliasFilesAUFHash, // output: (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash& missingAliasFilesPathHash) // output: full paths of missing aliased files
|
||||
{
|
||||
BlockHash::iterator iter = mBlockFileHash.begin();
|
||||
while (iter != mBlockFileHash.end())
|
||||
|
@ -2029,20 +2029,20 @@ void DirManager::FindMissingAliasedFiles(
|
|||
if ((!aliasedFileFullPath.empty()) &&
|
||||
!aliasedFileName.FileExists())
|
||||
{
|
||||
missingAliasedFileAUFHash[key] = b;
|
||||
if (missingAliasedFilePathHash.find(aliasedFileFullPath) ==
|
||||
missingAliasedFilePathHash.end()) // Add it only once.
|
||||
missingAliasFilesAUFHash[key] = b;
|
||||
if (missingAliasFilesPathHash.find(aliasedFileFullPath) ==
|
||||
missingAliasFilesPathHash.end()) // Add it only once.
|
||||
// Not actually using the block here, just the path,
|
||||
// so set the block to NULL to create the entry.
|
||||
missingAliasedFilePathHash[aliasedFileFullPath] = {};
|
||||
missingAliasFilesPathHash[aliasedFileFullPath] = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
|
||||
iter = missingAliasedFilePathHash.begin();
|
||||
while (iter != missingAliasedFilePathHash.end())
|
||||
iter = missingAliasFilesPathHash.begin();
|
||||
while (iter != missingAliasFilesPathHash.end())
|
||||
{
|
||||
wxLogWarning(_("Missing aliased audio file: '%s'"), iter->first);
|
||||
++iter;
|
||||
|
|
|
@ -159,9 +159,9 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
|
|||
// Too complicated during auto-recover. Just correct problems the "safest" way.
|
||||
int ProjectFSCK(const bool bForceError, const bool bAutoRecoverMode);
|
||||
|
||||
void FindMissingAliasedFiles(
|
||||
BlockHash& missingAliasedFileAUFHash, // output: (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash& missingAliasedFilePathHash); // output: full paths of missing aliased files
|
||||
void FindMissingAliasFiles(
|
||||
BlockHash& missingAliasFilesAUFHash, // output: (.auf) AliasBlockFiles whose aliased files are missing
|
||||
BlockHash& missingAliasFilesPathHash); // output: full paths of missing aliased files
|
||||
void FindMissingAUFs(
|
||||
BlockHash& missingAUFHash); // output: missing (.auf) AliasBlockFiles
|
||||
void FindMissingAUs(
|
||||
|
|
|
@ -1023,7 +1023,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
|||
mStatusBar->SetName(wxT("status_line")); // not localized
|
||||
mProjectNo = mProjectCounter++; // Bug 322
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
|
||||
// MM: DirManager is created dynamically, freed on demand via ref-counting
|
||||
// MM: We don't need to Ref() here because it start with refcount=1
|
||||
|
@ -1434,12 +1434,12 @@ void AudacityProject::UpdatePrefs()
|
|||
|
||||
void AudacityProject::SetMissingAliasFileDialog(wxDialog *dialog)
|
||||
{
|
||||
mAliasMissingWarningDialog = dialog;
|
||||
mMissingAliasFilesWarningDialog = dialog;
|
||||
}
|
||||
|
||||
wxDialog *AudacityProject::GetMissingAliasFileDialog()
|
||||
{
|
||||
return mAliasMissingWarningDialog;
|
||||
return mMissingAliasFilesWarningDialog;
|
||||
}
|
||||
|
||||
void AudacityProject::RedrawProject(const bool bForceWaveTracks /*= false*/)
|
||||
|
@ -5278,7 +5278,7 @@ bool AudacityProject::ExportFromTimerRecording(wxFileName fnFile, int iFormat, i
|
|||
{
|
||||
Exporter e;
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
return e.ProcessFromTimerRecording(this, false, 0.0, mTracks->GetEndTime(), fnFile, iFormat, iSubFormat, iFilterIndex);
|
||||
}
|
||||
|
||||
|
|
|
@ -628,7 +628,7 @@ private:
|
|||
Destroy_ptr<ContrastDialog> mContrastDialog;
|
||||
|
||||
// dialog for missing alias warnings
|
||||
wxDialog *mAliasMissingWarningDialog{};
|
||||
wxDialog *mMissingAliasFilesWarningDialog{};
|
||||
|
||||
bool mShownOnce{ false };
|
||||
|
||||
|
|
|
@ -674,8 +674,8 @@ bool Exporter::GetFilename()
|
|||
// This causes problems for the exporter, so we don't allow it.
|
||||
// Overwritting non-missing aliased files is okay.
|
||||
// Also, this can only happen for uncompressed audio.
|
||||
bool overwritingMissingAlias;
|
||||
overwritingMissingAlias = false;
|
||||
bool overwritingMissingAliasFiles;
|
||||
overwritingMissingAliasFiles = false;
|
||||
for (size_t i = 0; i < gAudacityProjects.size(); i++) {
|
||||
AliasedFileArray aliasedFiles;
|
||||
FindDependencies(gAudacityProjects[i].get(), aliasedFiles);
|
||||
|
@ -687,11 +687,11 @@ bool Exporter::GetFilename()
|
|||
The file cannot be written because the path is needed to restore the original audio to the project.\n\
|
||||
Choose Help > Diagnostics > Check Dependencies to view the locations of all missing files.\n\
|
||||
If you still wish to export, please choose a different filename or folder."));
|
||||
overwritingMissingAlias = true;
|
||||
overwritingMissingAliasFiles = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (overwritingMissingAlias)
|
||||
if (overwritingMissingAliasFiles)
|
||||
continue;
|
||||
|
||||
if (mFilename.FileExists()) {
|
||||
|
|
|
@ -33,7 +33,7 @@ void DoExport
|
|||
|
||||
Exporter e;
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
double t0 = 0.0;
|
||||
double t1 = tracks->GetEndTime();
|
||||
|
||||
|
@ -231,7 +231,7 @@ void OnExportSelection(const CommandContext &context)
|
|||
auto &selectedRegion = project.GetViewInfo().selectedRegion;
|
||||
Exporter e;
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
e.SetFileDialogTitle( _("Export Selected Audio") );
|
||||
e.Process(&project, true, selectedRegion.t0(),
|
||||
selectedRegion.t1());
|
||||
|
@ -303,7 +303,7 @@ void OnExportMultiple(const CommandContext &context)
|
|||
auto &project = context.project;
|
||||
ExportMultiple em(&project);
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
em.ShowModal();
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ void OnImport(const CommandContext &context)
|
|||
|
||||
// An import trigger for the alias missing dialog might not be intuitive, but
|
||||
// this serves to track the file if the users zooms in and such.
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
|
||||
wxArrayString selectedFiles = project.ShowOpenDialog(wxT(""));
|
||||
if (selectedFiles.size() == 0) {
|
||||
|
|
|
@ -412,7 +412,7 @@ bool DoEffect(
|
|||
project.SelectAllIfNone();
|
||||
}
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
|
||||
auto nTracksOriginally = project.GetTrackCount();
|
||||
wxWindow *focus = wxWindow::FindFocus();
|
||||
|
|
|
@ -43,7 +43,7 @@ void DoMixAndRender
|
|||
auto defaultFormat = project.GetDefaultFormat();
|
||||
auto trackPanel = project.GetTrackPanel();
|
||||
|
||||
wxGetApp().SetMissingAliasedFileWarningShouldShow(true);
|
||||
wxGetApp().SetMissingAliasFilesWarningShouldShow(true);
|
||||
|
||||
WaveTrack::Holder uNewLeft, uNewRight;
|
||||
::MixAndRender(
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
*//*****************************************************************//**
|
||||
|
||||
\class AliasedFileMissingDialog
|
||||
\class MissingAliasFileDialog
|
||||
\brief Special case of ErrorDialog for reporting missing alias files.
|
||||
|
||||
*//********************************************************************/
|
||||
|
@ -42,15 +42,15 @@
|
|||
#include "HelpSystem.h"
|
||||
|
||||
// special case for alias missing dialog because we keep track of if it exists.
|
||||
class AliasedFileMissingDialog final : public ErrorDialog
|
||||
class MissingAliasFileDialog final : public ErrorDialog
|
||||
{
|
||||
public:
|
||||
AliasedFileMissingDialog(AudacityProject *parent,
|
||||
MissingAliasFileDialog(AudacityProject *parent,
|
||||
const wxString & dlogTitle,
|
||||
const wxString & message,
|
||||
const wxString & helpURL,
|
||||
const bool Close = true, const bool modal = true);
|
||||
virtual ~AliasedFileMissingDialog();
|
||||
virtual ~MissingAliasFileDialog();
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(ErrorDialog, wxDialogWrapper)
|
||||
|
@ -59,7 +59,7 @@ BEGIN_EVENT_TABLE(ErrorDialog, wxDialogWrapper)
|
|||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
AliasedFileMissingDialog::AliasedFileMissingDialog(AudacityProject *parent,
|
||||
MissingAliasFileDialog::MissingAliasFileDialog(AudacityProject *parent,
|
||||
const wxString & dlogTitle,
|
||||
const wxString & message,
|
||||
const wxString & helpURL,
|
||||
|
@ -69,7 +69,7 @@ ErrorDialog(parent, dlogTitle, message, helpURL, Close, modal)
|
|||
parent->SetMissingAliasFileDialog(this);
|
||||
}
|
||||
|
||||
AliasedFileMissingDialog::~AliasedFileMissingDialog()
|
||||
MissingAliasFileDialog::~MissingAliasFileDialog()
|
||||
{
|
||||
((AudacityProject*)GetParent())->SetMissingAliasFileDialog(NULL);
|
||||
}
|
||||
|
@ -202,14 +202,14 @@ void ShowModelessErrorDialog(wxWindow *parent,
|
|||
// but in practice Destroy() in OnOK does that
|
||||
}
|
||||
|
||||
void ShowAliasMissingDialog(AudacityProject *parent,
|
||||
void ShowMissingAliasFilesDialog(AudacityProject *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpPage,
|
||||
const bool Close)
|
||||
{
|
||||
wxASSERT(parent); // to justify safenew
|
||||
ErrorDialog *dlog = safenew AliasedFileMissingDialog(parent, dlogTitle, message, helpPage, Close, false);
|
||||
ErrorDialog *dlog = safenew MissingAliasFileDialog(parent, dlogTitle, message, helpPage, Close, false);
|
||||
// Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
|
||||
// instead put it just above or on the top of the project.
|
||||
wxPoint point;
|
||||
|
|
|
@ -57,7 +57,7 @@ void ShowModelessErrorDialog(wxWindow *parent,
|
|||
bool Close = true);
|
||||
|
||||
/// Displays a custom modeless error dialog for aliased file errors
|
||||
void ShowAliasMissingDialog(AudacityProject *parent,
|
||||
void ShowMissingAliasFilesDialog(AudacityProject *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpPage,
|
||||
|
|
Loading…
Reference in New Issue