Audacity  3.0.3
Classes | Functions
FileNames Namespace Reference

Classes

struct  FileType
 

Functions

wxString FormatWildcard (const FileTypes &fileTypes)
 
bool DoCopyFile (const FilePath &file1, const FilePath &file2, bool overwrite=true)
 
bool HardLinkFile (const FilePath &file1, const FilePath &file2)
 
wxString MkDir (const wxString &Str)
 
bool IsMidi (const FilePath &fName)
 
const FilePathsAudacityPathList ()
 A list of directories that should be searched for Audacity files (plug-ins, help files, etc.). More...
 
void SetAudacityPathList (FilePaths list)
 
void MakeNameUnique (FilePaths &otherNames, wxFileName &newName)
 
wxString LowerCaseAppNameInPath (const wxString &dirIn)
 
FilePath DataDir ()
 Audacity user data directory. More...
 
FilePath ResourcesDir ()
 
FilePath HtmlHelpDir ()
 
FilePath HtmlHelpIndexFile (bool quick)
 
FilePath LegacyChainDir ()
 
FilePath MacroDir ()
 
FilePath NRPDir ()
 
FilePath NRPFile ()
 
FilePath PluginRegistry ()
 
FilePath PluginSettings ()
 
FilePath BaseDir ()
 
FilePath ModulesDir ()
 
FilePath PlugInDir ()
 The user plug-in directory (not a system one) More...
 
FilePath ThemeDir ()
 
FilePath ThemeComponentsDir ()
 
FilePath ThemeCachePng ()
 
FilePath ThemeCacheAsCee ()
 
FilePath ThemeComponent (const wxString &Str)
 
FilePath ThemeCacheHtm ()
 
FilePath ThemeImageDefsAsCee ()
 
FilePath PathFromAddr (void *addr)
 
bool IsPathAvailable (const FilePath &Path)
 
wxFileNameWrapper DefaultToDocumentsFolder (const wxString &preference)
 
wxString PreferenceKey (FileNames::Operation op, FileNames::PathType type)
 
FilePath FindDefaultPath (Operation op)
 
void UpdateDefaultPath (Operation op, const FilePath &path)
 
template<typename F >
FilePath WithDefaultPath (Operation op, const FilePath &defaultPath, F function)
 
