mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Move AudacityPathList & utilities from AudacityApp.h to FileNames.h
This commit is contained in:
@@ -28,7 +28,6 @@ i.e. an alternative to the usual interface, for Audacity.
|
||||
#include <wx/string.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include "AudacityApp.h"
|
||||
#include "FileNames.h"
|
||||
#include "PluginManager.h"
|
||||
|
||||
@@ -212,7 +211,7 @@ ModuleManager::~ModuleManager()
|
||||
// static
|
||||
void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
{
|
||||
const auto &audacityPathList = wxGetApp().audacityPathList;
|
||||
const auto &audacityPathList = FileNames::AudacityPathList();
|
||||
FilePaths pathList;
|
||||
FilePaths files;
|
||||
wxString pathVar;
|
||||
@@ -221,18 +220,18 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
// Code from LoadLadspa that might be useful in load modules.
|
||||
pathVar = wxGetenv(wxT("AUDACITY_MODULES_PATH"));
|
||||
if (!pathVar.empty())
|
||||
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
||||
FileNames::AddMultiPathsToPathList(pathVar, pathList);
|
||||
|
||||
for (i = 0; i < audacityPathList.size(); i++) {
|
||||
wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH;
|
||||
wxGetApp().AddUniquePathToPathList(prefix + wxT("modules"),
|
||||
FileNames::AddUniquePathToPathList(prefix + wxT("modules"),
|
||||
pathList);
|
||||
}
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, files);
|
||||
FileNames::FindFilesInPathList(wxT("*.dll"), pathList, files);
|
||||
#else
|
||||
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
|
||||
FileNames::FindFilesInPathList(wxT("*.so"), pathList, files);
|
||||
#endif
|
||||
|
||||
wxString saveOldCWD = ::wxGetCwd();
|
||||
@@ -357,19 +356,19 @@ bool ModuleManager::DiscoverProviders()
|
||||
|
||||
if (!pathVar.empty())
|
||||
{
|
||||
wxGetApp().AddMultiPathsToPathList(pathVar, pathList);
|
||||
FileNames::AddMultiPathsToPathList(pathVar, pathList);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxGetApp().AddUniquePathToPathList(FileNames::ModulesDir(), pathList);
|
||||
FileNames::AddUniquePathToPathList(FileNames::ModulesDir(), pathList);
|
||||
}
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
wxGetApp().FindFilesInPathList(wxT("*.dll"), pathList, provList);
|
||||
FileNames::FindFilesInPathList(wxT("*.dll"), pathList, provList);
|
||||
#elif defined(__WXMAC__)
|
||||
wxGetApp().FindFilesInPathList(wxT("*.dylib"), pathList, provList);
|
||||
FileNames::FindFilesInPathList(wxT("*.dylib"), pathList, provList);
|
||||
#else
|
||||
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, provList);
|
||||
FileNames::FindFilesInPathList(wxT("*.so"), pathList, provList);
|
||||
#endif
|
||||
|
||||
PluginManager & pm = PluginManager::Get();
|
||||
|
||||
Reference in New Issue
Block a user