Audacity  3.0.3
Classes | Functions
FileNames Namespace Reference

Classes

struct  FileType
 

Functions

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

Function Documentation

◆ AbbreviatePath()

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

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

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

Here is the caller graph for this function:

◆ AddMultiPathsToPathList()

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

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

Here is the caller graph for this function:

◆ AddUniquePathToPathList()

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

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

Here is the caller graph for this function:

◆ AudacityPathList()

FILES_API 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 ModuleManager::FindModules(), NyquistEffect::GetNyquistSearchPath(), NyquistEffectsModule::Initialize(), LangChoiceDialog::LangChoiceDialog(), LangChoiceDialog::OnOk(), GUIPrefs::Populate(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), NyquistEffect::Process(), and GUIPrefs::SetLang().

Here is the caller graph for this function:

◆ BaseDir()

FILES_API FilePath FileNames::BaseDir ( )

Referenced by NyquistEffect::Process().

Here is the caller graph for this function:

◆ CompareNoCase()

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

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

Here is the caller graph for this function:

◆ CreateUniqueName()

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

Referenced by TempDirectory::UnsavedProjectFileName().

Here is the caller graph for this function:

◆ DataDir()

FILES_API 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(), AudacityApp::InitPart2(), 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()

FILES_API wxFileNameWrapper FileNames::DefaultToDocumentsFolder ( const wxString &  preference)

Referenced by NyquistEffect::resolveFilePath().

Here is the caller graph for this function:

◆ DoCopyFile()

FILES_API 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()

FILES_API FilePath FileNames::FindDefaultPath ( Operation  op)

◆ FindFilesInPathList()

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

Referenced by ModuleManager::DiscoverProviders(), and ModuleManager::FindModules().

Here is the caller graph for this function:

◆ FormatWildcard()

FILES_API wxString FileNames::FormatWildcard ( const FileTypes fileTypes)

Referenced by FileDialogWrapper::Create(), and SelectFile().

Here is the caller graph for this function:

◆ HardLinkFile()

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

◆ HtmlHelpDir()

FILES_API FilePath FileNames::HtmlHelpDir ( )

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

Here is the caller graph for this function:

◆ HtmlHelpIndexFile()

FILES_API FilePath FileNames::HtmlHelpIndexFile ( bool  quick)

◆ IsMidi()

FILES_API bool FileNames::IsMidi ( const FilePath fName)

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

Here is the caller graph for this function:

◆ IsOnFATFileSystem()

FILES_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()

FILES_API bool FileNames::IsPathAvailable ( const FilePath Path)

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

Here is the caller graph for this function:

◆ LegacyChainDir()

FILES_API FilePath FileNames::LegacyChainDir ( )

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

Here is the caller graph for this function:

◆ LowerCaseAppNameInPath()

FILES_API wxString FileNames::LowerCaseAppNameInPath ( const wxString &  dirIn)

◆ MacroDir()

FILES_API 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()

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

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

Here is the caller graph for this function:

◆ MkDir()

FILES_API wxString FileNames::MkDir ( const wxString &  Str)

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

Here is the caller graph for this function:

◆ ModulesDir()

FILES_API FilePath FileNames::ModulesDir ( )

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

Here is the caller graph for this function:

◆ NRPDir()

FILES_API FilePath FileNames::NRPDir ( )

◆ NRPFile()

FILES_API FilePath FileNames::NRPFile ( )

◆ PathFromAddr()

FILES_API FilePath FileNames::PathFromAddr ( void *  addr)

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

Here is the caller graph for this function:

◆ PlugInDir()

FILES_API 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()

FILES_API FilePath FileNames::PluginRegistry ( )

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

Here is the caller graph for this function:

◆ PluginSettings()

FILES_API FilePath FileNames::PluginSettings ( )

Referenced by PluginManager::GetSettings().

Here is the caller graph for this function:

◆ PreferenceKey()

FILES_API 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()

FILES_API FilePath FileNames::ResourcesDir ( )

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

Here is the caller graph for this function:

◆ SetAudacityPathList()

FILES_API void FileNames::SetAudacityPathList ( FilePaths  list)

Referenced by AudacityApp::OnInit().

Here is the caller graph for this function:

◆ ThemeCacheAsCee()

FILES_API FilePath FileNames::ThemeCacheAsCee ( )

Referenced by ThemeBase::CreateImageCache().

Here is the caller graph for this function:

◆ ThemeCacheHtm()

FILES_API FilePath FileNames::ThemeCacheHtm ( )

Referenced by ThemeBase::WriteImageMap().

Here is the caller graph for this function:

◆ ThemeCachePng()

FILES_API FilePath FileNames::ThemeCachePng ( )

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

Here is the caller graph for this function:

◆ ThemeComponent()

FILES_API FilePath FileNames::ThemeComponent ( const wxString &  Str)

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

Here is the caller graph for this function:

◆ ThemeComponentsDir()

FILES_API FilePath FileNames::ThemeComponentsDir ( )

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

Here is the caller graph for this function:

◆ ThemeDir()

FILES_API FilePath FileNames::ThemeDir ( )

◆ ThemeImageDefsAsCee()

FILES_API FilePath FileNames::ThemeImageDefsAsCee ( )

Referenced by ThemeBase::WriteImageDefs().

Here is the caller graph for this function:

◆ UnsavedProjectExtension()

FILES_API wxString FileNames::UnsavedProjectExtension ( )

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

Here is the caller graph for this function:

◆ UpdateDefaultPath()

FILES_API 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 184 of file FileNames.h.

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

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

Referenced by SelectFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WritableLocationCheck()

FILES_API bool FileNames::WritableLocationCheck ( const FilePath path,
const TranslatableString message 
)

Check location on writable access and return true if checked successfully.

Referenced by anonymous_namespace{FileMenus.cpp}::DoExport(), DirectoriesPrefs::OnBrowse(), DirectoriesPrefs::OnTempBrowse(), and DirectoriesPrefs::Validate().

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