FilePath SelectFile (Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
 
void AddUniquePathToPathList (const FilePath &path, FilePaths &pathList)
 
void AddMultiPathsToPathList (const wxString &multiPathString, FilePaths &pathList)
 
void FindFilesInPathList (const wxString &pattern, const FilePaths &pathList, FilePaths &results, int flags=wxDIR_FILES)
 
int CompareNoCase (const wxString &first, const wxString &second)
 Protect against Unicode to multi-byte conversion failures on Windows. More...
 
wxString CreateUniqueName (const wxString &prefix, const wxString &suffix=wxEmptyString)
 
wxString UnsavedProjectExtension ()
 
AUDACITY_DLL_API bool IsOnFATFileSystem (const FilePath &path)
 
AUDACITY_DLL_API wxString AbbreviatePath (const wxFileName &fileName)
 Give enough of the path to identify the device. (On Windows, drive letter plus ':') More...
 

Function Documentation

◆ AbbreviatePath()

AUDACITY_DLL_API wxString FileNames::AbbreviatePath ( const wxFileName &  fileName)

Give enough of the path to identify the device. (On Windows, drive letter plus ':')

Referenced by AudacityProject::AudacityProject(), DBConnection::CheckpointThread(), ProjectFileManager::DoSave(), FileException::ErrorMessage(), ProjectFileManager::SaveCopy(), and FileException::WriteFailureMessage().

Here is the caller graph for this function:

◆ AddMultiPathsToPathList()

void FileNames::AddMultiPathsToPathList ( const wxString &  multiPathString,
FilePaths pathList 
)

Referenced by ModuleManager::DiscoverProviders(), ModuleManager::Initialize(), and AudacityApp::OnInit().

Here is the caller graph for this function:

◆ AddUniquePathToPathList()

void FileNames::AddUniquePathToPathList ( const FilePath path,
FilePaths pathList 
)

Referenced by ModuleManager::DiscoverProviders(), GetLanguages(), NyquistEffect::GetNyquistSearchPath(), ModuleManager::Initialize(), and AudacityApp::OnInit().

Here is the caller graph for this function:

◆ AudacityPathList()

const FilePaths& FileNames::AudacityPathList ( )

A list of directories that should be searched for Audacity files (plug-ins, help files, etc.).

On Unix this will include the directory Audacity was installed into, plus the current user's .audacity-data/Plug-Ins directory. Additional directories can be specified using the AUDACITY_PATH environment variable. On Windows or Mac OS, this will include the directory which contains the Audacity program.

Referenced by GetLanguages(), NyquistEffect::GetNyquistSearchPath(), NyquistEffectsModule::Initialize(), ModuleManager::Initialize(), and GUIPrefs::SetLang().

Here is the caller graph for this function:

◆ BaseDir()

FilePath FileNames::BaseDir ( )

Referenced by NyquistEffect::Process().

Here is the caller graph for this function:

◆ CompareNoCase()

int FileNames::CompareNoCase ( const wxString &  first,
const wxString &  second 
)

Protect against Unicode to multi-byte conversion failures on Windows.

Referenced by anonymous_namespace{FileMenus.cpp}::DoImport(), and ProjectManager::OpenFiles().

Here is the caller graph for this function:

◆ CreateUniqueName()

wxString FileNames::CreateUniqueName ( const wxString &  prefix,
const wxString &  suffix = wxEmptyString 
)

Referenced by TempDirectory::UnsavedProjectFileName().

Here is the caller graph for this function:

◆ DataDir()

FilePath FileNames::DataDir ( )

Audacity user data directory.

Where audacity keeps its settings and other user data squirreled away, by default ~/.audacity-data/ on Unix, Application Data/Audacity on windows system

Referenced by FFmpegPresets::FFmpegPresets(), EffectEqualization::GetDefaultFileName(), EffectEqualization::LoadCurves(), Tags::LoadGenres(), TagsEditorDialog::OnEdit(), EditCurvesDialog::OnExport(), EditCurvesDialog::OnImport(), AudacityApp::OnInit(), TagsEditorDialog::OnLoad(), EditCurvesDialog::OnOK(), TagsEditorDialog::OnReset(), TagsEditorDialog::OnSave(), NyquistEffect::Process(), QuitAudacity(), NyquistEffect::resolveFilePath(), EffectEqualization::SaveCurves(), and FFmpegPresets::~FFmpegPresets().

Here is the caller graph for this function:

◆ DefaultToDocumentsFolder()

wxFileNameWrapper FileNames::DefaultToDocumentsFolder ( const wxString &  preference)

Referenced by NyquistEffect::resolveFilePath().

Here is the caller graph for this function:

◆ DoCopyFile()

bool FileNames::DoCopyFile ( const FilePath file1,
const FilePath file2,
bool  overwrite = true 
)

Referenced by PluginManager::DropFile(), and MacroCommands::MigrateLegacyChains().

Here is the caller graph for this function:

◆ FindDefaultPath()

FilePath FileNames::FindDefaultPath ( Operation  op)

◆ FindFilesInPathList()

void FileNames::FindFilesInPathList ( const wxString &  pattern,
const FilePaths pathList,
FilePaths results,
int  flags = wxDIR_FILES 
)

Referenced by ModuleManager::DiscoverProviders(), ModuleManager::Initialize(), and TranslationExists().

Here is the caller graph for this function:

◆ FormatWildcard()

wxString FileNames::FormatWildcard ( const FileTypes fileTypes)

Referenced by FileDialogWrapper::Create().

Here is the caller graph for this function:

◆ HardLinkFile()

bool FileNames::HardLinkFile ( const FilePath file1,
const FilePath file2 
)

◆ HtmlHelpDir()

FilePath FileNames::HtmlHelpDir ( )

Referenced by FileLink(), LinkingHtmlWindow::OnLinkClicked(), NyquistEffect::Process(), and HelpSystem::ShowHelp().

Here is the caller graph for this function:

◆ HtmlHelpIndexFile()

FilePath FileNames::HtmlHelpIndexFile ( bool  quick)

◆ IsMidi()

bool FileNames::IsMidi ( const FilePath fName)

Referenced by Importer::Import(), LOFImportFileHandle::lofOpenFiles(), and ProjectFileManager::OpenFile().

Here is the caller graph for this function:

◆ IsOnFATFileSystem()

AUDACITY_DLL_API bool FileNames::IsOnFATFileSystem ( const FilePath path)

Referenced by ProjectFileManager::DoSave(), TempDirectory::FATFilesystemDenied(), ProjectFileIO::GetFreeDiskSpace(), ProjectFileManager::SaveCopy(), and TempDirectory::TempDir().

Here is the caller graph for this function:

◆ IsPathAvailable()

bool FileNames::IsPathAvailable ( const FilePath Path)

Referenced by ProjectFileManager::SaveAs(), and ProjectFileManager::SaveCopy().

Here is the caller graph for this function:

◆ LegacyChainDir()

FilePath FileNames::LegacyChainDir ( )

Referenced by MacroCommands::DeleteMacro(), and MacroCommands::MigrateLegacyChains().

Here is the caller graph for this function:

◆ LowerCaseAppNameInPath()

wxString FileNames::LowerCaseAppNameInPath ( const wxString &  dirIn)

◆ MacroDir()

FilePath FileNames::MacroDir ( )

Referenced by MacroCommands::AddMacro(), MacroCommands::DeleteMacro(), MacroCommands::GetNames(), MacroCommands::MigrateLegacyChains(), MacroCommands::ReadMacro(), MacroCommands::RenameMacro(), and MacroCommands::WriteMacro().

Here is the caller graph for this function:

◆ MakeNameUnique()

void FileNames::MakeNameUnique ( FilePaths otherNames,
wxFileName &  newName 
)

Referenced by ExportMultipleDialog::ExportMultipleByLabel(), and ExportMultipleDialog::ExportMultipleByTrack().

Here is the caller graph for this function:

◆ MkDir()

wxString FileNames::MkDir ( const wxString &  Str)

Referenced by AudacityApp::OnInit(), and TempDirectory::TempDir().

Here is the caller graph for this function:

◆ ModulesDir()

FilePath FileNames::ModulesDir ( )

Referenced by ModuleManager::DiscoverProviders(), and AudacityApp::OnInit().

Here is the caller graph for this function:

◆ NRPDir()

FilePath FileNames::NRPDir ( )

◆ NRPFile()

FilePath FileNames::NRPFile ( )

◆ PathFromAddr()

FilePath FileNames::PathFromAddr ( void *  addr)

Referenced by MP3Exporter::InitLibraryExternal(), and FFmpegLibs::InitLibs().

Here is the caller graph for this function:

◆ PlugInDir()

FilePath FileNames::PlugInDir ( )

The user plug-in directory (not a system one)

This returns the string path to where the user may have put plug-ins if they don't have system admin rights. Under default settings, it's <DataDir>/Plug-Ins/

Referenced by PluginManager::FindFilesInPathList(), NyquistEffect::GetNyquistSearchPath(), LadspaEffectsModule::InstallPath(), NyquistEffectsModule::InstallPath(), and NyquistEffect::Process().

Here is the caller graph for this function:

◆ PluginRegistry()

FilePath FileNames::PluginRegistry ( )

Referenced by PluginManager::Load(), and PluginManager::Save().

Here is the caller graph for this function:

◆ PluginSettings()

FilePath FileNames::PluginSettings ( )

Referenced by PluginManager::GetSettings().

Here is the caller graph for this function:

◆ PreferenceKey()

wxString FileNames::PreferenceKey ( FileNames::Operation  op,
FileNames::PathType  type 
)

Referenced by AudacityApp::InitPart2(), DirectoriesPrefs::OnTempBrowse(), DirectoriesPrefs::PopulateOrExchange(), TempDirectory::TempDir(), and WithDefaultPath().

Here is the caller graph for this function:

◆ ResourcesDir()

FilePath FileNames::ResourcesDir ( )

Referenced by EffectEqualization::GetDefaultFileName(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), and EffectEqualization::UpdateDefaultCurves().

Here is the caller graph for this function:

◆ SelectFile()

FilePath FileNames::SelectFile ( Operation  op,
const TranslatableString message,
const FilePath default_path,
const FilePath default_filename,
const FileExtension default_extension,
const FileTypes fileTypes,
int  flags,
wxWindow *  parent 
)

◆ SetAudacityPathList()

void FileNames::SetAudacityPathList ( FilePaths  list)

Referenced by AudacityApp::OnInit().

Here is the caller graph for this function:

◆ ThemeCacheAsCee()

FilePath FileNames::ThemeCacheAsCee ( )

Referenced by ThemeBase::CreateImageCache().

Here is the caller graph for this function:

◆ ThemeCacheHtm()

FilePath FileNames::ThemeCacheHtm ( )

Referenced by ThemeBase::WriteImageMap().

Here is the caller graph for this function:

◆ ThemeCachePng()

FilePath FileNames::ThemeCachePng ( )

Referenced by ThemeBase::CreateImageCache(), and ThemeBase::ReadImageCache().

Here is the caller graph for this function:

◆ ThemeComponent()

FilePath FileNames::ThemeComponent ( const wxString &  Str)

Referenced by ThemeBase::LoadComponents(), and ThemeBase::SaveComponents().

Here is the caller graph for this function:

◆ ThemeComponentsDir()

FilePath FileNames::ThemeComponentsDir ( )

Referenced by ThemeBase::LoadComponents(), and ThemeBase::SaveComponents().

Here is the caller graph for this function:

◆ ThemeDir()

FilePath FileNames::ThemeDir ( )

◆ ThemeImageDefsAsCee()

FilePath FileNames::ThemeImageDefsAsCee ( )

Referenced by ThemeBase::WriteImageDefs().

Here is the caller graph for this function:

◆ UnsavedProjectExtension()

wxString FileNames::UnsavedProjectExtension ( )

Referenced by AutoRecoveryDialog::OnDiscardSelected(), AutoRecoveryDialog::PopulateList(), and TempDirectory::UnsavedProjectFileName().

Here is the caller graph for this function:

◆ UpdateDefaultPath()

void FileNames::UpdateDefaultPath ( Operation  op,
const FilePath path 
)

Referenced by anonymous_namespace{FileMenus.cpp}::DoImport(), EVT_MENU_RANGE(), AudacityApp::InitTempDir(), ExportMultipleDialog::OnExport(), PluginActions::Handler::OnResetConfig(), Exporter::Process(), ProjectFileManager::ShowOpenDialog(), TempDirectory::TempDir(), and WithDefaultPath().

Here is the caller graph for this function:

◆ WithDefaultPath()

template<typename F >
FilePath FileNames::WithDefaultPath ( Operation  op,
const FilePath defaultPath,
function 
)

Definition at line 186 of file FileNames.h.

188  {
189  auto path = gPrefs->Read(PreferenceKey(op, PathType::User), defaultPath);
190  if (path.empty())
191  path = FileNames::FindDefaultPath(op);
192  auto result = function(path);
193  FileNames::UpdateDefaultPath(op, ::wxPathOnly(result));
194  return result;
195  }

References FindDefaultPath(), gPrefs, PreferenceKey(), and UpdateDefaultPath().

Here is the call graph for this function:
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
FileNames::FindDefaultPath
FilePath FindDefaultPath(Operation op)
FileNames::UpdateDefaultPath
void UpdateDefaultPath(Operation op, const FilePath &path)
FileNames::PreferenceKey
wxString PreferenceKey(FileNames::Operation op, FileNames::PathType type)